richard
25th November 2002, 12:30
Did someone succeed in using the sub-session tdpur4102s000 (in BaaN Ic4).
My return-code in the subsession is always 2, what made I wrong ?

regards

stpapi.put.field("tdpur4101m000","tdpur041.orno",
edit$(numoa,"999999"))
retour = stpapi.find("tdpur4101m000",error.txt)
if retour = 1 then

stpapi.handle.subproc("tdpur4101m000","tdpur4102s000","add")
stpapi.put.field("tdpur4102s000","tdpur041.orno",
edit$(numoa,"999999"))
stpapi.put.field("tdpur4102s000","tdpur041.pono",
edit$(posoa,"9999"))
retour = stpapi.find("tdpur4102s000",error.txt)
if retour = 1 then //problem always 2
stpapi.put.field("tdpur4102s000","tdpur041.cwar","UC2")
ret1 = stpapi.update("tdpur4102s000",true,error.txt)
if not ret1 then
retour = stpapi.recover("tdpur4102s000",error.txt)
endif
nbmaj = nbmaj + 1
endif
stpapi.end.session("tdpur4102s000")

endif
stpapi.end.session("tdpur4101m000")

Ilansu
25th November 2002, 12:48
You need to add :

stpapi.handle.subproc("tdpur4101m000","tdpur4102s000","add")

stpapi.continue.process("tdpur4101m000",error.txt)

stpapi.put.field"tdpur4102s000","tdpur041.orno",
edit$(numoa,"999999"))

Ilan S

richard
25th November 2002, 15:16
I also changed the first find with tdpur040.orno.
But when I debug the tdpur4102s session, it starts with the first order of the database instead the read tdpur040.

Regards

richard
25th November 2002, 16:05
When I change the edit$ from 9999 to ZZZ9 for pono it works !

The current was the line 10 with the format 9999.

Thank's for your help.