Ab Keur
9th October 2007, 05:59
Hello,
I am trying to automate our approval step for the purchase goods with AFS.
But the session acts funny on session tdpur4121m000 and tdilc4123s000.
We use only the location's and not the lotcontrol.
This is the script is use:
stpapi.put.field("tdpur4121m000", "tdpur045.reno", str$(tdpur045.reno))
stpapi.put.field("tdpur4121m000", "tdpur045.orno", str$(tdpur045.orno))
stpapi.put.field("tdpur4121m000", "tdpur045.pono", str$(tdpur045.pono))
ret = stpapi.find("tdpur4121m000", error.msg)
if ret = 1 then
stpapi.handle.subproc("tdpur4121m000", "tdilc4123s000", "add")
stpapi.put.field("tdpur4121m000", "tdpur045.quap", str$(approved.quantity))
ret = stpapi.update("tdpur4121m000",1, error.msg)
stpapi.put.field("tdilc4123s000", "tdilc111.stra", str$(approved.quantity))
stpapi.put.field("tdilc4123s000", "tdilc111.strd", str$(tdpur045.dqua - approved.quantity))
ret = stpapi.update("tdilc4123s000",1,error.msg)
ret = stpapi.save("tdilc4123s000",error.msg)
stpapi.end.session("tdilc4123s000",error.msg)
stpapi.end.session("tdpur4121m000",error.msg)
endif
The script runs with no problem, the result from AFS are all OK.
But when you lookup the results in Baan. The data is stored in the subsession, but the entered values are not stored in the main session.
Does anyone have experience with automating this session, or a working example for me.
Thanks in advance.
I am trying to automate our approval step for the purchase goods with AFS.
But the session acts funny on session tdpur4121m000 and tdilc4123s000.
We use only the location's and not the lotcontrol.
This is the script is use:
stpapi.put.field("tdpur4121m000", "tdpur045.reno", str$(tdpur045.reno))
stpapi.put.field("tdpur4121m000", "tdpur045.orno", str$(tdpur045.orno))
stpapi.put.field("tdpur4121m000", "tdpur045.pono", str$(tdpur045.pono))
ret = stpapi.find("tdpur4121m000", error.msg)
if ret = 1 then
stpapi.handle.subproc("tdpur4121m000", "tdilc4123s000", "add")
stpapi.put.field("tdpur4121m000", "tdpur045.quap", str$(approved.quantity))
ret = stpapi.update("tdpur4121m000",1, error.msg)
stpapi.put.field("tdilc4123s000", "tdilc111.stra", str$(approved.quantity))
stpapi.put.field("tdilc4123s000", "tdilc111.strd", str$(tdpur045.dqua - approved.quantity))
ret = stpapi.update("tdilc4123s000",1,error.msg)
ret = stpapi.save("tdilc4123s000",error.msg)
stpapi.end.session("tdilc4123s000",error.msg)
stpapi.end.session("tdpur4121m000",error.msg)
endif
The script runs with no problem, the result from AFS are all OK.
But when you lookup the results in Baan. The data is stored in the subsession, but the entered values are not stored in the main session.
Does anyone have experience with automating this session, or a working example for me.
Thanks in advance.