Now accepting guest editorial from SAP, Oracle, Workday and ServiceNow practitioners.Pitch a guide
The Sign-Off Table

Lesson 1 of 5

Why CDS: code pushdown and semantic models

9 min

Listen to this lesson

0:00 / 7:11

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.

Code pushdown moves the join and the totals into SAP HANA, so only the result travels to the ABAP application server.
The Sign-Off Table · thesignofftable.com/academy/sap-abp-201
Classic patternCDS pattern
Where joins happenNested SELECTs or loops in ABAPIn the view definition, executed by SAP HANA
Where totals are builtLOOP AT ... with COLLECT or SUMAggregate expressions in the view
Meaning of fieldsKnown only to the programAnnotations: currency, unit, text, label
ReuseCopy-paste the SELECT logicConsume the same view from many apps
AuthorizationAUTHORITY-CHECK coded in each programCDS access control applied to every ABAP SQL read
From program-centric data access to a reusable, semantic data model.
The Sign-Off Table · thesignofftable.com/academy/sap-abp-201

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.

Consumption (C_)Shaped for one app or service: ZC_CMC_OpenCoreDeposits for Maria’s Fiori list
Composite / base (R_ or I_)Combines entities and adds calculations: deposits per agreement
Basic interface (I_)One business entity, clean field names: ZI_CMC_CoreAgreement over table ZCMC_CORE_AGR
Released SAP viewsI_Customer, I_Product: stable building blocks from SAP
Database tablesZCMC_CORE_AGR and ZCMC_CORE_AGI: the custom tables carried over from ECC
Contoso’s core return model, layered the way SAP layers its own.
The Sign-Off Table · thesignofftable.com/academy/sap-abp-201

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?

Key points
  • 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. 1. What does code pushdown mean in the context of CDS?

  2. 2. Which prefix does SAP’s RAP naming guide use for a consumption projection view?

  3. 3. Which statement describes the basic interface layer of a virtual data model?

  4. 4. Before signing off a report rewritten as a CDS view, what evidence matters most?