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.
| BAPI or API | Area | What it does | Key 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.
Related Tools
SAP BAPI_PO_CREATE1 ABAP Skeleton Generator
Fill in vendor, plant and material to generate an ABAP skeleton for creating a purchase order with BAPI_PO_CREATE1.
SAPSAP BAPI_GOODSMVT_CREATE ABAP Code Generator
Fill in plant, material, quantity and movement type to get a working ABAP skeleton for posting a goods movement through the standard BAPI.
Developer ToolsSAP QM Usage Decision BAPI Skeleton
An ABAP skeleton for recording an inspection lot usage decision through the standard BAPI, with error handling and a commit only when no error is returned.
SAPSAP OData Service URL Builder
Generate a correct SAP Gateway OData V2 request URL with query options, test it in a browser or REST client, then reuse it in your code.
SAPSAP API Business Hub Request Generator
Build a ready-to-run cURL or HTTP request for an SAP API Business Hub sandbox or your own S/4HANA Cloud tenant, with the right headers and query options.
More SAP tools
See all- SAP Sales Document Types Reference
- SAP Pricing Procedure Design Worksheet
- SAP Item Category Determination Reference
- SAP Delivery Block Reasons Template
- SAP Credit Management Checklist
- SAP Output Determination Checklist
- SAP Billing Types Reference
- SAP Incompletion Log Checklist
- SAP SD Tables Reference (VBAK, VBAP, LIKP, VBRK and More)
Keep exploring
Free tools
- SAP QM Usage Decision BAPI SkeletonAn ABAP skeleton for recording an inspection lot usage decision through the standard BAPI, with error handling and a commit only when no error is returned.
- SAP MM Output Form Templates ListA searchable starter list of SAP MM output documents and the output type, application and form technology behind each one.
- SAP MM Tables and Key Fields ReferenceSearchable list of the core SAP MM tables with their primary key fields and what each stores, including S/4HANA changes.
ERP fixes and how-tos
- SAP MM BAPI for PO Create and Change: BAPI_PO_CREATE1 and BAPI_PO_CHANGEHow to use BAPI_PO_CREATE1 and BAPI_PO_CHANGE: header, item and schedule structures, the X-structures, error handling in RETURN and the commit step.
- How to Use BAPI_TRANSACTION_COMMIT CorrectlyBAPIs never commit their own update. Here is when to call BAPI_TRANSACTION_COMMIT with WAIT, and why a BAPI can run fine and still save nothing.
- SAP QM Integration With LIMS: How the Hand-Off WorksHow a LIMS connects to SAP QM: inspection lot hand-off, results and usage decision return, QM-STI, BAPIs, IDoc or API options and the failure points to test.
AI on your ERP
- AI for SAP S/4HANA Procurement (MM) That Reads POs, Receipts and Invoices TogetherAI for SAP S/4HANA procurement: query purchase orders, goods receipts and invoice matching in plain English, on-prem if needed, read-only by default.
- AI for SAP Quality Management: Notifications, 8D, and CAPA Without the Manual DraftingAI grounded on SAP QM data that triages notifications, drafts 8D and CAPA reports, and summarizes inspection trends, deployed on-prem for full traceability.
Integrations
- How to add AI agents to SAP ECC 6.0How to add AI agents to SAP ECC 6.0: a tool layer over BAPIs, RFC and IDocs, human approval before any posting, and an on-prem model that never leaves your network.
- How to build an MCP server for SAP S/4HANABuild a Model Context Protocol server for SAP S/4HANA: which read-only tools to expose, OData and BAPI backends, auth, stdio versus HTTP, scoping and audit.