balugr
13th August 2002, 12:20
Hi
I am trying to automate "Maintain Receipts" using AFS. The session hangs at the after the line - stpapi.handle.subproc( "tdpur4120m000", "tdilc4113s000", "send"). We are using Baan IVc4 with multi currency and lot control.
Start baan code:
|******************************************************************************
|* tdbardll0001 0 VRC B40C c4 umcr
|* AFS to Upload Purchase Receipt
|* omnibz
|* 12-08-02 [17:26]
|******************************************************************************
|* Script Type: Library
|******************************************************************************
#pragma used dll ottstpapihand
function extern use.afs.to.upload.receipts()
{
table ttdbar003
table ttdbar004
table ttdpur041
table ttdpur045
extern domain tcrcno reno
string err(50)
long ret.code
select tdbar003.*
from tdbar003
where tdbar003.stat = tdsls.lsta.free
order by tdbar003._index1
selectdo
stpapi.put.field("tdpur4120m000", "tdpur045.reno", str$(reno))
stpapi.put.field("tdpur4120m000", "form.dino", tdbar003.dino)
stpapi.put.field("tdpur4120m000", "tdpur045.orno", str$(tdbar003.orno))
stpapi.put.field("tdpur4120m000", "tdpur045.pono", str$(tdbar003.pono))
stpapi.put.field("tdpur4120m000", "tdpur045.diqu", str$(tdbar003.dqua))
stpapi.put.field("tdpur4120m000", "tdpur045.date", str$(tdbar003.ddtb))
stpapi.handle.subproc( "tdpur4120m000", "tdilc4113s000", "send")
select tdbar004.*
from tdbar004
where tdbar004._index1 = {:tdbar003.orno, :tdbar003.pono}
order by tdbar004._index1
selectdo
select tdpur041.*
from tdpur041
where tdpur041._index1 = {:tdbar003.orno, :tdbar003.pono}
selectdo
endselect
stpapi.put.field("tdilc4113s000", "tdilc402.clot", tdbar004.clot) ====> Session hangs here
stpapi.zoom.option("tdilc4113s000", 1, "tdltc0101s000", err)
stpapi.put.field("tdltc0101s000", "tdltc001.clot", tdbar004.clot)
stpapi.put.field("tdltc0101s000", "tdltc001.lsup", num.to.date$(tdbar004.dcod, 1))
stpapi.put.field("tdltc0101s000", "tdltc001.oudt", str$(tdbar003.ddtb))
stpapi.update("tdlc0101s000", 1, err)
stpapi.end.session("tdlc0101s000")
stpapi.put.field("tdilc4113s000", "tdilc402.date", str$(tdbar003.ddtb))
stpapi.put.field("tdilc4113s000", "tdilc402.stun", tdpur041.cuqp)
stpapi.put.field("tdilc4113s000", "tdilc402.qstr", str$(tdbar004.rqty))
selecteos
stpapi.update("tdilc4113s000", 1, err)
stpapi.end.session("tdilc4113s000")
endselect
stpapi.update("tdpur4120m000", true, err)
selecteos
stpapi.end.session("tdpur4120m000")
endselect
}
Any help is greatly appreciated.
I am trying to automate "Maintain Receipts" using AFS. The session hangs at the after the line - stpapi.handle.subproc( "tdpur4120m000", "tdilc4113s000", "send"). We are using Baan IVc4 with multi currency and lot control.
Start baan code:
|******************************************************************************
|* tdbardll0001 0 VRC B40C c4 umcr
|* AFS to Upload Purchase Receipt
|* omnibz
|* 12-08-02 [17:26]
|******************************************************************************
|* Script Type: Library
|******************************************************************************
#pragma used dll ottstpapihand
function extern use.afs.to.upload.receipts()
{
table ttdbar003
table ttdbar004
table ttdpur041
table ttdpur045
extern domain tcrcno reno
string err(50)
long ret.code
select tdbar003.*
from tdbar003
where tdbar003.stat = tdsls.lsta.free
order by tdbar003._index1
selectdo
stpapi.put.field("tdpur4120m000", "tdpur045.reno", str$(reno))
stpapi.put.field("tdpur4120m000", "form.dino", tdbar003.dino)
stpapi.put.field("tdpur4120m000", "tdpur045.orno", str$(tdbar003.orno))
stpapi.put.field("tdpur4120m000", "tdpur045.pono", str$(tdbar003.pono))
stpapi.put.field("tdpur4120m000", "tdpur045.diqu", str$(tdbar003.dqua))
stpapi.put.field("tdpur4120m000", "tdpur045.date", str$(tdbar003.ddtb))
stpapi.handle.subproc( "tdpur4120m000", "tdilc4113s000", "send")
select tdbar004.*
from tdbar004
where tdbar004._index1 = {:tdbar003.orno, :tdbar003.pono}
order by tdbar004._index1
selectdo
select tdpur041.*
from tdpur041
where tdpur041._index1 = {:tdbar003.orno, :tdbar003.pono}
selectdo
endselect
stpapi.put.field("tdilc4113s000", "tdilc402.clot", tdbar004.clot) ====> Session hangs here
stpapi.zoom.option("tdilc4113s000", 1, "tdltc0101s000", err)
stpapi.put.field("tdltc0101s000", "tdltc001.clot", tdbar004.clot)
stpapi.put.field("tdltc0101s000", "tdltc001.lsup", num.to.date$(tdbar004.dcod, 1))
stpapi.put.field("tdltc0101s000", "tdltc001.oudt", str$(tdbar003.ddtb))
stpapi.update("tdlc0101s000", 1, err)
stpapi.end.session("tdlc0101s000")
stpapi.put.field("tdilc4113s000", "tdilc402.date", str$(tdbar003.ddtb))
stpapi.put.field("tdilc4113s000", "tdilc402.stun", tdpur041.cuqp)
stpapi.put.field("tdilc4113s000", "tdilc402.qstr", str$(tdbar004.rqty))
selecteos
stpapi.update("tdilc4113s000", 1, err)
stpapi.end.session("tdilc4113s000")
endselect
stpapi.update("tdpur4120m000", true, err)
selecteos
stpapi.end.session("tdpur4120m000")
endselect
}
Any help is greatly appreciated.