AI ABAP Development With ADT MCP

How Agentic AI + Model Context Protocol is Transforming SAP Development

ABAP development has always been core to SAP implementation and operations. From writing custom reports to debugging complex SAP workflows, ABAP developers spend significant time navigating layers of business logic, configuration, and legacy code. With the rise of Generative AI, a new era of developer productivity is emerging — but not all AI tools are created equal.

This blog post explores how combining Claude Code (an agentic AI coding assistant) with a custom-built ADT MCP (ABAP Development Tools Model Context Protocol) server creates a powerful end-to-end AI development agent for SAP — one that can autonomously read, write, activate, and even run ABAP code in real time.

What You Will Learn: This post covers (1) the difference between assistive and agentic AI development, (2) the gaps in current SAP AI tooling, (3) what ADT MCP is and how it works, and (4) four real-world demo scenarios with concrete time and cost savings.

Open Source: The ADT MCP server used in all demos in this post is open-source and available at github.com/ethanhan2014/sap-adt-mcp. Note: SAP Hyperspace team is also currently working on an official MCP for ADT. The demos shown here use this community-built implementation.

Background: The State of AI ABAP Development

Assistive AI vs. Agentic AI

There are two fundamentally different categories of AI coding tools:

  • Assistive AI: Suggests code completions; the human accepts or rejects each suggestion. Examples include SAP Joule for Developers, GitHub Copilot, and Cursor IDE.
  • Agentic AI: Autonomously reads files, runs commands, writes and activates code, and runs tests — end-to-end. Examples include Claude Code, OpenAI Codex, and Google Gemini CLI.

Assistive AI is valuable for acceleration, but agentic AI is transformative. It does not just suggest — it acts.

Current State: SAP Joule for Developers

SAP released Joule for Developers in General Availability in March 2025, embedded into SAP Build Code and ADT (ABAP Development Tools). Its capabilities include:

  • Natural language to RAP (RESTful ABAP Programming Model) service generation
  • Inline ABAP code completion
  • Unit test auto-generation
  • Code explanation and refactoring assistance
  • ECC to S/4HANA Cloud modernization guidance

While these features are genuinely useful, Joule for Developers has notable limitations for day-to-day ABAP work:

  • No agentic execution — cannot autonomously chain multi-step tasks
  • No real-time SE80/SE38/SE24 awareness — lacks live system context
  • Hallucination risks — especially on custom Z-objects that are not in training data
  • SAP-only scope — limited integration with external tools and workflows
  • Stronger on ABAP Cloud/RAP, weaker on classic ECC and legacy patterns

SAP’s roadmap is moving toward Agentic AI via BTP AI agents — but that future is not here yet. The ADT MCP approach described in this post bridges that gap today.

ADT MCP: Bringing Agentic AI to ABAP

What Is ADT?

ABAP Development Tools (ADT) is SAP’s Eclipse-based IDE for writing ABAP code. It is the modern replacement for SAP GUI-based editors (SE80, SE38, SE24). ADT connects directly to SAP backend systems via REST/HTTP, and works with both on-premise S/4HANA and the SAP BTP ABAP Environment.

What makes ADT special for AI integration is its comprehensive REST/HTTP API layer — every operation you can perform in the ADT Eclipse plugin is backed by an HTTP endpoint.

What Is MCP?

MCP (Model Context Protocol) is an open-source standard that allows agentic AI tools to seamlessly connect with external data, tools, and systems. Think of it as a universal adapter: an AI model can use MCP to call external tools — read a file, query a database, make an API call — and act on the results.

ADT MCP: The Bridge

By wrapping SAP’s existing ADT REST/HTTP interfaces in an MCP server, we give agentic AI tools like Claude Code the ability to:

  • Read source code of ABAP programs, classes, includes, and function modules in real time
  • Write and modify ABAP source code directly in the SAP system
  • Activate ABAP objects after modification
  • Execute ABAP reports and retrieve output
  • Query SAP database tables with ABAP SQL
  • Fetch ST22 short dump details for debugging
  • Search for ABAP repository objects by pattern

The result: an AI agent that sees your actual SAP system — not hallucinated guesses — and takes real actions within it.

Real-World Use Cases

Below are four concrete scenarios demonstrating ADT MCP in action. Each includes the task description, the traditional manual approach with time estimates, the AI prompt used, and the actual time and cost consumed.

Use Case 1: ABAP Performance Optimization

The Task: Analyze ABAP report ZHANZ_LOOP_OPT and improve its performance — a relatively straightforward technical task with no deep functional domain knowledge required.

Traditional Approach (Without AI):

  1. Take ST12 runtime traces to identify program bottlenecks
  2. Analyze trace results to understand where time is spent
  3. Apply performance improvement techniques (COLLECT, parallel cursors, buffering)
  4. Rewrite affected code sections and compare performance

