BAPI_PO_GETITEMS — Read-only Purchase Order Item Retrieval BAPI
BAPI_PO_GETITEMS is a read-only BAPI that returns the item-level data of a standard purchase order, mirroring the item overview shown in ME23N, without pulling the full set of header, schedule line, account assignment and text substructures that BAPI_PO_GETDETAIL1 returns. It is used when a caller only needs material, quantity, plant and price at item level.
This page covers BAPI_PO_GETITEMS, the narrower sibling of BAPI_PO_GETDETAIL1 used to pull purchase order item data for interfaces and reports that do not need the full document structure. It focuses on how the RETURN table is misread in practice and where the item list silently disagrees with what ME23N shows.
Published 16 Sept 2026· 1,001 words
What it does
BAPI_PO_GETITEMS acts on the standard purchase order object, the same document read by ME23N and stored across EKKO and EKPO. Where BAPI_PO_GETDETAIL1 is the general-purpose reader that returns header data, item data, schedule lines, account assignment, conditions and texts in one call, BAPI_PO_GETITEMS is the narrower version aimed at callers that only need the item table itself: material number, short text, plant, storage location, order quantity, unit of measure, net price and item category. It is used inside custom reports, interface layers and older integration scaffolding where pulling the entire document detail structure is unnecessary overhead. It does not create, change or lock anything on the purchase order; it is a pure retrieval call and carries no authorization to alter data.
Important parameters
The interface is intentionally small. The parameters below are the ones consistently present across implementations of this BAPI; exact field-level naming inside the item structure can vary by release and should be checked against the actual function module signature before coding against it.
- PURCHASEORDER - the ten-digit purchase order number to be read, passed with leading zeros in the internal format
- ITEMS - export table returned with one row per PO item, carrying material, plant, quantity, unit, price and item category
- RETURN - standard BAPI return table carrying messages, message type and message class for the call
Commit behaviour
BAPI_PO_GETITEMS is a read-only call. It does not change the database, does not set an update lock on the purchase order, and does not require a following BAPI_TRANSACTION_COMMIT. Calling COMMIT after it is harmless but pointless, since there is nothing to flush. The absence of a commit requirement is sometimes misread by junior developers as a sign the call failed to do anything, when in fact a getter BAPI succeeding and doing nothing to the database are the same outcome. The only side effect worth checking for is buffer or number range read locks that some implementations acquire transiently while reading the document; these release on their own once the call returns and never need explicit handling.
Return handling
RETURN must be checked for message type E or A before trusting the ITEMS table, exactly as with any getter BAPI, but the more common defect here is trusting an empty RETURN as proof that data came back. A purchase order number that does not exist, or exists but has no items visible to the calling user's authorization, can come back with an empty RETURN table and an empty ITEMS table simultaneously, with no error message raised at all. Interfaces that check only 'RETURN is empty, therefore proceed' will process a purchase order with zero lines as if it were a valid empty document, and downstream logic built on the assumption that at least one item always exists breaks in ways that look like a data problem rather than an interface problem. The correct pattern is to check RETURN for errors first, then separately check whether ITEMS actually has rows, and treat a valid call with zero rows as its own distinct case rather than folding it into either the success or the failure branch.
ECC vs S/4HANA
In S/4HANA this BAPI still executes and returns data, since the underlying EKKO/EKPO structures and the purchasing document model are unchanged. It is not the recommended starting point for new integration work, however. New builds targeting purchase order read scenarios should use the released communication scenario and OData services around purchase order processing, or fall back to BAPI_PO_GETDETAIL1 for classic RFC/BAPI-based integrations that need more than item-level fields. BAPI_PO_GETITEMS is best treated as legacy-compatible rather than actively recommended.
Common pitfalls
Most failures trace back to assuming this BAPI behaves like the full detail call or like the ME23N screen.
- PO number passed without leading zeros returns no items and no error, because the internal ten-digit format was never matched
- Deleted items on the purchase order (deletion indicator set) may still appear in ITEMS depending on release, so downstream logic that does not filter on the deletion flag double-counts quantity
- Because it returns only item fields, any interface that also needs account assignment, schedule lines or long texts will appear to be missing data even though the BAPI is working exactly as designed; the fix is to call BAPI_PO_GETDETAIL1 instead, not to debug this BAPI further
- Client mismatch when the calling program runs under a background job user in a different logical system produces an empty item table that looks identical to a genuinely empty PO
- Item quantities returned are in the order unit, not always the base unit; comparisons against stock or GR data done without a unit conversion produce silent mismatches
Whose problem this is
This sits with the developer maintaining the calling interface, since the BAPI itself does not modify data and a wrong result almost always traces to how the caller passed the PO number or interpreted RETURN and ITEMS. Functional needs to confirm, from ME23N, which items exist on the purchase order, their deletion status, and the order unit, so the developer can compare that against what the BAPI actually returned.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-bapis/bapi-po-getitemsERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.