Sushanta
17th November 2002, 17:19
Dear all ,
How to handle subsessions in the following case:
Main Session - tdind0205m000
Populating data in the above session and then continuing-
Subsession - tdind0205s000 gets opened.
Save and Exit from tdind0205s000-
Another subsession tdslsl205s001 gets opened and necessary data get imported into this session(from tdind0205m000 most probably).So the sequence is
tdind0205m000-continue-tdind0205s000-save and exit-tdslsl205s001

In this case how should I write AFS so that subsessions will be handled and appropriate data will be imported to subsession tdslsl205s001.I have tries it several times.But all the time the subsession tdslsl205s001 gets opened independently and it is unable to import data from the previous sessions.As a result the record is not inserted in the session tdsls205s001 which is also happening when I am running the session tdslsl205s001 independently.

Pl. give suggestion and solution

Thanking You

mark_h
19th November 2002, 00:00
Could you post a copy of your current code - that may help someone find your problem. I have not worked on Baan5 so I am not familiar with these sessions, but I may see something in your code that may cause your problem.

Mark

Sushanta
19th November 2002, 15:16
Hi Mark,
Thanks a lot.
I am giving the code below:
stpapi.put.field("tdind0205m000","tdind021.extr",str$(tdextr.sales)
stpapi.put.field("tdind0205m000",örno.f","310838")
stpapi.put.field("tdind0205m000",örno.t","310838")
stpapi.handle.subproc("tdind0205m000","tdind0205s000","add")
stpapi.continue.process("tdind0205m000",err.msg)
(This opens the session tdind0205s000 - subsession of tdind0205m000.This is opening correctly with proper data import)
ret = stpapi.save(tdind020s000,err.msg)
stpapi.end.session("tdind0205s000")
(This ends (i.e., save and exit) the current session and automatically the session tdslsl205s001 gets opened)
Then necessary fields are not getting imported to this session.As a result the following statements do not work.
stpapi.put.field("tdslsl205s001","tdind021.eino",str$(21))
(In this case tdslsl205s001 gets reopened independenlty.It should take the already opened session from the previous statement.That means data are not getting imported to this session from the previous sessions)
stpapi.put.field("tdslsl205s001","tdind021.eidt",str$(date.num()))
stpapi.put.field("tdslsl205s001","tdind021.ttyp","SSD")
stpapi.put.field("tdslsl205s001","tdind021.extr",str$(tdextr.sales))
---
---
ret = stpapi.insert("tdslsl205s001",err.msg)
ret = stpapi.save("tdslsl205s001",err.msg)

The error showing Transaction type not allowed.

I seek your help in this regard.

Sushanta

mark_h
19th November 2002, 15:45
I do not see a control for the tdind0205s001 sub-session. Which program controls it? I would expect to see this line in the code if tdind0205m000 controls the tdind0205s001 sub-session.

stpapi.handle.subproc("tdind0205m000","tdind0205s001","add")

Without the right session controlling tdind0205s001 the the put.field would then start another independent tdind0205s001 sub-session.

Mark