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

> Source: https://netray.co/tools/sap-mm-table-relationships-join-reference
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

A searchable relationship map of SAP MM tables listing the join keys between purchasing, goods movement, invoice, material master and cost center tables.

## Category

sap

## Erp

SAP ECC / S/4HANA

## Audience

- SAP developer
- Report builder
- MM consultant

## Tool

**Kind:** worksheet

**Mode:** reference

**Columns:**

#### From table

**Key:** from

**Type:** text

#### To table

**Key:** to

**Type:** text

#### Join keys

**Key:** join

**Type:** text

#### Business object and note

**Key:** object

**Type:** text

**Rows:**

**From:** EKKO

**To:** EKPO

**Join:** EBELN

**Object:** Purchase order header to items. Contracts and scheduling agreements use the same tables, told apart by document category BSTYP

**From:** EKPO

**To:** EKET

**Join:** EBELN, EBELP

**Object:** PO item to schedule lines (delivery dates, scheduled quantity)

**From:** EKPO

**To:** EKKN

**Join:** EBELN, EBELP

**Object:** PO item to account assignment; EKKN holds cost center (KOSTL), order, WBS

**From:** EKPO

**To:** EKBE

**Join:** EBELN, EBELP

**Object:** PO item to purchase order history (goods receipts, invoice receipts)

**From:** EKKO

**To:** LFA1

**Join:** LIFNR

**Object:** PO header to vendor master general data

**From:** EKKO

**To:** T001W

**Join:** via EKPO-WERKS

**Object:** Plant name for the PO item

**From:** EKPO

**To:** MARA

**Join:** MATNR

**Object:** PO item to material master general data

**From:** EKPO

**To:** MARC

**Join:** MATNR, WERKS

**Object:** PO item to plant data of the material

**From:** EKKO (BSTYP K)

**To:** EKPO

**Join:** EBELN

**Object:** Contracts: header and items of outline agreements with document category K

**From:** EBAN

**To:** EKPO

**Join:** EBAN-BANFN = EKPO-BANFN, EBAN-BNFPO = EKPO-BNFPO

**Object:** Purchase requisition item to the PO item that covers it

**From:** EBAN

**To:** EBKN

**Join:** BANFN, BNFPO

**Object:** Requisition item to account assignment; EBKN holds the cost center

**From:** MKPF

**To:** MSEG

**Join:** MBLNR, MJAHR

**Object:** Material document header to items in ECC

**From:** MATDOC

**To:** MSEG / MKPF

**Join:** MBLNR, MJAHR, ZEILE

**Object:** S/4HANA material document table; MKPF and MSEG remain as compatibility views over MATDOC

**From:** MSEG

**To:** EKPO

**Join:** EBELN, EBELP

**Object:** Goods movement line to the PO item it references

**From:** MSEG

**To:** MARA

**Join:** MATNR

**Object:** Movement line to material master

**From:** MSEG

**To:** CSKS

**Join:** KOSTL, KOKRS

**Object:** Goods issue to cost center (movement type 201 and similar)

**From:** RBKP

**To:** RSEG

**Join:** BELNR, GJAHR

**Object:** Logistics invoice verification header to items (MIRO documents)

**From:** RSEG

**To:** EKPO

**Join:** EBELN, EBELP

**Object:** Invoice item to the PO item invoiced

**From:** RBKP

**To:** BKPF

**Join:** AWTYP = RMRP, AWKEY = BELNR + GJAHR

**Object:** Invoice document to its accounting document

**From:** MARA

**To:** MAKT

**Join:** MATNR, SPRAS

**Object:** Material master general data to descriptions by language

**From:** MARA

**To:** MARC

**Join:** MATNR

**Object:** General data to plant level data (MRP, procurement type)

**From:** MARC

**To:** MARD

**Join:** MATNR, WERKS

**Object:** Plant data to storage location stock

**From:** MARC

**To:** MBEW

**Join:** MATNR = MATNR, WERKS = BWKEY

**Object:** Plant to valuation data when valuation is at plant level

**From:** MARA

**To:** MARM

**Join:** MATNR

**Object:** Material to alternative units of measure

**From:** EINA

**To:** EINE

**Join:** INFNR

**Object:** Purchasing info record general data to purchasing organization data

**From:** EINA

**To:** LFA1

**Join:** LIFNR

**Object:** Info record to vendor

**From:** LFA1

**To:** LFM1

**Join:** LIFNR

**Object:** Vendor general data to purchasing organization data

**From:** CSKS

**To:** CSKT

**Join:** KOKRS, KOSTL, DATBI

**Object:** Cost center master to texts; pick the valid-to date row

**From:** EKKN

**To:** CSKS

**Join:** KOKRS, KOSTL

**Object:** PO cost center link: read EKKN-KOSTL for the cost center on a PO item

**Notes:** 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).

## Content

**Intro:** 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.

**Sections:**

#### How to read the map

**Body:** 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.

**Bullets:**

- 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

**Body:** 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

**Body:** 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

**Body:** 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.

**Cta:** 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.

**Faq:**

#### What are the main SAP MM tables?

**Answer:** 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?

**Answer:** 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?

**Answer:** 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?

**Answer:** 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.

## Search terms

sap mm tables relationship diagram, sap mm table names, sap mm tables in s4 hana, cost center table in sap mm, sap po cost center table, sap table mm document, sap mm table purchase requisition, sap mm contract table, sap mm tables for material master

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
