offdataai
SAP · data model template

SAP Inventory Analytics data model

Kimball warehouse for SAP inventory: transaction-grain material movements with material-document numbers (mblnr) as degenerate dimensions, a daily stock periodic snapshot combining MARD quantities and MBEW valuation (standard/moving-average price), and a periodic slow-moving fact with turns and obsolescence provisioning. Conformed MM-IM dimensions; SAP fiscal year/period drives period reporting.

SAP Materials Management inventory (MM-IM) analytics migrated from ECC / S/4HANA into Snowflake. Covers transaction-grain material movements (MSEG/MKPF, all movement types), a daily stock snapshot built from MARD quantities and MBEW valuation, and a slow-moving / obsolescence analysis over conformed material (MARA/MAKT, SCD2), plant (T001W), storage location (T001L), movement type, and batch 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.

KimballSAPSOXIFRSGAAP
10
tables
100
columns
15
relationships
0
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

inventory_movementsstock_positioninventory_healthconformed_dimensions

Design decisions

  • Transaction-grain movement fact at material-document line level

    SAP MM-IM records every stock change as an MSEG line under an MKPF header; declaring the fact at that atomic grain captures all movement types (101/201/261/601) and supports drill-across to any inventory rollup.

  • Daily stock periodic snapshot combining MARD and MBEW

    On-hand position (MARD quantities) and valuation (MBEW standard / moving-average price) are semi-additive balances needed daily for availability and balance-sheet inventory reporting independent of movement volume.

  • Separate slow-moving / obsolescence fact

    Inventory health (days since last movement, turns, obsolescence provision) is a derived periodic accumulation used for IFRS/GAAP write-down decisions and is kept separate from raw movements and the daily position snapshot.

  • SCD2 on the material master

    MARA/MARC/MBEW attributes (ABC indicator, MRP type, valuation class, price control) change over time; type-2 history preserves the as-was classification required for comparable inventory and valuation trend analysis.

Tables in the SAP Inventory 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 (3)

fct_material_movement

Grain: one row per material-document movement line (MSEG/MKPF)

Transaction-grain inventory movement fact — every stock change.

ColumnTypeKeys
material_movement_keybigintPK
date_keybigint
fiscal_period_keybigint
material_keybigint
plant_keybigint
storage_location_keybigint
movement_type_keybigint
batch_keybigint
material_documentvarchar
material_doc_itemvarchar
reference_documentvarchar
movement_quantitydecimal
entry_unitvarchar
movement_valuedecimal
currencyvarchar
is_goods_receiptboolean
is_goods_issueboolean

fct_stock_snapshot

Grain: one row per material per storage location per day (periodic snapshot, from MARD/MBEW)

Daily stock periodic snapshot — quantities and valuation, semi-additive.

ColumnTypeKeys
date_keybigint
fiscal_period_keybigint
material_keybigint
plant_keybigint
storage_location_keybigint
unrestricted_stock_qtydecimal
quality_inspection_qtydecimal
blocked_stock_qtydecimal
in_transit_qtydecimal
base_unit_of_measurevarchar
standard_pricedecimal
moving_average_pricedecimal
total_stock_valuedecimal
currencyvarchar

fct_slow_moving

Grain: one row per material per plant per fiscal period (slow-moving / obsolescence analysis)

Periodic accumulation supporting slow-moving and obsolete-stock reporting.

ColumnTypeKeys
fiscal_period_keybigint
material_keybigint
plant_keybigint
last_movement_date_keybigint
on_hand_quantitydecimal
on_hand_valuedecimal
days_since_last_movementinteger
days_supply_remaininginteger
annual_consumption_qtydecimal
turns_ratiodecimal
slow_moving_categoryvarchar
obsolescence_provisiondecimal

Dimension tables (6)

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
divisionvarchar
mrp_typevarchar
abc_indicatorvarchar
valuation_classvarchar
price_controlvarchar
is_batch_managedboolean
is_activeboolean

dim_plant

Grain: one row per plant

ColumnTypeKeys
plant_keybigintPK
plantvarcharBK
plant_namevarchar
cityvarchar
countryvarchar
company_codevarchar
valuation_areavarchar

dim_storage_location

Grain: one row per storage location

ColumnTypeKeys
storage_location_keybigintPK
storage_locationvarcharBK
storage_location_namevarchar
plantvarchar
is_warehouse_managedboolean

dim_batch

Grain: one row per material batch (MCHA / MCH1)

ColumnTypeKeys
batch_keybigintPK
batch_numbervarcharBK
material_numbervarchar
plantvarchar
date_of_manufacturedate
shelf_life_expiry_datedate
batch_statusvarchar
vendor_batchvarchar

Lookup tables (1)

dim_movement_type

Grain: one row per SAP inventory movement type

ColumnTypeKeys
movement_type_keybigintPK
movement_typevarcharBK
movement_type_namevarchar
debit_credit_indicatorvarchar
movement_categoryvarchar
is_reversalboolean

Relationships

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

  • fct_material_movement.date_key → dim_date (many-to-one)
  • fct_material_movement.fiscal_period_key → dim_fiscal_period (many-to-one)
  • fct_material_movement.material_key → dim_material (many-to-one)
  • fct_material_movement.plant_key → dim_plant (many-to-one)
  • fct_material_movement.storage_location_key → dim_storage_location (many-to-one)
  • fct_material_movement.movement_type_key → dim_movement_type (many-to-one)
  • fct_material_movement.batch_key → dim_batch (many-to-one)
  • fct_stock_snapshot.date_key → dim_date (many-to-one)
  • fct_stock_snapshot.fiscal_period_key → dim_fiscal_period (many-to-one)
  • fct_stock_snapshot.material_key → dim_material (many-to-one)
  • fct_stock_snapshot.plant_key → dim_plant (many-to-one)
  • fct_stock_snapshot.storage_location_key → dim_storage_location (many-to-one)
  • fct_slow_moving.fiscal_period_key → dim_fiscal_period (many-to-one)
  • fct_slow_moving.material_key → dim_material (many-to-one)
  • fct_slow_moving.plant_key → dim_plant (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