Skip to main content

«  View All Posts

Before Your Custom Code Moves to S/4HANA: Who Will Prove It Still Works?

6 min read

By Stefan Hetges

Before Your Custom Code Moves to S/4HANA: Who Will Prove It Still Works?
Before Your Custom Code Moves to S/4HANA: Who Will Prove It Still Works?
11:40

With AI, speed is no longer the scarce resource in S/4HANA custom code projects. Proof is.

Bottom line: With SAP ECC mainstream support ending in 2027, custom code is on the critical path of most S/4HANA programs. AI can write ABAP faster than ever, so producing code is no longer the problem. Before you choose a tool, ask two questions: who proves that the transformed code still does exactly what the old code did, and who carries the risk if it doesn't?

The question I hear most this year

In almost every executive meeting in 2026, someone asks me a version of the same question: "Can't AI just rewrite our custom code?"

It is a fair question. I use AI every day, and we have built it into our own platform. Coding assistants make developers faster, and generative tools can produce a working ABAP class in seconds. If the job were only to produce code, the problem would be close to solved.

But producing code was never the hard part. The hard part is knowing that thirty years of pricing rules, compliance checks, and exception handling behave the same on Monday morning after go-live as they did on Friday night before it. That is the question this post is about.

2027 is no longer a planning date

In our joint research with ASUG this spring, 61% of member organizations were fully migrated, partially migrated, or in the middle of the move. 92% said they are carrying custom code into S/4HANA. Clean Core has not made custom code disappear. It has raised the bar for how well you need to understand it. Where SAP's standard now covers what a company once had to build itself, going back to standard is the right call, and a full analysis shows exactly where that applies. Code that sets a company apart from its competitors is different: if everyone runs the same code, nothing differentiates them. Finding that balance deserves its own post.

What struck me most was how the risk shifts once a program starts. Teams still in planning worry most about scope: 43% fear underestimating it. Teams in execution worry about testing: 63% name extensive testing as a top challenge, compared with 52% of those still planning. I see the same pattern in our projects. What you don't know about your code during planning becomes testing effort during execution.

Why custom code estimates fail

An average ECC system in our benchmark has about 22,000 custom objects and 2.7 million lines of code. Inside that sit roughly 17,000 S/4HANA issues, 9,000 HANA compatibility issues, 15,000 HANA performance issues, and around 300,000 findings on best practices, ABAP Cloud, security, and stability. Typically, 40 to 60 percent of the code is never used in production.

Most teams size this work with standard code-check tools. Those tools do what they were built for: they report the findings they can see at that moment. Fix one layer of findings and the next layer appears. The estimate grows while the project runs, and the budget follows it.

Our Intelligent Automation Platform® parses the entire repository up front, together with usage data. Before we start, we know every issue, which ones our rules fix automatically, and what is left for a developer. That is why we can commit to a fixed price and a fixed timeline, typically four to six weeks per system, and back them with SLAs. We take on the delivery risk for the custom code because we have measured it, not estimated it.

The right tool for the right job

I don't see this as AI against automation. Each approach is good at something different, and the mistake is to use one for the other's job.

 

 

Developer assistant

Generative code agent

Rule-based automation with AI on top (smartShift)

Best at

Helping a developer write and fix code faster

Drafting new code or rewriting individual programs

Transforming an entire repository for S/4HANA and Clean Core

Unit of work

One object, with a developer at the screen

One program or task at a time

The full codebase in one pass

What gets checked

What the developer asks for

What the prompt asks for

250+ rulesets on every object: S/4HANA, HANA, performance, security, ABAP Cloud

Same input, same result?

Depends on the developer

Not guaranteed

Yes, deterministic

Who proves equivalence

The developer, object by object

Your testers, on code nobody on your team wrote

Tested transformation patterns, with the vendor accountable for the result

Timeline and commercial model

Open-ended, effort-based

Open-ended, effort-based

Fixed price, typically 4 to 6 weeks per system, SLAs

Two rows in this table matter most to me.

The first is coverage. An AI assistant fixes what you ask it to look for. If your prompt doesn't mention SQL injection, HANA performance, or ABAP Cloud readiness, those issues stay in the code, and a prompt that does ask for all of them produces very different code. Think about how you use AI for an everyday task such as an email. The first draft is 95% of what you want, and you adjust a few words before you hit send. That works because you read every word. Coding with AI is no different, except that nobody reads every line of 2.7 million. Our rules check every object for all of it, every time. Forrester's interviewees described the same effect: traditional efforts address what go-live requires, while automation lets them remediate a much broader part of the codebase.

