mstockre
2nd December 2004, 00:26
Im trying to use AFS to add sales orders into baan. Im currently getting an error in the AFS log: "Cost price structure not present for this date" . Session ticpr2210m00 cost is set for dates. For the item in question, the information is completely. You can manually run the session tdsls4101m000 then tdsls410s000 and the sales order for the item will enter, but not if I try through AFS. Im new to AFS so any help as to what I could be doing wrong would be appreciated.
Here is our coding:
Varibles in the stpapi.put statements are define as string with a value defind.
|************************************************************************************
function run.main.sess()
{
|*** This function invokes session tdsls04101m000
|************fields from the file*********************
stpapi.put.field("tdsls4101m001", "tdsls040.eono", eono)
|stpapi.put.field("tdsls4101m001", "tdsls040.odat", str$(odat))
|stpapi.put.field("tdsls4101m001", "tdsls040.prdt", str$(ddat))
|*************fields from varibles********************
stpapi.put.field("tdsls4101m001", "tdsls040.cuno", cuno)
stpapi.put.field("tdsls4101m001", "tdsls040.crep", crep)
write.err.record()
if all.ok then
stpapi.insert("tdsls4101m001",1,err)
stpapi.save("tdsls4101m001",err)
run.sub.sess()
endif
stpapi.end.session("tdsls4101m001")
if all.ok then
rec.writ = rec.writ + 1
else
rec.rej = rec.rej + 1
endif
}
function run.sub.sess()
{
|*** This function invokes sub-session tdsls4102s000 and updates the
|*** quantity field
stpapi.handle.subproc( "tdsls4101m001", "tdsls4102s001", "add")
if strip$(err) = "" then
stpapi.put.field("tdsls4102s001", "tdsls041.cuno",cuno)
stpapi.put.field("tdsls4102s001", "tdsls041.eseq",eseq)
stpapi.put.field("tdsls4102s001", "tdsls041.item", item)
||stpapi.put.field("tdsls4102s001", "tdsls041.citt",citt)
||stpapi.put.field("tdsls4102s001", "tdsls041.opol",opol)
stpapi.insert("tdsls4102s001",1,err)
stpapi.save("tdsls4102s001",err)
if strip$(err) <> "" then
write.err.record()
if strip$(err) <> "" then
write.err.record()
endif
else
write.err.record()
endif
stpapi.end.session("tdsls4102s001")
stpapi.handle.subproc( "tdsls4101m001", "tdsls4102s001", "kill")
Thank you,
Marianne
Here is our coding:
Varibles in the stpapi.put statements are define as string with a value defind.
|************************************************************************************
function run.main.sess()
{
|*** This function invokes session tdsls04101m000
|************fields from the file*********************
stpapi.put.field("tdsls4101m001", "tdsls040.eono", eono)
|stpapi.put.field("tdsls4101m001", "tdsls040.odat", str$(odat))
|stpapi.put.field("tdsls4101m001", "tdsls040.prdt", str$(ddat))
|*************fields from varibles********************
stpapi.put.field("tdsls4101m001", "tdsls040.cuno", cuno)
stpapi.put.field("tdsls4101m001", "tdsls040.crep", crep)
write.err.record()
if all.ok then
stpapi.insert("tdsls4101m001",1,err)
stpapi.save("tdsls4101m001",err)
run.sub.sess()
endif
stpapi.end.session("tdsls4101m001")
if all.ok then
rec.writ = rec.writ + 1
else
rec.rej = rec.rej + 1
endif
}
function run.sub.sess()
{
|*** This function invokes sub-session tdsls4102s000 and updates the
|*** quantity field
stpapi.handle.subproc( "tdsls4101m001", "tdsls4102s001", "add")
if strip$(err) = "" then
stpapi.put.field("tdsls4102s001", "tdsls041.cuno",cuno)
stpapi.put.field("tdsls4102s001", "tdsls041.eseq",eseq)
stpapi.put.field("tdsls4102s001", "tdsls041.item", item)
||stpapi.put.field("tdsls4102s001", "tdsls041.citt",citt)
||stpapi.put.field("tdsls4102s001", "tdsls041.opol",opol)
stpapi.insert("tdsls4102s001",1,err)
stpapi.save("tdsls4102s001",err)
if strip$(err) <> "" then
write.err.record()
if strip$(err) <> "" then
write.err.record()
endif
else
write.err.record()
endif
stpapi.end.session("tdsls4102s001")
stpapi.handle.subproc( "tdsls4101m001", "tdsls4102s001", "kill")
Thank you,
Marianne