srinivas
6th March 2002, 06:34
I was trying to maintain a transaction in tfgld1101m000 through an STP API call. But the batch number is not getting generated and I am getting error that "Record already existing". This is how I was trying to insert a record.

Also I am getting an error " Index 31 out of dims [0] 20 "

Where I am going wrong?

Thanks & Regards,
Srinivas


**************************************



stpapi.put.field("tfgld1101m000", "tedt.f", str$(tedt))
stpapi.put.field("tfgld1101m000", "tfgld101.year", year)
stpapi.put.field("tfgld1101m000", "bref.f", bref)
stpapi.put.field("tfgld1101m000", "fprd.f", fprd)
stpapi.put.field("tfgld1101m000", "rprd.f", rprd)
stpapi.put.field("tfgld1101m000", "vyer.f", vyer)
stpapi.put.field("tfgld1101m000", "vprd.f", vprd)





stpapi.put.field("tfgld1101m000", "tfgld101.ttyp", ttyp)

stpapi.handle.subproc( "tfgld1101m000", "tfgld1506s000", "add")


stpapi.insert("tfgld1101m000",1,error.msg)
Message("Insert error in tfgld101=%s",error.msg)

stpapi.save("tfgld1101m000",err)
Message("Save error in tfgld101=%s",err)


stpapi.end.session("tfgld1506s000")
stpapi.end.session("tfgld1101m000")

mark_h
6th March 2002, 13:45
On our system it expects you to input the batch number - we are on version 4c3. Does yours automatically create batch numbers? I would expect to see a stpapi.put.field("tfgld1101m000", "tfgld101.btno", btno)in the script somewhere.

Typically I do a find and then do the insert based on the find. So if I found the record I would only put the ttyp field, if I did not then I would insert the whole record. This eliminates the possiblilty of putting in duplicate batches.

Good Luck!

Mark

srinivas
6th March 2002, 14:01
Yes Mark. In our system the batch number would be automatically generated if I manually insert a record through tfgld1101m000. I tried by supplying the batch number also. I will try to find and the insert a record.

But why this index out of dims error is coming?? Any clues??

Thanx,

Srinivas

mark_h
6th March 2002, 14:53
Do not have a clue out the index 31 out of dims error. I was hoping that the insert was causing the problem. If the insert started working then maybe the out of dims error would go away.


Mark