VishalMistry
18th October 2017, 17:48
Hello,

I am facing one strange issue in AFS update of sales order line when I try to update warehouse code in sales order line.

The problem is when I goto session tdsls4102s000 and try to update the desired line, I get the message Purchase Order Already created for pos 20". But, when I try to update the line through AFS, the stpapi.update call does not capture proper message in in error.msg variable and the variable remains blank.

I am attaching screen shot of the error and script. I shall be grateful if anyone can point out the mistake and suggest improvement in the code.

Vishal

mark_h
19th October 2017, 04:09
The message looks like a warning and not a true error. Have you tried right after the update to do a stpapi.get.mess.code to see if that gets you the message?

VishalMistry
23rd October 2017, 16:04
Hello Mark,

You are right but it does not allow changing the warehouse after the message. One thing I have noticed is for some sales order lines, where the delivered qty is zero and sales order line status (tdsls045.ssls) = 3, AFS does not return any error and does not allow changing warehouse.

Vishal

mark_h
24th October 2017, 00:44
Have you tried the stpapi.get.mess.code to see if it gets you any messages at all? I know it some cases I head the errors off before they can occur in the afs code. So for example before processing I might check the line order status and quantity delivered and give the user a message and not try to process it thru the AFS code. Sometimes it just depends on the error and how the code reacts(the background baan session). It seems it works manually, but in the background they sometimes do something different.