# BAPI_PO_GETDETAIL — Get Purchase Order Details (Old)

> Reads the header, address, items, schedule lines, account assignments, confirmations, services and PO history of a purchase order. Developers use it in PO status reports and interfaces that send order information to external systems. Choose which blocks are returned with 'X' flags such as ITEMS, SCHEDULES and HISTORY; for new development the more complete BAPI_PO_GETDETAIL1 is preferred.

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

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| PURCHASEORDER | BAPIEKKO-PO_NUMBER | Purchase order number | Yes |
| ITEMS | BAPIMMPARA-SELECTION | Return items | - |
| ACCOUNT_ASSIGNMENT | BAPIMMPARA-SELECTION | Return account assignments | - |
| SCHEDULES | BAPIMMPARA-SELECTION | Return schedule lines | - |
| HISTORY | BAPIMMPARA-SELECTION | Return PO history | - |
| ITEM_TEXTS | BAPIMMPARA-SELECTION | Return item texts | - |
| HEADER_TEXTS | BAPIMMPARA-SELECTION | Return header texts | - |
| SERVICES | BAPIMMPARA-SELECTION | Return services | - |
| CONFIRMATIONS | BAPIMMPARA-SELECTION | Return confirmations | - |
| SERVICE_TEXTS | BAPIMMPARA-SELECTION | Return service texts | - |
| EXTENSIONS | BAPIMMPARA-SELECTION | Return customer extensions | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| PO_HEADER | BAPIEKKOL | PO header data |
| PO_ADDRESS | BAPIADDRESS | PO address |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| PO_HEADER_TEXTS | BAPIEKKOTX | Header texts | - |
| PO_ITEMS | BAPIEKPO | PO items | - |
| PO_ITEM_ACCOUNT_ASSIGNMENT | BAPIEKKN | Account assignments | - |
| PO_ITEM_SCHEDULES | BAPIEKET | Schedule lines | - |
| PO_ITEM_CONFIRMATIONS | BAPIEKES | Vendor confirmations | - |
| PO_ITEM_TEXTS | BAPIEKPOTX | Item texts | - |
| PO_ITEM_HISTORY | BAPIEKBE | PO history | - |
| PO_ITEM_HISTORY_TOTALS | BAPIEKBES | PO history totals | - |
| PO_ITEM_SERVICES | BAPIESLL | Service lines | - |
| EXTENSIONOUT | BAPIPAREX | Customer extension fields (output) | - |
| RETURN | BAPIRETURN | Return messages | - |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_PO_GETDETAIL'
  EXPORTING
    purchaseorder = lv_purchaseorder
  IMPORTING
    po_header = lv_po_header
    po_address = lv_po_address
  TABLES
    po_header_texts = lt_po_header_texts
    po_items = lt_po_items
    po_item_account_assignment = lt_po_item_account_assignment
    po_item_schedules = lt_po_item_schedules
    po_item_confirmations = lt_po_item_confirmations
    po_item_texts = lt_po_item_texts
    po_item_history = lt_po_item_history
    po_item_history_totals = lt_po_item_history_totals
    po_item_services = lt_po_item_services
    extensionout = lt_extensionout.
```

## Related tables

EKBE, EKET, EKKN, EKKO, EKPO

