VishalMistry
29th December 2011, 11:44
Hi All,
I am trying to insert item planning data through AFS of item planning session, but system is not displaying any error message and also not generating item planning data.
When I thoroughly checked script to find error details, in error variable it is storing the error "Session not available".
What could be the reason. Pl guide.
Vishal
vinceco252
29th December 2011, 17:26
Have you tried DAL2 instead? In LN, it is generally less error prone than AFS IMHO.
VishalMistry
31st December 2011, 06:53
I tried DAL2 also but did not use all the fields in dal.set.fields. It was not giving any error message neither it was creating record in Item Planning table.
I will try to set value of all fields using dal.set.fields and post the results.
Vishal
blanchap
24th February 2012, 22:24
you want to change or insert?
i did an AFS to modify data in the planning it's simple but it works.
here is the code.
function update.planning(domain tcpdno pdno.ref, domain tcopno opno.ref, domain tcdec2.3 ppm.ref)
{
long ret, retval, retval2
domain tcstr30 error.msg, recover.msg
stpapi.clear("tisfc1101m000")
stpapi.put.field("tisfc1101m000", "tisfc010.pdno", str$(pdno.ref))
stpapi.put.field("tisfc1101m000", "tisfc010.opno", str$(opno.ref))
ret = stpapi.find("tisfc1101m000", error.msg)
if ret = 1 then
stpapi.put.field("tisfc1101m000", "tisfc010.rutm", str$(ppm.ref))
retval = stpapi.update("tisfc1101m000", true, error.msg)
if not retval then
retval2 = stpapi.recover("tisfc1101m000", recover.msg)
else
retval2 = stpapi.save("tisfc1101m000", error.msg)
endif
endif
stpapi.end.session("tisfc1101m000")
}
hope this help.
PB
vinceco252
24th February 2012, 23:42
Vishal,
Does the item general data exist?
Vince