vsevilla
24th September 2002, 23:30
Hi
I'm trying to make an AFS for session Material To Issue for Production Orders.
The insert doesn't keep the value of sitm and the error message say " Item not Allowed"
I'm in Baan Vc Sp8
Does anyone has an idea on what can be wrong here.
My code is.
function run.main.sess()
{
|*** This function invokes session tisct1501m000
pdno = "T31000046"
sitm = string.set$(" ",9) & "COBLE"
opno = "20"
issu = "400"
dris = "2"
stpapi.put.field("ticst1501mc00", "ticst001.pdno", pdno)
ret.code = stpapi.change.view("ticst1501mc00", err)
if ret.code <> 1 then
err = "Error en orden de fabricación"
err = err & pdno
write.err.record()
else
run.sub.sess()
stpapi.end.session("ticst1501mc00")
endif
}
function run.sub.sess()
{
|*** This function invokes session tcmcs0503m000
ret.code = stpapi.synchronize.dialog("ticst1501mc00", "add", err)
if ret.code then
stpapi.put.field("ticst0101sc00", "ticst001.sitm", sitm)
stpapi.get.field("ticst0101sc00", "ticst001.sitm", m.sitm)
stpapi.put.field("ticst0101sc00", "ticst001.opno", opno)
stpapi.put.field("ticst0101sc00", "ticst001.issu", issu)
stpapi.put.field("ticst0101sc00", "ticst001.dris", dris)
stpapi.get.field("ticst0101sc00", "ticst001.sitm", m.sitm)
ret.code = stpapi.insert("ticst1501mc00",false,err)
if ret.code then
ret.code1 = stpapi.save("ticst1501mc00",err)
endif
if not ret.code or not ret.code1 then
ret.code = stpapi.recover("ticst0101sc00",err)
else
stpapi.get.field("ticst0101sc00", "next.pono", pono)
stpapi.enum.answer("ticst0101sc00", "ticst01011", tcyesno.yes)
stpapi.handle.subproc("ticst0101sc00", "tisfc0207m000", "add")
stpapi.form.command("ticst0101sc00",5,"exec.cont.process", err)
stpapi.end.session("tisfc0207m000")
stpapi.handle.subproc("ticst0101sc00", "tisfc0207m000", "kill")
endif
endif
}
I'm trying to make an AFS for session Material To Issue for Production Orders.
The insert doesn't keep the value of sitm and the error message say " Item not Allowed"
I'm in Baan Vc Sp8
Does anyone has an idea on what can be wrong here.
My code is.
function run.main.sess()
{
|*** This function invokes session tisct1501m000
pdno = "T31000046"
sitm = string.set$(" ",9) & "COBLE"
opno = "20"
issu = "400"
dris = "2"
stpapi.put.field("ticst1501mc00", "ticst001.pdno", pdno)
ret.code = stpapi.change.view("ticst1501mc00", err)
if ret.code <> 1 then
err = "Error en orden de fabricación"
err = err & pdno
write.err.record()
else
run.sub.sess()
stpapi.end.session("ticst1501mc00")
endif
}
function run.sub.sess()
{
|*** This function invokes session tcmcs0503m000
ret.code = stpapi.synchronize.dialog("ticst1501mc00", "add", err)
if ret.code then
stpapi.put.field("ticst0101sc00", "ticst001.sitm", sitm)
stpapi.get.field("ticst0101sc00", "ticst001.sitm", m.sitm)
stpapi.put.field("ticst0101sc00", "ticst001.opno", opno)
stpapi.put.field("ticst0101sc00", "ticst001.issu", issu)
stpapi.put.field("ticst0101sc00", "ticst001.dris", dris)
stpapi.get.field("ticst0101sc00", "ticst001.sitm", m.sitm)
ret.code = stpapi.insert("ticst1501mc00",false,err)
if ret.code then
ret.code1 = stpapi.save("ticst1501mc00",err)
endif
if not ret.code or not ret.code1 then
ret.code = stpapi.recover("ticst0101sc00",err)
else
stpapi.get.field("ticst0101sc00", "next.pono", pono)
stpapi.enum.answer("ticst0101sc00", "ticst01011", tcyesno.yes)
stpapi.handle.subproc("ticst0101sc00", "tisfc0207m000", "add")
stpapi.form.command("ticst0101sc00",5,"exec.cont.process", err)
stpapi.end.session("tisfc0207m000")
stpapi.handle.subproc("ticst0101sc00", "tisfc0207m000", "kill")
endif
endif
}