yashwant
17th May 2007, 07:52
Hi all,

I have written a AFS program for "Generate outbound session".But one error message is coming in message -m2 like"Report not Filled".Can any body help me on this regard,also i am attaching the code.

thank u
yashwant
function read.main.table()
{
string m1(40),m2(40),m3(40),m4(40),m5(40),m6(40),m7(40),run1(15)
stpapi.put.field( "tdilc4201m000", "runnumber", "1203")
stpapi.get.field("tdilc4201m000","runnumber",run1)
message(run1)
stpapi.put.field( "tdilc4201m000", "koor.f", str$(etol(tdilc.koob.act.sls)))
stpapi.put.field( "tdilc4201m000", "koor.t", str$(etol(tdilc.koob.act.sls)))
stpapi.put.field( "tdilc4201m000", "orno.f", str$(orno.f))
stpapi.put.field( "tdilc4201m000", "orno.t", str$(orno.t))
stpapi.insert("tdilc4201m000",true,m1)
stpapi.save("tdilc4201m000",m3)
stpapi.continue.process("tdilc4201m000",m2)
message("m2-%s",m2)
stpapi.set.report("tdilc4201m000", "rtdilc420101000", "D", m4)
if isspace(m4) then
stpapi.print.report("tdilc4201m000", m5)
stpapi.continue.process("tdilc4201m000",m6)
message("Report-%s",m6)
endif
stpapi.end.session( "tdilc4201m000")
}

bigjack
17th May 2007, 09:25
HI,

There are two stpapi.continue.process("tdilc4201m000") statements in your code. Is there any need for second statement. I think the stpapi.set.report("tdilc4201m000", "rtdilc420101000", "D", m4) should be written before the first call to stpapi.continue.process("tdilc4201m000").

Also there is no need for stpapi.print.report("tdilc4201m000", m5) statement.

Bye

yashwant
17th May 2007, 10:41
hi bijack

I did the same thing what u had written,but not "Run Number not allowed" is coming,but i can able to generate outbound with same run number manually.

thanks
yashwant

mark_h
17th May 2007, 14:37
My code - not sure if I posted it before. As it is there is no guarantee it will work for you. Something I always recommend is to be on the latest objects for both the session and the stpapi libraries.

function extern generate_outbound( domain tcmcs.str12 runnumber,
domain tcorno run.order.f,
domain tcorno run.order.t,
domain tcpono run.opno.f,
domain tcpono run.opno.t,
domain tcitem run.item.f,
domain tcitem run.item.t,
domain tccwar run.cwar.f,
domain tccwar run.cwar.t,
domain tgyenox run.advice,
ref string msg())
{
apishort= ""
export("apishort",apishort)
msg = ""
stpapi.put.field("tdilc4201m000","runnumber",runnumber)
stpapi.put.field("tdilc4201m000","koor.f",str$(tdilc.koob.act.sfc))
stpapi.put.field("tdilc4201m000","koor.t",str$(tdilc.koob.act.sfc))
stpapi.put.field("tdilc4201m000","cuno.f","")
stpapi.put.field("tdilc4201m000","cuno.t","ZZZZZZ")
stpapi.put.field("tdilc4201m000","orno.f",str$(run.order.f))
stpapi.put.field("tdilc4201m000","orno.t",str$(run.order.t))
stpapi.put.field("tdilc4201m000","opno.f",str$(run.opno.f))
stpapi.put.field("tdilc4201m000","opno.t",str$(run.opno.t))
stpapi.put.field("tdilc4201m000","prdt.t",str$(date.num()+1000))
|stpapi.put.field("tdilc4201m000","ddat.f",str$(date.num()-1000))
stpapi.put.field("tdilc4201m000","ddat.t",str$(date.num()+1000))
stpapi.put.field("tdilc4201m000","cprj.f","")
stpapi.put.field("tdilc4201m000","cprj.t","ZZZZZZ")
stpapi.put.field("tdilc4201m000","item.f",run.item.f)
stpapi.put.field("tdilc4201m000","item.t",run.item.t)
stpapi.put.field("tdilc4201m000","cwar.f",run.cwar.f)
stpapi.put.field("tdilc4201m000","cwar.t",run.cwar.t)
stpapi.put.field("tdilc4201m000","cntr.f","")
stpapi.put.field("tdilc4201m000","cntr.t","ZZZ")
stpapi.put.field("tdilc4201m000","crte.f","")
stpapi.put.field("tdilc4201m000","crte.t","ZZZZZ")

| 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
if run.advice = tgyenox.yes then
stpapi.put.field( "tdilc4201m000", "print.recom", str$(tcyesno.yes) )
else
stpapi.put.field( "tdilc4201m000", "print.recom", str$(tcyesno.no) )
endif
stpapi.put.field( "tdilc4201m000", "prnt.error.report", str$(tcyesno.yes) ) |20060804
stpapi.put.field( "tdilc4201m000", "prnt.shortage", str$(tcyesno.no) )
stpapi.put.field( "tdilc4201m000", "pr.peg.shortage", str$(tcyesno.no) )
stpapi.set.report( "tdilc4201m000","rtdilc420101000",spool.device, msg )
|Shortage Report
|stpapi.set.report( "tdilc4201m000","rtdilc420102000","D66", msg )

stpapi.continue.process("tdilc4201m000",msg)
stpapi.end.session("tdilc4201m000")
}

Andy..
13th April 2010, 12:36
Hi, I've had a very similar version of this running for a year or so on something around service pack 18-20. We have loaded service pack 27 for testing and now the exact same previous working code is giving the error 'report name not filled'

Here's an extract from apilog:


>tdilc4201m000 set.report
20dll->serv (set.reportrtdilc420101000D23)
tdilc4201m000(23)-RUNNING:set.report
23serv<-4gl (set.report0)
tdilc4201m000(23)-RUNNING:
<tdilc4201m000
>tdilc4201m000 continue.process
20dll->serv (cont.process23)
tdilc4201m000(23)-RUNNING:cont.process
24serv<-4gl (api.child.startedttstpsplopen 23)
27serv<-4gl (api.child.startedttstpsplopen 23)
23serv<-4gl (cont.process1)
tdilc4201m000(23)-RUNNING:
<tdilc4201m000 Report name not filled
>tdilc4201m000 get.mess.code
<tdilc4201m000 ttstps0301
>tdilc4201m000 end.session

Has anyone else found this (and resolved it!) ??

Thanks

mark_h
13th April 2010, 13:52
Go back to infor and check for updates on the tools and stpapi. That is the first thing I would do. I think we are going to try another service pack later this year. Plus make sure there are no new form fields or reports - I know one of these tdilc sessions started generating multiple reports on us and I had to re-design the code.

Andy..
21st April 2010, 15:48
this topic has more information...
http://www.baanboard.com/baanboard/showthread.php?p=162814#post162814
basically, the problem is with the SP27 version of the session - not the tools objects. SP26 is fine.