IT CanvassTalk to an advisor
SAP ABAP development · LessonBy , SAP Trainer, 10 yrs · Published · SAP S/4HANA 2023 · all levels

CDS views

CDS (Core Data Services) views are the modern, code-pushdown way to define data models and analytics in ABAP, executed on the HANA database. CDS is central to S/4HANA development, Fiori and analytics, and a must-learn for modern ABAP.

Quick answer

CDS is the data-modelling foundation of the modern ABAP RESTful Application Programming model (RAP), the standard for building Fiori apps and services in S/4HANA.

Key takeaways
  • CDS views are defined in ABAP (as source objects) but run as views on the HANA database, embodying the "code-to-data" principle…
  • CDS annotations add meaning and behaviour, expose a view as an OData service for Fiori (@OData.
  • CDS is central to S/4HANA development, Fiori and analytics, and a must-learn for modern ABAP.
  • Watch out: Pulling data into ABAP instead of modelling in CDS.

What CDS is

CDS views are defined in ABAP (as source objects) but run as views on the HANA database, embodying the "code-to-data" principle: instead of pulling rows into ABAP and processing them, you define rich, reusable views (with joins, aggregations, associations and annotations) that the database computes. CDS underpins S/4HANA’s data model, embedded analytics and OData/Fiori.

A simple CDS view

@AbapCatalog.sqlViewName: 'ZVSALESSUM'
@AccessControl.authorizationCheck: #CHECK
define view Z_Sales_Summary as select from vbak
  association [1..*] to vbap as _Items on vbak.vbeln = _Items.vbeln
{
  key vbak.vbeln,
  vbak.kunnr,
  sum( _Items.netwr ) as TotalValue
} group by vbak.vbeln, vbak.kunnr

Annotations make CDS powerful

CDS annotations add meaning and behaviour, expose a view as an OData service for Fiori (@OData.publish), mark analytics semantics, define UI hints, and enforce authorization. This is how one CDS view can drive a Fiori app, an analytical query and an API.

CDS and RAP

CDS is the data-modelling foundation of the modern ABAP RESTful Application Programming model (RAP), the standard for building Fiori apps and services in S/4HANA. Learning CDS is the entry point to modern, cloud-ready ABAP development.

Common pitfalls

  • Pulling data into ABAP instead of modelling in CDS.
  • Ignoring annotations that unlock OData/analytics.
  • Over-complex single views instead of layered, reusable ones.

Practice challenge

+0 XPStreak ×0
Question 1 of 3
Which statement is true of CDS views?

Frequently asked questions

What does the term CDS views refer to in SAP?
CDS (Core Data Services) views are the modern, code-pushdown way to define data models and analytics in ABAP, executed on the HANA database. CDS is central to S/4HANA development, Fiori and analytics, and a must-learn for modern ABAP.
What changed for CDS views in S/4HANA?
CDS views are defined in ABAP (as source objects) but run as views on the HANA database, embodying the "code-to-data" principle: instead of pulling rows into ABAP and processing them, you define rich, reusable views (with joins, aggregations, associations and annotations) that the database computes.
What is the Fiori angle on CDS views?
CDS is the data-modelling foundation of the modern ABAP RESTful Application Programming model (RAP), the standard for building Fiori apps and services in S/4HANA.
What tends to go wrong with CDS views?
Pulling data into ABAP instead of modelling in CDS. Ignoring annotations that unlock OData/analytics. Over-complex single views instead of layered, reusable ones.
Already working on SAP and stuck on a live ticket?Get an expert SAP developer on screen-share to finish your daily tasks with you. Deliver on time, protect your reputation and your job. Monthly support only, no task-wise plans.Task assigned · no idea where to startStill stuck · your job on the lineExpert joins your screenDelivered on timeExplore On Job Support