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

BAPI_PO_CHANGE Change Purchase Order

Changes an existing purchase order: header fields, items, schedule lines, account assignment, conditions and texts, and can also add new items. It is the standard way to update prices, quantities or delivery dates from a custom program or an inbound interface. Pass the item number in both POITEM and POITEMX, set 'X' only for the fields you change, and commit with BAPI_TRANSACTION_COMMIT when RETURN has no errors.

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

Importing parameters

ParameterTypeDescriptionRequired
PURCHASEORDERBAPIMEPOHEADER-PO_NUMBERPurchase order numberYes
POHEADERBAPIMEPOHEADERHeader data—
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
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—
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_CHANGE'
  EXPORTING
    purchaseorder = lv_purchaseorder
  IMPORTING
    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
    potextheader = lt_potextheader.

Related tables

Solutions using this function

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