# BAPI_PLANNEDORDER_GET_DETAIL — Get Planned Order Details

> Reads the header, capacity headers and component data of one planned order. It is used in reports and outbound interfaces that pass planned orders to APS or MES systems. Check RETURN before using HEADERDATA, because the structures stay initial when the order is not found.

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

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| PLANNEDORDER | BAPI_PLDORD-PLDORD_NUM | Planned order number | Yes |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| RETURN | BAPIRETURN1 | Return messages |
| HEADERDATA | BAPIPLAF_E1 | Planned order header data |
| CAPACITYHEADERDATA1 | BAPI_KBKO | Capacity header (detailed scheduling) |
| CAPACITYHEADERDATA2 | BAPI_KBKO | Capacity header (rate-based scheduling) |
| CAPACITYHEADERDATA3 | BAPI_KBKO | Capacity header (rough-cut scheduling) |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| COMPONENTSDATA | BAPI_PLDORDCOMP_E1 | Component data | - |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_PLANNEDORDER_GET_DETAIL'
  EXPORTING
    plannedorder = lv_plannedorder
  IMPORTING
    return = lv_return
    headerdata = lv_headerdata
    capacityheaderdata1 = lv_capacityheaderdata1
    capacityheaderdata2 = lv_capacityheaderdata2
    capacityheaderdata3 = lv_capacityheaderdata3
  TABLES
    componentsdata = lt_componentsdata.
```

## Related tables

PLAF, RESB

