# BAPI_PR_CHANGE — Change Purchase Requisition (Enjoy)

> Changes an Enjoy purchase requisition: header data, items, account assignment and texts, and can add new items. Custom programs use it to update quantities, delivery dates, sources of supply or account assignment in existing requisitions. Pass the item number in both PRITEM and PRITEMX, flag only the changed fields and commit with BAPI_TRANSACTION_COMMIT when RETURN is clean.

- Modules: MM
- Type: BAPI
- Function group: 2105
- Remote-enabled (RFC): Yes
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/bapi-pr-change/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| NUMBER | BAPIMEREQHEADER-PREQ_NO | Purchase requisition number | Yes |
| PRHEADER | BAPIMEREQHEADER | Header data | - |
| PRHEADERX | BAPIMEREQHEADERX | Header change flags | - |
| TESTRUN | BAPIFLAG-BAPIFLAG | Test run (no update) | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| PRHEADEREXP | BAPIMEREQHEADER | Header data (result) |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| RETURN | BAPIRET2 | Return messages | - |
| PRITEM | BAPIMEREQITEMIMP | Item data | - |
| 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)

```abap
CALL FUNCTION 'BAPI_PR_CHANGE'
  EXPORTING
    number = lv_number
  IMPORTING
    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

EBAN, EBKN

