on 07-10-2020 2:14 PM
Hi,
i have some questions regarding item changing in sales order lines through diapi.
I have an item with treetype "Assembly" in OITT inside of my salesorder line (RDR1).
For some reasons i have to change the treetype of this item (OITT) to treetype "Sales".
Therefore i have to change the itemcode in the salesorderline (RDR1) to another item,
change the treetype in OITT to "sales" and rechange the item in RDR1 to the old item.
Inside of SAP B1 GUI everything works fine and the mask reloads the sales BOM into the Lines.
If i try to do this with diapi it will not reload the lines correctly.
Does anyone have an idea how to handle this?
Here is some samplecode
'get SalesOrder
RetVal = vOrder.GetByKey("602")
vOrder.Lines.SetCurrentLine(0)
' change item in ordeline
vOrder.Lines.ItemCode = "000208"
RetVal = vOrder.Update()
'get Item BOM 'change treetype of item from assembly to sales
vProdTree.GetByKey("000208_TS")
vProdTree.TreeType = SAPbobsCOM.BoItemTreeTypes.iSalesTree
vProdTree.Update()
'rechange item in orderline
vOrder.Lines.ItemCode = ("000208_TS")
RetVal = vOrder.Update()
The orderlines remain with the item and the old status Assembly in treetype.
Thank you for your help.
Kind regards
Marc
******************************************************
before changing
After changing with GUI
After changing with DIAPI
Hello Aknit Chauhan,
thank you for your answer.
If i delete the line first and add a new line it works correct. But the line will be added at the end of the order. If the order has more than one item / line the visible order would be different.
Therefore i can not delete and add. Do you have any other tips for me?
Kind regards
Marc
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.