SAP BAPIObjectBAPI_PO_RELEASEModuleMM_P2P

BAPI_PO_RELEASE — BAPI_PO_RELEASE: releasing a blocked purchase order

BAPI_PO_RELEASE releases a purchase order held up by a release strategy, mirroring the release step in ME28 or ME29N. It takes the purchase order number and, optionally, a release code, and returns a RETURN table of messages. It does not commit automatically, and callers must loop the full RETURN table rather than checking only the first line or sy-subrc.

Covers BAPI_PO_RELEASE, the function module used to programmatically execute a release strategy step on a purchase order. Explains the parameters, why the call requires an explicit commit, and how to read the RETURN table correctly to avoid false positives. Also separates configuration failures owned by MM functional consultants from interface defects owned by development.

Published 16 Sept 2026· 1,011 words

What it does

BAPI_PO_RELEASE releases a purchase order that is currently blocked by a release strategy, performing the same function as the release step in transaction ME28 or the release tab of ME29N and ME22N. It acts on the purchase order header held in EKKO, updating the release indicator and, where the release strategy is item-based, the corresponding release fields on the relevant items in EKPO. The BAPI does not create or change the purchase order itself; it only advances the release status by one step, or completes the release if only one outstanding code remains. It assumes the purchase order has already been assigned a release strategy through classification of its release-relevant characteristics. If no strategy applies to the document, there is nothing for this call to do.

Important parameters

The interface is deliberately narrow: it identifies the document and, where needed, which approval step is being exercised.

  • PURCHASEORDER - the purchase order number to be released
  • PO_RELCODE - the release code being exercised for this call; can be left blank when only one release code is outstanding for the document, but must be supplied when several codes remain and a specific one needs to be executed
  • RETURN - table of message structures returned by the call, carrying message type, message class, message number and message text for every event the release generates, not just the outcome of the release step itself

Commit behaviour

BAPI_PO_RELEASE does not commit its own work to the database. Like nearly all release and workflow BAPIs, it stages the change and hands control back to the caller, who must invoke BAPI_TRANSACTION_COMMIT to make the release persist. If the caller checks RETURN, sees no error, and moves on without committing, the purchase order can appear released within the calling program's own session buffer but reverts to blocked status the moment it is read fresh, and the requester still sees it held. This is the most frequently reported integration defect against this BAPI: the release worked in a manual test, then silently failed to persist inside a batch job or middleware call that omitted the explicit commit.

Return handling

RETURN is a table, not a single structure, and this BAPI can return more than one line: one message for the release step itself, plus additional lines if the release triggers a workflow notification or a downstream check on budget, contract reference, or account assignment. Code that reads only the first line of RETURN, or checks sy-subrc after the call, misses errors sitting further down the table. The correct pattern is to loop the entire table and treat any line with type E or A as a failure regardless of position; type S or I lines are informational. A common wrapper bug treats an empty RETURN table as proof of success, but an empty table after this call usually means the release code was already satisfied or nothing changed, not that a release was executed. Log the full structure, including message class and number, not just the text, so recurring failure categories such as missing strategy, wrong code, or already-released status can be filtered programmatically instead of by string matching.

ECC vs S/4HANA

BAPI_PO_RELEASE remains the standard way to release a purchase order programmatically in S/4HANA; there is no dedicated newer released API that replaces it for this specific action. The underlying release strategy configuration, classification, release groups, codes, and strategies, is unchanged from ECC. Fiori approval apps for purchase orders invoke the same release logic under the hood rather than a separate service, so behaviour and message content stay consistent with the classic BAPI. Custom workflow and batch release programs built on this BAPI in ECC generally carry forward without redesign.

Common pitfalls

Most failures trace back to release strategy configuration or sequencing rather than to the BAPI call itself.

  • Release strategy never determined because the document's characteristics (value, plant, purchasing group, document type) fall outside every configured strategy; the call returns a message that nothing is releasable, which gets mistaken for a technical bug
  • Wrong release code passed for a multi-level strategy, rejected because that code is not next in the approval sequence
  • Purchase order changed after a partial release, resetting release status according to the strategy's reset indicators, so a repeat call is required and the previous call looks like it failed
  • Overall-release strategy confused with item-wise release, where the caller releases at header level for a document configured for release at item level and nothing visibly changes
  • Caller omits BAPI_TRANSACTION_COMMIT, so the release appears successful in the calling program's own read but is invisible to every other user or job until the transaction is committed

Whose problem this is

Functional consultants own the release strategy configuration: classification, characteristics, release groups and codes, and the approval sequence. A 'no release possible' result or the wrong code being expected is a configuration or master data question, not a coding defect. Developers own how the calling program handles RETURN and the commit call. Ask for the full RETURN table content and the purchase order's current release status fields before assigning fault to either side.

Related SAP objects

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

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