From Chaos to Clean Core: Tackling SAP Technical Debt with AI

SAP BTP Clean Core

Imagine walking into an archive room overflowing with documents. Some are useful, some are outdated, and some… well, no one remembers why they’re there at all. That’s what it feels like for many SAP customers staring down decades of custom code.

In a recent Lemongrass Live session, the conversation was all about that elephant in the SAP room: the journey to a clean core. It’s a term that’s been floating around since the ’90s-back when the goal was simply to keep customizations minimal. But today, it’s a whole new ballgame. A cleaner core means agility, faster innovation, lower upgrade costs-and increasingly, a critical step toward future-proofing your business.

Eamonn O’Neill and Chris Beard from Lemongrass unpacked this in their latest webinar, bringing clarity-and a little excitement-to a daunting challenge.

So What Is a Clean Core?

At its heart, the clean core approach is about reducing custom code within your SAP environment and instead shifting it to more modern, flexible platforms like SAP BTP (Business Technology Platform).

SAP’s Clean Core gauges “cleanliness” across six pillars (Software Stack, Extensibility, Integrations, Data, Processes, and Operations). The latest Lemongrass Live session explores just one aspect of the Clean Core strategy: extensibility – how businesses can move custom logic and enhancements outside the SAP core using modern, scalable platforms like SAP BTP (Business Technology Platform).

Chris described it as a three-tier journey. Most businesses are still stuck in Tier 3-loaded up with traditional ABAP customizations embedded deep within their systems. Tier 2 represents newer enhancements using updated approaches, while Tier 1 is the goal: a clean, modular, extensible environment where custom logic lives outside the core system-think serverless architecture, APIs, and microservices, all humming along in BTP.

But getting there isn’t as simple as flipping a switch.

The Mountain of Custom Code

How much code are we talking about? One customer Lemongrass works with has over 30,000 ABAP objects. Another has 20 million lines of code, most of it undocumented.

No one knows how much of it is still in use, what’s business-critical, or what could quietly be retired. It’s the definition of technical debt-and it’s growing more expensive by the day.

Traditional cleanup methods involving teams of functional and technical consultants just aren’t scalable anymore. So the question becomes: if the problem is huge, and the benefit is clear, how do you even begin?

The Business Case: Why Clean Core Now?

For companies still wondering why they should bother, Chris laid it out clearly: it’s about cost and innovation.
Clean core dramatically reduces the pain of upgrades. Instead of disruptive, costly cycles, you get seamless updates-just like any modern SaaS product. And with more frequent updates comes earlier access to innovation, especially in the AI space.

SAP is investing heavily in new features-but most of them are being released for public cloud customers first. That means businesses still clinging to legacy code risk missing out on the very capabilities that could give them a competitive edge.

And the destination is clear: SAP’s “North Star” is S/4HANA Public Cloud. RISE with SAP isn’t the endgame-it’s the road that gets you there. Companies are beginning to see that staying behind could leave them out of the race entirely.

Breaking It Down: The Six Rs

The first real step in tackling this mountain of customization? Knowing what to do with each piece of it.

Eamonn explained the familiar “Six Rs” framework-a way to triage and prioritize legacy code:

  • Retire: Up to 60% of custom code may no longer be used. If it’s obsolete, leave it behind.
  • Replace: Has SAP introduced new features that replicate what you once coded yourself?
  • Repurchase: Could a third-party app handle it better?
  • Retain: Some mission-critical code might still need to run within S/4-though SAP recommends this only in rare, low-latency cases.
  • Rehost: Shift code to BTP or other environments.
  • Refactor: Modernize your customizations using new languages and standards (like Node.js or serverless functions).

It’s a logical, step-by-step filter. But applying it across tens of thousands of objects? That’s where AI steps in.

Enter the AI Agents

Here’s where it gets really interesting. Lemongrass is using AI agents to accelerate and automate the clean core journey.

These agents don’t just read the code. They pull in runtime data, track usage patterns, cross-reference SAP best practices, and even apply customer-specific knowledge to make smarter decisions. They can decide what to retire, suggest replacements, and propose modern alternatives.

It’s like having a tireless team of SAP consultants working 24/7-with far more consistency.

This AI-driven approach takes a process that was previously manual, time-consuming, and costly-and turns it into something far more scalable and precise.

Ready to explore your path to clean core? Lemongrass is already helping customers unlock it with AI-driven intelligence and deep SAP expertise.

Get in touch to learn more or listen to the Lemongrass Live session here: AI-Driven Approach to Achieving a Clean Core in SAP Landscapes

Related Content