
Ask anyone who has run an S/4HANA program where it hurt most, and the answer is almost always the same: custom ABAP code. Years — sometimes decades — of bespoke developments pile up in an ECC system, much of it undocumented and written by people long gone. S/4HANA's simplified data model quietly breaks the assumptions that code relies on, and suddenly every custom object is a question mark. This is the phase where migrations stall, budgets blow, and timelines slip. Here's how to tackle it — and how AI has finally started to move the needle.
This is one of the two worst bottlenecks flagged in our complete migration guide (the other is data). Let's take custom code head-on.
Why Custom Code Is So Painful
Three things make custom ABAP the migration's hardest phase. First, volume: mature ECC systems accumulate thousands of custom objects. Second, opacity: much of it is undocumented, and the developers who wrote it have moved on, so nobody fully knows what it does or why. Third, fragility: S/4HANA changes the underlying tables and structures, so code that quietly worked for a decade can break in ways that are hard to predict. The result is a phase that resists estimation and punishes shortcuts — exactly the kind of work that eats schedules.
The Remediation Process, Step by Step
Done properly, custom-code migration follows a clear sequence:
- Inventory — catalogue every custom object in the system.
- Usage analysis — determine what is actually used. A large share is typically dead or redundant.
- Impact assessment — for each used object, assess how S/4HANA's simplifications affect it.
- Decide: remediate, retire, or replace — fix what's needed, delete what isn't, and swap custom logic for standard S/4HANA functionality wherever possible.
- Adapt and test — make the changes and validate them rigorously.
The most underrated step is retirement. Every unused object you delete is work you never have to do — which is why usage analysis is where the smart money goes first.
"The cheapest custom code to migrate is the code you delete. Before fixing anything, find out how much of it nobody actually uses anymore."
— ESS ENN Associates Enterprise Solutions Team
Where AI Changes the Game
Custom-code remediation is precisely where AI has made its most tangible dent. AI custom-code agents now analyze, document, and remediate large volumes of ABAP automatically — SAP's first ABAP custom-code migration agent for ECC→S/4HANA is already shipping, targeting a significant efficiency gain in this work. Partners report large cuts in documentation time, recoding, and ongoing custom-code maintenance when agentic analysis and remediation are applied. This is the single highest-impact place to deploy AI on a migration — and the one that turns an intimidating backlog into a tractable plan. See how AI accelerates S/4HANA migration.
The Ceiling: What AI Can't Fix Alone
A crucial reality check keeps the hype honest: automated quick-fixes cover roughly 40-60% of typical S/4HANA simplification cases. The rest — the complex, business-critical custom logic where a wrong change corrupts a financial posting or an order flow — still needs expert ABAP developers to remediate safely. This is why the winning model is "AI does the mechanical majority; experts own the risky minority." The value isn't in having hands to type; it's in the custom-code intelligence to know which changes are safe and which are landmines.
Custom Code and Clean Core
Remediation isn't only about making code work on S/4HANA — it's a chance to reach a clean core. Rather than modifying the S/4HANA standard core (which makes every future upgrade painful and blocks AI agents), the modern practice is to retire what you can and move genuinely necessary extensions onto SAP BTP via approved extension points. A clean core is what lets Joule agents and process intelligence run reliably afterward — the durable payoff covered in clean core, BTP and Joule agents. And custom code is only half the battle; the other half is data.