arunprasath
22nd February 2002, 09:45
I am using BCK 1.3. in Windows Platform. for Baan IV with Supply Chain Loaded.
I want to automate Maintain Receipts Session(tdpur4120m000). I have created BOI and AFS for
1.Maintain receipts session (tdpur4120m000)
2.subsession (tdpsc0191s000)
3.subsession (tdilc4114s000)
4.subsession for lot control(tdltc0101s000)

I am unable to start a subsession from a subsession.
when I call the subsession from a subsession, the java Client hangs. I couldnt generate AFS Log. so I test the BOI DLL by calling a customised method which inserts data into a table, and calling this function whereever necessary.

Here goes my code.

f4120m000.put.Receipt_Date(b.date) f4120m000.handle.sub.process( "tdilc4114s000", "add" )
ret=stpapi.change.view("tdpur4120m000")
test()|able to execute
stpapi.handle.subproc("tdilc4114s000","tdltc0101s000","add")|hangs here
test() | control doesnt comes here
|input some values here
f0101s000.end()
f4114s000.end()
f4120m000.end()


Here test() function inserts data into a customised table. I am able to execute the test function after I start the sub process. But after that, I am unable to put any values in the fields in the subsession. I am putting values for "table field" in the subsession. It just hangs.
Nothing is logged in the eventviewer.
Is there anyone who can help me???
Kindly get back soon.
Thanks in advance
Arun

mark_h
22nd February 2002, 16:34
Arun,

Let see.. you do:

f4120m000.put.Receipt_Date(b.date)
f4120m000.handle.sub.process( "tdilc4114s000", "add" )
ret=stpapi.change.view("tdpur4120m000")
test()

Is there something in the test subroutine that kicks off the tdilc4114s000? After the change.view is tdilc4114s000 running? Usually it takes an insert, update or continue to start the next subsession. (Since I have not done a function server on this session I am not real familiar with what happens.) Then once tdilc4114s000 is running something needs to happen in it to kick off tdltc0101s000. So pieces may be missing.

I recall other posts in this forum about this session and the api commands I will try to look for it.

Mark

arunprasath
22nd February 2002, 16:49
No mark, the test() just inserts a record into the table.
May be if there is something from the subsession tdltc4114s000 which has to be done to kickoff tdilc0101s000, I dont know. Please Help.
Thanks
Arun.

mark_h
22nd February 2002, 17:08
Here is a link (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=682) that may help. Are you maintaining or inserting a receipt? I would step through it by hand, documenting each step and what you had to do manually to get it to work. Example: When I insert a receipt in our version the first thing I have to do is insert a sales slip. The session tdpur4224s000 comes up and I have to insert a order. So my coding would look something like:

Put packing slip in tdpur4120
handle subproc tdpur4224s000
Insert in tdpur4120m000
Put order in tdpur4224s000

So you code needs what ever fields it requires to activate those subsessions.

Mark

arunprasath
22nd February 2002, 17:25
Mark, I am using B4c4 with supply chain loaded.
I am maintaining receipts.
so the sequence of steps is,
1.In the main session tdpur4120m000, I enter receipt Number,packingslip, pckslipdate, supplier.
2.after this subsession tdpsc0191s000 is started.
3.I enter the value Yes in the column Mark.
4.I close the subsession.
5. Next I start the subsession tdilc4114s000 from main session.

I am able to do till the above steps.

next I have to start the subsession "lot control" tdltc0101s000 from the subsession tdilc4114s000. My program hangs here.
the code which I have shown above is only the part where we start the subsession from the subsession.
Thanks
Arun

mark_h
22nd February 2002, 20:22
Arun said in a private message:

I already saw ur answer in that thread and successfully did the insertion of the data in the first subsession. Now the problem is calling subsession from the subsession.


Could you post that section of code where you activate the tdltc0101s000 subsession? Hopefully that might help someone else resolve the problem.

Thanks

Mark

arunprasath
23rd February 2002, 09:04
I give the full code here....

f4120m000.put.Purchase_Order(x.i.orno)|main session
f4120m000.put.Position_Number(x.i.pono)
f4120m000.put.Receipt_Number(x.i.reno)
stpapi.enum.answer("tdpur4120m000","tdpur41206",tcyesno.yes)
f4120m000.put.form.dino(x.i.form.dino)
f4120m000.put.Packing_Slip_Date(b.form.didt)
f4120m000.handle.sub.process( "tdpsc0191s000", "add" )|starting first subsession
ret=stpapi.change.view("tdpur4120m000")
f0191s000.put.Marked(myinput)
f0191s000.save(gapi.error.code)
f0191s000.end()|finishing first subsession
f4120m000.put.Quantity_on_Packing_Slip(x.i.diqu)|back to main session
f4120m000.put.Receipt_Date(b.date)
f4120m000.handle.sub.process( "tdilc4114s000", "add" )|starting subsession
ret=stpapi.change.view("tdpur4120m000")
test()|code executes till this.
f4114s000.handle.sub.process("tdltc0101s000","add")|starting subsession from subsession.code hangs here.
test()|this function is not executed.
f0101s000.put.Date(b.date)
f0101s000.end()
f4114s000.end()
f4120m000.insert(0,gapi.error.code)

mark_h
23rd February 2002, 16:43
When doing it manually what triggers the tdltc0101s000 session to activate? I see where you do the change view in tdpur4120m000, but I do not see anything that would cause the tdltc0101s000 session to start running. I wonder if it should be a stpapi.zoom.option instead of the handle sub-process. I have seen this before with other sub-sessions. You might want to give that a try and see what happens.


Mark

arunprasath
25th February 2002, 09:59
while doing manually, from the session tdilc4114s000, in the lot field, we need to zoom to the lotcontrol session(tdltc0101s000).
I have tried, zoom option also in the code.
I have also tried the change view().
Nothing is working out.
Arun

mark_h
25th February 2002, 16:04
Here is what I saw when I did a manual receipt for a lot controlled item - remember I am on 4c3. I put the packing slip qty, and delivery qty. When I tabbed from the delevery qty tdltc4113s000 started. There I put the lot information. At that point it looks like I am done. I do not even have a tdltc4114s000 session to look at. So from what I saw I am going to make a guess at what might help.

Everything is fine upto this point:
f4120m000.handle.sub.process( "tdilc4114s000", "add" )|starting subsession

Now that tdilc4114s000 is running do what needs to be done to that form. What I see next in your code is "ret=stpapi.change.view("tdpur4120m000")". It looks like you are returning command to the tdpur4120m000 session BEFORE processing in the tdilc4114s000. Here is what I would expect to see:

f4120m000.handle.sub.process( "tdilc4114s000", "add" )|starting subsession
f4114s000.find (if necessary)
f4114s000.put
f4114s000.handle.sub.process("tdltc0101s000","add")
f4114s000.save or insert.
f0101s000.put
f0101s000.save or insert
f0101s000.end
f4114s000.save or end

Since I do not have these sessions I do not know if it would be a handle.sub.process or the zoom.option. OR if it requires a save before or after the handle or zoom.

Sorry I am not much help. Right now it looks like that "ret=stpapi.change.view("tdpur4120m000")" command after the "f4120m000.handle.sub.process( "tdilc4114s000", "add" )" could be causing problems.

Good Luck!

Mark