offdataai
SAP · data model template

SAP Order-to-Cash Analytics data model

Kimball warehouse for SAP O2C: transaction-grain sales order lines, delivery items, and billing lines with SAP document numbers (vbeln) as degenerate dimensions, plus a daily open-order periodic snapshot, over conformed SD dimensions. Customer tax IDs and PII are classified and masked; SAP fiscal year/period (gjahr/poper) drives period reporting.

SAP Sales & Distribution (SD) order-to-cash analytics migrated from ECC / S/4HANA into Snowflake. Covers the sales order (VBAK/VBAP), outbound delivery (LIKP/LIPS), and billing (VBRK/VBRP) processes plus a daily open-order backlog snapshot, over conformed material (MARA/MAKT), customer (KNA1/KNVV, SCD2), sales organization, company code, and shipping-point dimensions with SAP fiscal-period accounting. It is a Kimball dimensional model: fact tables at a declared grain surrounded by conformed dimensions, ready for BI tools and a semantic layer.

KimballSAPSOXGDPRIFRS
12
tables
139
columns
25
relationships
4
PII columns

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

Subject areas

order_managementfulfilmentbillingconformed_dimensions

Design decisions

  • Three transaction-grain facts mirroring the SD document flow

    SAP SD's order (VBAK/VBAP) → delivery (LIKP/LIPS) → billing (VBRK/VBRP) document chain is best modelled as three conformed transaction-grain facts so backlog, fulfilment, and revenue can each drill to atomic line detail and drill-across via shared dimensions.

  • SAP document numbers as degenerate dimensions

    vbeln/posnr identify the operational document but carry no attributes of their own, so per Kimball they live as non-null varchar degenerate dimensions on the fact rather than as standalone dimension tables.

  • Daily open-order periodic snapshot

    Open backlog (ordered minus delivered) is semi-additive and needed daily for demand and revenue forecasting independent of order volume, so a periodic snapshot supplements the transaction facts.

  • SCD2 on material and customer master data

    MARA material group / product hierarchy and KNA1/KNVV customer group and sales-area assignments change over time; type-2 history preserves the as-was master attributes required for comparable trend analysis.

Tables in the SAP Order-to-Cash Analytics 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.

Fact tables (4)

fct_sales_order_line

Grain: one row per sales order schedule line (VBAK/VBAP)

Transaction-grain SD fact at order schedule-line level.

ColumnTypeKeys
sales_order_line_keybigintPK
date_keybigint
fiscal_period_keybigint
material_keybigint
customer_keybigint
sales_org_keybigint
company_code_keybigint
sales_doc_type_keybigint
requested_delivery_date_keybigint
sales_documentvarchar
sales_itemvarchar
schedule_linevarchar
order_quantitydecimal
sales_unitvarchar
net_valuedecimal
net_pricedecimal
tax_amountdecimal
document_currencyvarchar
confirmed_quantitydecimal
rejection_reasonvarchar
is_rejectedboolean

fct_delivery_item

Grain: one row per outbound delivery item (LIKP/LIPS)

Transaction-grain delivery fact — fulfilment leg of O2C.

ColumnTypeKeys
delivery_item_keybigintPK
date_keybigint
fiscal_period_keybigint
material_keybigint
customer_keybigint
sales_org_keybigint
shipping_point_keybigint
goods_issue_date_keybigint
delivery_documentvarchar
delivery_itemvarchar
reference_sales_documentvarchar
delivery_quantitydecimal
sales_unitvarchar
net_weightdecimal
weight_unitvarchar
picked_quantitydecimal
is_goods_issuedboolean

fct_billing_line

Grain: one row per billing document item (VBRK/VBRP)

Transaction-grain billing fact — invoiced revenue leg of O2C.

ColumnTypeKeys
billing_line_keybigintPK
date_keybigint
fiscal_period_keybigint
material_keybigint
customer_keybigint
sales_org_keybigint
company_code_keybigint
sales_doc_type_keybigint
billing_documentvarchar
billing_itemvarchar
reference_deliveryvarchar
billed_quantitydecimal
sales_unitvarchar
net_valuedecimal
cost_valuedecimal
tax_amountdecimal
gross_valuedecimal
document_currencyvarchar
is_cancelledboolean

fct_open_order_snapshot

Grain: one row per open sales order line per day (periodic snapshot)

Daily periodic snapshot of open order backlog — semi-additive.

ColumnTypeKeys
date_keybigint
fiscal_period_keybigint
material_keybigint
customer_keybigint
sales_org_keybigint
sales_documentvarchar
sales_itemvarchar
open_quantitydecimal
open_valuedecimal
days_openinteger
is_overdueboolean

