MM BAPI RFC Used the same way in S/4HANA

BAPI_PO_CREATE Create Purchase Order (Old)

Creates a purchase order from header, item, schedule line, account assignment and service data and returns the PO number. It still appears in older programs and interfaces; for new development SAP recommends BAPI_PO_CREATE1, which supports more fields and change logic. PO_ITEM_SCHEDULES is mandatory and SKIP_ITEMS_WITH_ERROR lets you skip faulty items; check RETURN (type BAPIRETURN) and call BAPI_TRANSACTION_COMMIT.

Function group
MEWP
Remote-enabled (RFC)
Yes
Type
BAPI

Importing parameters

ParameterTypeDescriptionRequired
PO_HEADERBAPIEKKOCPO header dataYes
PO_HEADER_ADD_DATABAPIEKKOAAdditional header data—
HEADER_ADD_DATA_RELEVANTBAPIMMPARA-SELECTIONUse additional header data—
PO_ADDRESSBAPIADDRESSOne-time vendor address—
SKIP_ITEMS_WITH_ERRORBAPIMMPARA-SELECTIONSkip items with errors—
ITEM_ADD_DATA_RELEVANTBAPIMMPARA-SELECTIONUse additional item data—
HEADER_TECH_FIELDSBAPITECHTechnical header fields—

Exporting parameters

ParameterTypeDescription
PURCHASEORDERBAPIEKKOC-PO_NUMBERPurchase order number

Tables parameters

ParameterTypeDescriptionRequired
PO_ITEMSBAPIEKPOCPO itemsYes
PO_ITEM_ADD_DATABAPIEKPOAAdditional item data—
PO_ITEM_SCHEDULESBAPIEKETSchedule linesYes
PO_ITEM_ACCOUNT_ASSIGNMENTBAPIEKKNAccount assignments—
PO_ITEM_TEXTBAPIEKPOTXItem texts—
PO_BUSINESS_PARTNERBAPIEKKOPPartner roles—
PO_SERVICESBAPIESLLCService lines—
PO_SRV_ACCASS_VALUESBAPIESKLCService account assignment values—
PO_SERVICES_TEXTBAPIESLLTXService texts—
PO_LIMITSBAPIESUHCLimits—
PO_CONTRACT_LIMITSBAPIESUCCContract limits—
POADDRDELIVERYBAPIMEPOADDRDELIVERYItem delivery address—
EXTENSIONINBAPIPAREXCustomer extension fields (input)—
RETURNBAPIRETURNReturn messages—

Call template (ABAP)

A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.

CALL FUNCTION 'BAPI_PO_CREATE'
  EXPORTING
    po_header = lv_po_header
  IMPORTING
    purchaseorder = lv_purchaseorder
  TABLES
    po_items = lt_po_items
    po_item_add_data = lt_po_item_add_data
    po_item_schedules = lt_po_item_schedules
    po_item_account_assignment = lt_po_item_account_assignment
    po_item_text = lt_po_item_text
    po_business_partner = lt_po_business_partner
    po_services = lt_po_services
    po_srv_accass_values = lt_po_srv_accass_values
    po_services_text = lt_po_services_text
    po_limits = lt_po_limits.

Related tables

Can't find the report you need?

We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.

Request a custom report