Clean Core Without the Rewrite Reflex: A Risk-Based Way to Triage SAP Custom Code
A practical SAP Clean Core framework for deciding which custom dependencies to retain, isolate, replace, redesign or retire instead of rewriting everything.
By ERPClimb Editorial Team ยท Published 2026-09-18 ยท 8 min read
Clean Core is a dependency problem before it is a coding problem
A custom report that has run reliably for ten years is not automatically a modernization priority just because it contains old ABAP syntax. The architectural risk comes from what the development depends on, how often that dependency changes, and how difficult the object is to upgrade or replace.
The first step in a Clean Core review should therefore be inventory, not rewriting. Identify direct table access, unreleased function modules, classes, enhancement spots, classic exits, implicit enhancements, generated objects, external RFC contracts and custom modifications.
Classify the dependency footprint
Every custom object can be placed into a small number of dependency categories. Some use stable released APIs. Some read tables directly but never update them. Others depend on unreleased implementation details, modifications or deeply coupled exits.
The category matters because two programs with identical business importance can have completely different upgrade risk. A small utility that modifies standard code may deserve attention before a large custom report that consumes stable interfaces.
- Released and supported API or extension point
- Stable read-only dependency with a migration path
- Unreleased API or implementation object
- Modification or implicit enhancement
- Tightly coupled integration contract
- Dead or duplicated custom object
Separate technical accessibility from architectural approval
Traditional ABAP systems allow access to many objects that are technically callable. That does not mean those objects are the intended extension contract for a cloud-ready or upgrade-stable architecture.
For each dependency, check whether a released API, CDS entity, class, event or extension point can provide the same business semantics. Replacing a table with a newer-looking CDS view is not an improvement if the view does not represent the same business meaning.
Use four factors to prioritize remediation
A useful modernization queue can be built from four factors: business criticality, dependency risk, change frequency and replacement complexity. High-criticality objects that use fragile dependencies and change frequently should move toward the front of the queue.
Low-change utilities with low upgrade exposure can remain under control while the team addresses the objects that actually create release friction. This prevents Clean Core from becoming an expensive blanket rewrite programme.
- Business criticality: what stops if this fails?
- Dependency risk: released contract or internal implementation detail?
- Change frequency: how often does this object need modification?
- Replacement complexity: is there a proven supported alternative?
Choose one of five outcomes
Modernization is not a binary keep-or-rewrite decision. In practice, the useful outcomes are retain, encapsulate, replace, redesign or retire.
Retain when the dependency is supported and the object remains valuable. Encapsulate when a fragile dependency cannot be removed immediately but can be isolated behind a controlled interface. Replace when a released alternative preserves semantics. Redesign when the requirement belongs in a side-by-side extension or event-driven pattern. Retire when the custom object duplicates standard capability or no longer has meaningful usage.
Measure progress by reduced coupling, not line count
A team can delete thousands of lines of code and still remain tightly coupled to the core. Conversely, a modest refactoring that moves critical dependencies behind released contracts can materially improve upgrade stability.
The better modernization metrics are the share of critical custom objects using released interfaces, the number of modifications or implicit enhancements, the volume of direct core dependencies, and the effort required to adopt a new S/4HANA release.
ERPClimb is an independent educational and technology publication. It is not affiliated with, endorsed by, or sponsored by SAP SE. SAP and SAP product names are trademarks or registered trademarks of SAP SE. Technical guidance should be validated in your own landscape before production use.