Estimated Time: ~10 minutes

With Claude Code + ADT MCP:

The agent read the program, identified LOOP AT ... WHERE as the primary bottleneck, and automatically wrote an optimized version using parallel cursor techniques — all in 35 seconds.

Example AI Prompt: Read ABAP program ZHANZ_LOOP_OPT, identify loop-related performance bottlenecks, and append an optimized version of the same logic to the end of the program without changing the original code. Preserve functional behavior, clearly separate original vs optimized sections, and add comments explaining the optimizations. If possible, include a small runtime measurement block so I can compare performance between both versions.

MetricTraditionalWith ADT MCP
Time~10 minutes~35 seconds
Output TokensN/A~6,000
AI CostN/A~$0.35

Use Case 2: Root Cause Analysis — Billing Block on CMR

The Task: Custom ABAP report ZHANZ_CMR was developed to automatically create Credit Memo Requests (CMRs). However, all created CMRs are placed on a header billing block. The task: find out why and where the billing block is being introduced.

This is a complex task requiring both technical and functional SAP Sales knowledge.

Traditional Approach (Without AI):

  1. Identify the technical field for billing block on table VBAK (field: FAKSK)
  2. Use Where-Used List to find all code references to FAKSK
  3. Set breakpoints at each location and re-run the program
  4. Step through execution to find where VBAK-FAKSK gets assigned

Estimated Time: 10 to 30 minutes

With Claude Code + ADT MCP:

The AI agent went beyond the code itself: it analyzed BAPI parameter passing, checked sales document type configuration, examined user exits, and ultimately identified the source of the billing block from the sales document type configuration — something a developer would need functional knowledge to even look for.

Example AI Prompt: Analyze ABAP report ZHANZ_CMR and identify where the billing block is set for Credit Memo Requests created by this program. Please find the exact code location (program/include/form/method/FM), the field being populated (for example header/item billing block), and show the relevant assignment statement or call stack that causes the billing block to be applied. If the block is not set directly in the report, trace whether it comes from configuration, enhancement, copy control, or document defaulting logic.

MetricTraditionalWith ADT MCP
Time10—30 minutes~3 minutes
Output TokensN/A~26,700
AI CostN/A~$3.11

Use Case 3: ABAP Report Development — Sales Order Creation via BAPI

The Task: Write an ABAP report that uses BAPI_SALESORDER_CREATEFROMDAT2 to create sales orders, using sales order AP12347207 as a reference template. This is a common development task that requires understanding BAPI structures, SD master data, and clean modular coding.

Traditional Approach (Without AI):

  1. Read and understand the BAPI_SALESORDER_CREATEFROMDAT2 function module definition
  2. Study required structures: BAPISDHD1, BAPIPARNR, BAPISDITM, BAPISCHDL
  3. Write the ABAP program with proper header, partner, item, and schedule line population
  4. Test, debug, and iterate until the BAPI executes successfully

Estimated Time: 30 minutes to 1 hour

With Claude Code + ADT MCP:

The agent read the FM definition, queried VBAK/VBAP/VBPA tables to understand the reference order structure, generated a full modular ABAP report, activated it, and ran test iterations — all autonomously. Total time including iterative testing was about 30 minutes.

Example AI Prompt: Create a complete ABAP report in my SAP system to generate a new Sales Order using BAPI_SALESORDER_CREATEFROMDAT2. Use sales order AP12347207 as the template/reference source. The report should read relevant SD master/transaction data from the reference order, map header, partner, and item data into the BAPI structures, call the BAPI, process return messages, and commit the transaction only if successful. Please include clean modular code, clear comments, and robust error handling.

MetricTraditionalWith ADT MCP
Time30—60 minutes~30 minutes
Output TokensN/A~19M (multi-turn)
AI CostN/A~$12.68

Cost Note: The higher token count here reflects an iterative, multi-turn agentic session where the AI ran, tested, debugged, and re-ran the report multiple times. The output is a production-quality, fully tested ABAP program — not just a code snippet.

Use Case 4: ABAP Snake Game in SAP GUI

The Task: Write a complete Snake game in ABAP that runs inside SAP GUI — a challenging technical exercise requiring SAP GUI screen programming, ABAP OOP, and game logic design. This is a complex task with no existing template.

Traditional Approach (Without AI):

  1. Research Snake game rules and mechanics
  2. Design the technical architecture: screen control, keyboard handling in SAP GUI, game loop
  3. Implement game logic: movement, growth, collision detection, scoring
  4. Implement SAP GUI screen with custom controls
  5. Test and debug the full implementation

Estimated Time: ~1 full day

With Claude Code + ADT MCP:

