offdataai
SAP · data model template

SAP MM Purchasing data model

Third-normal-form mirror of the SAP MM procure-to-pay tables as they land from the source ERP. Each SAP table becomes its own entity with a warehouse surrogate key plus the genuine SAP business key(s), and child item/schedule/history tables reference their header/master tables via foreign keys. Vendor name, address and tax identifiers are PII-masked under GDPR.

Normalized replica of SAP ECC/S4HANA Materials Management procurement source tables for a warehouse staging/replication layer: purchase order header (EKKO), item (EKPO), schedule (EKET) and PO history (EKBE); purchase requisitions (EBAN); goods movements (MKPF/MSEG); and purchasing info records (EINA/EINE) — keyed by the real SAP business keys (ebeln, ebelp, etenr, banfn, mblnr) and anchored to vendor (LFA1), plant (T001W), purchasing org and material (MARA) check/master tables. It is a normalized (3NF) relational model that mirrors the source system, suited to operational databases and to landing source data faithfully.

3NFSAPGDPRSOX
14
tables
136
columns
18
relationships
7
PII columns

Opening the template creates a project with the ERD, platform-native DDL, a dbt project and documentation already generated (recommended platform: PostgreSQL). Edit it in plain English or on the canvas, then ship it to any supported warehouse.

Subject areas

referencerequisitionpurchase_ordergoods_movementinfo_record

Design decisions

  • Header/item/schedule normalization mirrors SAP MM

    SAP MM stores a purchase order as EKKO (header) → EKPO (item) → EKET (schedule line); replicating that hierarchy 1:1 keeps the staging layer lossless and reconcilable against the source EKKO/EKPO/EKET tables.

  • Separate PO history and goods movements

    Goods receipts and invoice receipts are posted as material documents (MKPF/MSEG) and summarized into PO history (EKBE); keeping them as their own entities preserves the GR/IR audit trail SAP records per PO item.

  • Info records split into general and org-level data

    SAP separates purchasing info record general data (EINA) from purchasing organization data (EINE) because price/lead-time vary by purchasing org; the split avoids repeating vendor/material keys across org rows.

  • Check tables modeled as lookups

    Purchasing org, plant (T001W), vendor (LFA1) and material (MARA) are slow SAP check/master tables; modeling them as lookups without an audit trail keeps reference data clean and avoids re-keying every transaction row.

Tables in the SAP MM Purchasing model

Every table with its grain, columns, types and keys. PK marks a primary key, BK a business key and PII a column classified as personal data, which gets a masking strategy by default.

Tables (10)

purchase_req_header

Grain: one row per purchase requisition (banfn)

SAP EBAN (header-level attributes) — purchase requisition.

ColumnTypeKeys
purchase_req_header_keybigintPK
banfnvarcharBK
bsartvarchar
ernamvarcharPII
erdatdate

purchase_req_item

Grain: one row per purchase requisition item (banfn, bnfpo)

SAP EBAN — purchase requisition item.

ColumnTypeKeys
purchase_req_item_keybigintPK
purchase_req_header_keybigint
material_keybigint
plant_keybigint
banfnvarcharBK
bnfpovarcharBK
matnrvarchar
werksvarchar
mengedecimal
meinsvarchar
lfdatdate
preisdecimal
frgkzvarchar

po_header

Grain: one row per purchase order header (ebeln)

SAP EKKO — purchasing document header.

ColumnTypeKeys
po_header_keybigintPK
vendor_keybigint
purchasing_org_keybigint
ebelnvarcharBK
bsartvarchar
bstypvarchar
lifnrvarchar
ekorgvarchar
ekgrpvarchar
bukrsvarchar
waersvarchar
bedatdate
ernamvarcharPII

po_item

Grain: one row per purchase order item (ebeln, ebelp)

SAP EKPO — purchasing document item.

ColumnTypeKeys
po_item_keybigintPK
po_header_keybigint
material_keybigint
plant_keybigint
ebelnvarcharBK
ebelpvarcharBK
matnrvarchar
txz01varchar
werksvarchar
lgortvarchar
mengedecimal
meinsvarchar
netprdecimal
netwrdecimal
mwskzvarchar
loekzvarchar

po_schedule

Grain: one row per PO delivery schedule line (ebeln, ebelp, etenr)

SAP EKET — scheduling agreement schedule lines.

ColumnTypeKeys
po_schedule_keybigintPK
po_item_keybigint
ebelnvarcharBK
ebelpvarcharBK
etenrvarcharBK
eindtdate
mengedecimal
wemngdecimal
dabmgdecimal

po_history

