Lesson 1 of 5
Why CDS: code pushdown and semantic models
9 min
Listen to this lesson
Almost everything you see in a modern SAP S/4HANA system reads its data through ABAP Core Data Services (CDS). Fiori list reports, analytical apps, RAP business objects, released APIs and enterprise search all sit on CDS entities. SAP describes ABAP CDS as a framework for defining and consuming semantically rich data models: an extension of SQL that lets you use the strengths of the SAP HANA database and add meaning that transactional and analytical frameworks understand. If you develop, test or sign off anything in SAP S/4HANA, you will meet CDS daily.
Code pushdown
Classic ABAP often read rows into the application server and then filtered, joined and summed them in loops. On SAP HANA that wastes the database's strength. Code pushdown means expressing data-intensive logic where the data lives: joins, filters, aggregations and calculations are defined in a CDS view and executed by the database, and only the result travels to ABAP. For Contoso this matters on day one. The converted core deposit report read every core return agreement and every item into internal tables to total open deposits per customer; a CDS view returns the totals directly.
| Classic pattern | CDS pattern | |
|---|---|---|
| Where joins happen | Nested SELECTs or loops in ABAP | In the view definition, executed by SAP HANA |
| Where totals are built | LOOP AT ... with COLLECT or SUM | Aggregate expressions in the view |
| Meaning of fields | Known only to the program | Annotations: currency, unit, text, label |
| Reuse | Copy-paste the SELECT logic | Consume the same view from many apps |
| Authorization | AUTHORITY-CHECK coded in each program | CDS access control applied to every ABAP SQL read |
Semantic data models
A CDS view is more than a stored query. Through annotations it says which field is an amount and which field holds its currency, which field is the text for a code, how the entity should appear in a Fiori list, and whether it is a cube or a dimension for analytics. Through associations it declares how it relates to other entities, such as an agreement to its customer. Through access controls it declares who may see which rows. The same model then serves read-only reports and transactional RAP apps, which is why SAP calls one data model for both read-only and transactional scenarios a key benefit.
The virtual data model
SAP builds SAP S/4HANA's own CDS models in layers, known as the virtual data model (VDM). Basic interface views sit close to the tables and expose clean, business-named fields. Composite views combine them. Consumption views are shaped for one app or service. SAP's RAP naming conventions reflect the same idea: I_ for interface views, R_ for the base views of a RAP business object, C_ for consumption projections and E_ for extension include views. Many SAP I_ views, such as I_Customer and I_Product, are released APIs you can build on; check API State in ADT before relying on one.
What would you do?
Priya's team finds that the converted core deposit report takes 14 minutes at month-end. Kenji proposes replacing its SELECT-and-LOOP logic with a CDS view that totals deposits per customer. What should Priya ask for before signing off the change?
- CDS defines semantically rich data models executed on SAP HANA.
- Code pushdown moves joins, filters and totals into the database.
- Annotations, associations and access controls give a view meaning beyond SQL.
- SAP layers its models (VDM): basic interface, composite, consumption.
- Prefixes: I_ interface, R_ RAP base, C_ consumption projection, E_ extension include.
Check your understanding · not graded
Lesson check
1. What does code pushdown mean in the context of CDS?
2. Which prefix does SAP’s RAP naming guide use for a consumption projection view?
3. Which statement describes the basic interface layer of a virtual data model?
4. Before signing off a report rewritten as a CDS view, what evidence matters most?