βš™οΈSAPTools

EKPO: Purchasing Document Item

MM

EKPO 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

FieldType / data elementLengthDescription
πŸ”‘MANDTCLNT3Client
πŸ”‘EBELNEBELN10Purchasing Document Number
πŸ”‘EBELPEBELP5Item Number
MATNRMATNR18Material Number
WERKSWERKS4Plant
MENGEMENGE13PO Quantity
MEINSMEINS3Order Unit
NETPRPREIS11Net 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