SAP BAPIObjectBAPI_PO_CREATE1ModuleMM_P2P

BAPI_PO_CREATE1 — BAPI_PO_CREATE1 Purchase Order Creation

BAPI_PO_CREATE1 creates a purchase order in the same way ME21N does, writing to EKKO, EKPO and related tables. It does not commit on its own, so a missing BAPI_TRANSACTION_COMMIT call leaves the returned PO number unpersisted. Its RETURN table must be scanned by TYPE for E or A entries, not just checked for emptiness, because SY-SUBRC after the call is not a reliable success indicator.

This page covers what BAPI_PO_CREATE1 does, its main import and table parameters, and how its commit and return-handling behaviour causes real interface defects when read carelessly. It also lists the recurring master-data and configuration gaps that surface only when this BAPI is called, not when the PO is entered manually through ME21N.

Published 16 Sept 2026· 1,116 words

What it does

BAPI_PO_CREATE1 creates a purchasing document of the standard purchase order type, acting on the same business object as transaction ME21N. It writes header data to EKKO, item data to EKPO, schedule lines to EKET, account assignment to EKKN, and partner data to EKPA, exactly as the online transaction would. It is used for interfaces that generate POs from external procurement systems, e-procurement catalogs, custom conversion programs, or automated replenishment logic where a requisition is converted without a buyer touching ME21N. It supports the same item categories, account assignment categories and document types as the transaction, and inherits the same configuration dependencies, so a PO type that fails validation in ME21N will fail the same way through this BAPI.

Important parameters

  • POHEADER - document type, vendor, purchasing organization, purchasing group, company code, currency and document date; mandatory header fields
  • POITEM - line item data: material or short text, plant, storage location, order quantity, unit of measure, net price, item category, account assignment category
  • POITEMX - flag structure mirroring POITEM; each field must be explicitly marked X or the corresponding POITEM value is ignored on the call
  • POSCHEDULE - delivery schedule lines: schedule line number, quantity, statistics-relevant delivery date
  • POACCOUNT - account assignment detail for non-stock items: cost center, G/L account, WBS element, order number
  • POCOND - condition records for pricing, freight and discount at item level
  • POTEXTHEADER and POTEXTITEM - long text segments for header and item texts
  • POPARTNER - partner functions such as ordering address, invoicing party, or vendor sub-range
  • RETURN - table of BAPIRET2 messages carrying the actual success or failure result of the call
  • EXPPURCHASEORDER - the created PO number, only meaningful once RETURN has been checked for errors
  • EXTENSIONIN - customer-defined structure for fields added to EKKO or EKPO via the standard include, used for Z-field enhancements

Commit behaviour

The BAPI does not commit the database update itself. A separate call to BAPI_TRANSACTION_COMMIT is required after RETURN has been checked and found clean. If the caller omits this, EXPPURCHASEORDER is still populated with a number in the response, which misleads developers into believing the PO exists, but nothing is written to the database and the number is either wasted or reused on the next call depending on number range buffering. In background jobs this shows up as PDs created according to the interface log but absent from ME23N. Some custom wrappers call COMMIT WORK directly instead of the BAPI wrapper; this generally works but bypasses the update task synchronization the wrapper provides, and under heavy parallel load can produce timing-related lock waits that BAPI_TRANSACTION_COMMIT with WAIT would have avoided.

Return handling

RETURN is a table of BAPIRET2 structures, not a single flag, and SY-SUBRC after the CALL FUNCTION is essentially always zero for a well-formed RPC call regardless of whether the business logic succeeded. The only reliable check is looping through RETURN and testing the TYPE field for E or A; anything else, including S and I, does not mean failure. A frequent interface bug treats any non-empty RETURN table as an error and aborts, which breaks on the common case of a PO created successfully with an informational message about price determination or a missing tax jurisdiction default. The opposite bug is worse: code that only checks whether EXPPURCHASEORDER is blank as a proxy for success, ignoring RETURN entirely, which lets a PO with a real error message pass silently because some error paths still return a preliminary or blank number. Message number and ID inside RETURN matter for root-causing recurring failures such as release strategy determination or vendor purchasing-org extension, and should be logged, not discarded, even on apparent success.

ECC vs S/4HANA

BAPI_PO_CREATE1 remains valid and released for use on S/4HANA; there is no mandatory replacement forcing migration away from it for classic ABAP-based integrations. For newer extension scenarios, particularly Fiori-based or cloud-adjacent development, SAP-released OData and API services for purchase order processing are the preferred entry point, but they sit on top of largely the same underlying logic rather than superseding this BAPI outright. Field-level behaviour and configuration dependencies carry over from ECC largely unchanged, aside from additional customer fields reachable through the extension include.

Common pitfalls

  • POITEM row sent without a matching POITEMX entry with the correct fields marked X: the item is silently dropped or created with default values instead of the ones passed
  • Account assignment category set on the item but POACCOUNT left empty or incomplete: the call fails with a generic account assignment error that gives no field-level detail
  • Vendor exists in the vendor master but is not extended to the purchasing organization on the header: fails at header level with a vendor-not-valid message that looks like a data entry error but is a master data gap
  • GR-based invoice verification and goods receipt indicators left at system default because the interface did not set them explicitly: PO created successfully but downstream invoice matching behaves unexpectedly
  • Release strategy configured on the document type but header data incomplete at creation time: PO is created and blocked for release, which the interface reports as success because RETURN contains no error, only a status change nobody checked for
  • External number range expected but internal assignment forced by configuration: the EBELN passed in POHEADER is ignored without any RETURN warning, and the interface stores the wrong number

Whose problem this is

A failure inside RETURN pointing to vendor, purchasing org, pricing or release strategy is functional: the fix is master data or configuration, and functional should reproduce the same input manually in ME21N first. A failure where RETURN is clean but data is missing, wrong item mapped, or the commit never happened is developer-side interface code. Whoever raises the ticket should attach the full RETURN table content, not just 'it failed'.

Related SAP objects

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

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