SD
BAPI
RFC
Used the same way in S/4HANA
BAPI_SALESORDER_CHANGE Change Sales Order
Changes an existing sales order: header fields, items, schedule lines, partners and conditions, like VA02. It is used in mass-change programs and in interfaces that update order quantities, dates or prices. ORDER_HEADER_INX is mandatory; set UPDATEFLAG (U, I or D) and the X flag of every changed field, then call BAPI_TRANSACTION_COMMIT afterwards only when RETURN contains no message of type E or A.
- Function group
- 2032
- Remote-enabled (RFC)
- Yes
- Type
- BAPI
Importing parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| SALESDOCUMENT | BAPIVBELN-VBELN | Sales document number | Yes |
| ORDER_HEADER_IN | BAPISDH1 | Order header data | — |
| ORDER_HEADER_INX | BAPISDH1X | Order header change flags (X structure) | Yes |
| SIMULATION | BAPIFLAG-BAPIFLAG | Simulation mode (no update) | — |
| BEHAVE_WHEN_ERROR | BAPIFLAG-BAPIFLAG | Error handling behavior | — |
| LOGIC_SWITCH | BAPISDLS | SD logic switch (pricing, ATP control) | — |
| NO_STATUS_BUF_INIT | BAPIFLAG-BAPIFLAG | Do not refresh status buffer | — |
Tables parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| RETURN | BAPIRET2 | Return messages | Yes |
| ORDER_ITEM_IN | BAPISDITM | Order item data | — |
| ORDER_ITEM_INX | BAPISDITMX | Order item change flags (X structure) | — |
| PARTNERS | BAPIPARNR | Document partners | — |
| PARTNERCHANGES | BAPIPARNRC | Partner changes | — |
| PARTNERADDRESSES | BAPIADDR1 | Partner addresses | — |
| SCHEDULE_LINES | BAPISCHDL | Schedule lines | — |
| SCHEDULE_LINESX | BAPISCHDLX | Schedule line change flags (X structure) | — |
| CONDITIONS_IN | BAPICOND | Pricing conditions | — |
| CONDITIONS_INX | BAPICONDX | Condition change flags (X structure) | — |
| ORDER_TEXT | BAPISDTEXT | Texts | — |
| ORDER_KEYS | BAPISDKEY | Reference keys of created objects | — |
| EXTENSIONIN | BAPIPAREX | Customer enhancement fields (EXTENSIONIN) | — |
Call template (ABAP)
A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = lv_salesdocument
order_header_inx = lv_order_header_inx
TABLES
return = lt_return
order_item_in = lt_order_item_in
order_item_inx = lt_order_item_inx
partners = lt_partners
partnerchanges = lt_partnerchanges
partneraddresses = lt_partneraddresses
schedule_lines = lt_schedule_lines
schedule_linesx = lt_schedule_linesx
conditions_in = lt_conditions_in
conditions_inx = lt_conditions_inx.Related tables
Can't find the report you need?
We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.