Jordi.Tolra
26th October 2012, 17:03
Hello I'm preparing an AFS in BaaN IV to create Items via de option copy items, but I'm receiving the message:

"Function '<697>'; recursion not possible refcount=2.
Can not continue in tiitm0101m000 in DLL: ottstpstandard (<31>)[]
Recursion not yet implemented
Can not continue in tiitm0101m000 in DLL: ottstpstandard (<31>)[]"

The code I'm using is the following:


cdll0101.put.Item(item.f)

if cdll0101.find() then
cdll0101.handle.sub.process("tiitm0202s000", "add" )
stpapi.application.option("tiitm0101m000",1, 16, mess.out) |#Here I got the error

cdll02021.put.Enter_New_Item_Code(item.t)
cdll02021.put.Copy_Alternative_Items(always.yes)
cdll02021.put.Copy_Alternative_Suppliers(always.yes)
cdll02021.put.Copy_Production_Bills_of_Material(copy.bom)
cdll02021.put.Copy_Routing(copy.rou)
cdll02021.put.Copy_E_Item_Relations(always.yes)
cdll02021.continue(mess.out)
endif


Does somebody had this error? Does somebody know which is the problem and which is the solution?

thanks in advance for your help

Jordi

mark_h
28th October 2012, 04:35
I am not sure that will work - stpapi.application.option is for the choice.user options in 4c4 and stpapi.zoom is for items on the menu. Now I could not think of a method to activate the duplicate occurance option(at least that is what I think option 16 is), but what I did test out is adding the session to the menu. So what I did was find the menu the session used and added tiitm0202s000 to it - this worked:

stpapi.put.field("tppdm0110m000","tiitm001.item", "MAP91528")
ret = stpapi.find("tppdm0110m000")
stpapi.handle.subproc("tppdm0110m000", "tiitm0202s000", "add")
stpapi.handle.subproc("tppdm0110m000", "mtiitm000090011", "7")
stpapi.zoom.option("tppdm0110m000",1,"tiitm0202s000",err)
stpapi.put.field("tiitm0202s000", "copy.item", "mark345")
stpapi.enum.answer("tiitm0202s000", "tiitm0101t", tcyesno.yes) |Copy text to yes - not verified
stpapi.continue.process("tiitm0202s000",err)
stpapi.end.session("tiitm0202s000") | Not sure this is needed.
if(ret <> 1) then
message("err")
endif
message(err)
stpapi.end.session("tppdm0110m000")

Keep in mind different menus get run for different types of menus - I added it to the form 1 menu for a purchase part. It worked if I ran it manually or thru afs code.

Jordi.Tolra
30th October 2012, 14:38
Hi Mark,

I tried it and it worked ok.

thanks a lot for your tip`.

Best Regards

Jordi