fmorais
3rd November 2005, 13:21
Hi everyone.
Trying to create a function server to maintain inbound data (BIVc4)
Had some problems which are already referred in other threads and were able to correct them. Also installed some solutions for tdilc4515s000.
Read some threads about creating a similar function server and my code is more or less the same.
My current problem is that no errors are generated and everything seems to be working but, the receipt line is not inserted in the tdilc4104s000 session.
Logged the actions to afs.log and there is nothing there to give me a hint.
A curious thing, is that in the line:
stpapi.get.field("tdilc4104s000", "tdilc402.serb", fm.serb)
the variable fm.serb returns empty, indicating that the line was not inserted.
Can anybody give me a hint?
Please find my code bellow.
function insere.linha()
{
long posicao
domain tcdate data.lote
string data.lote$(8)
domain tcqiv1 quant2
domain tcconv factor.conv
long rc
domain tcmcs.str20 fm.kooa
domain tcmcs.str20 fm.ordem
domain tcmcs.str20 fm.lote
domain tcmcs.str5 fm.serb
|Executar
stpapi.put.field("tdilc4103m000","runnumber", logname$)
|Tipo de Ordem
stpapi.put.field("tdilc4103m000","k.o.order", str$(etol(tdilc.kooa.act.pmg)))
|Ordem
stpapi.put.field("tdilc4103m000","ordernr", str$(ordem))
stpapi.handle.subproc("tdilc4103m000", "tdilc4104s000", "add")
stpapi.continue.process("tdilc4103m000", error.msg)
stpapi.handle.subproc("tdilc4104s000","tdilc4515s000","add")
stpapi.handle.subproc("tdilc4104s000","tdilc4512s000","add")
retval = stpapi.insert("tdilc4104s000", 1, error.msg)
stpapi.put.field("tdilc4515s000","tdilc402.koor", str$(etol(tdilc.kooa.act.pmg)))
stpapi.put.field("tdilc4515s000","tdilc402.orno", str$(ordem))
stpapi.put.field("tdilc4515s000","tdilc402.pono", "0")
stpapi.put.field("tdilc4515s000","tdilc402.sera", "0")
stpapi.put.field("tdilc4515s000","tdilc402.item", artigopa)
rc = stpapi.change.view("tdilc4515s000", error.msg)
if not isspace(error.msg) or rc<> 1 then
stpapi.get.field("tdilc4515s000", "tdilc402.koor", fm.kooa)
stpapi.get.field("tdilc4515s000", "tdilc402.orno", fm.ordem)
stpapi.get.field("tdilc4515s000", "tdilc402.clot", fm.lote)
erro.rep = "Linha2 - " & error.code & " - " & error.msg
rprt_send()
stpapi.end.session("tdilc4515s000")
stpapi.end.session("tdilc4512s000")
stpapi.end.session("tdilc4104s000")
stpapi.end.session("tdilc4103m000")
endif
rc = stpapi.browse.set("tdilc4515s000", "first.set", error.msg)
rc = stpapi.find("tdilc4515s000", error.msg)
stpapi.get.field("tdilc4515s000", "tdilc402.koor", fm.kooa)
stpapi.get.field("tdilc4515s000", "tdilc402.orno", fm.ordem)
stpapi.get.field("tdilc4515s000", "tdilc402.clot", fm.lote)
rc = stpapi.mark("tdilc4515s000", error.msg)
stpapi.continue.process("tdilc4515s000", error.msg)
if not isspace(error.msg) or rc<> 1 then
erro.rep = "Linha3 - " & error.code & " - " & error.msg
rprt_send()
stpapi.end.session("tdilc4515s000")
stpapi.end.session("tdilc4512s000")
stpapi.end.session("tdilc4104s000")
stpapi.end.session("tdilc4103m000")
endif
stpapi.end.session("tdilc4515s000")
stpapi.put.field("tdilc4104s000", "tdilc402.loca", localizacao)
stpapi.put.field("tdilc4104s000", "tdilc402.qstr", str$(quantidade))
rc = stpapi.update("tdilc4104s000",0,error.msg)
if rc<> 1 then
erro.rep = "Linha4 - " & error.code & " - " & error.msg
rprt_send()
stpapi.end.session("tdilc4515s000")
stpapi.end.session("tdilc4512s000")
stpapi.end.session("tdilc4104s000")
stpapi.end.session("tdilc4103m000")
endif
stpapi.get.field("tdilc4104s000", "tdilc402.serb", fm.serb)
stpapi.end.session("tdilc4512s000")
stpapi.end.session("tdilc4104s000")
stpapi.end.session("tdilc4103m000")
}
Thanks a lot
Fred
Trying to create a function server to maintain inbound data (BIVc4)
Had some problems which are already referred in other threads and were able to correct them. Also installed some solutions for tdilc4515s000.
Read some threads about creating a similar function server and my code is more or less the same.
My current problem is that no errors are generated and everything seems to be working but, the receipt line is not inserted in the tdilc4104s000 session.
Logged the actions to afs.log and there is nothing there to give me a hint.
A curious thing, is that in the line:
stpapi.get.field("tdilc4104s000", "tdilc402.serb", fm.serb)
the variable fm.serb returns empty, indicating that the line was not inserted.
Can anybody give me a hint?
Please find my code bellow.
function insere.linha()
{
long posicao
domain tcdate data.lote
string data.lote$(8)
domain tcqiv1 quant2
domain tcconv factor.conv
long rc
domain tcmcs.str20 fm.kooa
domain tcmcs.str20 fm.ordem
domain tcmcs.str20 fm.lote
domain tcmcs.str5 fm.serb
|Executar
stpapi.put.field("tdilc4103m000","runnumber", logname$)
|Tipo de Ordem
stpapi.put.field("tdilc4103m000","k.o.order", str$(etol(tdilc.kooa.act.pmg)))
|Ordem
stpapi.put.field("tdilc4103m000","ordernr", str$(ordem))
stpapi.handle.subproc("tdilc4103m000", "tdilc4104s000", "add")
stpapi.continue.process("tdilc4103m000", error.msg)
stpapi.handle.subproc("tdilc4104s000","tdilc4515s000","add")
stpapi.handle.subproc("tdilc4104s000","tdilc4512s000","add")
retval = stpapi.insert("tdilc4104s000", 1, error.msg)
stpapi.put.field("tdilc4515s000","tdilc402.koor", str$(etol(tdilc.kooa.act.pmg)))
stpapi.put.field("tdilc4515s000","tdilc402.orno", str$(ordem))
stpapi.put.field("tdilc4515s000","tdilc402.pono", "0")
stpapi.put.field("tdilc4515s000","tdilc402.sera", "0")
stpapi.put.field("tdilc4515s000","tdilc402.item", artigopa)
rc = stpapi.change.view("tdilc4515s000", error.msg)
if not isspace(error.msg) or rc<> 1 then
stpapi.get.field("tdilc4515s000", "tdilc402.koor", fm.kooa)
stpapi.get.field("tdilc4515s000", "tdilc402.orno", fm.ordem)
stpapi.get.field("tdilc4515s000", "tdilc402.clot", fm.lote)
erro.rep = "Linha2 - " & error.code & " - " & error.msg
rprt_send()
stpapi.end.session("tdilc4515s000")
stpapi.end.session("tdilc4512s000")
stpapi.end.session("tdilc4104s000")
stpapi.end.session("tdilc4103m000")
endif
rc = stpapi.browse.set("tdilc4515s000", "first.set", error.msg)
rc = stpapi.find("tdilc4515s000", error.msg)
stpapi.get.field("tdilc4515s000", "tdilc402.koor", fm.kooa)
stpapi.get.field("tdilc4515s000", "tdilc402.orno", fm.ordem)
stpapi.get.field("tdilc4515s000", "tdilc402.clot", fm.lote)
rc = stpapi.mark("tdilc4515s000", error.msg)
stpapi.continue.process("tdilc4515s000", error.msg)
if not isspace(error.msg) or rc<> 1 then
erro.rep = "Linha3 - " & error.code & " - " & error.msg
rprt_send()
stpapi.end.session("tdilc4515s000")
stpapi.end.session("tdilc4512s000")
stpapi.end.session("tdilc4104s000")
stpapi.end.session("tdilc4103m000")
endif
stpapi.end.session("tdilc4515s000")
stpapi.put.field("tdilc4104s000", "tdilc402.loca", localizacao)
stpapi.put.field("tdilc4104s000", "tdilc402.qstr", str$(quantidade))
rc = stpapi.update("tdilc4104s000",0,error.msg)
if rc<> 1 then
erro.rep = "Linha4 - " & error.code & " - " & error.msg
rprt_send()
stpapi.end.session("tdilc4515s000")
stpapi.end.session("tdilc4512s000")
stpapi.end.session("tdilc4104s000")
stpapi.end.session("tdilc4103m000")
endif
stpapi.get.field("tdilc4104s000", "tdilc402.serb", fm.serb)
stpapi.end.session("tdilc4512s000")
stpapi.end.session("tdilc4104s000")
stpapi.end.session("tdilc4103m000")
}
Thanks a lot
Fred