DietrichS
22nd September 2015, 12:44
Hey,

I made a session to create items with the data from a text-file. It works well when I run it manually. It works well when I run it with ttaad5203m000. But when I run it from the Unix Shell with
/opt/BAAN/soft/etc/rc.startjob500 TEST
no item is created. I get no error message, so I do not have an idea what the problem is. Everything looks fine, but no item....

stpapi.put.field("tiitm0101m000", "tiitm001.item", strip$(itm.item))
stpapi.put.field("tiitm0101m000", "tiitm001.dsca", strip$(itm.dsca))
stpapi.put.field("tiitm0101m000", "tiitm001.dscd", "TC-Imp.")
stpapi.put.field("tiitm0101m000", "tiitm001.kitm", str$(etol(itm.kitm)))
stpapi.put.field("tiitm0101m000", "tiitm001.citg", itm.citg)
stpapi.put.field("tiitm0101m000", "tiitm001.wght", str$(itm.wght))

dum = stpapi.insert("tiitm0101m000", 1, error.msg)
if not dum then
dum1 = stpapi.recover("tiitm0101m000", error.msg1)
endif
if isspace(error.msg) then
error.msg = "ok"
else
error.msg = "ERROR"
endif
stpapi.end.session("tiitm0101m000", error.msg3)

mark_h
22nd September 2015, 16:32
Make sure all the correct variables and paths are in place for the job. Maybe even add some messages to show where in the script the job is. My first suspicion is that the script is not opening the file with part numbers in it correctly.

DietrichS
13th October 2015, 10:20
Ok, I have it.

I took the original object oitm0101 and it worked. So it was clear that the problem was somewhere in my customization of tiitm0101m000. I found the bad parts by commenting line by line out. That was no so funny but I managed it.

Dietrich

mark_h
13th October 2015, 14:58
Glad you found the solution. I would have never guessed it was a personalization.