VishalMistry
21st August 2017, 14:13
Hi all,

I want to bulk update order system system (tiitm001.osys) to MRP. For this I am passing a text file that contains list of items.

I am deliberately passing an item with MPS order system to check if the system returns same error message as if I am working with Item master session (tiitm0101m000). But, If I check value of error.desc, it remains empty. In fact when I try to change the order system directly through session, I get the error message "Item found in MPS". My code is as given below:

stpapi.put.field("tiitm0101m000", "tiitm001.osys", str$(tcosys.mrp))
stpapi.save("tiitm0101m000", error.desc)

Can anybody guide me how to get the error message ?

Vishal

mark_h
21st August 2017, 15:06
Have you tried stpapi.get.mess.code? Are you sure it is an error and not just a warning?

VishalMistry
21st August 2017, 15:26
Hello Mark,

Yes. It is an error. I tried to execute the session directly and change the order system, it gave an error message and reverted back to old order system.

I tried to check the value of error as well as mess.
mess = stpapi.get.mess.code("tiitm0101m000", error)

Both are empty after stpapi.save.

Vishal

mark_h
21st August 2017, 16:14
Have you tried stpapi.update versus save?

VishalMistry
21st August 2017, 16:36
Hi Mark,

My problem got solved after replacing stpapi.save with stpapi.update call.

Thank you for your guidance.

Vishal