manojsharma
15th February 2005, 14:27
Hi all,
I have created AFS for updating sales orders with a given price, the script is working fine except it does not end session tdsls4504s000. Due to this, the session got hanged.
Can anybody help me out
Thanx in advance
mark_h
15th February 2005, 16:01
There is this thread (http://www.baanboard.com/baanboard/showthread.php?t=16164&highlight=tdsls4504s000) which may help. Also just wondering if this session is like tdpur4503s000 from maintain purchase order lines. In my function servers for tdpur4101m000 where I start the lines(tdpur4107s000) I just ignore tdpur4503s000 and when I end tdpur4107s000 it also closes the tdpur4503s000 session. Have you tried skipping the end on tdsls4504s000? Just a thought.
Mark
manojsharma
18th February 2005, 08:43
Thanx for your response but problem is not solved. I have skipped the end on tdsls4504s000 but it got hang when closing tdsls4105s000 and in option dialog the session tdsls4504s000 is still active.
I have also kill the session tdsls4504s000 but it still hang when closing tdsls4105s000.
I am pasting my script for your ready reference
function read.main.table()
{
select tdsls045.*, tdsls041.*
from tdsls045, tdsls041 |for update
where tdsls045.orno>=:w.orno
and tdsls045.orno<=:w.orno.t
and tdsls045.pono>=:w.pono
and tdsls045.pono<=:w.pono.t
and tdsls045.srnb>=:w.srnb
and tdsls045.srnb<=:w.srnb.t
and tdsls045.cuno>=:w.cuno
and tdsls045.cuno<=:w.cuno.t
and tdsls045.item>=:w.item
and tdsls045.item<=:w.item.t
and tdsls041.odat>=:w.odate
and tdsls041.odat<=:w.odate.t
and tdsls045.srnb=0
and tdsls045.cmba refers to tdsls041
order by tdsls045._index1
selectdo
ordno = tdsls045.orno
pono = tdsls045.pono
cuno = tdsls045.cuno
if (tdsls045.dqua=0 and tdsls045.bqua=0) and tdsls045.pmsk(3;1)="y" then
ret.h = 0.0
prog.name$ = "tdsls4101"
stpapi.put.field("tdsls4101m000", "tdsls040.orno", str$(ordno))
ret = stpapi.find("tdsls4101m000", w.err.mesg)
stpapi.handle.subproc("tdsls4101m000", "tdsls4105s000", "add")
stpapi.continue.process( "tdsls4101m000", w.err.mesg )
stpapi.put.field("tdsls4105s000", "tdsls041.orno", str$(ordno))
stpapi.put.field("tdsls4105s000", "tdsls041.pono", str$(pono))
ret = stpapi.find("tdsls4105s000", w.err.mesg)
slsbasepr = price.m
stpapi.handle.subproc("tdsls4105s000", "tdind0271s000", "send")
stpapi.put.field("tdsls4105s000", "slsbasepr", str$(price.m))
stpapi.update("tdsls4105s000", 1, w.err.mesg)
stpapi.save("tdsls4105s000", w.err.mesg)
stpapi.put.field("tdind0271s000","docu.no",str$(ordno))
stpapi.put.field("tdind0271s000","posi.no",str$(pono))
ret.m = stpapi.find("tdind0271s000")
if ret.m = 0 then
message(w.err.mesg)
message("Insert Fail in Lines Extensions, Session tdind0271s000")
return
else
stpapi.put.field("tdind0271s000","base.dt",str$(date.num()))
stpapi.update("tdind0271s000",true,w.err.mesg)
stpapi.save("tdind0271s000",w.err.mesg)
endif
stpapi.end.session("tdind0271s000")
long hold.pno
long pno
long info(256)
string pname(15), baan.sess
domain tcbool sess.found
sess.found = false
pno = 0
hold.pno = pno
baan.sess = "tdsls4504s000"
pno = pstat (pno, pname, info)
while pno > 0 and not sess.found
hold.pno = pno
pno = pstat (pno, pname, info)
if strip$(pname)="tdsls4504s000" then
kill(hold.pno)
sess.found = true
endif
endwhile
| long m.hold.pno
| long m.pno
| long m.info(256)
| string m.pname(15), m.baan.sess
| domain tcbool m.sess.found
|
| m.sess.found = false
| m.pno = 0
| m.hold.pno = m.pno
|
| m.pno = pstat (m.pno, m.pname, m.info)
| while m.pno > 0 and not m.sess.found
| m.hold.pno = m.pno
| m.pno = pstat (m.pno, m.pname, m.info)
| if strip$(m.pname)="tdsls4105s000" then
| kill(m.hold.pno)
| m.sess.found = true
| endif
| endwhile
| long n.hold.pno
| long n.pno
| long n.info(256)
| string n.pname(15), n.baan.sess
| domain tcbool n.sess.found
|
| n.sess.found = false
| n.pno = 0
| n.hold.pno = n.pno
|
| n.pno = pstat (n.pno, n.pname, n.info)
| while n.pno > 0 and not n.sess.found
| n.hold.pno = n.pno
| n.pno = pstat (n.pno, n.pname, n.info)
| if strip$(n.pname)="tdsls4101m000" then
| kill(n.hold.pno)
| n.sess.found = true
| endif
| endwhile
| stpapi.end.session("tdsls4504s000",w.err.mesg)
if isspace(w.err.mesg) then
stpapi.end.session("tdsls4105s000",w.err.mesg)
else
stpapi.recover("tdsls4105s000", w.recover.mesg)
endif
if isspace(w.err.mesg) then
stpapi.end.session("tdsls4101m000")
else
stpapi.recover("tdsls4101m000", w.recover.mesg)
endif
endif
endselect
}
mark_h
18th February 2005, 16:18
Not much help on these sessions. Have you tried "add" instead of send with the tdind0271s000 session? Just wondering if the send command may be causing it to lock up. You may also just need the latest objects for stpapi and for the session. I found this other http://www.baanboard.com/baanboard/showthread.php?t=12116&highlight=tdsls4105s000 and I am not sure if it is relevant. Sorry I am not much help.
Mark
manojsharma
22nd February 2005, 06:51
Hi Mark,
On changing to "Add" instead of send with tdind0271s000, the session is hang with the message "can't send command".
One more question, we have purchase a new server, in both the server objects are same but in old server my other AFS are working fine but in new server my AFS got hang-up. The porting set of old server is 6.1c.6.0.6 and new server is 6.1c.7.0.6. Is it due to porting set.
Thanx in advance.
Manoj Sharma
mark_h
22nd February 2005, 14:10
Not really sure what to do about tdind0271s000 - I have just never used send. That may be the correct thing to do in this case, but since I do not have or use these sessions it makes it more difficult to help.
Yes - the porting set can cause problems. Baan did have us update the porting because of problems I was having with my function servers.
Mark