SAPFree referencePDF, Excel, Word exportSAP ECC / S/4HANA

SAP MM BAPI List (Plus QM BAPIs and S/4HANA APIs) with Commit Notes

Integrations with SAP MM and QM usually go through BAPIs in ECC and through OData APIs in S/4HANA. This list gives the commonly used ones with what they do, the main parameters and whether you need to commit afterwards.

Download:
BAPI or APIAreaWhat it doesKey parameters and notes
BAPI_PO_CREATE1
MM-PUR
Create a purchase order
POHEADER and POHEADERX, POITEM and POITEMX, POSCHEDULE and POSCHEDULEX; RETURN table; needs BAPI_TRANSACTION_COMMIT
BAPI_PO_CHANGE
MM-PUR
Change a purchase order
PURCHASEORDER plus changed structures and their X flag structures; commit required
BAPI_PO_GETDETAIL1
MM-PUR
Read PO header, items, schedule lines
Read only, no commit; returns PO_HEADER, PO_ITEMS and PO_ITEM_SCHEDULES
BAPI_PO_RELEASE
MM-PUR
Release a PO with a release code
PURCHASEORDER, PO_REL_CODE; commit required
BAPI_PR_CREATE
MM-PUR
Create a purchase requisition
PRHEADER, PRITEM and PRITEMX; commit required. BAPI_REQUISITION_CREATE is the older equivalent
BAPI_REQUISITION_RELEASE
MM-PUR
Release a requisition
NUMBER, REL_CODE, ITEM; commit required
BAPI_CONTRACT_CREATE
MM-PUR
Create an outline agreement (contract)
HEADER, ITEM with their X structures; commit required
BAPI_GOODSMVT_CREATE
MM-IM
Post a goods movement (receipt, issue, transfer)
GOODSMVT_HEADER, GOODSMVT_CODE (for example 01 goods receipt for PO), GOODSMVT_ITEM; commit required
BAPI_MATERIAL_SAVEDATA
MM-MD
Create or change a material master
HEADDATA plus plant, storage, valuation structures and X flag structures; commit required
BAPI_MATERIAL_GET_DETAIL
MM-MD
Read material master data
MATERIAL, PLANT, VALUATIONAREA; read only
BAPI_MATERIAL_AVAILABILITY
MM-IM
Check availability (ATP) of a material
Read only; returns available quantity by date
BAPI_INCOMINGINVOICE_CREATE
MM-IV
Post a logistics invoice (like MIRO)
HEADERDATA, ITEMDATA; commit required. BAPI_INCOMINGINVOICE_PARK parks it
BAPI_TRANSACTION_COMMIT
General
Commit the pending BAPI changes
Call after a successful BAPI, with WAIT = X when the next step needs the data
BAPI_TRANSACTION_ROLLBACK
General
Roll back the pending BAPI changes
Call when RETURN contains type E or A messages
BAPI_INSPLOT_GETDETAIL
QM
Read an inspection lot
NUMBER = inspection lot; read only
BAPI_INSPOPER_GETDETAIL
QM
Read inspection operations and characteristics
Read only
BAPI_INSPOPER_RECORDRESULT
QM
Record inspection results
Characteristic results per operation; commit required
BAPI_INSPLOT_SETUSAGEDECISION
QM
Make the usage decision for a lot
NUMBER, UD_DATA; commit required
BAPI_QUALNOT_CREATE
QM
Create a quality notification
NOTIF_TYPE, NOTIFHEADER; follow with BAPI_QUALNOT_SAVE and commit
BAPI_QUALNOT_GETDETAIL
QM
Read a quality notification
Read only
API_PURCHASEORDER_PROCESS_SRV
S/4HANA OData
Create, read and change purchase orders
Published on SAP Business Accelerator Hub; uses CSRF token for writes
API_PURCHASEREQ_PROCESS_SRV
S/4HANA OData
Create, read and change purchase requisitions
OData V2 service; check available entity sets on the hub
API_MATERIAL_DOCUMENT_SRV
S/4HANA OData
Post and read material documents
Goods movements through OData instead of BAPI_GOODSMVT_CREATE
API_PRODUCT_SRV
S/4HANA OData
Read and maintain products (materials)
Product master through OData; check supported fields per release
API_SUPPLIERINVOICE_PROCESS_SRV
S/4HANA OData
Create and read supplier invoices
Replacement route for invoice BAPIs in cloud-style integration
API_INSPECTIONLOT_SRV
S/4HANA OData
Read and process inspection lots
QM inspection lot service; confirm the entity sets for your release on the hub

