cancel
Showing results for 
Search instead for 
Did you mean: 

Adding new item using BAPI_SALESORDER_CHANGE

Former Member
0 Kudos

Hi Everyone,

I am trying to use BAPI_SALESORDER_CHANGE to add a new item to my sales order.

I filled the sales order number in the parameter SALESDOCUMENT.

In the ORDER_HEADER_INX, I set the update flag to 'U'.

In the ORDER_ITEM_INX, I set the update flag to 'I'.

In the ORDER_ITEM_IN, I entered the material number.

In SCHEDULE_LINES, I entered the REQ_QTY.

In SCHEDULE_LINESX, I set the update flag to 'I'.

For both the SCHEDULE_LINESX and ORDER_ITEM_INX, I leave the item numbers blank. This is because I am inserting a new item.

I got a success message but no new item was added. What did I miss? Also, I am wondering if the system is able to link the REQ_QTY in the SCHEDULE_LINES to the Material in ORDER_ITEM_IN?

Best Regards,

Junwen

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

As far as I know you should be using another BAPI: BAPI_SALESORDER_CREATEFROMDAT2

Generally these rules apply:

1. BAPI_SALESORDER_CREATEFROMDAT2 is used to create new orders or add line items to existing orders.

2. BAPI_SALESORDER_CHANGE is used to make amendments to existing orders.

3. BAPI_SALESORDER_CHANGE is used to cancel line items.

Hope this helps.

athavanraja
Active Contributor
0 Kudos

I have not used this BAPI. But just wanted to check, did you call BAPI_TRANSACTION_COMMIT after calling BAPI_SALESORDER_CHANGE? else do that.

Regards

Raja