The agent designed the full architecture, wrote the game logic, implemented SAP GUI custom container controls, handled the keyboard input constraints inherent to SAP GUI, and delivered a working Snake game (ZHANZ_SNAKE_GAME) in 40 minutes.

Example AI Prompt: Write a complete ABAP executable report for a Snake game that runs in SAP GUI. It should support New Game, Restart, and Quit, and use WASD for movement. The snake should grow when eating food, track score, and end the game on wall/self collision. Provide full runnable code, comments, SAP GUI-compatible UI logic, and explain any limitations with keyboard input handling in SAP GUI.

MetricTraditionalWith ADT MCP
Time~1 day~40 minutes
Output TokensN/A~150,000
AI CostN/A~$15.00

Bonus: ST22 Dump Analysis at Scale

The Task: Retrieve all ST22 runtime error dumps from today, analyze the root cause of each, group duplicates, and provide resolution recommendations. Normally this is a manual process requiring a developer to review each dump individually.

Traditional Approach (Without AI):

  1. Open transaction ST22 and review each dump
  2. Read the call stack and variable values for each
  3. Research the error type and identify root cause
  4. Compile findings into a report

Estimated Time: 1 to 2 days (depending on dump volume)

With Claude Code + ADT MCP:

Example AI Prompt: Fetch all ST22 dumps from today and analyze the root cause of each one using the short dump details, call stack, and available variable values. Group duplicate dumps if applicable, explain why each error occurred, and provide recommendations for immediate resolution and long-term prevention.

MetricTraditionalWith ADT MCP
Time1—2 days~5 minutes
Output TokensN/A~4M (many dumps)
AI CostN/A~$3.00

How It Works: Technical Architecture

The architecture is straightforward. Claude Code (running on your local machine or CI environment) connects to the ADT MCP server via the MCP protocol. The MCP server translates MCP tool calls into ADT REST API calls against your SAP system.

Claude Code (Agentic AI)—>ADT MCP Server (Node.js)—>SAP System (ADT REST API)

The MCP server exposes a rich set of tools to the AI agent, including:

  • get_abap_program / get_class / get_include — read source code
  • change_abap_program / change_abap_class — write source code
  • execute_program — run reports and get output
  • execute_sql — query SAP database tables
  • fetch_st22_dumps — retrieve and parse short dumps
  • search_object — find objects by name pattern
  • get_structure / get_table / get_data_element — read DDIC definitions

Getting Started

To try ADT MCP yourself, you need:

  • An SAP system accessible via ADT REST API (on-premise S/4HANA or BTP ABAP)
  • Claude Code installed (claude.ai/code or Anthropic API access)
  • Node.js runtime for the MCP server
  • ADT user credentials with appropriate authorization objects

The setup involves cloning the repository, configuring your SAP connection details, and pointing Claude Code to the MCP server in its configuration. Detailed setup instructions are in the repository README.

Repository: github.com/ethanhan2014/sap-adt-mcp — Includes full MCP server source, setup guide, configuration reference, and example prompts for common SAP development tasks.

Considerations and Best Practices

Security

  • Use a dedicated ADT user for AI operations with minimal necessary authorizations
  • Do not enable this in production without change management controls
  • Review all AI-generated code before transport to production
  • Consider enabling transport request assignment in your MCP configuration

Cost Management

  • Simple read-only analysis tasks are inexpensive ($0.35 to $3)
  • Complex multi-turn development sessions with many activations can be $10 to $15
  • Use smaller/faster models for exploratory tasks; reserve larger models for complex development
  • Set token limits in your Claude Code configuration to avoid runaway costs

Quality Assurance

  • Always review generated code for correctness and compliance with your coding standards
  • Include unit test generation in your AI prompts from the start
  • Use the AI for the first draft; apply your domain knowledge for final review

Conclusion

The combination of agentic AI (Claude Code) and ADT MCP represents a genuinely new capability for SAP ABAP development. It is not merely autocomplete or code suggestion — it is an autonomous development agent that reads your actual system, understands your actual code, and takes real actions within it.

The four use cases in this post demonstrate consistent patterns: tasks that took hours now take minutes. Tasks that required deep technical expertise to set up and run can be initiated with a well-crafted natural language prompt. The productivity gains are real and measurable.

As SAP continues to develop its own AI capabilities, tools like ADT MCP serve as a practical bridge — bringing agentic AI into SAP development today, without waiting for official roadmap delivery.

If you are an SAP developer, BASIS administrator, or technical consultant, I encourage you to try it. Start with a simple code analysis task on a development system. Measure the time. Evaluate the quality. The results may surprise you.

Share Your Experience: Tried ADT MCP with your own SAP scenarios? Share your results and questions in the SAP Community or open an issue on the GitHub repository. The more use cases we explore, the better the tooling will become.