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

BAPI_PO_CREATE1 Create Purchase Order

Creates a purchase order with header, items, schedule lines, account assignment, conditions, partners and texts, running the same checks as ME21N. Custom programs use it for PO uploads and for interfaces that turn external orders into SAP purchase orders. Mark every filled field with 'X' in POHEADERX/POITEMX (and the other ...X tables), check RETURN for type E or A messages and call BAPI_TRANSACTION_COMMIT afterwards.

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

Importing parameters

ParameterTypeDescriptionRequired
POHEADERBAPIMEPOHEADERHeader dataYes
POHEADERXBAPIMEPOHEADERXHeader change flags—
TESTRUNBAPIFLAG-BAPIFLAGTest run (no update)—
NO_MESSAGINGBAPIFLAG-BAPIFLAGNo output (message) determination—
NO_PRICE_FROM_POBAPIFLAG-BAPIFLAGDo not adopt price from last document—

Exporting parameters

ParameterTypeDescription
EXPPURCHASEORDERBAPIMEPOHEADER-PO_NUMBERNumber of the created purchase order
EXPHEADERBAPIMEPOHEADERHeader data (result)
EXPPOEXPIMPHEADERBAPIEIKPForeign trade header data (result)

Tables parameters

ParameterTypeDescriptionRequired
RETURNBAPIRET2Return messages—
POITEMBAPIMEPOITEMItem data—
POITEMXBAPIMEPOITEMXItem change flags—
POSCHEDULEBAPIMEPOSCHEDULEDelivery schedule lines—
POSCHEDULEXBAPIMEPOSCHEDULXSchedule line change flags—
POACCOUNTBAPIMEPOACCOUNTAccount assignment data—
POACCOUNTXBAPIMEPOACCOUNTXAccount assignment change flags—
POCONDBAPIMEPOCONDItem conditions—
POCONDXBAPIMEPOCONDXCondition change flags—
POPARTNERBAPIEKKOPPartners—
POTEXTHEADERBAPIMEPOTEXTHEADERHeader texts—
POTEXTITEMBAPIMEPOTEXTItem texts—
EXTENSIONINBAPIPAREXCustomer fields (inbound)—

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_CREATE1'
  EXPORTING
    poheader = lv_poheader
  IMPORTING
    exppurchaseorder = lv_exppurchaseorder
    expheader = lv_expheader
    exppoexpimpheader = lv_exppoexpimpheader
  TABLES
    return = lt_return
    poitem = lt_poitem
    poitemx = lt_poitemx
    poschedule = lt_poschedule
    poschedulex = lt_poschedulex
    poaccount = lt_poaccount
    poaccountx = lt_poaccountx
    pocond = lt_pocond
    pocondx = lt_pocondx
    popartner = lt_popartner.

Related tables

Solutions using this function

MM Program Custom Mass upload

Mass Purchase Order Creation from Excel Program

A custom program that creates purchase orders in bulk from Excel or CSV rows, grouping them by vendor, purchasing organization and group number. It …

EKKO · EKPO · EKET · EKKN

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