Sub topic 1
What clean core means and why it matters
Prerequisites
This chapter assumes you know the following:
- Basic SAP S/4HANA business processes and the role of an ERP system.
- REST and OData APIs at a general level.
- Cloud concepts such as services, tenants, and OAuth 2.0.
- Simple JavaScript or Node.js code, which appears in later chapters.
No code is needed in this chapter.
The problem clean core addresses
Most companies change their ERP system to fit their processes. In classic SAP systems, that often meant editing SAP standard code, adding custom code that reads SAP's internal tables, or using internal function modules that SAP never promised to keep stable.
These changes work on the day you build them. They cause trouble later. SAP can change or remove its internal objects in any release. When you upgrade, your custom code may break, or you may have to test and repair it before the upgrade can go live. Upgrades become slow and expensive, so teams postpone them and fall behind on innovation.
The clean core principle
Clean core is the principle that you keep the standard SAP S/4HANA system as close to unmodified as possible. You add your own logic through extension techniques that use stable, documented interfaces only. The system's core stays upgradeable, and your extensions keep working across releases.
Clean core does not mean "no customization." It means that customization happens in a controlled place and through a defined contract.
The principle has four parts:
- No modifications. You do not change SAP standard objects.
- Stable interfaces only. Extensions use released APIs and extension points. Chapter 2 covers these.
- Separation. Custom logic is kept apart from the standard code, either inside a protected area or outside the system.
- Upgrade safety. An upgrade should not force you to rework your extensions.
Where extensions can live
The diagram shows the idea. The core sits in the middle. Extensions connect to it only through stable contracts.
The three extension options are introduced here and explained in later chapters:
| Option | Where it runs | Typical use |
|---|---|---|
| In-app extensibility | Inside S/4HANA, set up by key users | Custom fields, simple logic |
| Developer extensibility | Inside S/4HANA, written in ABAP Cloud | Tightly coupled logic that needs the same transaction |
| Side-by-side extensibility | On SAP BTP, outside S/4HANA | New apps, integrations, and independent lifecycles |
Why it matters in practice
Clean core pays off in four ways:
- Faster upgrades. Less custom code touches internal objects, so there is less to retest and repair.
- Cloud readiness. In SAP S/4HANA Cloud, SAP upgrades the system on a fixed schedule. Extensions that depend on internals cannot survive that rhythm.
- Lower risk. Stable contracts make breakage rare and predictable.
- Better access to innovation. You can adopt new SAP features without first clearing a backlog of custom code.
A short example
Suppose a team needs to show a "review status" next to each business partner. Two designs are possible.
- Design 1: Add a custom table in S/4HANA and read the standard partner tables directly. If SAP changes those tables, the extension can fail after an upgrade.
- Design 2: Build a small app on SAP BTP. It reads partner data through the released Business Partner OData API and stores the review status in its own database. SAP can change its internals freely, because the app only depends on the API.
Design 2 follows clean core. You build exactly this kind of app with CAP later in the tutorial.
Exercise
A colleague proposes reading the standard business partner database tables directly from a custom ABAP report because "it is faster than the API." Which part of the clean core principle does this break, and what is the likely consequence at upgrade time?
Show answer
It breaks the "stable interfaces only" part. The tables are internal objects that SAP can change or remove in any release, so the report may fail or return wrong data after an upgrade and would need to be repaired and retested. The clean core alternative is to use a released API.