SD
BAPI
RFC
Used the same way in S/4HANA
BAPI_CUSTOMERRETURN_CHANGE Change Customer Returns Order
Changes an existing customer returns order: header, items, schedule lines, partners and conditions. It is used to update returned quantities or reasons coming from an RMA system. RETURN_HEADER_INX is mandatory; set UPDATEFLAG and the X flags, then call BAPI_TRANSACTION_COMMIT afterwards only when RETURN contains no message of type E or A.
- Function group
- 2102
- Remote-enabled (RFC)
- Yes
- Type
- BAPI
Importing parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| SALESDOCUMENT | BAPIVBELN-VBELN | Sales document number | Yes |
| RETURN_HEADER_IN | BAPISDHD1 | Returns order header data | — |
| RETURN_HEADER_INX | BAPISDHD1X | Returns order header change flags (X structure) | Yes |
| SIMULATION | BAPIFLAG-BAPIFLAG | Simulation mode (no update) | — |
| CONVERT | BAPIFLAG-BAPIFLAG | Convert partner roles and document types to internal format | — |
| 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 | — |
| RETURN_ITEMS_IN | BAPISDITM | Returns order item data | — |
| RETURN_ITEMS_INX | BAPISDITMX | Returns order item change flags (X structure) | — |
| PARTNERS | BAPIPARNR | Document partners | — |
| PARTNERCHANGES | BAPIPARNRC | Partner changes | — |
| 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) | — |
| RETURN_TEXT | BAPISDTEXT | Texts | — |
| RETURN_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_CUSTOMERRETURN_CHANGE'
EXPORTING
salesdocument = lv_salesdocument
return_header_inx = lv_return_header_inx
TABLES
return = lt_return
return_items_in = lt_return_items_in
return_items_inx = lt_return_items_inx
partners = lt_partners
partnerchanges = lt_partnerchanges
schedule_lines = lt_schedule_lines
schedule_linesx = lt_schedule_linesx
conditions_in = lt_conditions_in
conditions_inx = lt_conditions_inx
return_text = lt_return_text.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.