pramod
1st September 2016, 22:25
I am trying to copy one item to another item using the AFS for tcibd0205m000. When I step through tcibdf0205m000.Copy(errmsg), a pop screen shows up with some error message like if the BP is inactive in tdipu010, it's not copying that. I want to store the message in a variable, sometime there are multiple lines shows up in the message window. How do I do that? I have commented the End() so that the message window stays and I can see error messages if any for other items.

Here is my script.
tcibdf0205m000.put.Item.original.item(item)
tcibdf0205m000.put.Item.new.item(new.item)
tcibdf0205m000.put.Description.new.item.desc(ndsc)
tcibdf0205m000.put.Alternative_Items(yn.no)
tcibdf0205m000.put.Item_text(yn.yes)
tcibdf0205m000.put.E_Item_Relations(yn.no)
tcibdf0205m000.put.Routing(yn.yes)
tcibdf0205m000.put.Business_Partners_by_Item(yn.yes)
tcibdf0205m000.put.Bill_of_Material(yn.yes)
tcibdf0205m000.put.Supplying_Relationships(yn.yes)
tcibdf0205m000.put.Cost_and_Valuation_Price(yn.no)
tcibdf0205m000.Copy(errmsg)
| tcibdf0205m000.end(errmsg)

Thanks in advance for any clue.

manish_patel
2nd September 2016, 06:29
Syntax:
string stpapi.get.mess.code(string session [, ref string err.mesg])

mark_h
2nd September 2016, 14:13
Actually there should not be any kind of window popping up in the foreground from the session you are running with afs code. Everything should stay in the background.

What Manish recommends is how I get the last the last message from the session I am running in the backgroup, assuming it is not an error returned in the actual afs code.