We have a requirement to delete a sales order using the BAPI_SALESORDER_CHANGE Bapi. We can delete/reject individual line items using this FM but the calling service does not know how many lines are on the order so we need to delete/reject the order at the header level.
The documentation says to just put D in the UPDATEFLAG in the ORDER_HEADER_INX in the ORDER_HEADER_INX import parameter table. When we do this we get a success message but the order remains unchanged.
We used the BAPI_TRANSACTION_COMMIT bapi to complete the transaction but no success.
First, please set D as the value of flag for updating.
1) Use this in order to delete the Sales Order
SALESDOCUMENT = <doc. number>.
ORDER_HEADER_INX-UPDATEFLAG = 'D'.
2) Please run the program below to delete an item of Sales Order
SALESDOCUMENT = <doc. number>.
ORDER_ITEM_IN-ITM_NUMBER = <item number>.
ORDER_ITEM_INX-ITM_NUMBER = <item number>.
ORDER_ITEM_INX-UPDATEFLAG = 'D'.
Max