Mastering CDS Views in SAP ABAP on HANA

The Foundation Every S/4HANA Developer Must Own in 2026

If ABAP on HANA is the engine driving S/4HANA, then Core Data Services (CDS) Views are its fuel — and developers who cannot write them fluently are effectively locked out of modern SAP development. In 2026, CDS Views are not an advanced topic; they are the absolute baseline.

In the previous post of this series, we explored why learning SAP ABAP on HANA in 2026 is one of the most strategically sound career moves in enterprise technology. Now we go deeper. This post breaks down exactly what CDS Views are, why they replace classic SELECT statements, how they power SAP’s entire S/4HANA Virtual Data Model (VDM), and how you can write your first CDS View today — even as a beginner.


Key Stats:

  • 100% of S/4HANA VDM is built on CDS Views
  • 10x faster query performance vs. classic ABAP SELECT.
  • 3,500+ standard CDS Views delivered by SAP in S/4HANA
  • #1 most requested ABAP on HANA skill in job postings

1. What Are CDS Views — And Why Do They Exist?

The Problem With Classic ABAP SELECT

Classic ABAP developers are accustomed to fetching data with SELECT statements into internal tables, then processing that data in application memory. On traditional databases, this was the only practical approach. But when SAP HANA arrived — a fully in-memory, columnar database — this pattern became a performance anti-pattern. Bringing millions of rows from the database into application memory just to aggregate them is like driving to a library, photocopying every book, and then reading them at home. It is wasteful, slow, and inefficient.

CDS as the Answer to Push-Down Logic

Core Data Services solves this by defining data models and data access logic directly at the database level. Instead of telling ABAP to fetch data and then compute, you define a CDS View that tells HANA to compute and then return only the result. This “push-down” principle is the central performance philosophy of SAP ABAP on HANA, and CDS Views are its primary mechanism.

Key Concept: A CDS View is not just a database view. It is a semantic, annotation-rich data definition that can carry metadata, access controls, OData exposure settings, and analytical capabilities — all in one artefact.


2. The Anatomy of a CDS View

Three Layers Every Developer Must Understand

A CDS View in SAP ABAP has three distinct components that work together. Understanding each layer is essential before writing a single line of CDS syntax.

  • Data Definition — The DDL source file: defines the view name, associations, fields, and joins
  • Annotations — Metadata decorators: control OData exposure, UI labels, access control, and analytics
  • Access Control — DCL source: restricts data visibility using authorisation objects and conditions

Your First CDS View: A Practical Example

Below is a minimal but complete CDS view that reads sales order header data from the standard S/4HANA table and exposes it with a meaningful semantic label.

@AbapCatalog.sqlViewName: 'ZSALES_V'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Sales Order Overview'

define view Z_CDS_SalesOrder
  as select from vbak
{
  key vbeln          as SalesOrder,
      erdat          as CreationDate,
      auart          as OrderType,
      kunnr          as SoldToParty,
      netwr          as NetValue,
      waerk          as Currency
}

This single artefact replaces a classic SELECT, an internal table declaration, and multiple ABAP statements. More importantly, the computation happens inside HANA — not inside the application server. Even this simple example executes significantly faster at scale.


3. The CDS View Hierarchy: Interface, Consumption, and Extension Views

How SAP Structures Its Own VDM — And Why You Should Mirror It

SAP’s S/4HANA Virtual Data Model uses a three-tier CDS hierarchy that has become the industry standard for custom development. Understanding this hierarchy is what separates junior ABAP developers from architects.

  • Basic Interface Views (prefix I_) — raw data access, close to table level, reusable across all layers
  • Composite Interface Views (also I_) — combine multiple basic views through associations and joins
  • Consumption Views (prefix C_) — purpose-built for a specific consumer: Fiori app, OData service, or analytical query
  • Extension Include Views — allow partners and customers to add custom fields without modifying SAP standard

Why This Matters for Your Custom Development

When you build custom reports, Fiori apps, or BTP extensions, mirroring this hierarchy keeps your development clean and upgradeable. A consumption view for a Fiori app should never read directly from a database table — it should consume a well-defined interface view. This separation of concerns is not just best practice; on S/4HANA, it is increasingly enforced by SAP’s clean core guidelines.

“Developers who understand the VDM hierarchy can navigate and extend SAP’s standard data model in hours. Those who don’t spend days reverse-engineering table relationships that CDS associations already expose cleanly.” — SAP Mentor, SAP Community 2025


4. Associations: The Most Powerful Feature Most Beginners Ignore

Associations vs. Joins — A Critical Distinction

Classic SQL joins are eager — they execute at query time regardless of whether the joined data is actually needed. CDS Associations are lazy — they define a potential path to related data, but the join only fires when a consumer actually navigates the association. This makes CDS Views dramatically more efficient in composite scenarios where some consumers need related data, and others do not.

