avin_ln
6th June 2014, 08:10
hello everyone,

I am facing a strange error while initiating inventory for production order throug afs.
It always gies me error like Device not found.
I am posting my code, for reference


ret = stpapi.find("ticst0101m100", ret.err)
if ret = 1 then
stpapi.put.field("ticst0101m100", "ticst001.pdno", i.pdno)
ret = stpapi.change.view("ticst0101m100", ret.err)
if ret = 1 then
stpapi.put.field("ticst0101m100", "ticst001.pono", str$(i.pono))
ret = stpapi.find("ticst0101m100", ret.err)
if ret = 1 then
ret = stpapi.mark("ticst0101m100", ret.err)
ret = stpapi.synchronize.dialog("ticst0101m100", "modify", ret.err)
if ret then
stpapi.enum.answer("ticst0101m100", "ticst01011", tcyesno.yes)
stpapi.set.report("ticst0101m100", "rtisfc020701000", "D", ret.err)
stpapi.form.command("ticst0101m100", 5, "initiate.inventory", ret.err)

if isspace(ret.err) then

stpapi.end.session("ticst0101m100")
stpapi.end.session("ticst0101m100")
return(true)
endif
endif
endif
endif
endif

stpapi.end.session("ticst0101m100")
stpapi.end.session("ticst0101m100")
return(false)

bhushanchanda
6th June 2014, 12:39
Have you tried with spool.device or ascif?

Or, like initialize spool.device = "D" and then pass it. Its AFS, you need to try variations.

avin_ln
7th June 2014, 08:45
Thank you Bhushan,

Your solution worked perfectly