SAPFree referencePDF, Excel, Word exportSAP ECC / S/4HANA

SAP MM Tables Relationship Diagram as a Join Key Map (EKKO, MSEG, MARA, MATDOC)

To write a report on purchasing or inventory you need to know which tables link to which and on what keys. This map shows the common SAP MM relationships in one searchable list, from purchase requisition to purchase order to goods receipt to invoice, plus the material master and cost center links.

Download:
From tableTo tableJoin keysBusiness object and note
EKKO
EKPO
EBELN
Purchase order header to items. Contracts and scheduling agreements use the same tables, told apart by document category BSTYP
EKPO
EKET
EBELN, EBELP
PO item to schedule lines (delivery dates, scheduled quantity)
EKPO
EKKN
EBELN, EBELP
PO item to account assignment; EKKN holds cost center (KOSTL), order, WBS
EKPO
EKBE
EBELN, EBELP
PO item to purchase order history (goods receipts, invoice receipts)
EKKO
LFA1
LIFNR
PO header to vendor master general data
EKKO
T001W
via EKPO-WERKS
Plant name for the PO item
EKPO
MARA
MATNR
PO item to material master general data
EKPO
MARC
MATNR, WERKS
PO item to plant data of the material
EKKO (BSTYP K)
EKPO
EBELN
Contracts: header and items of outline agreements with document category K
EBAN
EKPO
EBAN-BANFN = EKPO-BANFN, EBAN-BNFPO = EKPO-BNFPO
Purchase requisition item to the PO item that covers it
EBAN
EBKN
BANFN, BNFPO
Requisition item to account assignment; EBKN holds the cost center
MKPF
MSEG
MBLNR, MJAHR
Material document header to items in ECC
MATDOC
MSEG / MKPF
MBLNR, MJAHR, ZEILE
S/4HANA material document table; MKPF and MSEG remain as compatibility views over MATDOC
MSEG
EKPO
EBELN, EBELP
Goods movement line to the PO item it references
MSEG
MARA
MATNR
Movement line to material master
MSEG
CSKS
KOSTL, KOKRS
Goods issue to cost center (movement type 201 and similar)
RBKP
RSEG
BELNR, GJAHR
Logistics invoice verification header to items (MIRO documents)
RSEG
EKPO
EBELN, EBELP
Invoice item to the PO item invoiced
RBKP
BKPF
AWTYP = RMRP, AWKEY = BELNR + GJAHR
Invoice document to its accounting document
MARA
MAKT
MATNR, SPRAS
Material master general data to descriptions by language
MARA
MARC
MATNR
General data to plant level data (MRP, procurement type)
MARC
MARD
MATNR, WERKS
Plant data to storage location stock
MARC
MBEW
MATNR = MATNR, WERKS = BWKEY
Plant to valuation data when valuation is at plant level
MARA
MARM
MATNR
Material to alternative units of measure
EINA
EINE
INFNR
Purchasing info record general data to purchasing organization data
EINA
LFA1
LIFNR
Info record to vendor
LFA1
LFM1
LIFNR
Vendor general data to purchasing organization data
CSKS
CSKT
KOKRS, KOSTL, DATBI
Cost center master to texts; pick the valid-to date row
EKKN
CSKS
KOKRS, KOSTL
PO cost center link: read EKKN-KOSTL for the cost center on a PO item

MMBE and MM03 are transaction codes, not tables: MMBE is the stock overview and MM03 displays a material master. The tables behind them are MARD, MARC and MARA. Key field lists are the usual ones; confirm the full primary key in SE11 for your release, and note that S/4HANA changes stock and material document tables (MATDOC, NSDM views).

Want these joins run for you?

Tell us the questions your buyers ask and we can show how a read-only assistant would answer them from your SAP data. Optional.

Optional. The tool and every export work without this. No spam.

How to read the map

Each row is one join: the table you start from, the table you reach, and the fields that connect them. Chain rows to build a query. For example, requisition to PO to goods movement to invoice runs through EBAN, EKPO, MSEG and RSEG. Always include the item field as well as the document number, or one PO with many items will multiply your rows.

  • Chain EBAN, EKPO, MSEG and RSEG for the full procure-to-pay trail.
  • Add the client field MANDT in every join when you work outside Open SQL.
  • Use EKBE when you only need history, it avoids joining MSEG and RSEG.

What changed in S/4HANA

In S/4HANA the material document is stored in MATDOC, which merges the former header, item and stock figure tables. MKPF and MSEG still exist as compatibility views so old programs keep working, but a new report should select from MATDOC. Stock quantities by period and material are also read through views rather than the old summary tables. Check the simplification list for your target release before you freeze a data model.

Finding the cost center on a PO

The cost center is not in EKPO. It sits in the account assignment table EKKN, one row per PO item and account assignment line (EKKN-KOSTL with controlling area KOKRS). Requisitions work the same way through EBKN. For goods issues to a cost center, the cost center is carried on the material document line. Join EKKN to CSKS for master data and to CSKT for the name.

Common mistakes

Typical mistakes are joining on document number alone, forgetting that contracts and scheduling agreements share the EKKO and EKPO tables, and treating MMBE or MM03 as tables. Another is reading MBEW without matching the valuation area to the plant or company code, which returns the wrong price. Filter on BSTYP and deletion indicators before you count anything.

Frequently Asked Questions

What are the main SAP MM tables?

The core ones are EKKO and EKPO for purchasing documents, EBAN for requisitions, MARA, MARC and MARD for material master and stock, MKPF and MSEG (or MATDOC in S/4HANA) for goods movements, and RBKP and RSEG for invoice verification.

Is MMBE a table in SAP?

No. MMBE is a transaction code for the stock overview. The data behind it comes from tables such as MARD for storage location stock, MARC for plant data and MCHB for batch stock. Likewise MM03 is a transaction that displays a material master, not a table.

Which table stores the cost center on a purchase order?

EKKN, the PO account assignment table, holds the cost center in field KOSTL per item. Join EKKN to EKPO on EBELN and EBELP. For requisitions the equivalent table is EBKN. The cost center master data is in CSKS.

Where are contracts stored in SAP MM?

Outline agreements use the same tables as purchase orders. Contracts are EKKO and EKPO rows with document category K, and scheduling agreements use category L. Filter on BSTYP to separate them, and read EKAB for release documents against a contract.

If you keep rebuilding the same procure-to-pay joins by hand, we can wire a private assistant to a read-only copy of your SAP data so buyers ask in plain language and see the query it ran.