offdataai
SAP · data model template

SAP SD Sales data model

Third-normal-form mirror of the SAP SD document flow as it lands 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 tables reference their header/master tables via foreign keys. Customer name, address and tax identifiers are PII-masked under GDPR.

Normalized replica of SAP ECC/S4HANA Sales & Distribution source tables for a warehouse staging/replication layer: sales document header (VBAK), item (VBAP) and schedule line (VBEP), document partners (VBPA), outbound delivery header (LIKP) and item (LIPS), billing header (VBRK) and item (VBRP), and pricing conditions (KONV) — keyed by the real SAP business keys (vbeln, posnr, etenr) and anchored to SAP check tables (TVAK, sales org) and the customer master (KNA1). It is a normalized (3NF) relational model that mirrors the source system, suited to operational databases and to landing source data faithfully.

3NFSAPGDPRSOX
12
tables
125
columns
16
relationships
6
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

referenceorderdeliverybillingpricing

Design decisions

  • Header/item/schedule normalization mirrors SAP SD

    SAP SD stores a sales document as VBAK (header) → VBAP (item) → VBEP (schedule line); replicating that hierarchy 1:1 keeps the staging layer lossless and lets it be reconciled directly against the source tables.

  • Document flow split into order, delivery and billing

    SAP posts the order-to-cash chain as separate documents (VBAK → LIKP → VBRK) linked by reference fields (vgbel/aubel); modeling each as its own header/item pair preserves the document-flow lineage VBFA expresses.

  • Pricing conditions kept separate from the item

    SAP holds condition records in KONV/PRCD_ELEMENTS keyed by document condition number (knumv); a dedicated table avoids exploding the item row and supports multiple condition types (PR00, K004, MWST) per item.

  • Check tables modeled as lookups

    Document type (TVAK), sales org and the customer master (KNA1) 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 SD Sales 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 (9)

sales_doc_header

Grain: one row per sales document header (vbeln)

SAP VBAK — sales document header.

ColumnTypeKeys
sales_doc_header_keybigintPK
sales_doc_type_keybigint
sales_org_keybigint
sold_to_customer_keybigint
vbelnvarcharBK
auartvarchar
vkorgvarchar
vtwegvarchar
spartvarchar
kunnrvarchar
erdatdate
ernamvarcharPII
audatdate
netwrdecimal
waersvarchar
vbtypvarchar

sales_doc_item

Grain: one row per sales document item (vbeln, posnr)

SAP VBAP — sales document item.

ColumnTypeKeys
sales_doc_item_keybigintPK
sales_doc_header_keybigint
vbelnvarcharBK
posnrvarcharBK
matnrvarchar
arktxvarchar
werksvarchar
kwmengdecimal
meinsvarchar
netwrdecimal
netprdecimal
waersvarchar
mwsbpdecimal
abgruvarchar

schedule_line

Grain: one row per schedule line (vbeln, posnr, etenr)

SAP VBEP — sales document schedule line.

ColumnTypeKeys
schedule_line_keybigintPK
sales_doc_item_keybigint
vbelnvarcharBK
posnrvarcharBK
etenrvarcharBK
edatudate
wmengdecimal
bmengdecimal
meinsvarchar
ettypvarchar

partner

Grain: one row per partner function on a sales document (vbeln, posnr, parvw)

SAP VBPA — sales document partner.

ColumnTypeKeys
partner_keybigintPK
sales_doc_header_keybigint
partner_customer_keybigint
vbelnvarcharBK
posnrvarcharBK
parvwvarcharBK
kunnrvarchar
adrnrvarchar
name1varcharPII

delivery_header

Grain: one row per outbound delivery header (vbeln_li)

SAP LIKP — delivery header.

ColumnTypeKeys
delivery_header_keybigintPK
sales_org_keybigint
ship_to_customer_keybigint
vbeln_livarcharBK
lfartvarchar
vstelvarchar
kunnrvarchar
lfdatdate
wadatdate
wadat_istdate
erdatdate
btgewdecimal
geweivarchar

