Sub topic 13
Clean core and extensibility principles
Prerequisites and scope
This chapter assumes you know what custom ABAP code is, how a development, quality and production landscape works, and what a simplification item is. It builds on the custom code analysis chapter and the fit-to-standard chapter. It feeds the final chapter on choosing a transition path.
After this chapter you should be able to explain what "clean core" means, name the extensibility options that SAP offers, and describe how the principle changes the work in a greenfield, brownfield or selective data transition project.
What clean core means
A clean core is an SAP S/4HANA system whose standard software is kept free of modifications and of custom code that depends on internal SAP objects. The goal is to make upgrades cheap and predictable. In an ECC system, years of modifications, user exits and direct table access made each upgrade a project. A clean core removes much of that cost.
Clean core is a design principle, not a product. SAP describes it along several dimensions. The main ones are:
- Extensibility. Custom functions use released, stable extension points.
- Data. Custom code reads and writes data through released interfaces, not by touching standard tables directly.
- Processes. Business processes stay close to the standard and are not rebuilt without need.
- Integration. Systems connect through released APIs and events, not through custom point-to-point interfaces.
- Operations. Monitoring, testing and lifecycle management are automated enough to apply updates regularly.
SAP has changed the exact wording of these dimensions over time. Check the current SAP guidance for the version you work with. The idea stays the same: build on what SAP promises to keep stable.
Why it matters for a transition
The transition is the best moment to reduce custom code. Two reasons apply.
- Cost of carrying code forward. Every custom object you convert must be analyzed, adapted, tested and later maintained. Objects that are unused cost effort for no benefit.
- A stable future. If you move to a modified core, you repeat the ECC problem on a new platform, and updates become harder again.
Fit-to-standard workshops are where the process side of clean core starts. Each gap the team accepts as a custom requirement should have a recorded reason. Custom code analysis is where the code side starts. Together they decide how much has to be rebuilt.
The extensibility options
SAP offers three main styles of extension. They differ in where the code runs and how tightly it is coupled to the core.
| Style | Where it runs | Typical use | Coupling to core |
|---|---|---|---|
| In-app (key user) extensibility | Inside the S/4HANA system | Custom fields, custom logic, simple custom business objects, UI adaptations | Low, uses released objects only |
| Developer extensibility (on-stack) | Inside the S/4HANA system, written in ABAP Cloud | Custom ABAP logic that needs transactional proximity to the core | Medium, restricted to released APIs |
| Side-by-side extensibility | Outside the core, on SAP Business Technology Platform (BTP) | New apps, extensions with their own data, integrations | Lowest, connects through APIs and events |
In-app extensibility
Key users, not developers, create custom fields, add validations and change forms using apps delivered with the system. Because the tools only expose released objects, an upgrade does not break the result. This option suits small, well-bounded changes.
Developer extensibility
Developer extensibility lets ABAP developers write code inside the system under ABAP Cloud. ABAP Cloud is a restricted ABAP development model. Code may use only objects that SAP has marked as released, and the system enforces this through ABAP language versions and checks. Code that follows the rules stays upgrade-stable.
Use it when the extension must run in the same transaction as standard logic, for example to add a check during a posting.
Side-by-side extensibility
Side-by-side extensions run on SAP BTP and talk to S/4HANA through released APIs and business events. The core knows nothing about them. Use this style when the extension has its own lifecycle, serves a different user group, needs a different technology, or should be decoupled from system upgrade timing.
The cost is added architecture: authentication, network connections, monitoring and a second platform to operate. Do not choose it by default for small changes that in-app extensibility handles.
Released objects and the stability contract
All three styles depend on one idea: released objects. A released object is an API, CDS view, class, business event or similar artifact that SAP has formally declared stable for customer use. SAP states a release contract for it, and it commits not to change the object in an incompatible way within that contract.
Unreleased objects, such as internal function modules, standard tables read directly, or classes not marked for use, can change or disappear in any release. Code that uses them is the main reason upgrades break custom code.
A practical rule follows: before you use an SAP object, check its release state in the ABAP Development Tools (ADT) for Eclipse. If it is not released, look for a released alternative. If none exists, record the gap and raise it with SAP or use a documented workaround.
Classic extensions in a clean core world
Many ECC systems contain older extension techniques. Their status differs.
| Technique | Clean core status |
|---|---|
| Modifications of SAP objects | Not acceptable. Remove or replace. |
| Implicit enhancements | Avoid. They depend on internal code structure. |
| User exits, customer exits, BAdIs | Depends. Only BAdIs and exits that are released are stable. Check each one. |
| Direct SELECTs on standard tables | Risky. Tables may change or be replaced under simplification items. |
| Custom Z-reports and Z-tables with no link to standard internals | Usually fine. Check for hidden dependencies. |
The ABAP test cockpit (ATC) can run checks against a chosen cloud-readiness level and list violations. Treat the finding list as a work backlog and rank it by business value and effort.
Effect on each transition path
Clean core affects the three paths differently.
- Greenfield. You start with an empty system, so you can enforce clean core from the first day. The risk is that teams rebuild old customizations out of habit. Hold each request to the fit-to-standard record and pick the extension style with the decision flow above.
- Brownfield. The existing code arrives with the system. A conversion does not make it clean. You first make the code work, because simplification items force many changes. Then you reduce and modernize it in steps. A common pattern is to decommission unused code before conversion, adapt what is needed, and move selected custom logic to a clean extension model afterward.
- Selective data transition. The target is often a new or restructured system, so you can decide object by object which custom code and data come across. This gives more room to clean up than a plain conversion, but needs more analysis effort.
Common errors
- Treating clean core as a rule for code only. Processes, integrations and data matter too. A standard-looking system with heavy custom processes is not clean.
- Declaring a goal without measuring it. Track the number of unreleased object usages, the number of custom objects, and the number of modifications. Without numbers you cannot show progress.
- Moving everything to BTP. Side-by-side is not automatically cleaner. A poorly designed extension on BTP is still hard to maintain.
- Postponing cleanup after go-live. After go-live, budget and attention fall. If cleanup is not scheduled before go-live, it often does not happen.
- Ignoring the transition cost of clean extensions. Rewriting code into a clean model takes real effort. Do it where the benefit is clear, such as code that changes often or blocks upgrades.
Summary
Clean core keeps the standard software free of modifications so updates stay affordable. Use released objects only. Pick the least coupled extension style that meets the requirement: in-app first, developer extensibility for in-transaction logic, side-by-side for decoupled needs. Greenfield can start clean, brownfield must clean up over time, and selective data transition lets you choose what to bring.
Exercise
A company converts its ECC system by brownfield. Custom code analysis shows a report that reads the standard table directly and is run once a year, and a validation that must run during a sales order save and uses unreleased function modules. What would you do with each under clean core?
Show answer
The yearly report is a candidate for removal or for rewriting against a released CDS view or API, depending on whether the business still needs it. Because it runs rarely, low-effort options such as retiring it are worth checking first. The validation must run inside the sales order transaction, so developer extensibility with ABAP Cloud is the fitting style. The team should look for a released BAdI or API in ADT, reimplement the logic against released objects only, and drop the unreleased function modules. Side-by-side would not work well, because the logic must act within the same transaction.
Exercise
Give two situations where side-by-side extensibility on SAP BTP is a better choice than in-app extensibility, and one situation where it is not.
Show answer
Better: a new application for external partners that needs its own data store and release cycle, and an extension that must be decoupled from the S/4HANA upgrade schedule. Not better: adding a single custom field to a standard form, where in-app extensibility is simpler and avoids the cost of running another platform.