Examine clean core levels A to D and adopt ABAP Cloud fundamentals to build upgrade-stable extensions using released APIs and modern CDS view entities.
When you adapt custom code for SAP S/4HANA (SAP Business Suite 4 SAP HANA), your immediate goal is to make existing programs run without errors. Once your system conversion stabilizes, you face a strategic choice for ongoing development. You can keep writing ABAP (Advanced Business Application Programming) the old way, or you can adopt clean core principles so that future upgrades require far less remediation effort.
Previous lesson: ABAP on SAP HANA: Sorting, Database Hints and Code Pushdown | Next lesson: Testing, Cutover and AI-Assisted Custom Code Remediation
Clean core is an architectural strategy that separates custom business logic from the underlying SAP system code. When custom code accesses SAP database tables directly or calls undocumented function modules, any SAP upgrade or support package can break that code. Clean core prevents this break by routing all custom interactions through defined, stable boundaries.
In August 2025, SAP defined four clean core extensibility levels to help you classify and evaluate custom development:
Common Mistake: You do not need to rewrite your entire custom code base in ABAP Cloud during a system conversion. Brownfield conversions bring over classic code that runs as Standard ABAP (often sitting at Level B or Level C). Clean core is your target for new custom applications and targeted refactoring, not an overnight mandate for every existing report.
ABAP Cloud is SAP's development model for building cloud-ready, upgrade-stable applications. It is available in SAP S/4HANA Cloud and modern on-premise releases of SAP S/4HANA. It enforces clean core architecture at the compiler level.
Classic ABAP uses the language version known as "Standard ABAP". Under Standard ABAP, you have access to the entire legacy runtime. You can create executable reports with SE38, design Dynpro screens, use classic selection screens, and execute Open SQL queries against almost any standard SAP table.
ABAP Cloud uses the restricted language version known as "ABAP for Cloud Development". In this environment, the compiler blocks outdated statements and unreleased dependencies:
WRITE), or executable reports.You set the ABAP language version per development object in ADT. In the object properties view, open the General tab, look for ABAP Language Version, and select either "Standard ABAP" or "ABAP for Cloud Development".
Pro Tip: When Harbor Supply Co. migrates to S/4HANA, existing custom programs like ZSD_ORDER_STATUS continue to run as Standard ABAP. However, if the development team builds a new customer-facing status portal, they should set the language version to ABAP for Cloud Development and use released CDS views.
In ABAP Cloud, you can only reference SAP objects that carry a formal release contract. For ABAP Cloud development, the contract to look for is C1, which means the object is released for use in cloud development and SAP keeps it stable across upgrades.
If your program needs data from the sales order tables, you do not query table VBAK directly. Instead, you query a released CDS (Core Data Services) view entity provided by SAP. SAP names many of these released interface views with the prefix I_.
Here is how data retrieval changes when moving from classic ABAP database queries to an ABAP Cloud development model:
Standard ABAP:
abapCopy
ABAP Cloud:
abapCopy
If you try to write SELECT FROM vbak inside an object set to "ABAP for Cloud Development", the syntax check reports an error because VBAK is not a released object.
You can inspect released APIs directly inside ADT. In the Project Explorer, open the system library and navigate to the Released Objects node. You can search by object type to locate released CDS views, released classes, and released data types.
Clean core provides two distinct architectural paths for building new functionality: on-stack extensions and side-by-side extensions.
On-stack extensions run directly inside the SAP S/4HANA system database and application layer. You use this model when custom logic requires high-speed access to large volumes of local enterprise data or needs to execute within standard database transactions.
The modern transactional framework for on-stack ABAP Cloud development is RAP (ABAP RESTful Application Programming Model). RAP replaces old frameworks such as BOPF (Business Object Processing Framework) and classic dialog transactions. In RAP, you define:
Side-by-side extensions run outside the S/4HANA system on SAP BTP. You use this architecture for independent apps, external partner portals, mobile applications, or applications that integrate with multiple non-SAP systems.
SAP BTP communicates with SAP S/4HANA using secure protocols such as OData services or RFC (Remote Function Call) connections managed through the SAP Cloud Connector. Because the extension runs on BTP, its workload does not use compute resources on your S/4HANA system, and S/4HANA upgrades have less impact on the external application.
During a system conversion, Harbor Supply Co. brings thousands of custom objects into S/4HANA. How should your development team organize and manage this code? A practical custom code strategy follows three paths:
Programs like ZMM_STOCK_MOVES and ZSD_PRICE_EXPORT are remediated for data model changes (such as MATDOC and PRCD_ELEMENTS) and kept in Standard ABAP. They continue to run as classic reports. You do not spend time rewriting working batch jobs into RAP or ABAP Cloud unless a major business change requires a complete redesign.
If custom programs must access unreleased SAP objects or legacy tables, wrap those reads inside a custom wrapper class. This design keeps Level C dependencies isolated in one place. When SAP later releases a standard API for that function, you only need to update the wrapper class rather than multiple calling programs.
Create a dedicated ABAP software component or custom package tree in ADT with the language version set to ABAP for Cloud Development. Mandate that all brand-new reporting, interfaces, and SAP Fiori transactional apps are created in this package. This practice prevents the accumulation of fresh technical debt.
Explore how ADT manages language versions and released APIs by completing this exercise in your S/4HANA system:
System Library, and expand Released Objects.Core Data Services and browse the released view entities available under Data Definitions. Check the properties of view I_SalesOrder to see its release state (Contract C1).ZTEST_CLEAN_CORE or use an existing sandbox package.SELECT statement directly against table VBAK.VBAK query with a SELECT from I_SalesOrder using modern syntax, and run the syntax check again.In the next lesson, Testing, Cutover and AI-Assisted Custom Code Remediation, you will learn how to plan regression tests, manage cutover transports, monitor short dumps after go-live, and use AI-assisted tools responsibly during remediation.
Was this lesson helpful?