Grain: one row per PO history record (ebeln, ebelp, zekkn, vgabe, gjahr, belnr, buzei)

SAP EKBE — purchase order history.

ColumnTypeKeys
po_history_keybigintPK
po_item_keybigint
ebelnvarcharBK
ebelpvarcharBK
vgabevarcharBK
gjahrvarcharBK
belnrvarcharBK
buzeivarcharBK
bewtpvarchar
mengedecimal
dmbtrdecimal
shkzgvarchar
budatdate

goods_movement_header

Grain: one row per material document header (mblnr, mjahr)

SAP MKPF — material document header.

ColumnTypeKeys
goods_movement_header_keybigintPK
mblnrvarcharBK
mjahrvarcharBK
bldatdate
budatdate
usnamvarcharPII
blartvarchar

goods_movement

Grain: one row per material document item (mblnr, mjahr, zeile)

SAP MSEG — material document segment.

ColumnTypeKeys
goods_movement_keybigintPK
goods_movement_header_keybigint
material_keybigint
plant_keybigint
po_item_keybigint
mblnrvarcharBK
mjahrvarcharBK
zeilevarcharBK
bwartvarchar
matnrvarchar
werksvarchar
lgortvarchar
mengedecimal
meinsvarchar
dmbtrdecimal
shkzgvarchar
ebelnvarchar
ebelpvarchar

info_record

Grain: one row per purchasing info record general data (infnr)

SAP EINA — purchasing info record general data.

ColumnTypeKeys
info_record_keybigintPK
vendor_keybigint
material_keybigint
infnrvarcharBK
lifnrvarchar
matnrvarchar
matklvarchar
loekzvarchar

info_record_org

Grain: one row per info record purchasing org data (infnr, ekorg, esokz, werks)

SAP EINE — purchasing info record purchasing organization data.

ColumnTypeKeys
info_record_org_keybigintPK
info_record_keybigint
purchasing_org_keybigint
infnrvarcharBK
ekorgvarcharBK
esokzvarcharBK
netprdecimal
waersvarchar
aplfzdecimal
ekgrpvarchar

Lookup tables (4)

purchasing_org

Grain: one row per purchasing organization

SAP T024E — purchasing organization check table.

ColumnTypeKeys
purchasing_org_keybigintPK
ekorgvarcharBK
ekotxvarchar
bukrsvarchar

plant

Grain: one row per plant / receiving location

SAP T001W — plant/branch check table.

ColumnTypeKeys
plant_keybigintPK
werksvarcharBK
name1varchar
land1varchar
regiovarchar
bukrsvarchar

material

Grain: one row per material master general record

SAP MARA — material master (general), referenced as a lookup here.

ColumnTypeKeys
material_keybigintPK
matnrvarcharBK
mtartvarchar
matklvarchar
meinsvarchar
maktxvarchar

vendor

Grain: one row per vendor master general record

SAP LFA1 — vendor master (general), referenced as a lookup here.

ColumnTypeKeys
vendor_keybigintPK
lifnrvarcharBK
name1varcharPII
land1varchar
ort01varcharPII
pstlzvarcharPII
stcd1varcharPII
ktokkvarchar

Relationships

Each relationship is a foreign key on the first table referencing the second.

  • purchase_req_item.purchase_req_header_key → purchase_req_header (many-to-one)
  • purchase_req_item.material_key → material (many-to-one)
  • purchase_req_item.plant_key → plant (many-to-one)
  • po_header.vendor_key → vendor (many-to-one)
  • po_header.purchasing_org_key → purchasing_org (many-to-one)
  • po_item.po_header_key → po_header (many-to-one)
  • po_item.material_key → material (many-to-one)
  • po_item.plant_key → plant (many-to-one)
  • po_schedule.po_item_key → po_item (many-to-one)
  • po_history.po_item_key → po_item (many-to-one)
  • goods_movement.goods_movement_header_key → goods_movement_header (many-to-one)
  • goods_movement.material_key → material (many-to-one)
  • goods_movement.plant_key → plant (many-to-one)
  • goods_movement.po_item_key → po_item (many-to-one)
  • info_record.vendor_key → vendor (many-to-one)
  • info_record.material_key → material (many-to-one)
  • info_record_org.info_record_key → info_record (many-to-one)
  • info_record_org.purchasing_org_key → purchasing_org (many-to-one)

Related templates

All templates →
Start for $1

From requirements to AI-ready context, in one platform.

Describe your business in a conversation, start from a template or connect your own database. Your first model is ready in minutes.

Get startedBook a demo

Plans from $1/month · cancel any time