logo

Are you need IT Support Engineer? Free Consultant

S/4HANA Custom Code Migration Agent – Accelerating…

  • By sujay
  • 15/06/2026
  • 5 Views

Custom code migration from ECC to SAP S/4HANA is typically an effort-intensive and time-consuming process. During the post-conversion phase, it often involves many developers and multiple challenging steps, including understanding legacy code, analyzing source code packages for SAP S/4HANA readiness using the ABAP test cockpit, and adapting the code to make it SAP S/4HANA-compliant. This process requires a deep understanding of SAP S/4HANA simplifications and their impact on the code.

To enhance productivity of custom code migration developers by speeding up their analysis and adaptation tasks SAP has already delivered the AI-based skills in the custom code tools within SAP Joule for Developers,  ABAP AI capabilities.

Building on these capabilities, SAP is now taking the next step to further accelerate and scale custom code migration by leveraging agentic AI within SAP Joule for Developers ABAP AI. As part of this innovation, SAP introduces the S/4HANA Custom Code Migration Agent for mass AI-based custom code transformation from ECC to SAP S/4HANA.

Overview

The SAP S/4HANA Custom Code Migration Agent provides an autonomous and context-aware intelligent AI agentic loop delivered within SAP Joule for Developers, ABAP AI capabilities, which executes typical sequential tasks of code migration developer largely self-operating with human oversight only where needed. The agent streamlines and speeds up custom code migration by automating execution of S/4HANA readiness checks with ABAP test cockpit, providing intelligent interpretation of analysis results categorizing them by complexity and remediations options, adapting the code automatically by executing available deterministic quick fixes and finally applying the AI-generated code fixes.  The agent uses the ADT MCP server in ABAP development tools for Eclipse, leveraging MCP tools for ABAP test cockpit.

The agent operates on the custom code packages largely in the batch mode, enabling developer to focus on other development tasks and notifying only if an action, review of code changes or decision is required. In this way the agent helps to free developer capacity, allowing teams to focus on other priorities.

The agent maintains the original code structure while making only minimal, targeted fixes based on ABAP test cockpit results. To follow standard SAP deployment procedures and enable proper tracking the agent records all changes in the same provided transport request. The developer maintains complete visibility of all migration activities done by agent.  After the agent finishes processing, developers just review the applied changes and activate the objects. This approach improves migration efficiency while keeping developers fully in control of the final code quality.

To get an overview watch also the YouTube video Joule for developers, ABAP AI capabilities – S/4HANA Custom Code Migration Agent.

Let’s now look how to enable and use S/4HANA Custom Code Migration Agent.

Prerequisites

  1. SAP S/4HANA system (>= 2021 release, private cloud or on-prem *) system with custom code, which must be adapted to SAP S/4HANA.
  2. Entitlement for SAP Joule for Developers, ABAP AI capabilities.
  3. Valid license for AI assistant (for example GitHub Copilot or Amazon Q Developer). AI assistant is installed as Eclipse Plugin from Eclipse Marketplace.

* The availability of SAP Joule for Developers, ABAP AI capabilities for SAP S/4HANA On-Premise 2025, 2023, 2022 and 2021 availability is subject to the special RISE with SAP contract conditions announced at SAP Sapphire. Please verify your entitlement and contract status before planning adoption.

Enablement

  1. Entitle and enable SAP Joule for developers, ABAP AI capabilities for side-by-side use. See SAP Joule for Developers, ABAP AI capabilities including agentic capabilities is now available!
  2. Install the latest build of ABAP development tools for Eclipse (version 3.60) with MCP server capability. Enable and configure MCP server by using ABAP development tools documentation accessible under Help->Help Contents menu:

According to the documentation instructions do the following.

Use menu Windows->Preferences to open the preferences window, navigate under ABAP Development to the MCP Server and click the checkbox Enable ADT MCP Server. This will enable and start the local HTTP server that hosts the ADT MCP server at http://localhost:/mcp (on the default port 2234, which can be changed). The server Token will be automatically generated and used for authentication between the ADT MCP server and the MCP client. The ADT MCP server uses bearer token-based authorization. 

A1_Enable_Mcp_Token.png

Then configure the ADT MCP server in your MCP host (for example GitHub Copilot or Amazon Q) to perform ABAP development tasks in an agentic workflow. Use the generated token.