The second is repeatability. Run our rules twice on the same code, and you get the same result. That makes the result testable at scale and lowers testing effort. Because every change follows a known rule, testers can verify the patterns instead of re-checking every object, and usage data focuses regression testing on the code that is actually used. Repeatability is also the basis for a measurable first step toward Clean Core: unused code retired, code modernized, ABAP Cloud syntax applied where released APIs exist, and everything else flagged with a clear path forward.

The question nobody asks: who proves equivalence?

When a tool rewrites code, someone has to prove that the new version behaves like the old one. For code that runs your pricing, your month-end close, or a regulatory report, "it compiles and looks right" is not proof.

With a developer assistant, the developer at the screen carries that proof, one object at a time. With a generative agent that rewrites whole programs, the proof moves to your testers. With rule-based transformation, each change follows a known, tested pattern, applied the same way across the whole repository, and the vendor stands behind the result.

Regulated industries show what this means in practice. Under GxP rules, a pharmaceutical company must verify every program it changes, including that nothing was added that shouldn't be there. Our pharma customers solve this by reviewing and approving our transformation rules. Once a rule is approved, every change it makes is covered by that approval, instead of every changed line being reviewed by hand. That only works because the rules are deterministic. You cannot approve a rule once if its output changes with every run.

Buyers feel this. In the ASUG research, 74% expect their use of AI for new custom code development to grow within the next 12 to 24 months. The most common condition for using it more is greater trust in AI accuracy and explainability, named by 39%.

Our answer is a clear division of labor. Rules do the mass transformation, where equivalence has to be guaranteed. AI works on top, where judgment helps, and a person reviews the result. When we say 99.99% precision, we mean fewer than one defect found in testing per 10,000 automated fixes. The customer gets a commitment on the outcome, not only a tool.

What "done" looks like

  • Procter & Gamble: 77,000 custom objects and 1.3 million issues remediated in eight weeks, with a defect rate below 0.01%, saving 42,000 person-days.
  • Beiersdorf: 33,000 custom objects and 5.6 million lines of code, with 69,000 issues resolved in six weeks.
  • CONA Services: 45,000 objects and 5.8 million lines of code, with 262,843 issues resolved in a three-month program that included functional adjustments and testing, while Automated Dual Maintenance synchronized 1,500 ECC changes per month.
  • Foodstuffs South Island: 1.9 million lines of code converted and thousands of unused objects retired, saving more than 1,000 person-days.

In a commissioned Total Economic Impact™ study published in August 2026, Forrester Consulting interviewed five of our customers and modeled a composite organization with 150,000 custom objects. It found a 254% ROI, a net present value of $10.5 million, and payback in under six months. The composite avoided up to 99,840 developer hours, retired 25% of its custom code, and finished its S/4HANA migration six months sooner.

One result matters to business leaders as much as any of these numbers: none of these customers had to freeze development. Automated Dual Maintenance carries the changes made in ECC into the S/4HANA project landscape every month, so the business keeps moving while the project runs. The same rules transform every change that goes live in ECC during the project and arrives in S/4HANA already remediated. That is only practical with automation. As one interviewee in the Forrester study put it: "We don't have a business that can stop because we're running a transformation project."

Across more than 3,500 SAP systems and more than 4 billion lines of code, that is the standard we hold ourselves to.

Questions I would ask before signing anything

  1. Do we know every issue in our custom code today, or only the first layer our check tools report?
  2. Which of our code is ours to protect, which is unused, and which belongs outside the core?
  3. Who proves that the transformed code behaves the same as the old code, and how?
  4. Who carries the risk if scope, time, or budget move?
  5. Can our business keep developing during the project, or will we need a code freeze?

If you can answer these with data, you are in a strong position. If the answers are estimates, start with visibility.

We offer a complimentary Rapid Code Analysis: every object and every issue in your repository quantified, and a clear view of what can be automated. Request yours here.

Terms used in this article

  • Custom code remediation: adapting existing ABAP code to S/4HANA simplification items, the HANA database and current coding standards.
  • Dual Maintenance®: carrying ongoing ECC changes into the S/4HANA project landscape automatically, so development continues without a code freeze.
  • Clean Core: SAP's approach of keeping the core close to standard, with extensions built on released, upgrade-stable interfaces. It is a path, and remediation is a measurable first step on it.
  • Outcome-based delivery: fixed scope, fixed price, and fixed timeline, backed by SLAs, with the vendor accountable for the result.

Stefan Hetges

Stefan Hetges is the founder of smartShift. He started the company in 2002 and led its focus into SAP custom code transformation in 2006. He is a co-inventor of the patents underlying smartShift’s automation platform, developed with a team of architects, friends, and longtime collaborators. Every fixed-price, fixed-timeline SAP transformation project smartShift has delivered across nearly two decades has come in on time and on budget, and delivered guaranteed outcomes.

Stay ahead of SAP modernization.

Get the latest insights on S/4HANA, Clean Core, custom code, and AI delivered to your inbox.