# BAPI_PRODORD_CHANGE — Change Production Order

> Changes header fields of an existing production order, for example quantity or basic dates. It is used when an external planning system reschedules orders or when a custom program corrects orders in bulk. Set the matching flag in ORDERDATAX for every field you fill in ORDERDATA, otherwise the value is ignored.

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

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| NUMBER | BAPI_ORDER_KEY-ORDER_NUMBER | Production order number | Yes |
| ORDERDATA | BAPI_PP_ORDER_CHANGE | Production order fields to change | Yes |
| ORDERDATAX | BAPI_PP_ORDER_CHANGEX | Change flags for order data | Yes |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| MASTER_DATA_READ | BAPIFLAG-BAPIFLAG | Master data was read again |
| ORDER_STATUS | BAPI_ORDER_STATUS | Order status indicators |
| ORDER_TYPE | BAPI_ORDER_COPY-ORDER_TYPE | Order type |
| RETURN | BAPIRET2 | Return messages |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_PRODORD_CHANGE'
  EXPORTING
    number = lv_number
    orderdata = lv_orderdata
    orderdatax = lv_orderdatax
  IMPORTING
    master_data_read = lv_master_data_read
    order_status = lv_order_status
    order_type = lv_order_type
    return = lv_return.
```

## Related tables

AFKO, AFPO, AUFK

