thieuf
30th July 2009, 11:01
Hello All,

After upgrading to SP25 (BIV on Unix) A simple AFS program is not working anymore. The program is intended to change items from specific suppliers back to purchased if they where changed to manufactured for some reason or other. (session runs in a job)

The script is pretty simple:

stpapi.put.field("tiitm0101m000","tiitm001.item", xitem)

xret = stpapi.find("tiitm0101m000", err.msg)
if xret = 1 then

stpapi.put.field("tiitm0101m000","tiitm001.kitm","1")

xretval = stpapi.update("tiitm0101m000", true, err.msg)

if not isspace(err.msg) then
xretval = stpapi.recover("tiitm0101m000", recover.msg)
endif
endif

stpapi.end.session("tiitm0101m000")

After the upgrade it is not working anymore. The error message says "Unknown enum".

After many different attempts (different put.field statments etc...) I have found a way that still gives me the error message, but does the update by spliting the update and save command like this:

xretval = stpapi.update("tiitm0101m000", 0, err.msg)

xretval = stpapi.save("tiitm0101m000", err.msg)

After the stpapi.update call, the error message still is "unknowm enum", but the item is updated and save as a purchased item so it works.

has anybody encountered this before? What am I missing here....?

Greetings Thieu

mark_h
30th July 2009, 17:45
Well first they say using etol for enums is better: stpapi.put.field("tfgld1115s000", "tfgld102.dbcr",str$(etol(tfudi210.dbcr))). I doubt if that makes a difference, but thought I would mention. Were any new fields added to the item master? I thought one SP did add a field or two to the item master. Can't remember.

Did you update your stpapi libraries and tools package with the service pack? And yes I have had to split update and saves before to do something like this.

thieuf
30th July 2009, 17:51
hello mark,

tried to use the "etol" solution but that did not make any difference. Don't know about the libraries and stuff, but will ask our system administrator.

We also get a test environment on SP 26 somewhere next week. Will try it on that level too to see what gives... Thanks for the reply.
much apprieciated..

regards thieu