Kingsto88
21st September 2005, 11:30
Hi experts,
I am trying to run whinh4201m000 to generate using API. (baan5c)
Has anyone done this before?
My code is as below. No error message is appearing when i run stpapi.form.command. Anyone know what is wrong?
Thanks and regards,
function update.table()
{
long ret
message("update")
string tmp.orno(6)
stpapi.put.field("whinh4201m000","runnumber","")
stpapi.put.field("whinh4201m000","overwrite.range",str$(tcyesno.yes))
stpapi.put.field("whinh4201m000","oorg.f",str$(whinh.oorg.sales))
stpapi.put.field("whinh4201m000","oorg.t",str$(whinh.oorg.sales))
stpapi.put.field("whinh4201m000","orno.f","210000009")
stpapi.put.field("whinh4201m000","orno.t","210000009")
stpapi.put.field("whinh4201m000","oset.f","0")
stpapi.put.field("whinh4201m000","oset.t","999")
stpapi.put.field("whinh4201m000","pono.f","0")
stpapi.put.field("whinh4201m000","pono.t","9999")
stpapi.put.field("whinh4201m000","dldt.f",str$(date.num()-100000))
stpapi.put.field("whinh4201m000","dldt.t",str$(date.num()+100000))
stpapi.put.field("whinh4201m000","stty.f",str$(whinh.type.warehouse))
stpapi.put.field("whinh4201m000","stty.t",str$(whinh.type.work.center))
stpapi.put.field("whinh4201m000","stco.f","")
stpapi.put.field("whinh4201m000","stco.t","ZZZZZZZZZ")
stpapi.put.field("whinh4201m000","shpt.f","")
stpapi.put.field("whinh4201m000","shpt.t","ZZZZZZZZZ")
stpapi.put.field("whinh4201m000","crte.f","")
stpapi.put.field("whinh4201m000","crte.t","ZZZZZ")
stpapi.put.field("whinh4201m000","carr.f","")
stpapi.put.field("whinh4201m000","carr.t","ZZZ")
stpapi.put.field("whinh4201m000","cwar.f","")
stpapi.put.field("whinh4201m000","cwar.t","ZZZZZZ")
stpapi.put.field("whinh4201m000","item.f","")
stpapi.put.field("whinh4201m000","item.t",
"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ")
| The next 4 lines generate both the advice and shortages, if you want
| just one report then set the flags correctly, but always point the report
| to the advice report - This is the only way to get it to work.
| Advice Report
stpapi.put.field( "whinh4201m000", "pradvice", str$(tcyesno.no) )
stpapi.put.field( "whinh4201m000", "prshortage", str$(tcyesno.no) )
|spool.fileout = "tmp0001"
|stpapi.set.report( "whinh4201m000","rwhinh420101000","ASCIF", msg )
stpapi.form.command("whinh4201m000",5,"exec.user.0",msg)
if not isspace(msg) then
|stpapi.continue.process("whinh4201m000",msg)
message("%s",msg)
endif
stpapi.end.session("whinh4201m000")
}
I am trying to run whinh4201m000 to generate using API. (baan5c)
Has anyone done this before?
My code is as below. No error message is appearing when i run stpapi.form.command. Anyone know what is wrong?
Thanks and regards,
function update.table()
{
long ret
message("update")
string tmp.orno(6)
stpapi.put.field("whinh4201m000","runnumber","")
stpapi.put.field("whinh4201m000","overwrite.range",str$(tcyesno.yes))
stpapi.put.field("whinh4201m000","oorg.f",str$(whinh.oorg.sales))
stpapi.put.field("whinh4201m000","oorg.t",str$(whinh.oorg.sales))
stpapi.put.field("whinh4201m000","orno.f","210000009")
stpapi.put.field("whinh4201m000","orno.t","210000009")
stpapi.put.field("whinh4201m000","oset.f","0")
stpapi.put.field("whinh4201m000","oset.t","999")
stpapi.put.field("whinh4201m000","pono.f","0")
stpapi.put.field("whinh4201m000","pono.t","9999")
stpapi.put.field("whinh4201m000","dldt.f",str$(date.num()-100000))
stpapi.put.field("whinh4201m000","dldt.t",str$(date.num()+100000))
stpapi.put.field("whinh4201m000","stty.f",str$(whinh.type.warehouse))
stpapi.put.field("whinh4201m000","stty.t",str$(whinh.type.work.center))
stpapi.put.field("whinh4201m000","stco.f","")
stpapi.put.field("whinh4201m000","stco.t","ZZZZZZZZZ")
stpapi.put.field("whinh4201m000","shpt.f","")
stpapi.put.field("whinh4201m000","shpt.t","ZZZZZZZZZ")
stpapi.put.field("whinh4201m000","crte.f","")
stpapi.put.field("whinh4201m000","crte.t","ZZZZZ")
stpapi.put.field("whinh4201m000","carr.f","")
stpapi.put.field("whinh4201m000","carr.t","ZZZ")
stpapi.put.field("whinh4201m000","cwar.f","")
stpapi.put.field("whinh4201m000","cwar.t","ZZZZZZ")
stpapi.put.field("whinh4201m000","item.f","")
stpapi.put.field("whinh4201m000","item.t",
"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ")
| The next 4 lines generate both the advice and shortages, if you want
| just one report then set the flags correctly, but always point the report
| to the advice report - This is the only way to get it to work.
| Advice Report
stpapi.put.field( "whinh4201m000", "pradvice", str$(tcyesno.no) )
stpapi.put.field( "whinh4201m000", "prshortage", str$(tcyesno.no) )
|spool.fileout = "tmp0001"
|stpapi.set.report( "whinh4201m000","rwhinh420101000","ASCIF", msg )
stpapi.form.command("whinh4201m000",5,"exec.user.0",msg)
if not isspace(msg) then
|stpapi.continue.process("whinh4201m000",msg)
message("%s",msg)
endif
stpapi.end.session("whinh4201m000")
}