kiran kumar
15th June 2011, 13:26
Hi Gurus,
I want to finalize the batches using AFS. I am calling the session tfgld1110m000 and clicking the select button with proper run no. and getting the sub session tfgld1111s000 to select the all batches to finalize. When I am clicking the Finalize button , a report should be displayed automatically.But here the spool device handler "ttstpsplopen" sub process session window is popping out for manual input. How to handle the "ttsstpsplopen" in AFS ? Please find the attachment of my sample script and suggest me that any modifications required.
Thanks in advance
mark_h
15th June 2011, 15:42
Since I really do not know these sessions - which session generates the report? Is it tfgld1111s000? If so then try setting the report using stpapi.set.report. If it is a subsession that tfgld1111s000 spawns then you need to control that and set stpapi.set.report for it.
kiran kumar
27th July 2011, 11:22
Hi Mark,
We can use stpapi.set.report when the report linked to particular session. Here the reports linked to other sub session which is generating after "Generate" button click event. I am trying to handle the sub session but some parameter values not passing to that session from parent session.Can you suggest me any other solution pls?
mark_h
27th July 2011, 15:23
Post all of your code. I might be able to make suggestions. From looking at the code you have attached - I would expect to see something like this:
|after all batches selection
stpapi.set.report("tfgld1111s000","rtfgld121111000","D",err.mesg)
stpapi.continue.process("tfgld1111s000",err.mesg)
stpapi.end.session("tfgld1111s000")
stpapi.end.session("tfgld1111s000")
stpapi.end.session("tfgld1110m000")
That is all I would expect to see. You do not have to put any fields to ttstpsplopen
This is a simple sample I created once.
spool.device = "D66"
stpapi.set.report("tcmcs0403m000","rtcmcs040301000",spool.device,err)
stpapi.continue.process("tcmcs0403m000",err)
stpapi.end.session("tcmcs0403m000")
kiran kumar
27th July 2011, 17:31
Hi Mark ,
Thank you for your quick response. Please find the new attachment.
mark_h
27th July 2011, 19:46
There are issues and I can make a recommendation, but don't have a solution. There have been known issues with sessions that automatically zoom to another session and start running. So first the code - I stripped out everything I did not need to process a single batch.
stpapi.put.field("tfgld1110m000","tfgld109.year",str$(2011))
stpapi.put.field("tfgld1110m000","tfgld109.trun",str$(6))
rc=stpapi.find("tfgld1110m000")
if rc=1 then
stpapi.handle.subproc( "tfgld1110m000","tfgld1111s000","add" )
stpapi.continue.process("tfgld1110m000", err)
if strip$(err)<>"" then
stpapi.recover("tfgld1110m000", err)
endif
stpapi.put.field("tfgld1111s000","tfgld100.btno",str$(6))
rc=stpapi.find("tfgld1111s000")
if rc=1 then
stpapi.put.field("tfgld1111s000","sel",str$(tcyesno.yes))
stpapi.update("tfgld1111s000",1,err)
| stpapi.save("tfgld1111s000",err)
if strip$(err)<>"" then
stpapi.recover("tfgld1111s000",err)
endif
endif
stpapi.handle.subproc("tfgld1111s000","tfgld1211s000","add")
spool.device = "D66"
stpapi.set.report("tfgld1111s000","rtfgld121111000","D66",err)
stpapi.continue.process("tfgld1111s000",err)
stpapi.end.session("tfgld1211s000")
stpapi.end.session("tfgld1111s000")
endif
stpapi.end.session("tfgld1110m000")
This line stpapi.continue.process("tfgld1111s000",err) starts the tfgld1211s000 session, which was in the foreground - not in the background as expected. It then immediately asked for a spool device. This should not happen when running sessions in API mode.
Now I have a few suggestions:
(1) Contact infor with this issue and see if they fix it.
(2) Is there another session that would finalize batches?
(3) If you own source code - put the sessions in debug mode step thru them and see what you need to do to get it to run in API mode. I have never done this since we do not own source code. I don't know what this would take.
(4) What I did once and I do not know if it will work in this case. What I did was when one session immediately called the subsession next - I could not control the subsession to update the records. What I was to create my own session. In my session I just put an empty field. Then a continue button to zoom to the subsession in question. This allowed my api code to control the subsession - I could then update the records. I don't know if this is possible in your case - maybe clone tfgld1212s000 to a main session. Then call it separately from the original sessions where you select the batches. To do this you would need to figure out what to put on the form to get it to process correctly. This is something you can play around with.
kiran kumar
28th July 2011, 09:37
Hi Mark,
Here we are not having any source code, because all are standard sessions. I'll check that any other sessions will fulfill my requirement or not and then I'll get back to you. Thank you for Knowledge Transfer.
kiran kumar
3rd August 2011, 08:37
Hi Mark,
I approached to infor regarding this issue, but I didn't get the solution. Another session(tfgld1210m000) is there to fulfill my requirement but its also having the same issue as discussed above. Can u suggest me if any work around is there to Finalize the batches please?
mark_h
3rd August 2011, 18:01
The only work around I can think of is to use something to extend source code. You can see the ~vamsi free ware in the code and utities form. What you can try is to use this method to see if you can control that subsession which pops in the foreground. This takes a lot of work and sometimes just flat out guess work. What you end up with is a modification that wraps around the original object. I have done this a couple of times with our Qkey project - I try to not recommend it because you can spend weeks making sure you do not break it for normal use, but fix it for API use. It can become very complex in making sure you get the "if api.mode then" in all the right places.