SD
BAPI
RFC
Used the same way in S/4HANA
BAPI_CUSTOMERRETURN_CREATE Create Customer Returns Order
Creates a customer returns order with header, item, partner, schedule line and condition data. It is used in returns portals and RMA interfaces that record customer returns in SD. Use a returns document type in RETURN_HEADER_IN, reference the original billing document if required, and 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 |
|---|---|---|---|
| SALESDOCUMENTIN | BAPIVBELN-VBELN | External sales document number | — |
| RETURN_HEADER_IN | BAPISDHD1 | Returns order header data | Yes |
| RETURN_HEADER_INX | BAPISDHD1X | Returns order header change flags (X structure) | — |
| SENDER | BAPI_SENDER | Logical sender system (ALE) | — |
| BEHAVE_WHEN_ERROR | BAPIFLAG-BAPIFLAG | Error handling behavior | — |
| TESTRUN | BAPIFLAG-BAPIFLAG | Test run (no update) | — |
| CONVERT | BAPIFLAG-BAPIFLAG | Convert partner roles and document types to internal format | — |
| LOGIC_SWITCH | BAPISDLS | SD logic switch (pricing, ATP control) | — |
Exporting parameters
| Parameter | Type | Description |
|---|---|---|
| SALESDOCUMENT | BAPIVBELN-VBELN | Returns order number created |
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) | — |
| RETURN_PARTNERS | BAPIPARNR | Returns order partners | Yes |
| RETURN_SCHEDULES_IN | BAPISCHDL | Schedule lines | — |
| RETURN_SCHEDULES_INX | BAPISCHDLX | Schedule line change flags (X structure) | — |
| RETURN_CONDITIONS_IN | BAPICOND | Pricing conditions | — |
| RETURN_TEXT | BAPISDTEXT | Texts | — |
| RETURN_KEYS | BAPISDKEY | Reference keys of created objects | — |
| PARTNERADDRESSES | BAPIADDR1 | Partner addresses | — |
| 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_CREATE'
EXPORTING
return_header_in = lv_return_header_in
IMPORTING
salesdocument = lv_salesdocument
TABLES
return = lt_return
return_items_in = lt_return_items_in
return_items_inx = lt_return_items_inx
return_partners = lt_return_partners
return_schedules_in = lt_return_schedules_in
return_schedules_inx = lt_return_schedules_inx
return_conditions_in = lt_return_conditions_in
return_text = lt_return_text
return_keys = lt_return_keys
partneraddresses = lt_partneraddresses.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.