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
| Parameter | Type | Description | Required |
|---|---|---|---|
| POHEADER | BAPIMEPOHEADER | Header data | Yes |
| POHEADERX | BAPIMEPOHEADERX | Header change flags | — |
| TESTRUN | BAPIFLAG-BAPIFLAG | Test run (no update) | — |
| NO_MESSAGING | BAPIFLAG-BAPIFLAG | No output (message) determination | — |
| NO_PRICE_FROM_PO | BAPIFLAG-BAPIFLAG | Do not adopt price from last document | — |
Exporting parameters
| Parameter | Type | Description |
|---|---|---|
| EXPPURCHASEORDER | BAPIMEPOHEADER-PO_NUMBER | Number of the created purchase order |
| EXPHEADER | BAPIMEPOHEADER | Header data (result) |
| EXPPOEXPIMPHEADER | BAPIEIKP | Foreign trade header data (result) |
Tables parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| RETURN | BAPIRET2 | Return messages | — |
| POITEM | BAPIMEPOITEM | Item data | — |
| POITEMX | BAPIMEPOITEMX | Item change flags | — |
| POSCHEDULE | BAPIMEPOSCHEDULE | Delivery schedule lines | — |
| POSCHEDULEX | BAPIMEPOSCHEDULX | Schedule line change flags | — |
| POACCOUNT | BAPIMEPOACCOUNT | Account assignment data | — |
| POACCOUNTX | BAPIMEPOACCOUNTX | Account assignment change flags | — |
| POCOND | BAPIMEPOCOND | Item conditions | — |
| POCONDX | BAPIMEPOCONDX | Condition change flags | — |
| POPARTNER | BAPIEKKOP | Partners | — |
| POTEXTHEADER | BAPIMEPOTEXTHEADER | Header texts | — |
| POTEXTITEM | BAPIMEPOTEXT | Item texts | — |
| EXTENSIONIN | BAPIPAREX | Customer 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
Automatic Conversion of Released Purchase Requisitions to Purchase Orders Program
A custom background program that assigns released requisitions not yet converted to an order to a vendor via the source list and info record, groups …
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 …
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.