Here is the example of configuration template for MCP server, which can be added inside server definition:

 “adt-mcp-server”: {
     “url “: “http://localhost:/mcp”,
     “requestInit”: {
    “headers”: {
       “Authorization”: “Bearer
   }
 }
}

A1_Configure_Mcp_Token.png

You will see the list of available ADT MCP tools exposed by the ADT MCP server:

A1_Mcp_Tools.png

3.  Refer to the steps in SAP Notes 3751537 and 3751829  to download and add the custom instructions in case of GitHub Copilot and the rules in case of Amazon Q, respectively. Add custom instructions (copy & paste from respective downloaded .md file) to activate agentic loop integration with your AI assistant (GitHub Copilot or Amazon Q).

A1_Custom_Instructions.png

4.  Finally apply changes and close the Preferences window.

S/4HANA Custom Code Migration Agent in Action

Now let’s work with the S/4HANA Custom Code Migration agent to explore and understand its processing flow.

Go to the chat window of your AI assistant (in the following GitHub Copilot will be used as example) and prompt the agent to migrate your custom package using the prompt example below (or similar):

“Migrate package to SAP S/4HANA compliant code with variant

A1_Prompt_To_Migrate_Pkg.png

The agent responds with the summary of details for execution collected from your prompt and asks for your confirmation.

A1_Migrate_Copilot_Response.png

After your confirmation the agent will request a list of available ABAP systems (destinations) from the related ADT MCP tool and setup destination based on your confirmation.

A1_Dest_Setup.png

After the agent knows the ABAP system it triggers ATC analysis for S/4HANA readiness. As you will see, before running the ADT MCP tool for ATC analysis the agent is asking you for confirmation. In this way human-in-the-loop approach is integrated through the whole agentic workflow allowing developer to meet a decision.

A1_Atc_Run_Result.png

After ATC run with S/4HANA readiness check variant is executed over your custom package the summary of ATC results (number of errors, warnings and information messages) along with the determined amounts of available deterministic quick fixes and proposed AI-based fixes for ATC findings is reported back by the agent. The next step for you is to provide transport request. For the agent-led custom code migration a single dedicated transport request must be created for all sub-packages and all (sub-) objects of the custom code migration package to support continuous processing agentic flow.

As soon as transport request is provided the agent can make the changes to the code and starts first with deterministic quick fixes (involving the user by asking for confirmation regarding execution of the ADT MCP tool for running quick fixes):

A1_Tr_Run_Qf.png

After user confirmation the agent performs mass execution of available deterministic quick fixes on the source code along with activation of changed objects:

A1_Apply_Determ_Qf.png

The “old” source code parts changed by the quick fix are commented out, so that the user can any time review the changes, follow up on quick fix changes in the code and revert if needed.

A1_Determ_Qf_Code.png

As next step the agent reruns ATC with S/4HANA readiness to demonstrate the progress and get remaining findings after applying the deterministic quick fixes and proposes AI-based fixes for the complex use cases, for which deterministic quick fixes do not exist:

A1_Atc_Run_After_Applied_Qf.png

For each AI-based fix the confidence score of the fix proposal is calculated. The agent automatically changes the code only using AI-based fixes with high confidence score and without syntax errors. AI-based fixes with lower confidence score or causing syntax errors are inserted into the code as proposals in the comments. This will allow developers to review the proposed changes and adjust them as needed:

A1_Ai_Qf_Code.png

During autonomous mass execution of AI-based fixes the user can anytime ask the agent about the status. The agent will run the related ADT MCP tool (with user confirmation) and get intermediate results of AI-based fixes to demonstrate the progress.

A1_Ai_Qf_Progress.png

Finally, the agent provides a summary of all changes:

A1_Ai_Fixes_Done.png

The AI-based fixes along with their confidence score are stored in the CSV file and can be imported for example into the Excel table for review.

A1_Confidence_Table.png

The final step for the code migration developer is to review manually the changes in the inactive objects, activate the objects and execute the final ATC run for S/4HANA readiness.

What's next

While the agent is already ready to assist with code remediation workflows today, we have an ambitious roadmap ahead. Upcoming releases will add side-by-side review of AI-proposed code fixes with approval/rejection controls, processing of individual object sets and additional capabilities to make remediation faster, more transparent, and more scalable.

Stay tuned!

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *