offdataai
SAP · data model template

SAP TM Transportation & Freight Analytics data model

Kimball warehouse for SAP TM transportation: a freight-order execution fact at FO stage/item grain (/SCMTMS/D_TORROT + /SCMTMS/D_TORITM) with four role-played date dimensions (planned/actual departure and arrival), role-played source and destination locations, and weight/volume/distance/transit measures for lane, mode and on-time analysis; plus a freight-settlement cost fact at FSD charge-item grain (/SCMTMS/D_TCHRGI) carrying base, fuel-surcharge, accessorial, tax, accrued and settled charge amounts over carrier (SCD2 scorecards), charge-type and freight-agreement dimensions for freight cost per kg/shipment, carrier scorecards and accessorial analysis.

SAP Transportation Management (TM) freight analytics migrated from S/4HANA into Snowflake. Models the SAP TM execution flow — a posted SD delivery creates a Freight Unit consolidated into a Freight Order (/SCMTMS/D_TORROT root + /SCMTMS/D_TORITM items), which drives a Freight Settlement Document whose charge items (/SCMTMS/D_TCHRGI) and elements (/SCMTMS/D_TCHRGE) are calculated from Freight Agreements. Two transaction-grain facts (freight-order execution and freight settlement) share conformed carrier (SCD2), location (role-played source/destination), transportation-mode, shipping-type, charge-type, freight-agreement, company-code, and date dimensions. It is a Kimball dimensional model: fact tables at a declared grain surrounded by conformed dimensions, ready for BI tools and a semantic layer.

KimballSAPSOXDOT-FMCSA
10
tables
103
columns
17
relationships
1
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

freight_executionfreight_settlementconformed_dimensions

Design decisions

  • Two transaction-grain facts at different grains (FO execution vs FSD cost)

    SAP TM separates physical execution from financial settlement: the Freight Order (/SCMTMS/D_TORROT) records the move while the Freight Settlement Document (FSD + /SCMTMS/D_TCHRGI) records the agreed cost. Modelling fct_freight_order at FO stage/item grain and fct_freight_settlement at FSD charge-item grain keeps each fact additive and avoids mixing operational (transit, on-time) with financial (charge) measures that have different grains.

  • Role-played source and destination location dimensions for lane analysis

    A freight order and each settled charge reference both an origin and a destination location (/SCMTMS/D_TORROT srclocid/deslocid). Modelling dim_location once and role-playing it via distinct source_location_key and dest_location_key foreign keys gives true origin-destination lane analytics (freight cost per lane) without duplicating the dimension.

  • SCD2 carrier dimension for carrier scorecards

    Carrier master attributes (rating tier, preferred status, primary mode, SCAC) change over time; type-2 history preserves the as-was carrier profile so on-time and cost scorecards compare each shipment against the carrier attributes that applied when it shipped.

  • Freight-agreement dimension on the settlement fact

    FSD charges are calculated from Freight Agreements (/SCMTMS/D_TCCMA) via charge elements (/SCMTMS/D_TCHRGE); carrying dim_freight_agreement (contract vs spot, rate basis, validity) lets analysts attribute cost to the agreement and rate basis used, and audit contracted-vs-spot freight spend.

  • Four role-played date dimensions capturing the FU→FO→FSD timeline

    On-time performance and transit analysis need planned vs actual departure and arrival as separate role-played date keys on the freight-order fact, while settlement posts on its own settlement date. Splitting these date roles supports delay-hours and on-time KPIs that follow the SD delivery → Freight Unit → Freight Order → Freight Settlement Document flow.

Tables in the SAP TM Transportation & Freight 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 (2)

fct_freight_order

Grain: one row per freight order stage/item (/SCMTMS/D_TORROT root + /SCMTMS/D_TORITM item)

Freight-order execution fact — lane/mode/on-time performance at FO stage/item grain.

ColumnTypeKeys
freight_order_keybigintPK
planned_departure_date_keybigint
actual_departure_date_keybigint
planned_arrival_date_keybigint
actual_arrival_date_keybigint
carrier_keybigint
source_location_keybigint
dest_location_keybigint
transportation_mode_keybigint
shipping_type_keybigint
company_code_keybigint
freight_order_idvarchar
freight_unit_idvarchar
shipment_idvarchar
gross_weightdecimal
net_weightdecimal
volumedecimal
distancedecimal
stop_countinteger
container_countinteger
planned_transit_hoursdecimal
actual_transit_hoursdecimal
delay_hoursdecimal
weight_unitvarchar
currencyvarchar
is_on_timeboolean
is_ltlboolean
is_exportboolean

