jojovalenton
29th April 2014, 11:42
hello,

i created one afs to print sales order acknowledgement and its making the status to executed but i need some help advise why its taking time and other sales order to print acknowledgement even if i specified only one orno in the parameters and this causes to take longer time, in normal LN session it take seconds only. thanks in advance for your advise.

|scripts:
stpapi.put.field("tdsls4100m900","tdsls400.orno",i.orno.afs)
ret1 = stpapi.find("tdsls4100m900",error.msg)
if ret1 = 1 then
ret2 = stpapi.mark("tdsls4100m900", error.msg)
if ret2 then
stpapi.form.command("tdsls4100m900", 2, "tdsls4401m000", error.msg)
if error.msg = "" then
stpapi.put.field("tdsls4401m000","ofbp.f.segment.1",i.ofbp.afs)
stpapi.put.field("tdsls4401m000","ofbp.t.segment.2",i.ofbp.afs)
stpapi.put.field("tdsls4401m000","orno.f.segment.1",i.orno.afs)
stpapi.put.field("tdsls4401m000","orno.t.segment.2",i.orno.afs)
stpapi.put.field("tdsls4401m000","docs.to.print",str$(etol(tdsls.docs.acks)))
stpapi.put.field("tdsls4401m000","quan.to.print",str$(etol(tdsls.koqu.ordered.quan)))
stpapi.put.field("tdsls4401m000","printed",str$(etol(tdsls.kofl.all.excl.cancel)))
stpapi.put.field("tdsls4401m000","new.cncl.only",str$(tcyesno.no))
stpapi.put.field("tdsls4401m000","prnt.options",str$(tcyesno.no))
stpapi.put.field("tdsls4401m000","prnt.sellpr",str$(tcyesno.no))
stpapi.put.field("tdsls4401m000","prnt.promotions",str$(tcyesno.no))
stpapi.put.field("tdsls4401m000","prnt.uef.req",str$(tcyesno.no))
stpapi.put.field("tdsls4401m000","prnt.matr.supply",str$(tcyesno.no))
stpapi.put.field("tdsls4401m000","prnt.components",str$(tcyesno.no))
stpapi.put.field("tdsls4401m000","device.selection",str$(etol(tcdvsl.specific)))
stpapi.set.report("tdsls4401m000", "rtdsls440101000", "N", error.msg)

stpapi.form.command("tdsls4401m000", 5, "print.data",error.msg)
endif
endif
endif


regards,

jojo

mark_h
29th April 2014, 15:33
Well not sure any of this makes a difference - my first thought was do you have to run tdsls4401m000 by starting tdsls4100m900? I can't say since we are not on LN and do not use the sessions. When you run it by hand do you use the exact same parameters that you use in the AFS code - such as N as the print device?

I would also ask if you have code for tdsls4401m000 - you could put it in debug mode and find what is making it run so long.

BaanInOhio
29th April 2014, 16:39
stpapi.put.field("tdsls4401m000","ofbp.f.segment.1",i.ofbp.afs)
stpapi.put.field("tdsls4401m000","ofbp.t.segment.2",i.ofbp.afs)
stpapi.put.field("tdsls4401m000","orno.f.segment.1",i.orno.afs)
stpapi.put.field("tdsls4401m000","orno.t.segment.2",i.orno.afs


Do you use segments for your BP and order number? This is common with the item but I haven't seen it used in BPs or order numbers. The standard solution has single fields for obfp.f, ofbp.t, orno.f, and orno.t. I don't know how your segments are defined, but I would doubt that you would put the same field in both parts of the field segments.

My sales ack automation looks like this.


stpapi.put.field("tdsls4401m000","ofbp.f",i.ofbp.afs)
stpapi.put.field("tdsls4401m000","ofbp.t",i.ofbp.afs)
stpapi.put.field("tdsls4401m000","orno.f",i.orno.afs)
stpapi.put.field("tdsls4401m000","orno.t",i.orno.afs

jojovalenton
30th April 2014, 11:08
hi,

thank you guys for the reply, appreciated your constant replies to my queries.

regards,

jojo