Dimension tables (7)

dim_date

Grain: one row per calendar day

ColumnTypeKeys
date_keybigintPK
full_datedateBK
day_of_monthsmallint
month_numbersmallint
month_namevarchar
quartersmallint
yearsmallint
is_business_dayboolean
is_period_endboolean

dim_fiscal_period

Grain: one row per SAP fiscal year/period (gjahr/monat)

ColumnTypeKeys
fiscal_period_keybigintPK
fiscal_period_codevarcharBK
fiscal_yearsmallint
fiscal_periodsmallint
fiscal_variantvarchar
period_start_datedate
period_end_datedate
is_special_periodboolean
period_statusvarchar

dim_material

Grain: one row per material per SCD2 version

SCD type 2

ColumnTypeKeys
material_keybigintPK
material_numbervarcharBK
material_descriptionvarchar
material_typevarchar
material_groupvarchar
base_unit_of_measurevarchar
product_hierarchyvarchar
divisionvarchar
gross_weightdecimal
weight_unitvarchar
is_activeboolean

dim_customer

Grain: one row per customer per SCD2 version

SCD type 2

ColumnTypeKeys
customer_keybigintPK
customer_numbervarcharBK
customer_namevarcharPII
search_termvarchar
street_addressvarcharPII
cityvarchar
regionvarchar
postal_codevarcharPII
countryvarchar
tax_numbervarcharPII
customer_groupvarchar
account_groupvarchar
payment_termsvarchar
credit_control_areavarchar
is_activeboolean

dim_sales_org

Grain: one row per sales organization / distribution channel / division

ColumnTypeKeys
sales_org_keybigintPK
sales_orgvarcharBK
sales_org_namevarchar
distribution_channelvarchar
distribution_channel_namevarchar
divisionvarchar
division_namevarchar
company_codevarchar
currencyvarchar

dim_company_code

Grain: one row per SAP company code

ColumnTypeKeys
company_code_keybigintPK
company_codevarcharBK
company_namevarchar
countryvarchar
local_currencyvarchar
chart_of_accountsvarchar
fiscal_year_variantvarchar

dim_shipping_point

Grain: one row per shipping point

ColumnTypeKeys
shipping_point_keybigintPK
shipping_pointvarcharBK
shipping_point_namevarchar
plantvarchar
countryvarchar
loading_time_dayssmallint

Lookup tables (1)

dim_sales_doc_type

Grain: one row per SAP sales document type

ColumnTypeKeys
sales_doc_type_keybigintPK
sales_doc_typevarcharBK
sales_doc_type_namevarchar
sd_document_categoryvarchar
is_returnsboolean

Relationships

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

  • fct_sales_order_line.date_key → dim_date (many-to-one)
  • fct_sales_order_line.fiscal_period_key → dim_fiscal_period (many-to-one)
  • fct_sales_order_line.material_key → dim_material (many-to-one)
  • fct_sales_order_line.customer_key → dim_customer (many-to-one)
  • fct_sales_order_line.sales_org_key → dim_sales_org (many-to-one)
  • fct_sales_order_line.company_code_key → dim_company_code (many-to-one)
  • fct_sales_order_line.sales_doc_type_key → dim_sales_doc_type (many-to-one)
  • fct_delivery_item.date_key → dim_date (many-to-one)
  • fct_delivery_item.fiscal_period_key → dim_fiscal_period (many-to-one)
  • fct_delivery_item.material_key → dim_material (many-to-one)
  • fct_delivery_item.customer_key → dim_customer (many-to-one)
  • fct_delivery_item.sales_org_key → dim_sales_org (many-to-one)
  • fct_delivery_item.shipping_point_key → dim_shipping_point (many-to-one)
  • fct_billing_line.date_key → dim_date (many-to-one)
  • fct_billing_line.fiscal_period_key → dim_fiscal_period (many-to-one)
  • fct_billing_line.material_key → dim_material (many-to-one)
  • fct_billing_line.customer_key → dim_customer (many-to-one)
  • fct_billing_line.sales_org_key → dim_sales_org (many-to-one)
  • fct_billing_line.company_code_key → dim_company_code (many-to-one)
  • fct_billing_line.sales_doc_type_key → dim_sales_doc_type (many-to-one)
  • fct_open_order_snapshot.date_key → dim_date (many-to-one)
  • fct_open_order_snapshot.fiscal_period_key → dim_fiscal_period (many-to-one)
  • fct_open_order_snapshot.material_key → dim_material (many-to-one)
  • fct_open_order_snapshot.customer_key → dim_customer (many-to-one)
  • fct_open_order_snapshot.sales_org_key → dim_sales_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