define view Z_CDS_SalesOrderWithCustomer
  as select from vbak
  association [0..1] to kna1 as _Customer
    on $projection.SoldToParty = _Customer.kunnr
{
  key vbeln           as SalesOrder,
      kunnr           as SoldToParty,
      netwr           as NetValue,

      _Customer.name1 as CustomerName,
      _Customer
}

Path Expressions in ABAP and OData

Once an association is defined, consumers can navigate it using path expressions. In ABAP, a SELECT on a CDS view can traverse _Customer.name1 without writing any explicit join. In OData, the association becomes a navigation property automatically. This consistency across consumption channels is one of CDS’s most elegant design features.


5. Annotations That Transform a View From Data to Application

OData Exposure With @OData.publish

Adding a single annotation to a CDS View can automatically generate an OData service, making the data instantly consumable by Fiori apps, SAP Analytics Cloud, and third-party integrations. This eliminates the tedious manual work of creating service definitions and mappings in classic ABAP development.

UI Annotations for Fiori Elements

The @UI annotation namespace allows developers to define how fields appear in Fiori Elements templates — labels, search fields, table column visibility, and facets — all from within the CDS View itself. A developer who understands @UI.lineItem, @UI.selectionField, and @UI.facet can build a complete Fiori List Report without writing a single line of JavaScript.

Power Tip: Annotations in CDS Views are not just metadata decorators. They are executable instructions that drive Fiori rendering, OData generation, access control evaluation, and SAP Analytics Cloud consumption — all from one place. Learning annotation namespaces deeply pays dividends across every SAP technology stream.

Analytics Annotations for Embedded Reporting

The @Analytics and @Semantics annotation namespaces turn a CDS View into an analytical query consumable by SAP Analytics Cloud, SAP Lumira, or custom query execution via the InA protocol. Dimensions, measures, and hierarchies are defined once in CDS and consumed everywhere — eliminating duplicate modelling across reporting tools.


6. Access Control With DCL — Securing Your CDS Views

Why Implicit Access Control Is Insufficient

By default, a CDS View with @AccessControl.authorizationCheck: #CHECK performs implicit ABAP authority checks based on the underlying tables. For many scenarios, this is adequate. But for custom views that aggregate sensitive data — HR records, financial positions, personal customer data — explicit DCL (Data Control Language) access control is mandatory.

Writing Your First DCL Rule

A DCL source file defines which conditions must be satisfied for a user to see rows in a CDS View. Conditions are expressed using authorisation objects and can reference organisational assignments like company code, plant, or cost centre. This row-level security approach is far more granular than classic ABAP authority checks and aligns with GDPR and data residency requirements that enterprises increasingly face.

@MappingRole: true
define role Z_CDS_SalesOrder_DCL {
  grant select on Z_CDS_SalesOrderWithCustomer
    where (SalesOrganisation) = aspect pfcg_auth(
      V_VBAK_AAT,
      VKORG,
      ACTVT, '03');
}

7. Building Your CDS Skills: A Practical Learning Path

Week 1–2: Foundations

Start with SAP’s free learning content on the SAP Learning Hub. The course “Working with Core Data Services in ABAP” covers DDL syntax, basic views, and annotations. Supplement with hands-on practice in a free SAP BTP ABAP Environment trial — write at least five CDS Views from scratch before moving on.

Week 3–4: Intermediate Patterns

Study SAP’s standard VDM by navigating delivered CDS Views in ADT (ABAP Development Tools in Eclipse). Pick a business process you know — sales orders, purchase orders, HR leave — and trace the CDS hierarchy from consumption view down to basic interface view. This reverse-engineering exercise accelerates understanding faster than any tutorial.

Week 5–6: Project-Grade Application

Build a complete mini-project: a CDS View hierarchy with associations, DCL access control, OData exposure, and a Fiori Elements list report consuming it. This portfolio piece demonstrates real-world capability and is directly relevant to job interviews and client engagements.

Recommended tools and resources:

  • ABAP Development Tools (ADT) in Eclipse — mandatory for CDS development
  • SAP Help Portal — Core Data Services (ABAP CDS) documentation
  • SAP BTP Free Tier ABAP Environment — free hands-on access
  • SAP Community CDS tag — hundreds of worked examples and Q&A threads

Conclusion: CDS Views Are the Career Gateway Into Modern SAP

In the S/4HANA era, every significant development task — whether building Fiori apps, exposing APIs, generating analytical reports, or extending the VDM — flows through Core Data Services. CDS Views are not one skill among many in the ABAP on HANA toolkit. They are the foundational layer on which everything else is built.

Developers who invest time in truly mastering CDS Views — their hierarchy, associations, annotations, and access control — will find that adjacent skills (ABAP RAP, OData services, SAP Analytics Cloud integration) become dramatically easier to learn. The investment compounds.

In the next post in this series, we will go deeper into ABAP Managed Database Procedures (AMDPs) — where the most dramatic HANA performance gains live and where experienced developers separate themselves from the crowd.

Leave a Reply

Your email address will not be published. Required fields are marked *