Guide - Integrations

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.

TL;DR - Use the MCP + CLI route for a scoped, short-lived analysis. Use the official API or approved connector route for recurring dashboards, history, permissions, and reconciliation.

How do you connect SAP to Metabase?

1 - MCP + CLI route (AI-assisted)

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.

Best for
  • Quick questions about SAP data
  • Validating fields and dashboard ideas before building a pipeline
  • Loading a minimal, permissioned snapshot into Metabase
Trade-offs
  • 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
2 - Pipeline route (warehouse-backed)

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.

Best for
  • Recurring finance and leadership dashboards
  • Historical aging, lifecycle, and period reporting
  • Joining finance data with sales, product, and operations data
Trade-offs
  • 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?

For: Finance leaders

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
For: Finance operations

Operations

The work that needs attention before the next close.

  • Blocked invoices
  • Overdue receivables
  • Purchase-order commitments
  • Close task and posting status
For: Controllers

Controls and reconciliation

Find exceptions before they become close surprises.

  • Unbalanced or reversed documents
  • Intercompany exceptions
  • Three-way match exceptions
  • Reconciliation status
For: FP&A

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 csv for a first snapshot and mb upload replace for 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
MCP clientExample MCP configuration - verify before use
{
  "mcpServers": {
    "sap": {
      "type": "http",
      "url": "https://<your-btp-app-route>/mcp"
    }
  }
}
TerminalLoad a SAP CSV with the Metabase CLI
# 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.csv
Verify before connecting: check the current SAP OData MCP gateway documentation, review every MCP tool, and enable an uploads database under Admin > Settings > Uploads. This is a third-party server: review its source, pin its version, and restrict it to the minimum read tools and credentials.

Can 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.

Prompt for a SAP finance dashboard
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

  1. Create a dedicated read-only integration identity and document its scopes.
  2. Land raw records with source IDs, source timestamps, extraction time, and currency fields intact.
  3. Apply updates and deletes idempotently; keep lifecycle history when aging or process metrics depend on it.
  4. Reconcile modeled totals to SAP for a closed period before exposing the models broadly.
  5. Connect Metabase to the destination database and schedule model refreshes.

Source documentation

What data model should you use?

EntityGrainUse
journal_entriesone row per accounting document lineledger and financial statements
business_partnersone row per customer or supplierAR, AP, and concentration
operational_documentsone row per invoice, order, or delivery lineprocess and reconciliation
plans_actualsone row per period-account-controlling dimensionvariance 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?

Practical SQL patterns

Operating expense by cost centerPostgreSQL
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;
Open receivables by company codePostgreSQL

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;

Common mistakes

Querying unreleased SAP tables directly.→ Use released APIs, CDS views, or a governed replication layer with an owner.
Mixing ledgers, company codes, and currencies.→ Make these dimensions explicit and define consolidation rules before aggregation.
Ignoring document reversals and open-item status.→ Model lifecycle and clearing references so statements and aging reconcile.

Dashboards

Integrations

Analytics

FAQ

Can Metabase connect directly to SAP OData?
Metabase connects to databases, not generic OData services. Extract released SAP APIs into a supported database or query a governed SAP data platform through a supported driver.
Which SAP API should I use?
Choose the released API or CDS view for your S/4HANA edition and business object in SAP Business Accelerator Hub; availability varies by deployment.
Does Metabase connect natively to SAP?
No. Metabase reads supported databases and uploaded tables. Sync SAP data into a database or load a scoped CSV snapshot first.