delivery_item

Grain: one row per delivery item (vbeln_li, posnr)

SAP LIPS — delivery item.

ColumnTypeKeys
delivery_item_keybigintPK
delivery_header_keybigint
source_sales_item_keybigint
vbeln_livarcharBK
posnrvarcharBK
matnrvarchar
werksvarchar
lgortvarchar
lfimgdecimal
meinsvarchar
vgbelvarchar
vgposvarchar

billing_header

Grain: one row per billing document header (vbeln_bi)

SAP VBRK — billing document header.

ColumnTypeKeys
billing_header_keybigintPK
sales_org_keybigint
payer_customer_keybigint
vbeln_bivarcharBK
fkartvarchar
fkdatdate
kunrgvarchar
netwrdecimal
mwsbkdecimal
waerkvarchar
fkstoboolean
erdatdate

billing_item

Grain: one row per billing document item (vbeln_bi, posnr)

SAP VBRP — billing document item.

ColumnTypeKeys
billing_item_keybigintPK
billing_header_keybigint
source_delivery_item_keybigint
vbeln_bivarcharBK
posnrvarcharBK
matnrvarchar
fkimgdecimal
vrkmevarchar
netwrdecimal
mwsbpdecimal
aubelvarchar
auposvarchar

pricing_condition

Grain: one row per pricing condition record (knumv, kposn, stunr)

SAP KONV / PRCD_ELEMENTS — conditions (transaction data).

ColumnTypeKeys
pricing_condition_keybigintPK
sales_doc_item_keybigint
knumvvarcharBK
kposnvarcharBK
stunrvarcharBK
kschlvarchar
kbetrdecimal
kwertdecimal
waersvarchar
kstbsdecimal

Lookup tables (3)

sales_doc_type

Grain: one row per sales document type

SAP TVAK / TVAKT — sales document type check table.

ColumnTypeKeys
sales_doc_type_keybigintPK
auartvarcharBK
vtextvarchar
doc_categoryvarchar

sales_org

Grain: one row per sales organization

SAP TVKO / TVKOT — sales organization check table.

ColumnTypeKeys
sales_org_keybigintPK
vkorgvarcharBK
vtextvarchar
waersvarchar
bukrsvarchar

customer

Grain: one row per customer master general record

SAP KNA1 — customer master (general data), referenced as a lookup here.

ColumnTypeKeys
customer_keybigintPK
kunnrvarcharBK
name1varcharPII
land1varchar
ort01varcharPII
pstlzvarcharPII
stcd1varcharPII
ktokdvarchar

Relationships

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

  • sales_doc_header.sales_doc_type_key → sales_doc_type (many-to-one)
  • sales_doc_header.sales_org_key → sales_org (many-to-one)
  • sales_doc_header.sold_to_customer_key → customer (many-to-one)
  • sales_doc_item.sales_doc_header_key → sales_doc_header (many-to-one)
  • schedule_line.sales_doc_item_key → sales_doc_item (many-to-one)
  • partner.sales_doc_header_key → sales_doc_header (many-to-one)
  • partner.partner_customer_key → customer (many-to-one)
  • delivery_header.sales_org_key → sales_org (many-to-one)
  • delivery_header.ship_to_customer_key → customer (many-to-one)
  • delivery_item.delivery_header_key → delivery_header (many-to-one)
  • delivery_item.source_sales_item_key → sales_doc_item (many-to-one)
  • billing_header.sales_org_key → sales_org (many-to-one)
  • billing_header.payer_customer_key → customer (many-to-one)
  • billing_item.billing_header_key → billing_header (many-to-one)
  • billing_item.source_delivery_item_key → delivery_item (many-to-one)
  • pricing_condition.sales_doc_item_key → sales_doc_item (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