EKPO: Purchasing Document Item
MMEKPO stores the items of purchasing documents: one row per item with the material, plant, order quantity, order unit and net price. Each row belongs to a header in EKKO with the same EBELN.
Primary key
EBELN + EBELP
plus the client field
Module
MM
Fields in this reference
8
How the EKPO key works
The primary key is MANDT, EBELN and EBELP. EBELP is the five-digit item number, typically 00010, 00020 and so on.
EKPO fields
| Field | Type / data element | Length | Description |
|---|---|---|---|
| πMANDT | CLNT | 3 | Client |
| πEBELN | EBELN | 10 | Purchasing Document Number |
| πEBELP | EBELP | 5 | Item Number |
| MATNR | MATNR | 18 | Material Number |
| WERKS | WERKS | 4 | Plant |
| MENGE | MENGE | 13 | PO Quantity |
| MEINS | MEINS | 3 | Order Unit |
| NETPR | PREIS | 11 | Net Price |
This is a curated subset of the most commonly used fields, not the complete table definition. A real system contains more fields and can differ by release and customizing, so confirm the definition in transaction SE11 before relying on it.
Example ABAP SELECT for EKPO
" Open SQL applies the client (MANDT) automatically, so it is not part of the WHERE clause. DATA lv_ebeln TYPE ekpo-ebeln. SELECT ebelp, matnr, werks, menge FROM ekpo WHERE ebeln = @lv_ebeln INTO TABLE @DATA(lt_ekpo).
Modern Open SQL with host variables (ABAP 7.40 and later). Need a different field list or conditions? Build it in the ABAP SELECT Builder.
Tables related to EKPO
- EKKO (joined on EBELN): Header of the purchasing document.
- MARA (joined on MATNR): Cross-plant material master data.
- MARC (joined on MATNR + WERKS): Plant data of the ordered material.
- MSEG (joined on EBELN + EBELP): Goods movements posted against the PO item.
- EKBE (joined on EBELN + EBELP): Purchase order history.
Practical tips for EKPO
- NETPR is the net price per price unit. The price unit field PEINH, which is not part of the subset shown above, belongs to the same table, so the item value is NETPR / PEINH * MENGE.
- Items flagged for deletion carry a value in LOEKZ, another field outside the subset shown above. Add LOEKZ = space to the WHERE clause to exclude them.
- MENGE is in the order unit MEINS, which can differ from the base unit of measure in MARA.
EKPO FAQ
How is the net value of a PO item calculated?
Divide the net price NETPR by the price unit PEINH and multiply the result by the order quantity MENGE.
How do I exclude deleted PO items?
Add LOEKZ = space to the WHERE clause. Items flagged for deletion have a value in that field.
Keep exploring
- SAP Table Field Lookup: search all 28 tables and their fields.
- SAP BAPI Explorer: find the BAPI that creates or changes this data.
- CDS View Generator: expose these tables through a CDS view.