offdataai
SAP · data model template

SAP Record-to-Report (GL) Analytics data model

Kimball warehouse for SAP R2R: transaction-grain GL line items with document numbers (belnr) as degenerate dimensions and multi-currency amounts (local/document/group), plus a monthly trial-balance periodic snapshot. Conformed FI/CO dimensions with SCD2 chart of accounts, cost center, and profit center; SAP fiscal year/period (gjahr/poper) including special closing periods drives period reporting.

SAP FI/CO record-to-report analytics migrated from ECC / S/4HANA into Snowflake. Covers GL line-item postings at document-line grain (classic BKPF/BSEG or the S/4HANA ACDOCA universal journal) and a monthly trial-balance snapshot over conformed GL account (SKA1/SKB1, SCD2), company code (T001), cost center (CSKS), profit center (CEPC), document type, and currency dimensions, with SAP fiscal-period accounting for statement and segment reporting. 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
104
columns
14
relationships
2
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

general_ledgertrial_balanceconformed_dimensions

Design decisions

  • Document-line grain aligned to ACDOCA / BSEG

    The atomic event of the SAP ledger is a single document line (one GL account, one debit or credit); the S/4HANA ACDOCA universal journal already stores at this grain, so declaring the fact there supports drill-across to any FI/CO rollup.

  • Multi-currency amounts on every fact line

    SAP carries amounts in document, local (company-code), and group currencies (wsl/hsl/ksl); retaining all three plus the exchange rate supports consolidation and statutory reporting under IFRS/GAAP without re-deriving FX.

  • Separate monthly trial-balance periodic snapshot

    Balances are semi-additive (sum across accounts, not periods); a periodic snapshot at account/company-code/period grain gives fast financial-statement reporting independent of journal volume and ties to SAP period-end close.

  • SCD2 on chart of accounts, cost center, and profit center

    Reorganizations and restatements change FI/CO master attributes (account group, FSV node, profit-center segment) over time; type-2 history preserves the as-was mapping required for comparable, SOX-auditable period reporting.

Tables in the SAP Record-to-Report (GL) 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_gl_line_item

Grain: one row per GL accounting document line (BKPF/BSEG or S/4 ACDOCA universal journal)

Transaction-grain ledger fact — one line of a posted GL document.

ColumnTypeKeys
gl_line_item_keybigintPK
date_keybigint
fiscal_period_keybigint
gl_account_keybigint
company_code_keybigint
cost_center_keybigint
profit_center_keybigint
document_type_keybigint
currency_keybigint
document_date_keybigint
entry_date_keybigint
accounting_documentvarchar
document_linevarchar
reference_documentvarchar
posting_keyvarchar
debit_credit_indicatorvarchar
amount_localdecimal
amount_documentdecimal
amount_groupdecimal
debit_amountdecimal
credit_amountdecimal
exchange_ratedecimal
is_reversalboolean
is_open_itemboolean

fct_trial_balance_snapshot

Grain: one row per GL account per company code per fiscal period (monthly periodic snapshot)

Monthly periodic snapshot — balances semi-additive across periods.

ColumnTypeKeys
fiscal_period_keybigint
gl_account_keybigint
company_code_keybigint
cost_center_keybigint
profit_center_keybigint
currency_keybigint
opening_balancedecimal
period_debitsdecimal
period_creditsdecimal
net_movementdecimal
closing_balancedecimal
closing_balance_groupdecimal
is_adjustedboolean

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_gl_account

Grain: one row per GL account per SCD2 version

SCD type 2

ColumnTypeKeys
gl_account_keybigintPK
gl_account_numbervarcharBK
gl_account_namevarchar
chart_of_accountsvarchar
account_groupvarchar
account_typevarchar
pl_statement_account_typevarchar
balance_sheet_indicatorboolean
normal_balancevarchar
financial_statement_versionvarchar
is_reconciliation_accountboolean
is_open_item_managedboolean
is_activeboolean

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
controlling_areavarchar

dim_cost_center

Grain: one row per cost center per SCD2 version

SCD type 2

ColumnTypeKeys
cost_center_keybigintPK
cost_centervarcharBK
cost_center_namevarchar
controlling_areavarchar
cost_center_categoryvarchar
company_codevarchar
profit_centervarchar
responsible_managervarcharPII
hierarchy_nodevarchar
is_activeboolean

dim_profit_center

Grain: one row per profit center per SCD2 version

SCD type 2

ColumnTypeKeys
profit_center_keybigintPK
profit_centervarcharBK
profit_center_namevarchar
controlling_areavarchar
segmentvarchar
responsible_managervarcharPII
hierarchy_nodevarchar
is_activeboolean

Lookup tables (2)

dim_document_type

Grain: one row per SAP FI document type

ColumnTypeKeys
document_type_keybigintPK
document_typevarcharBK
document_type_namevarchar
number_rangevarchar
reverse_document_typevarchar
is_net_documentboolean

dim_currency

Grain: one row per ISO / SAP currency

ColumnTypeKeys
currency_keybigintPK
currency_codevarcharBK
currency_namevarchar
decimal_placessmallint

Relationships

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

  • fct_gl_line_item.date_key → dim_date (many-to-one)
  • fct_gl_line_item.fiscal_period_key → dim_fiscal_period (many-to-one)
  • fct_gl_line_item.gl_account_key → dim_gl_account (many-to-one)
  • fct_gl_line_item.company_code_key → dim_company_code (many-to-one)
  • fct_gl_line_item.cost_center_key → dim_cost_center (many-to-one)
  • fct_gl_line_item.profit_center_key → dim_profit_center (many-to-one)
  • fct_gl_line_item.document_type_key → dim_document_type (many-to-one)
  • fct_gl_line_item.currency_key → dim_currency (many-to-one)
  • fct_trial_balance_snapshot.fiscal_period_key → dim_fiscal_period (many-to-one)
  • fct_trial_balance_snapshot.gl_account_key → dim_gl_account (many-to-one)
  • fct_trial_balance_snapshot.company_code_key → dim_company_code (many-to-one)
  • fct_trial_balance_snapshot.cost_center_key → dim_cost_center (many-to-one)
  • fct_trial_balance_snapshot.profit_center_key → dim_profit_center (many-to-one)
  • fct_trial_balance_snapshot.currency_key → dim_currency (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