# BAPI_INTERNALORDER_CREATE — Create Internal Order

> Creates an internal order from the passed master data (order type, controlling area, company code, responsible cost center, etc.). Programs that open project, event or investment orders in bulk use it instead of KO01. You can pass settlement rules in the SRULES table; if RETURN has no errors, call BAPI_TRANSACTION_COMMIT and read the new number from ORDERID.

- Modules: CO
- Type: BAPI
- Function group: 2075
- Remote-enabled (RFC): Yes
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/bapi-internalorder-create/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| I_MASTER_DATA | BAPI2075_7 | Order master data | Yes |
| TESTRUN | BAPI0012_GEN-TESTRUN | Test run (no update) | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| ORDERID | BAPI2075_2-ORDER | Created order number |
| E_MASTER_DATA | BAPI2075_2 | Order master data (output) |
| E_MASTER_DATB | BAPI2075_7B | Additional order master data (output) |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| SRULES | BAPI2075_6 | Settlement rules | - |
| RETURN | BAPIRET2 | Return messages | - |
| EXTENSIONIN | BAPIPAREX | Customer extension fields (input) | - |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_INTERNALORDER_CREATE'
  EXPORTING
    i_master_data = lv_i_master_data
  IMPORTING
    orderid = lv_orderid
    e_master_data = lv_e_master_data
    e_master_datb = lv_e_master_datb
  TABLES
    srules = lt_srules
    return = lt_return
    extensionin = lt_extensionin.
```

## Related tables

AUFK

