gbernal
19th December 2007, 06:37
Hello everybody,
I've developed a session to transfer automatically planned INV SIC orders to SFC. Unfortunally I don't know what happens when the SFC orders are inserted in tisfc001 (done by the std tdinv3250m00), after the insertion and report execution the session hangs.
The report is the correct. Actually tdinv3250m000 only uses one report (rtdinv325001000). Doing it manually the session takes the same report and carries out some validations over the items in tdinv300, if some data is wrong (cost absent for the item for example) the report comes with the wrong planned orders. If succed the confirmed transfer orders with their SFC order number are listed. I don't know if I have to consider something additional to get the AFS running fine.
Any suggestion will be appreciated
tks in advance.
Gbernal
mark_h
20th December 2007, 15:04
Well the first thing I would do is see if there is something running in the background when it hangs. Is there a subsession or maybe a question you missed? Both of those can cause sessions to hang - I am assuming it hangs on the end session command. Does the session hang on both errors and successes? The most radical solution is to use the kill command on the session - in one case I had to do this, but first try everything else.
One thing to think about (and I do this at times) is make sure that the data will "succeed" when processed through the session. I do not know if this is possible or not in your case. It does seem kind of redundant, but it cuts down on error handling in the function server.
gbernal
28th December 2007, 00:25
Tks Mark.
I see there's nothing running on background. The hangs occurs in both cases. Actually in succed case the SFC orders are generated, the report is shown in the screen, when I close the report window control returns to the api session and it continues working but never finishs. Considering asks missing, I don't think so, for the manually parameters introduction only the Production Serie (firs free number serie) is asked, wich is well introduced.
Here is the code I use:
stpapi.put.field("tdinv3250m000","orno.f","0")
stpapi.put.field("tdinv3250m000","orno.t","99999")
stpapi.put.field("tdinv3250m000","item.f","")
stpapi.put.field("tdinv3250m000","item.t","ZZZZZZZZZZZZZZZZ")
stpapi.put.field("tdinv3250m000","cntr.f","")
stpapi.put.field("tdinv3250m000","cntr.t","zzz")
stpapi.put.field("tdinv3250m000","citg.f","")
stpapi.put.field("tdinv3250m000","citg.t","ZZZZZZ")
stpapi.put.field("tdinv3250m000","cwar.f","T32")
stpapi.put.field("tdinv3250m000","cwar.t","T32")
stpapi.put.field("tdinv3250m000","cplb.f","0")
stpapi.put.field("tdinv3250m000","cplb.t","999999")
stpapi.put.field("tdinv3250m000","grno.sfc.i","62")
stpapi.put.field("tdinv3250m000","grno.pmg.i","0")
stpapi.set.report("tdinv3250m000","rtdinv325001000","D",msg)
stpapi.continue.process("tdinv3250m000",msg)
stpapi.end.session("tdinv3250m000")
end()
Now considering your solution to kill the session. How can I do it?, because there aren't any subprocess running on background and as I've seen the main session, the subsession and the kill parameters must be used:
stpapi.handle.subproc(string session, string sub.prog, string action)
Here also I attach the afs.log generated by the session execution.
Any help will be appreciated.
mark_h
28th December 2007, 13:32
Wrong kill - I really do not recommend using this method, but see this link here (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=14201&highlight=kill). Do you own source code? Is there a way to get tdinv3250m000 into debug mode?
when I close the report window control returns to the api session and it continues working but never finishs
Curious about this - you should not have to close the report window for control to return to the api session. After the continue, and once the report is finished generating the session should return to the stpapi.end.session command. In debug mode does the api session stop working on this command stpapi.end.session("tdinv3250m000")?
You may also want to get the latest versions of both the api libraries and session objects from Baan. I recommend updating both the sessions and the libraries before using the kill method I posted at the top.
gbernal
10th January 2008, 16:50
Hello Mark
Tks for your help.
Considering your recommendation of not using "kill". I ask to my company's baan application administrator to ask for the api upgrades to infor. The one provided for infor are the same we have in our environment, anyway it was installed again and bad news: session still continues doing the same "hanging".....
I think the problem is with tdinv3250m000 session...
I left this issue and to give a solution to my users I'm inserting the INV orders into SFC directly by means AFS in the tisfc0101m000 session, then the confirmed INV orders are deleted by the same process from tdinv300. Some troubles I found at the insertion moment, basicaly they were because of the first free serie number.. but it was solved.
Now I have the solution and is working fine...
Thank you for your assistance
best regards
Germán Bernal