SAP BAPIObjectBAPI_PRODORD_GET_DETAILModulePP_M2D

BAPI_PRODORD_GET_DETAIL — Read Production Order Header, Operations and Components

BAPI_PRODORD_GET_DETAIL is the read-only counterpart to the CO03 display screen. Given an order number it returns header, operation, component and status data in output tables, without locking the order for change. It does not commit and does not change data, so failures show up as empty tables or an unnoticed error entry in RETURN rather than a runtime dump.

This page covers what BAPI_PRODORD_GET_DETAIL actually returns for a production order, the parameters worth trusting, and the specific way interfaces get this wrong by inspecting the data tables instead of RETURN. It also addresses collective orders, deletion-flagged orders, and where this BAPI sits relative to newer read APIs on S/4HANA.

Published 16 Sept 2026· 1,031 words

What it does

The BAPI acts on the production order object and mirrors what a user sees on the CO03 display transaction: order header data, the operation list, the component list, and status information. It is a pure read, comparable to opening the order in display mode rather than change mode. It is typically called from monitoring reports, MES or shop-floor integration layers, and pre-confirmation validation logic that needs to know what an order currently contains before posting a confirmation or a goods movement against it. Because it is read-only it carries none of the locking or transactional risk of the create and change BAPIs for the same object, but it is also frequently misused as a polling mechanism for change detection, which it was never designed to be efficient at.

Important parameters

  • NUMBER - the production order number to read, passed as a single value import parameter.
  • COLLECTIVE_ORDER - flag controlling whether sub-orders of a collective order are pulled along with the header order; left blank, only the single order passed in NUMBER is read.
  • HEADER - export structure carrying order type, plant, material, quantities and dates for the order.
  • OPERATIONS - table of operation data for the order, one row per operation/suboperation.
  • COMPONENTS - table of component (reservation) lines for the order, including quantities and withdrawn status.
  • STATUS - table of system and user status entries active on the order.
  • RETURN - standard message table, the only reliable indicator of whether the read actually succeeded.

Commit behaviour

There is nothing to commit. The BAPI does not change the production order, so a caller who forgets BAPI_TRANSACTION_COMMIT loses nothing, because no data was ever written. The risk runs the other way: some interface code calls BAPI_TRANSACTION_COMMIT reflexively after every BAPI call as a habit, which on a read-only call is harmless but wastes a dialog step and can trigger an unnecessary commit work process cycle inside a tight loop that reads hundreds of orders. The order is read with a shared lock briefly during the call and released once the function module returns, so it does not block other users from opening the same order in CO02 concurrently.

Return handling

RETURN is a table, not a single structure, because a single call can touch a header order plus its sub-orders when COLLECTIVE_ORDER is set, and each order can generate its own message. The recurring interface bug is checking whether HEADER or OPERATIONS came back non-initial and treating that as success, instead of scanning RETURN for entries with TYPE equal to E or A. An order that does not exist, an order the user has no authorization to display, or an order in a plant the caller has not been granted access to all return with empty data tables and an error entry in RETURN, and code that skips RETURN silently treats a failed read as an order with zero operations and zero components, which then gets reported downstream as a legitimately empty order. Warning-level entries also appear for orders flagged for deletion or already technically completed, and these are frequently swallowed because the calling code only tests for E and A, missing the case where the caller should have stopped processing before using stale structure data.

ECC vs S/4HANA

The BAPI still works on S/4HANA for reading production orders because the underlying order structure was not fundamentally rebuilt, and existing ECC-era interfaces using it continue to function. For new integration builds, particularly OData or API-based consumption of production order data, a released communication scenario or CDS-based API for manufacturing orders is the better starting point, since it is designed for external consumption and versioned for compatibility in a way the classic BAPI is not. This BAPI remains reasonable for internal ABAP programs and older middleware that already speaks BAPI natively.

Common pitfalls

  • COLLECTIVE_ORDER left blank when the order passed is the header of a collective order returns only the top-level order data, and downstream logic that expects full component and operation detail from all sub-orders silently gets a partial picture.
  • Calling the BAPI for an order carrying the deletion flag returns data along with a warning in RETURN, and interfaces that ignore RETURN happily process a dead order as if it were active.
  • The BAPI returns planned order structure data only, never actual costs or actual confirmed quantities, so integrations expecting cost or confirmation totals from this call get nothing and mistake the absence for a bug rather than a scope mismatch.
  • Using this BAPI in a polling loop to detect changes on a large population of orders creates avoidable system load; change pointers or an IDoc-based or event-based mechanism is the correct tool for that pattern.
  • Unit of measure and quantity decimal handling in COMPONENTS does not automatically match what an external MES or scheduling system expects, and mismatches surface as silent quantity discrepancies rather than errors.

Whose problem this is

This sits with the interface developer first, since the failure pattern is almost always a RETURN table that was not evaluated correctly rather than incorrect master data. The PP functional consultant gets pulled in when the underlying order status or component list looks wrong even in CO03 itself. Evidence to bring: the order number, a CO03 screenshot of the same order, and the raw RETURN table content from the BAPI call for comparison.

Related SAP objects

Reviewed pages this object connects to in the ERPClimb knowledge graph.

Source: ERPClimb — https://erpclimb.com/sap-bapis/bapi-prodord-get-detailERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.