BAPI_CUSTOMERRETURN_CREATE — Creating Customer Returns via BAPI
BAPI_CUSTOMERRETURN_CREATE creates a customer return document in SD, the same document VA01 produces when the order type is set to a returns type. It acts on the sales document object (VBAK/VBAP), taking header, item, partner and schedule line data, and returns the new document number in SALESDOCUMENT plus messages in the RETURN table. It does not commit automatically.
This page covers what BAPI_CUSTOMERRETURN_CREATE does within the order to cash returns flow, which parameters actually carry data, and why interfaces built around it silently create phantom or half-populated return orders. The return handling section is the load-bearing part of the page.
Published 16 Sept 2026· 1,014 words
What it does
BAPI_CUSTOMERRETURN_CREATE creates a sales document of the returns category, the object VA01 produces when the returns order type is selected instead of a standard order type. It sits at the front of the reverse logistics leg of order to cash: a return order is created first, then a return delivery is posted against it, goods come back into inventory, and a credit memo settles the customer account. The BAPI accepts the same shape of data as a standard sales order create call - header attributes, item lines with materials and quantities, partner data, and schedule lines - plus a reason for return at item level and, where relevant, a reference back to the original sales order or billing document being returned against.
Important parameters
The interface mirrors the standard sales order create BAPI structure closely, since a return order is still a sales document at the table level.
- ORDER_HEADER_IN - header data: document type, sales organization, distribution channel, division, sales office
- ORDER_ITEMS_IN - item data: material number, target quantity, unit of measure, reason for return, reference to the original order or billing document line
- ORDER_PARTNERS - partner data: sold-to, ship-to, payer, bill-to and their partner functions
- ORDER_SCHEDULES_IN - schedule line data: requested date and quantity split per item
- ORDER_CONDITIONS_IN - manual pricing condition overrides at header or item level, used when the return should not simply inherit original pricing
- SALESDOCUMENT - export parameter returning the number of the return document once created
- RETURN - the standard BAPI message table carrying success, warning, and error messages from the create attempt
Commit behaviour
The BAPI does not commit the database on its own. It builds the return order inside the current LUW and hands back a document number in SALESDOCUMENT if processing reached that point, but nothing is durable until the caller issues an explicit commit. Programs that call the BAPI and move straight to the next step without committing will see a document number that later resolves to nothing in the sales document tables, because the update was rolled back at the end of the session. This is the most common cause of the phantom document number complaint: the interface log shows a return order number, the functional user cannot find it in the transaction, and the two teams waste time comparing logs before someone notices the missing commit call.
Return handling
RETURN is a table, not a flag, and it has to be read as one. The common failure is checking only whether the table is empty and treating a non-empty SALESDOCUMENT as proof of success - but SALESDOCUMENT can be populated even when RETURN contains error-level entries, because the field gets set before the final consistency check runs in some code paths. The correct read loops over RETURN and treats any line with type E or A as a failure regardless of what SALESDOCUMENT holds, surfaces type W lines as warnings that need functional review rather than silent suppression, and only trusts SALESDOCUMENT as final once no E or A line exists and a commit has actually been issued. A second, quieter bug shows up with multi-item calls: one item fails on a reason-for-return validation while the others succeed, and the interface logs the whole call as a single pass or fail instead of checking which item number each RETURN entry references.
ECC vs S/4HANA
BAPI_CUSTOMERRETURN_CREATE continues to work on S/4HANA because it sits on top of the same sales document creation logic that VA01 uses, and that logic has not been withdrawn. There is no confirmed, widely adopted released API that has formally replaced it for returns creation specifically, unlike some other O2C objects that have modern equivalents. Teams building new integrations should still check whether a released API for sales document creation covers the returns scenario before defaulting to this BAPI, but as of current practice it remains the standard call for programmatic returns creation.
Common pitfalls
Most failures trace back to configuration gaps rather than the BAPI itself, but they surface as interface errors first.
- Reason for return code is not configured as allowed for the item category, rejected only at the item level while the header line in RETURN looks generic
- Reference to the original sales order or billing document is missing, invalid, or already fully returned against, breaking the link needed for downstream credit memo processing
- Sales area combination is not extended for the customer, or the ship-to partner is not assigned to that sales area, producing a partner determination error
- Copy control between the source document type and the returns order type is missing or restricted when the call attempts to create with reference
- Caller omits the transaction commit and treats a returned document number as proof of a saved document
- Mixed-result multi-item calls treated as fully successful because only the header-level absence of E messages was checked
Whose problem this is
Configuration issues - order type, item category, reason for return, copy control, partner determination - are functional territory and need the full RETURN table plus the input payload to diagnose. Missing commits and lazy RETURN parsing that produce false-positive success logs are developer territory. Functional teams should hand over the raw RETURN table content, not a summary, when escalating an interface failure to development.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-bapis/bapi-customerreturn-createERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.