saumya
15th September 2008, 07:50
Hi all,

I m facing some problem, plz help me out.
here is the afs for storage inspection. When i do manually i dont get any error, with the similer data. but through afs me getting error "Inventory not sufficient" . but manually i m able to do.


long seqn.tmp, ret_val
string errmsg(100)



seqn.tmp = seqn.tmp + 1
stpapi.put.field( "tcqms2120m000", "tcqms220.item", " 7300000014")
stpapi.put.field( "tcqms2120m000", "tcqms220.seqn", "1")
ret_val = stpapi.insert( "tcqms2120m000", 1, errmsg )
if not(isspace(errmsg)) then
message("Error in Maintain Storage Inspection: %s", errmsg)
else

stpapi.handle.subproc("tcqms2120m000", "tcqms2120s000", "add")
stpapi.continue.process("tcqms2120m000", errmsg )


stpapi.put.field( "tcqms2120s000", "tcqms220.item", " 7300000014")
stpapi.put.field( "tcqms2120s000", "tcqms220.seqn", "1")
stpapi.change.view("tcqms2120s000", errmsg)

stpapi.put.field( "tcqms2120s000", "tcqms220.cwar", "W01")
stpapi.put.field( "tcqms2120s000", "tcqms220.loca", " RECP")
stpapi.put.field( "tcqms2120s000", "tcqms220.clot", " 12222")
stpapi.put.field( "tcqms2120s000", "tcqms220.date", "13062009 ")
stpapi.put.field( "tcqms2120s000", "tcqms220.stun", "KG ")
stpapi.put.field( "tcqms2120s000", "tcqms220.oqua", "4")
ret_val = stpapi.insert( "tcqms2120s000", 1, errmsg )
stpapi.end.session( "tcqms2120s000", errmsg)
stpapi.end.session( "tcqms2120m000", errmsg)
endif

mark_h
15th September 2008, 14:51
First check and make sure your data is correct. You might want to get the fields. If possible, and you have source code for tcqms2120m000, put the session in debug. Then check the values in it. I typically use something like somedate = str$(some.date) where some.date is the domain tcdate. The I put somedate to the session - I am not sure if what you are using actually works.