Sub topic 4
Classifying extensions with clean core levels A to D
This chapter assumes you know what the clean core principle is and what a released API is. It also assumes you can tell in-app, developer, and side-by-side extensions apart. Here you learn to rate an existing extension against the clean core levels.
Why levels exist
"Keep the core clean" is hard to measure. Real systems contain a mix of extensions. Some use only stable interfaces, and others reach into SAP internals. The clean core levels give you a four-step scale so you can sort extensions, compare them, and decide which to fix first.
The level depends on what an extension uses and how it attaches to SAP code. It does not depend on where the extension runs. A side-by-side app can still land in a low level if it calls an unsupported interface.
The four levels
| Level | What the extension uses | Upgrade stability |
|---|---|---|
| A | Released APIs and released extension points only | Stable contract. Cloud-ready. |
| B | Classic APIs and classic extension technologies that SAP documents but has not released for ABAP Cloud | Generally stable, but no formal contract for the cloud |
| C | Internal SAP objects that are not released | No stability promise. Can change or vanish in an upgrade. |
| D | Modifications, implicit enhancements, or direct changes to SAP objects | Likely to break. Needs manual rework at each upgrade. |
Level A is the target. Level B is acceptable as a transition state, and you should plan to move it to A when a released alternative appears. Levels C and D are the technical debt you want to find and remove.
Read the diagram from the worst finding down. One level D dependency makes the whole extension level D, even if everything else is clean. The rating is only as good as the weakest dependency.
Worked classification
Take three extensions from a typical landscape:
- A CAP service on BTP that reads business partners through the released
API_BUSINESS_PARTNEROData API. It uses only a released contract, so it is level A. - A custom ABAP program that calls a classic BAPI documented by SAP but not released for ABAP Cloud. It is level B.
- A custom report that reads an SAP database table directly, because no API existed when it was written. The table is an internal object, so it is level C.
Now suppose extension 3 also contains an implicit enhancement that injects code into a standard SAP program. The implicit enhancement alters SAP code, so the rating drops to level D.
How to apply the levels
- Inventory first. List every custom object and what it depends on.
- Use tooling where you have it. ABAP Test Cockpit (ATC) checks can flag usage of unreleased objects, which gives you evidence for level C findings.
- Record the level with each extension, so reviews can compare against the same scale.
- Set a rule for new work. For example, new extensions must be level A, and a level B needs a written reason.
- Plan remediation for C and D. Look for a released API or extension point, or move the logic side by side.
Common mistakes
- Assuming "runs on BTP" means level A. The dependency decides the level, not the runtime.
- Rating by the average instead of the worst dependency.
- Treating level B as permanent. It has no formal cloud contract, so it can still become a migration task.
Exercise
A side-by-side CAP app reads data from an SAP S/4HANA system. It uses one released OData API and one internal table exposed through a custom service that a colleague built by reading the database directly. What level does the extension get, and why?
Show answer
Level C. The rating follows the weakest dependency. The released API alone would be level A, but the direct use of an internal, unreleased table has no stability contract, so the whole extension is level C. The fix is to replace the table access with a released API or a released CDS view.