VishalMistry
26th October 2015, 17:43
Hi all
I am calling following function which releases the production order passed to it.

function execute.session.tisfc0204m000(domain tcpdno ref.pdno)
{

stpapi.put.field(REL.ORDR,"pdno.f",str$(ref.pdno))
stpapi.put.field(REL.ORDR,"pdno.t",str$(ref.pdno))
stpapi.put.field(REL.ORDR,"cprj.f","")
stpapi.put.field(REL.ORDR,"cprj.t","ZZZZZZ")
stpapi.put.field(REL.ORDR,"prdt.f",str$(0))
stpapi.put.field(REL.ORDR,"prdt.t",str$(prdt.t.cus))
stpapi.set.report(REL.ORDR, "rtisfc020401000", alt.dev, error.msg)
stpapi.print.report(REL.ORDR, error.msg)
stpapi.end.session( REL.ORDR, error.msg)
}

The status of prod.order is planned or document printed and the device selected is getting stored in alt.dev.

Calling this session does not change the status of production order to Released.

Anybody any clue please. Any help in this regard is highly appreciated.

Vishal

VishalMistry
26th October 2015, 18:28
I got solution. The Actual code is

stpapi.put.field(REL.ORDR,"pdno.f",str$(ref.pdno))
stpapi.put.field(REL.ORDR,"pdno.t",str$(ref.pdno))
stpapi.put.field(REL.ORDR,"cprj.f","")
stpapi.put.field(REL.ORDR,"cprj.t","ZZZZZZ")
|stpapi.put.field(REL.ORDR,"prdt.f",str$(0))
stpapi.put.field(REL.ORDR,"prdt.t",str$(prdt.t.cus))
stpapi.set.report(REL.ORDR, "rtisfc020401000", alt.dev, error.msg)
stpapi.continue.process(REL.ORDR,error.msg)
|stpapi.print.report(REL.ORDR, error.msg)
stpapi.end.session( REL.ORDR, error.msg)

Actually i forgot to write
stpapi.set.report(REL.ORDR, "rtisfc020401000", alt.dev, error.msg)
stpapi.continue.process(REL.ORDR,error.msg)

Vishal

mark_h
26th October 2015, 19:10
The old code below worked for me - but the production order on our system has to be at documents printed status before it will change to releases using tisfc0204m000. I also pushed the date range out just to make sure it was covered. So you might want to check the date you are using also.


function release_production_order()
{
spool.device = ""
spool.fileout = ""
sfc.order = 374644
| Setup report.
| Put the fields.
stpapi.put.field( "tisfc0204m000", "ccot.f", " " )
stpapi.put.field( "tisfc0204m000", "ccot.t", "ZZZ" )

stpapi.put.field( "tisfc0204m000", "pdno.f",str$(sfc.order))
stpapi.put.field( "tisfc0204m000", "pdno.t",str$(sfc.order))
stpapi.put.field( "tisfc0204m000", "prdt.f", str$(date.num()-1000) )
stpapi.put.field( "tisfc0204m000", "prdt.t", str$(date.num()+1000) )
| Set report
stpapi.set.report("tisfc0204m000","rtisfc020401000","D66",errmsg)
if(strip$(errmsg)<>"") then
message("Report: "&errmsg)
else
stpapi.continue.process( "tisfc0204m000", errmsg)
if(strip$(errmsg)<>"") then
message("Continue: "&errmsg)
endif
endif
tmsg = stpapi.get.mess.code("tisfc0204m000", errmsg)
stpapi.end.session( "tisfc0204m000" )
}