Sub topic 9
Clean core and ABAP Cloud
This chapter assumes you know the three editions (Public, Private, on-premise), the three extensibility models (in-app, developer, side-by-side), and basic ABAP syntax. It explains the clean core principle and how ABAP Cloud enforces it.
What clean core means
Clean core is a rule for keeping the standard SAP system free of modifications. Custom code and extensions use only released, stable interfaces. SAP can then update the system without breaking your extensions, and you can adopt new releases with less testing.
A core is clean when it meets these conditions:
- No modifications of SAP objects.
- No reads or writes of unreleased tables, such as MARA.
- No calls to unreleased function modules or classes.
- Extensions stay upgrade-stable because they depend only on released APIs.
Why it matters most in Public Edition
In Public Edition, SAP upgrades every customer on a fixed cadence in a shared, multi-tenant landscape. You cannot delay an upgrade to repair a broken extension. For this reason the edition allows only ABAP Cloud, and the system blocks unreleased objects.
Private Edition and on-premise still allow classic ABAP. Clean core there is a discipline, not a technical block. The cost of ignoring it appears later, as more effort in each upgrade and conversion.
| Aspect | Public Edition | Private Edition | On-premise |
|---|---|---|---|
| Classic ABAP allowed | No | Yes | Yes |
| ABAP Cloud allowed | Yes | Yes | Yes |
| Clean core enforced by system | Yes | No, by governance | No, by governance |
What ABAP Cloud is
ABAP Cloud is the development model for clean core extensions. It combines a restricted ABAP language version with released APIs only. It is built around these elements:
- The ABAP language version "ABAP for Cloud Development", which removes statements that are not cloud-safe.
- Released objects, which carry a release contract such as C1 (use in ABAP Cloud). SAP promises to keep these stable.
- The ABAP Development Tools in Eclipse, which flag violations of the rules while you edit.
- Modern building blocks such as CDS views and the RAP programming model.
Same code in every edition
Code written to the ABAP Cloud rules runs in all three editions. The class below uses only released APIs.
CLASS zcl_edition_probe DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
ENDCLASS.
CLASS zcl_edition_probe IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
out->write( cl_abap_context_info=>get_system_date( ) ).
out->write( cl_abap_context_info=>get_user_technical_name( ) ).
ENDMETHOD.
ENDCLASS.Now compare this statement, which reads an unreleased table directly.
SELECT SINGLE matnr
FROM mara
INTO @DATA(lv_matnr).Classic ABAP accepts it in Private Edition and on-premise. ABAP Cloud rejects it in Public Edition, because MARA has no release contract. The fix is to read through a released CDS view, which SAP maintains as the stable access path to the same data.
How the layers fit together
Common errors
- Treating clean core as a Public Edition topic only, then facing a costly clean-up during a later move.
- Wrapping an unreleased object in a custom class and calling that a clean extension. The dependency on the unreleased object remains.
- Assuming a released API never changes. Released objects can be deprecated, but SAP keeps them working during the deprecation period.
Exercise
A team on Private Edition has an old custom report that selects from MARA. Why will it block a later move to Public Edition, and what is the fix?
Show answer
MARA is not released, so ABAP Cloud, the only development model in Public Edition, rejects the access. The fix is to rewrite the access to use a released CDS view that exposes the material data, and to check the rest of the report against the ABAP Cloud rules.