Always read the RETURN table after a BAPI call and check for message types E and A before you commit. Parameter lists are summarized, so confirm the exact structures in SE37 for your release and the OData metadata in the SAP Business Accelerator Hub. Your landscape may also expose newer APIs than the ones listed.

Planning an SAP integration or agent?

Tell us the transaction you want to automate and we can sketch an approval-gated design. Optional follow-up.

Optional. The tool and every export work without this. No spam.

How to use the list

Search by object, such as purchase order, goods movement or inspection lot. Note the commit column: write BAPIs change data only in memory until you call BAPI_TRANSACTION_COMMIT, and read BAPIs need none. Open the function module in SE37 to see the exact import, export and table parameters before you code against it.

  • Write BAPI, then check RETURN for E and A messages, then commit or roll back.
  • Pass an X structure for every field you want to set or change.
  • Use WAIT = X on the commit when a following call reads the new data.

BAPIs versus S/4HANA OData APIs

BAPIs are remote-enabled function modules called through RFC from an ABAP or middleware client. OData APIs are web services published for S/4HANA, listed on the SAP Business Accelerator Hub with their entity sets and sample payloads. For new cloud or hybrid integrations OData is usually preferred because it passes through the gateway and respects released API contracts. On-premise systems often keep using BAPIs for batch jobs.

Commit and error handling

Every BAPI returns messages in a RETURN structure or table. A type S or W message is acceptable; E or A means nothing should be committed. Wrap the call so that errors trigger BAPI_TRANSACTION_ROLLBACK. For bulk loads, commit per document rather than per file, so a bad row does not block a thousand good ones. Log the PO or document number returned by the call.

Common mistakes

Developers often forget the X flag structure, so fields are silently ignored, skip the commit and see no document, or call BAPI_GOODSMVT_CREATE with the wrong GOODSMVT_CODE. Another trap is testing in a client without the right authorizations, then seeing different results in production. Test with the same user role as the production interface.

Frequently Asked Questions

What are the main BAPIs for SAP MM?

The common ones are BAPI_PO_CREATE1 and BAPI_PO_CHANGE for purchase orders, BAPI_GOODSMVT_CREATE for goods movements, BAPI_MATERIAL_SAVEDATA for material master, BAPI_INCOMINGINVOICE_CREATE for invoices and BAPI_PR_CREATE for requisitions. Most of them need a commit afterwards.

Do I need BAPI_TRANSACTION_COMMIT after every BAPI?

After every BAPI that writes data, yes, once you have confirmed that the RETURN table has no error messages. Read-only BAPIs such as BAPI_PO_GETDETAIL1 do not need it. If errors appear, call BAPI_TRANSACTION_ROLLBACK instead.

What APIs does S/4HANA offer for MM and QM?

S/4HANA publishes OData services such as API_PURCHASEORDER_PROCESS_SRV, API_MATERIAL_DOCUMENT_SRV and API_INSPECTIONLOT_SRV, listed with their entity sets on the SAP Business Accelerator Hub. They use standard HTTP calls with a CSRF token for changes.

Why are my BAPI fields not saved?

Most change and create BAPIs use a second structure with an X flag per field. If the X structure does not mark the field, SAP ignores the value without an error. Fill both the value and the matching X structure, then inspect the RETURN table.

If you are building integrations or AI agents that write to SAP, we can help design a human-approved write-back pattern around these BAPIs and APIs, with the data staying in your environment.

Keep exploring

Free tools

ERP fixes and how-tos

AI on your ERP

Integrations

Software