veyant
2nd May 2005, 13:57
Hi,

I am writing an AFS for changing QTY in Existing Order. Now when i try to send STPAPI.UPDATE, it gives an Error "TAX CODE NOT FOUND IN TAX TABLE".

However when i checked Processes activation i found that

Sesion tdsls4101m000 is activaed ny my Cust. Session [ Parent ID - Cust session]

Session tdsls4105s000 is activated by Cust Session [ Parent ID - Cust Sess] However, it should be activated from tdsls4101m000.
i am not able to find where exactly, the Problem is. funniest thing is my other Sales AFS are working fine.

here is Code which i am writing in this session:


stpapi.put.field("tdsls4101m000","tdsls040.orno", str$(orno))
ret = stpapi.find("tdsls4101m000",w.err.msg)

|stpapi.handle.subproc("tdsls4105s000", "tdsls04504s000","")
stpapi.put.field("tdsls4105s000","tdsls040.orno", str$(orno))
stpapi.put.field("tdsls4105s000","tdsls041.pono", str$(pono))
stpapi.handle.subproc("tdsls4101m000","tdsls4105s000","add")
stpapi.continue.process("tdsls4101m000",w.err.msg)
stpapi.handle.subproc("tdsls4105s000", "mtdsls000090461", "12")
ret = stpapi.find("tdsls4105s000")
if ret = 1 then

stpapi.put.field( "tdsls4105s000", "tdsls041.odat", str$(curr.date))
stpapi.put.field( "tdsls4105s000", "tdsls041.ddta", str$(curr.date))
stpapi.put.field("tdsls4105s000","tdsls041.oqua", str$(qty))
stpapi.put.field( "tdsls4105s000", "tdsls041.prdt", str$(curr.date))
|stpapi.put.field( "tdsls4105s000", "tdsls041.cvat", tax.code )
stpapi.update("tdsls4105s000",1,w.err.msg)
stpapi.save("tdsls4105s000",w.err.msg)
endif

stpapi.handle.subproc("tdsls4105s000","tdslsl102s002","add")
stpapi.put.field( "tdslsl102s002", "tdind017.orno", str$(orno))
stpapi.put.field( "tdslsl102s002", "tdind017.pono", str$(pono))
ret = stpapi.find("tdsls4105s000",w.err.msg)
if ret = 0 or ret = 1 then
stpapi.put.field( "tdslsl102s002", "tdind017.pono", str$(curr.date))
stpapi.update("tdslsl102s002",1,w.err.msg)
stpapi.save("tdslsl102s002",w.err.msg)
endif
stpapi.end.session("tdslsl102s002")
|stpapi.end.session("tdsls4504s000")
stpapi.end.session("tdsls4105s000")
stpapi.end.session("tdsls4101m000")

mark_h
2nd May 2005, 21:53
Use the search option with tdsls4105s000 - here is one link (http://www.baanboard.com/baanboard/showthread.php?t=23174&highlight=tdsls4105s000). The code posted on this thread should help. Not sure if you have to deal with india localization, but the code should work upto that point.