MM
BAPI
RFC
Used the same way in S/4HANA
BAPI_PR_CREATE Create Purchase Requisition (Enjoy)
Creates a purchase requisition with the Enjoy interface used by ME51N, including header, items, account assignment and texts. It is the recommended BAPI for new requisition uploads and interfaces and returns the new number in NUMBER. Fill PRITEMX/PRACCOUNTX with 'X' for every field you pass, check RETURN and call BAPI_TRANSACTION_COMMIT.
- Function group
- 2105
- Remote-enabled (RFC)
- Yes
- Type
- BAPI
Importing parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| PRHEADER | BAPIMEREQHEADER | Header data | — |
| PRHEADERX | BAPIMEREQHEADERX | Header change flags | — |
| TESTRUN | BAPIFLAG-BAPIFLAG | Test run (no update) | — |
Exporting parameters
| Parameter | Type | Description |
|---|---|---|
| NUMBER | BAPIMEREQHEADER-PREQ_NO | Number of the created purchase requisition |
| PRHEADEREXP | BAPIMEREQHEADER | Header data (result) |
Tables parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| RETURN | BAPIRET2 | Return messages | — |
| PRITEM | BAPIMEREQITEMIMP | Item data | Yes |
| PRITEMX | BAPIMEREQITEMX | Item change flags | — |
| PRACCOUNT | BAPIMEREQACCOUNT | Account assignment data | — |
| PRACCOUNTX | BAPIMEREQACCOUNTX | Account assignment change flags | — |
| PRHEADERTEXT | BAPIMEREQHEADTEXT | Header texts | — |
| PRITEMTEXT | BAPIMEREQITEMTEXT | 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_PR_CREATE'
IMPORTING
number = lv_number
prheaderexp = lv_prheaderexp
TABLES
return = lt_return
pritem = lt_pritem
pritemx = lt_pritemx
praccount = lt_praccount
praccountx = lt_praccountx
prheadertext = lt_prheadertext
pritemtext = lt_pritemtext
extensionin = lt_extensionin.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.