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
| Parameter | Type | Description | Required |
|---|---|---|---|
| PO_HEADER | BAPIEKKOC | PO header data | Yes |
| PO_HEADER_ADD_DATA | BAPIEKKOA | Additional header data | — |
| HEADER_ADD_DATA_RELEVANT | BAPIMMPARA-SELECTION | Use additional header data | — |
| PO_ADDRESS | BAPIADDRESS | One-time vendor address | — |
| SKIP_ITEMS_WITH_ERROR | BAPIMMPARA-SELECTION | Skip items with errors | — |
| ITEM_ADD_DATA_RELEVANT | BAPIMMPARA-SELECTION | Use additional item data | — |
| HEADER_TECH_FIELDS | BAPITECH | Technical header fields | — |
Exporting parameters
| Parameter | Type | Description |
|---|---|---|
| PURCHASEORDER | BAPIEKKOC-PO_NUMBER | Purchase order number |
Tables parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| PO_ITEMS | BAPIEKPOC | PO items | Yes |
| PO_ITEM_ADD_DATA | BAPIEKPOA | Additional item data | — |
| PO_ITEM_SCHEDULES | BAPIEKET | Schedule lines | Yes |
| PO_ITEM_ACCOUNT_ASSIGNMENT | BAPIEKKN | Account assignments | — |
| PO_ITEM_TEXT | BAPIEKPOTX | Item texts | — |
| PO_BUSINESS_PARTNER | BAPIEKKOP | Partner roles | — |
| PO_SERVICES | BAPIESLLC | Service lines | — |
| PO_SRV_ACCASS_VALUES | BAPIESKLC | Service account assignment values | — |
| PO_SERVICES_TEXT | BAPIESLLTX | Service texts | — |
| PO_LIMITS | BAPIESUHC | Limits | — |
| PO_CONTRACT_LIMITS | BAPIESUCC | Contract limits | — |
| POADDRDELIVERY | BAPIMEPOADDRDELIVERY | Item delivery address | — |
| EXTENSIONIN | BAPIPAREX | Customer extension fields (input) | — |
| RETURN | BAPIRETURN | Return 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.