How do you analyze SAP ERP data in Metabase?
SAP analytics turns finance operations into shared, queryable models. SAP S/4HANA and SAP BTP expose finance and operational business objects through released APIs, OData services, CDS views, and integration services. Metabase should query a governed database layer built from those released interfaces, not an unrestricted production ERP schema. Metabase connects to the database that holds the synced data; it does not connect natively to SAP.
How do you connect SAP to Metabase?
Explore a scoped snapshot quickly
The community SAP OData to MCP Server for BTP discovers S/4HANA or ECC OData services through BTP destinations. Deploy it in your own BTP environment, disable write operations, and expose only released read APIs. Pair the approved server with the Metabase CLI to load a focused CSV as a table and model.
- Quick questions about SAP data
- Validating fields and dashboard ideas before building a pipeline
- Loading a minimal, permissioned snapshot into Metabase
- A CSV is a point-in-time snapshot, not governed reporting
- Finance data needs least-privilege credentials and an explicit tool allowlist
- Move recurring dashboards to the warehouse-backed route
Durable dashboards with history
Use released SAP OData APIs, CDS extraction, SAP Datasphere, BTP integration services, or an approved connector to land finance objects in a database. Preserve company code, ledger, fiscal period, controlling dimensions, currency, and document status.
- Recurring finance and leadership dashboards
- Historical aging, lifecycle, and period reporting
- Joining finance data with sales, product, and operations data
- Requires a destination database and maintained sync
- You own currency, status, accounting period, and reconciliation definitions
- Every modeled total should reconcile to the source system
What can you analyze from SAP?
- P&L, balance sheet, and trial balance by ledger and company code
- AR and AP aging
- Procure-to-pay and vendor spend
- Cash position and liquidity
- Budget, plan, and actual by cost center or profit center
Which SAP dashboards should you build in Metabase?
Finance overview
A compact view of cash, exposure, and operating performance.
- Cash and liquidity
- Revenue, margin, and operating expense
- AR and AP aging
- Plan vs. actual
Operations
The work that needs attention before the next close.
- Blocked invoices
- Overdue receivables
- Purchase-order commitments
- Close task and posting status
Controls and reconciliation
Find exceptions before they become close surprises.
- Unbalanced or reversed documents
- Intercompany exceptions
- Three-way match exceptions
- Reconciliation status
Planning and trends
Compare actuals with the plan and explain the variance.
- Cost-center variance
- Working-capital trend
- Liquidity forecast
- Margin by product or segment
How do you use SAP MCP with the Metabase CLI?
The SAP OData MCP gateway is a communityMCP option for AI-assisted exploration. The community SAP OData to MCP Server for BTP discovers S/4HANA or ECC OData services through BTP destinations. Deploy it in your own BTP environment, disable write operations, and expose only released read APIs. The Metabase CLI can then upload a sanitized CSV and create a ready-to-query table and model.
- Start with a narrow read-only question and the minimum required objects.
- Remove secrets, bank details, and personal fields before exporting.
- Use
mb upload csvfor a first snapshot andmb upload replacefor a controlled refresh. - Move to an API or connector sync when the dashboard becomes recurring.
How do you set up SAP MCP and the Metabase CLI?
SAP OData MCP gatewaycommunity
- Data source
- SAP API
- Auth
- SAP communication arrangement or technical user with released read APIs
- Access
- Read-only, least privilege
- Use for
- Exploration and scoped exports
Metabase CLIofficial
- Install
npm install -g @metabase/cli- Auth
mb auth login- Load data
mb upload csv --file data.csv- Requires
- An uploads database in Metabase
{
"mcpServers": {
"sap": {
"type": "http",
"url": "https://<your-btp-app-route>/mcp"
}
}
}# Install the Metabase CLI
npm install -g @metabase/cli
# Log in (opens your browser; requires Metabase v62+)
mb auth login --url https://your-metabase.example.com
# Load a scoped SAP export - creates a table and a model
mb upload csv --file sap-export.csv --collection "Finance & Accounting"
# Refresh the same table later
mb upload replace <table-id> --file sap-export.csvCan you generate a SAP finance dashboard with AI?
Yes. Use the prompt below with an assistant that can access an approved data route and the Metabase CLI. It tells the assistant to inspect the real schema, reconcile totals, and skip cards that the available data cannot support.
Create a polished Metabase dashboard for SAP finance analytics.
Work end to end: find existing modeled data first; if none exists, load a minimal
read-only snapshot or describe the warehouse sync required.
Goal: Connect SAP S/4HANA or SAP BTP data to Metabase for general-ledger, working-capital, spend, cash, budget, and operational finance dashboards.
Inspect before querying:
- Inspect actual tables, column names, currencies, status values, and timestamps.
- Do not assume the source schema matches this guide exactly.
- Reconcile source totals before publishing any finance KPI.
Important:
- Do not claim Metabase connects natively to SAP; it reads a
supported database or CLI-uploaded tables.
- Keep native amount, native currency, and reporting-currency amount separate.
- Distinguish authorization, posting, payment, settlement, and reconciliation
states where the source exposes them.
- Use stable business keys and apply updates/deletes during incremental syncs.
- Exclude account numbers, personal data, and secrets from broad dashboards.
- Only build cards whose required fields and history are actually present.
Dashboard sections:
1. Finance overview: Cash and liquidity; Revenue, margin, and operating expense; AR and AP aging; Plan vs. actual.
2. Operations: Blocked invoices; Overdue receivables; Purchase-order commitments; Close task and posting status.
3. Controls and reconciliation: Unbalanced or reversed documents; Intercompany exceptions; Three-way match exceptions; Reconciliation status.
4. Planning and trends: Cost-center variance; Working-capital trend; Liquidity forecast; Margin by product or segment.
Suggested models: modeled_sap_gl, modeled_sap_open_items, modeled_sap_vendor_spend, modeled_sap_plan_actuals.
Output: Build the dashboard if you have permission; otherwise provide the exact
questions, SQL, model definitions, and layout. State refresh time, reporting
currency, accounting basis, and any reconciliation caveats.How do you sync SAP into a database or warehouse?
Use released SAP OData APIs, CDS extraction, SAP Datasphere, BTP integration services, or an approved connector to land finance objects in a database. Preserve company code, ledger, fiscal period, controlling dimensions, currency, and document status.
SAP API or data service
Start from SAP's official interface and authentication documentation. Extract only the finance objects required by the models below.
dlt SAP HANA replication route
Use dlt's SQL source for governed HANA views or adapt its REST source for released SAP APIs.
Implementation checklist
- Create a dedicated read-only integration identity and document its scopes.
- Land raw records with source IDs, source timestamps, extraction time, and currency fields intact.
- Apply updates and deletes idempotently; keep lifecycle history when aging or process metrics depend on it.
- Reconcile modeled totals to SAP for a closed period before exposing the models broadly.
- Connect Metabase to the destination database and schedule model refreshes.
Source documentation
What data model should you use?
| Entity | Grain | Use |
|---|---|---|
journal_entries | one row per accounting document line | ledger and financial statements |
business_partners | one row per customer or supplier | AR, AP, and concentration |
operational_documents | one row per invoice, order, or delivery line | process and reconciliation |
plans_actuals | one row per period-account-controlling dimension | variance analysis |
Build reusable models such as modeled_sap_gl, modeled_sap_open_items, modeled_sap_vendor_spend, modeled_sap_plan_actuals.
Which finance metrics are useful?
- Cash balance and runway
- Accounts receivable aging
- Days sales outstanding
- Gross margin
- Budget variance
- FX exposure
Practical SQL patterns
SELECT
fiscal_year,
fiscal_period,
cost_center,
SUM(company_code_currency_amount) AS operating_expense
FROM modeled_sap_gl
WHERE account_type = 'EXPENSE'
AND ledger = '0L'
GROUP BY 1, 2, 3
ORDER BY 1, 2, 4 DESC;Keep company code and document currency explicit before consolidation.
SELECT
company_code,
document_currency,
CASE
WHEN CURRENT_DATE <= due_date THEN 'Current'
WHEN CURRENT_DATE - due_date <= 30 THEN '1-30 days'
WHEN CURRENT_DATE - due_date <= 60 THEN '31-60 days'
ELSE '61+ days'
END AS aging_bucket,
SUM(open_amount) AS open_amount
FROM modeled_sap_open_ar
WHERE clearing_document IS NULL
GROUP BY 1, 2, 3
ORDER BY 1, 2, 3;