tomlbacon
4th January 2012, 00:04
I'm trying to do Stpapi command for session whinh3522m000 and whinh3122s000 to update the Approvals in table whinh211 in Baan V. I have a form and require the Order, set and position number to find the records that I want to process. Program goes thru the stpapi command and all err.msg's are ok but doesn't update the Records with new values. Would like any help can get.
Thanks, Code of stpapi is below
do.update = 1
do.save = 1
stpapi.put.field( "whinh3522m000", "whinh211.orno", orno.f )
stpapi.put.field( "whinh3522m000", "whinh211.oset", str$(whinh211.oset) )
stpapi.put.field( "whinh3522m000", "whinh211.pono", str$(whinh211.pono) )
stpapi.put.field( "whinh3522m000", "whinh211.seqn", str$(whinh211.seqn) )
stpapi.put.field( "whinh3522m000", "whinh211.sern", str$(whinh211.sern) )
stpapi.put.field( "whinh3522m000", "whinh211.apnr", str$(whinh211.apun) )
stpapi.put.field( "whinh3522m000", "whinh211.cwar", str$(whinh211.cwar) )
stpapi.put.field( "whinh3522m000", "whinh211.loca", str$(whinh211.loca) )
stpapi.put.field( "whinh3522m000", "whinh211.stra", str$(whinh211.stkt) ) |* Approved Inventory
stpapi.put.field( "whinh3522m000", "whinh211.strr", str$(whinh211.strr) ) |* Rejected Inventory
stpapi.put.field( "whinh3122s000", "whinh211.oorg", str$(whinh211.oorg)) |* Order Origin
stpapi.put.field( "whinh3122s000", "whinh211.orno", orno.f ) |* Order Number
stpapi.put.field( "whinh3122s000", "whinh211.oset", str$(whinh211.oset) ) |* Order Set
stpapi.put.field( "whinh3122s000", "whinh211.pono", str$(whinh211.pono) ) |* Position Number
stpapi.put.field( "whinh3122s000", "whinh211.seqn", str$(whinh211.seqn) ) |* Seqence Number
stpapi.put.field( "whinh3122s000", "whinh211.sern", str$(whinh211.sern) ) |* Advice Number
stpapi.put.field( "whinh3122s000", "whinh211.apun", whinh211.apun ) |* Approval UOM
stpapi.put.field( "whinh3122s000", "whinh211.stra", str$(whinh211.stkt) ) |* Approved Inventory
stpapi.put.field( "whinh3122s000", "whinh211.rjun", whinh211.rjun ) |* Rejected UOM
stpapi.put.field( "whinh3122s000", "whinh211.strr", str$(whinh211.strr) ) |* Rejected Inventory
stpapi.put.field( "whinh3122s000", "whinh211.resn", "" ) |* Reason Code
stpapi.mark( "whinh3522m000" )
stpapi.synchronize.dialog("whinh3522m000", "modify" , err.msg)
stpapi.update( "whinh3122s000", do.update, err.msg )
stpapi.save( "whinh3122s000", err.msg )
stpapi.handle.subproc( "whinh3522m000", "whinh3122s000", "modify" )
stpapi.update( "whinh3522m000", do.save, err.msg )
stpapi.save( "whinh3522m000", err.msg )
stpapi.end.session( "whinh3522m000" )
stpapi.end.session( "whinh3122s000" )
Thanks, Code of stpapi is below
do.update = 1
do.save = 1
stpapi.put.field( "whinh3522m000", "whinh211.orno", orno.f )
stpapi.put.field( "whinh3522m000", "whinh211.oset", str$(whinh211.oset) )
stpapi.put.field( "whinh3522m000", "whinh211.pono", str$(whinh211.pono) )
stpapi.put.field( "whinh3522m000", "whinh211.seqn", str$(whinh211.seqn) )
stpapi.put.field( "whinh3522m000", "whinh211.sern", str$(whinh211.sern) )
stpapi.put.field( "whinh3522m000", "whinh211.apnr", str$(whinh211.apun) )
stpapi.put.field( "whinh3522m000", "whinh211.cwar", str$(whinh211.cwar) )
stpapi.put.field( "whinh3522m000", "whinh211.loca", str$(whinh211.loca) )
stpapi.put.field( "whinh3522m000", "whinh211.stra", str$(whinh211.stkt) ) |* Approved Inventory
stpapi.put.field( "whinh3522m000", "whinh211.strr", str$(whinh211.strr) ) |* Rejected Inventory
stpapi.put.field( "whinh3122s000", "whinh211.oorg", str$(whinh211.oorg)) |* Order Origin
stpapi.put.field( "whinh3122s000", "whinh211.orno", orno.f ) |* Order Number
stpapi.put.field( "whinh3122s000", "whinh211.oset", str$(whinh211.oset) ) |* Order Set
stpapi.put.field( "whinh3122s000", "whinh211.pono", str$(whinh211.pono) ) |* Position Number
stpapi.put.field( "whinh3122s000", "whinh211.seqn", str$(whinh211.seqn) ) |* Seqence Number
stpapi.put.field( "whinh3122s000", "whinh211.sern", str$(whinh211.sern) ) |* Advice Number
stpapi.put.field( "whinh3122s000", "whinh211.apun", whinh211.apun ) |* Approval UOM
stpapi.put.field( "whinh3122s000", "whinh211.stra", str$(whinh211.stkt) ) |* Approved Inventory
stpapi.put.field( "whinh3122s000", "whinh211.rjun", whinh211.rjun ) |* Rejected UOM
stpapi.put.field( "whinh3122s000", "whinh211.strr", str$(whinh211.strr) ) |* Rejected Inventory
stpapi.put.field( "whinh3122s000", "whinh211.resn", "" ) |* Reason Code
stpapi.mark( "whinh3522m000" )
stpapi.synchronize.dialog("whinh3522m000", "modify" , err.msg)
stpapi.update( "whinh3122s000", do.update, err.msg )
stpapi.save( "whinh3122s000", err.msg )
stpapi.handle.subproc( "whinh3522m000", "whinh3122s000", "modify" )
stpapi.update( "whinh3522m000", do.save, err.msg )
stpapi.save( "whinh3522m000", err.msg )
stpapi.end.session( "whinh3522m000" )
stpapi.end.session( "whinh3122s000" )