ClaudeSAP S/4HANA Agent view

How to use Claude with SAP S/4HANA

Short answer

Connect Claude to S/4HANA by exposing released OData services or BAPIs as MCP tools, then pointing Claude Desktop, Claude Code or your own app at that MCP server. Hosting can be the Anthropic API, AWS Bedrock or Google Vertex AI. For data that cannot leave the site, use an on-prem open-weight model behind the same tool layer.

Claude is popular with SAP teams for two different jobs. Developers use it to read and write ABAP, CDS views and RAP behavior definitions, and to explain legacy custom code before a conversion. Business users want it to answer questions about live orders, stock and purchasing, which needs a controlled path into the system.

The cleanest path for the second job is the Model Context Protocol. Instead of writing a bespoke integration per app, you build one MCP server that exposes a few well-described S/4HANA tools, and any MCP-capable client can use it. That includes Claude apps, Claude Code and agents you build with the API.

The remaining question is where the model runs. Anthropic's API, Bedrock and Vertex have different data handling, regional and contractual terms, and some S/4HANA customers cannot use any of them for certain data. This page covers each route in order.

What teams use it for

Custom code review before conversion

Developers feed Z-programs flagged by the ABAP Test Cockpit and custom code migration checks to Claude to summarize behavior and propose simplified replacements. Output is reviewed and tested in a sandbox.

Open order and stock questions through MCP

A planner asks Claude, connected to an MCP server, which components for tomorrow's production orders are short, and gets an answer built from live stock and reservation tools.

Drafting CDS views and Fiori elements apps

A developer asks Claude to draft a CDS view over released I_ views with annotations for a list report, then refines it in ADT.

Contract and specification reading

Procurement uploads a supply agreement and asks Claude to extract pricing tiers and delivery terms to compare against the PO conditions fetched by tools.

Month-end variance commentary

Finance exports cost center and universal journal (ACDOCA) summaries and asks Claude to draft variance commentary, which controllers edit.

SAP S/4HANA integration surface

  • Released OData services (V2 and V4) from api.sap.com for business objects; service names and versions depend on release and edition.
  • Released CDS views (I_ prefix) exposed through the Gateway for read-heavy questions, and ABAP RAP for custom services with proper authorization checks.
  • BAPIs and function modules over RFC for on-prem write paths, usually wrapped by a middleware or ABAP service instead of exposed directly.
  • Authentication: communication users and OAuth 2.0 in cloud editions; basic, X.509 or SAML-based options on-prem via the Gateway and Web Dispatcher.
  • Developer tooling: ABAP Development Tools in Eclipse and SAP Business Application Studio, where Claude assists with code but does not replace the transport and review process.

How it works

  1. 1

    Decide between developer use and live data use

    Code assistance needs only source text. Live data use needs a tool layer. Treat them as separate projects with different risk profiles.

  2. 2

    Build or adopt an MCP server

    Expose a handful of read-only tools first: get_sales_order, get_stock, get_po_status, get_bom. Write precise descriptions and typed parameters. Community SAP MCP servers exist, but review their code before pointing them at a production system.

  3. 3

    Connect Claude clients

    Claude Desktop or Claude Code can attach a local server over stdio. For shared use, host the server over HTTP behind SSO and register it with your organization's workspace according to current Anthropic documentation.

  4. 4

    Choose the model hosting route

    Anthropic API for the simplest path, AWS Bedrock or Google Vertex AI if your cloud contracts, regions and private networking already live there. Check retention and region settings for each.

  5. 5

    Scope SAP access per user

    Pass the user identity to the server and call SAP on that user's behalf where possible. If you use a technical user, limit plants, company codes and fields.

  6. 6

    Add prompts and evaluation

    Write a system prompt with your terminology (plant codes, order types, MRP controllers) and test it against a list of real questions with known answers.

Example flows

Component shortage check from Claude Desktop

Trigger: A planner asks which released production orders for tomorrow are short on components.

  1. Claude calls the production order tool for the plant and date.
  2. It calls the stock and reservation tools for each component.
  3. It compares requirement with available stock and open PO receipts.
  4. It answers with a short table and the likely cause for each shortage.

Result: The planner gets a shortage list without opening MD04 or CO24.

Custom code explanation before upgrade

Trigger: A developer opens a custom report flagged in the custom code migration app.

  1. The developer pastes the source and any used tables into Claude Code.
  2. Claude summarizes behavior, flags deprecated statements and direct table reads of replaced tables.
  3. It proposes a replacement using released APIs or CDS views.
  4. The developer tests in a sandbox and transports normally.

Result: Faster review of custom code with human accountability retained.

Keeping data on-prem

Some S/4HANA estates cannot send business data to any hosted model, including through a cloud provider's private endpoint. In that case keep the MCP server and SAP connectivity on your side and swap the model for an open-weight one served with vLLM or Ollama on your GPUs. The tool layer stays identical, so you can run Claude for developer assistance on non-sensitive source code and a private model for anything touching orders, prices or drawings. For air-gapped programs, the private model lane is mandatory and the MCP server runs inside the enclave with no external route.

Security checklist

  • Review any MCP server you did not write. Its code runs with whatever SAP access you give it.
  • Start read-only and require explicit approval for any write tool, ideally creating drafts only.
  • Use per-user identity or tightly scoped technical users, and mirror SAP authorizations in the tool layer.
  • Check retention, regional processing and training terms for your chosen Anthropic, Bedrock or Vertex arrangement.
  • Log tool calls with user, arguments and response size. Alert on unusual volumes.

Ways to get it done

Claude for code assistance only

Effort: Hours to set up, policy decision on source code sharing.

Lowest risk. Use for ABAP, CDS and conversion work with no live data.

MCP server plus Claude via API, Bedrock or Vertex

Effort: Days to weeks, mostly for authentication and tool design.

Good for live read-only questions when a cloud model is acceptable.

Private model behind the same tools, built with a partner such as Netray

Effort: Weeks, with hardware sizing as the long lead item.

Good when data cannot leave your network.

Pitfalls

  • !Pointing a community MCP server at production with a powerful user because it was convenient.
  • !Returning wide OData payloads. Trim to the fields needed so the model stays accurate and cheaper.
  • !Treating generated ABAP as safe. Always run ATC checks and code review before transport.
  • !Ignoring licence terms for API access. Confirm how SAP counts calls from your tool layer.
  • !Assuming connectors and plan features are fixed. They change, so validate against current documentation.

Frequently asked questions

Does Claude have a native SAP S/4HANA connector?

Do not assume so. The practical route is an MCP server that wraps your SAP APIs. Some community and vendor servers exist and may suit you, but review them like any code that touches production, and confirm their maintenance status.

Can Claude run through AWS Bedrock for SAP data?

Yes, many teams access Claude through Bedrock or Vertex AI to use existing cloud contracts, regions and private networking. Data handling still needs review. Verify retention, logging and region settings with your cloud and legal teams.

Is Claude good for ABAP?

It is useful for explaining, reviewing and drafting ABAP, CDS and RAP, but generated code can be wrong or use outdated statements. Treat it as an assistant, then run ATC, unit tests and normal review before transport.

How do we keep Claude from changing SAP data?

Only expose read tools at first. When you add write tools, make them create drafts or requests, and require a person with SAP authorization to release them. Technical users should not hold broad posting roles.

What if we are air-gapped?

Then hosted Claude is not an option for that data. Run the MCP server and an open-weight model entirely inside the enclave. You keep the same tool design, with a different model behind it.

Want Claude working on your SAP S/4HANA?

A free 30 minute assessment: we map the integration path for your version and setup, and where it should run.

Get a free assessment