Skip to content
IT Canvass
SAP ABAP development · Lesson

CDS views

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.

Want to learn this properly?

Our live, instructor-led SAP Training covers this hands-on, with real projects and a certification path.

Check your understanding

  1. Which statement is true of CDS views?

    • A. This downloads hub gathers practical, reusable SAP assets, templates, cheat sheets, sample projects and…
    • B. CDS underpins S/4HANA’s data model, embedded analytics and OData/Fiori.
    • C. The sales order is the central document of SAP SD, it captures a customer’s request to buy, driving…
    Show answer

    B. CDS underpins S/4HANA’s data model, embedded analytics and OData/Fiori.

    Covered in the “What CDS is” section of this lesson.

  2. Which of these also applies to CDS views?

    • A. CDS annotations add meaning and behaviour, expose a view as an OData service for Fiori (@OData.
    • B. Protecting app servers but not central services/database.
    • C. Skipping the discipline under delivery pressure.
    Show answer

    A. CDS annotations add meaning and behaviour, expose a view as an OData service for Fiori (@OData.

    Covered in the “Annotations make CDS powerful” section of this lesson.

  3. Which part of the Learn SAP curriculum covers CDS views?

    • A. SAP ABAP development
    • B. SAP best practices
    • C. SAP labs
    Show answer

    A. SAP ABAP development

    This lesson sits in the SAP ABAP development section of the Learn SAP course.

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.
CallWhatsAppEnquire