arunprasath
2nd December 2002, 17:12
Hi,
When I put values in the session tfacr1110s000 and then say stpapi.insert(), it starts two subsessions one by one.
The First subsession is tfacr1102s000(Maintain One time customer) and after we enter values into this session and when we close this session, the next subsession pops up. This subsession is tfacr1111s000. so I need to enter values into this subsession and then close this session.

I have created two handles for these two session in the main session.
As soon as I say insert in the parent session tfacr1110s000, the first subsession pops up and as I close this session after insertion, I am able to see the next subsession that has been started in the background .(using ps).
now when I use the line stpapi.put.field("") into this second session, I am getting a fatal error.

index 0 out of dims[1] 3
Cannot continue

I hope AFS can take care of two subsessions that will be popped up after a single insert.

Here is my code
After putting values in the session tfacr1110s000,
stpapi.handle.subproc("tfacr1110s000","tfacr1102s000","add")
stpapi.handle.subproc("tfacr1110s000","tfacr1111s000","add")
ret=stpapi.insert("tfacr1110s000",true,error.code)

Now first subsession starts up.
stpapi.put.field("tfacr1102s000","tfacr202.ccty",str$(" "))
stpapi.insert("tfacr1102s000",true,neglect)
stpapi.end.session("tfacr1102s000")

Now in the background I am able to see the next subsession started.
here in this line below,when I try to put values, I am getting this fatal error.
stpapi.put.field("tfacr1111s000","tfgld102.leac",str$(ledgeraccount))

Where did I went wrong?
or is this again a bug with Baan?
thanks for your suggestions
regards,
s.arun prasath

mark_h
2nd December 2002, 17:46
What happens when you do it manually? After inputing data into tfacr1110s000 and hitting insert does it then start the two sub-sessions one at time. By this I mean does tfacr1102s000 start, then you do your insert, exit and return to tfacr1110s000. Then the tfacr1111s000 sub-session starts. If so I suspect it is a bug in Baan. It almost looks like if the session is running in the background it does not wait for data in one before continuing and starting the next session.

I am not sure if you can do this, but maybe use kill on the second session. Then do the first sub-session to finish it. Then back in the main session (tfacr1110s000) run a zoom or something else to re-launch the second session to process the data thru it.

Just a guess.

Mark

arunprasath
2nd December 2002, 17:53
Thanks mark for your reply.

Actually, when I run manually,
1.the first subsession pops up and
2.I do a save and exit and then
3.the second subsession pops up
4. I again insert data and then save and exit
5.now I come back to the main session.

I have tried killing the second subsession mark, by issuing stpapi.handle.subsession("","","kill").
even then, after I close the first subsession the second session is still running.
so I tried issuing a stpapi.end.session("tfacr1111s000")
even then, this session is not getting closed.

so I am unable to go back to the main session and then start the second subsession with continue option.

I think I should kill this session programmatically, using kill command.
so donno what to do..
How many bugs does this AFS have??

mark_h
2nd December 2002, 18:29
That makes we wonder, which session actually controls the tfacr1111s000. Hmm - went and glanced at the script for tfacr1110. It looks like the session tfacr1102s000 is zoomed to from tfacr1110s000, which would make the session controlled by tfacr1110s000. But the tfacr1111s000 session is declared in a pragma used statement, which means it is probably a back ground session. This means the "add" and "kill" would not work since the session is not controlled by tfacr1110s000. I would expect that if you just ended tfacr1110s000 right after tfacr1102s000 sub-session it would also end. Like this:

stpapi.handle.subproc("tfacr1110s000","tfacr1102s000","add")
ret=stpapi.insert("tfacr1110s000",true,error.code)
stpapi.put.field("tfacr1102s000","tfacr202.ccty",str$(" "))
stpapi.insert("tfacr1102s000",true,neglect)
stpapi.end.session("tfacr1102s000")
stpapi.end.session("tfacr1110s000")


But then I do not know how you would go about getting data input into the tfacr1111s000 sub-session. We do not have any code for the tfacr1111s000 session so I really do not know how you would control that sub-session. Hoping this helps you.

As for how many errors are in the AFS - well probably about as many programmers as Baan has, times the number of coding techniques you could use, times the number of lines of code in Baan. :) It probably is not that bad, but the coding is not standard all the way through all modules, so sometimes the sessions are not very friendly to the AFS style of coding.

Mark

arunprasath
3rd December 2002, 15:48
Mark,

After executing
stpapi.handle.subproc("tfacr1110s000","tfacr1102s000","add")
ret=stpapi.insert("tfacr1110s000",true,error.code)
stpapi.put.field("tfacr1102s000","tfacr202.ccty",str$(" "))
stpapi.insert("tfacr1102s000",true,neglect)
stpapi.end.session("tfacr1102s000")
stpapi.end.session("tfacr1111s000")

the session tfacr1111s000 is still running in the background.
I have tried ending the parent session stpapi.end.session("tfacr1110s000"). even then this session tfacr1111s000 is still running.

so I found the process id of the session tfacr1111s000 and then killed it.
then I am closing the parent sessions tfacr1110s000 and also tfgld1101m000. I could come back to the session again.
when I come back again, the simultaneous popping up of two sessions is not there. Only one session is coming.(tfacr1111s000).
I could handle this.
I know using kill is not advised. but at times, I gotto...
thanks again

mark_h
3rd December 2002, 16:02
As long as it works, use it. I have done things to get these function servers to work, that really was not recommended - but I do not worry about it. Just remember that new releases of these sessions may require changes to the function servers.

Mark