fct_freight_settlement

Grain: one row per freight settlement document charge item (FSD + /SCMTMS/D_TCHRGI)

Freight-settlement cost fact — FSD charge items for carrier cost and accessorial analysis.

ColumnTypeKeys
freight_settlement_keybigintPK
settlement_date_keybigint
carrier_keybigint
charge_type_keybigint
source_location_keybigint
dest_location_keybigint
company_code_keybigint
freight_agreement_keybigint
fsd_idvarchar
freight_order_idvarchar
charge_amountdecimal
base_amountdecimal
fuel_surcharge_amountdecimal
accessorial_amountdecimal
tax_amountdecimal
accrued_amountdecimal
settled_amountdecimal
ratedecimal
billable_weightdecimal
currencyvarchar
is_accruedboolean
is_disputedboolean

Dimension tables (8)

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

dim_carrier

Grain: one row per carrier per SCD2 version (SAP TM business partner)

SCD type 2

ColumnTypeKeys
carrier_keybigintPK
carrier_idvarcharBK
carrier_namevarcharPII
scac_codevarchar
primary_modevarchar
countryvarchar
ratingvarchar
is_preferredboolean

dim_location

Grain: one row per transportation location (role-played as source and destination)

ColumnTypeKeys
location_keybigintPK
location_idvarcharBK
location_namevarchar
location_typevarchar
cityvarchar
regionvarchar
countryvarchar
zonevarchar
latitudedecimal
longitudedecimal

dim_transportation_mode

Grain: one row per transportation mode

ColumnTypeKeys
transportation_mode_keybigintPK
modevarcharBK
descriptionvarchar
categoryvarchar

dim_shipping_type

Grain: one row per shipping type

ColumnTypeKeys
shipping_type_keybigintPK
shipping_typevarcharBK
descriptionvarchar
ftl_ltlvarchar
is_parcelboolean

dim_charge_type

Grain: one row per freight charge type (SAP TM charge element)

ColumnTypeKeys
charge_type_keybigintPK
charge_typevarcharBK
descriptionvarchar
charge_categoryvarchar
is_accessorialboolean

dim_freight_agreement

Grain: one row per freight agreement (SAP TM forwarding/freight agreement)

ColumnTypeKeys
freight_agreement_keybigintPK
agreement_idvarcharBK
carriervarchar
agreement_typevarchar
rate_basisvarchar
valid_fromdate
valid_todate
currencyvarchar

dim_company_code

Grain: one row per SAP company code

ColumnTypeKeys
company_code_keybigintPK
company_codevarcharBK
company_namevarchar
countryvarchar
currencyvarchar

Relationships

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

  • fct_freight_order.planned_departure_date_key → dim_date (many-to-one)
  • fct_freight_order.actual_departure_date_key → dim_date (many-to-one)
  • fct_freight_order.planned_arrival_date_key → dim_date (many-to-one)
  • fct_freight_order.actual_arrival_date_key → dim_date (many-to-one)
  • fct_freight_order.carrier_key → dim_carrier (many-to-one)
  • fct_freight_order.source_location_key → dim_location (many-to-one)
  • fct_freight_order.dest_location_key → dim_location (many-to-one)
  • fct_freight_order.transportation_mode_key → dim_transportation_mode (many-to-one)
  • fct_freight_order.shipping_type_key → dim_shipping_type (many-to-one)
  • fct_freight_order.company_code_key → dim_company_code (many-to-one)
  • fct_freight_settlement.settlement_date_key → dim_date (many-to-one)
  • fct_freight_settlement.carrier_key → dim_carrier (many-to-one)
  • fct_freight_settlement.charge_type_key → dim_charge_type (many-to-one)
  • fct_freight_settlement.source_location_key → dim_location (many-to-one)
  • fct_freight_settlement.dest_location_key → dim_location (many-to-one)
  • fct_freight_settlement.company_code_key → dim_company_code (many-to-one)
  • fct_freight_settlement.freight_agreement_key → dim_freight_agreement (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