# BAPI_PRODORD_CREATE — Create Production Order

> Creates a production order from header data such as material, plant, order type, quantity and basic dates; routing and BOM are exploded as in CO01. Developers use it in interfaces from MES or planning tools and in mass-creation uploads. Read ORDER_NUMBER only when RETURN has no E or A message, then call BAPI_TRANSACTION_COMMIT.

- 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-create/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| ORDERDATA | BAPI_PP_ORDER_CREATE | Data for creating the production order | Yes |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| ORDER_NUMBER | BAPI_ORDER_KEY-ORDER_NUMBER | Production order number |
| ORDER_TYPE | BAPI_ORDER_COPY-ORDER_TYPE | Order type |
| RETURN | BAPIRET2 | Return messages |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_PRODORD_CREATE'
  EXPORTING
    orderdata = lv_orderdata
  IMPORTING
    order_number = lv_order_number
    order_type = lv_order_type
    return = lv_return.
```

## Related tables

AFKO, AFPO, AFVC, AUFK, RESB

