Blogs

ABAP CDS Views: Complete Introduction and Developer Guide (2026)

ABAP CDS (Core Data Services) Views are a modern data modeling framework in SAP development that allows developers to define database views enriched with business semantics, annotations, and associations — directly on the application server. Unlike traditional ABAP Open SQL queries or database-level views, CDS views push data-intensive operations down to the SAP HANA database layer, dramatically improving query performance while making data models reusable across Fiori apps, OData services, and analytics tools.

CDS Views are written using a SQL-like DDL (Data Definition Language) syntax inside the ABAP Development Tools (ADT) in Eclipse. They are the foundation of SAP’s RAP (RESTful Application Programming) model and Virtual Data Models (VDMs) in S/4HANA — understanding CDS is now a baseline competency for any SAP ABAP developer working in modern SAP landscapes.

What Are ABAP CDS Views?

ABAP CDS views are database view definitions managed at the ABAP application layer rather than directly in the database. This distinction matters because:

  • They are portable: CDS views are database-agnostic at the definition level (though optimized for HANA).
  • They carry semantics: annotations embed metadata that UI frameworks, analytics engines, and API frameworks consume automatically.
  • They are composable: one CDS view can build on another, creating layered data models from raw tables to consumption-ready APIs.
  • They are activated: when activated in ADT, the ABAP runtime generates the corresponding database object and makes it available to Open SQL, OData, and analytics tools.

Key Features of ABAP CDS Views

SAP HANA Code Push-Down

The most significant performance advantage of CDS views is code push-down: complex calculations, aggregations, and joins are executed directly in SAP HANA’s in-memory engine rather than in the ABAP application layer. This eliminates the “select everything and filter in ABAP” anti-pattern that caused performance problems in older SAP systems. For large data sets, the difference can be orders of magnitude.

Annotations for Business Semantics

Annotations are metadata directives embedded in CDS source code that communicate intent to consuming frameworks. Examples:

  • @AbapCatalog.sqlViewName: Defines the database view name generated on activation.
  • @OData.publish: true: Automatically exposes the CDS view as an OData service.
  • @UI.lineItem: Marks fields for display in Fiori List Report applications.
  • @Analytics.dataCategory: Configures the view for use in SAP Analytics Cloud or Analysis for Office.
  • @AccessControl.authorizationCheck: Enforces authorization checks via CDS Access Control (DCL).

Associations (Implicit JOINs)

Associations define relationships between CDS views declaratively. Unlike hardcoded JOINs, associations are only resolved when a consuming view or query actually navigates the path — making data models more flexible and preventing unnecessary database reads.

OData Exposure

CDS views can be exposed as OData V2 or V4 services with minimal additional configuration. In the RAP model, a CDS view with the right annotations and a behavior definition becomes a full Create-Read-Update-Delete (CRUD) OData service that Fiori apps consume directly.

Types of ABAP CDS Views (Virtual Data Model Layers)

SAP’s Virtual Data Model (VDM) in S/4HANA organizes CDS views into three layers:

Basic CDS Views (Raw Layer)

Basic views sit directly on top of physical SAP database tables (like BKPF, VBAK, MARA). They define the raw data exposure with minimal business logic — primarily field selection, type casting, and simple calculations. Basic views are the foundation that composite and consumption views build on.

Composite CDS Views (Business Logic Layer)

Composite views combine multiple basic views to build richer data models representing meaningful business entities. This is where joins between documents, currency conversions, and business-specific logic are applied.

Consumption CDS Views (UI/API Layer)

Consumption views are optimized for specific UI scenarios (Fiori apps, reports) or API surfaces. They carry the heaviest annotation load — UI annotations, search annotations, and analytics annotations that directly drive application behavior.

CDS Views vs Traditional ABAP Reports

  • Performance: CDS views execute in HANA (push-down); traditional reports execute in the ABAP layer after fetching data. For large data volumes, CDS views are significantly faster.
  • Reusability: CDS views are standalone, named objects that any program, OData service, or another view can reference. Traditional reports encapsulate logic that cannot be easily reused.
  • Semantics: CDS views carry annotations that Fiori, analytics, and API frameworks understand automatically.
  • Maintainability: Changes to a CDS view propagate to all consumers automatically.
  • Development tools: CDS views are developed in Eclipse ADT; traditional reports use SE38/SE80 in SAP GUI.

ABAP CDS Views and the RAP Framework

CDS views are the data model foundation of SAP’s RESTful ABAP Programming Model (RAP) — the recommended approach for building transactional SAP Fiori apps in S/4HANA. In RAP, a CDS view defines the data structure, a Behavior Definition specifies which CRUD operations are supported, and a Behavior Implementation class provides the ABAP logic.

How to Get Started with ABAP CDS Views

  1. Install ABAP Development Tools (ADT) in Eclipse with the SAP-provided plugin update site.
  2. Connect ADT to your SAP S/4HANA or NetWeaver system.
  3. Create a new Core Data Services → Data Definition object in your package.
  4. Write the CDS DDL: define the data source (FROM clause), select fields, add associations, and apply annotations.
  5. Activate the view. ADT generates the database view and reports any syntax or activation errors.
  6. Test the view using the Data Preview function in ADT.
  7. Expose it as an OData service or connect to an Analytics scenario via the appropriate annotations.

For teams new to CDS, the SAP Community ABAP topic page provides structured learning paths. Our SAP ABAP consultants can also provide hands-on guidance.

Frequently Asked Questions

What are ABAP CDS Views used for?

CDS views are used to define reusable, semantically rich data models in SAP systems. They power Fiori applications, OData APIs, analytics reports, and form the data layer of RAP-based transactional apps. They replace older data access patterns with a centralized, maintainable data modeling approach.

Do ABAP CDS Views require SAP HANA?

ABAP CDS views can be defined and used on non-HANA databases, but their full performance potential — especially code push-down for complex aggregations — is realized only on SAP HANA. In S/4HANA environments (which mandate HANA), CDS views are the standard data modeling approach.

What is the difference between CDS Views and database views?

Database views (SE11) are defined at the database level with no business semantics beyond field mappings and join conditions. CDS views are defined at the ABAP application layer, carry annotations, support associations, can include calculated fields and currency conversions, and integrate with the entire SAP application framework.

Are CDS Views part of S/4HANA?

Yes. SAP S/4HANA’s entire Virtual Data Model is built using CDS views. SAP delivers thousands of CDS views in S/4HANA that expose business data for reporting, APIs, and Fiori apps. Custom development in S/4HANA is expected to follow the same CDS-based approach.

When should I use a CDS View instead of an ABAP class or function module?

Use a CDS view when your goal is to read and expose data — for reporting, analytics, Fiori UI, or OData APIs. Use an ABAP class or function module when you need to write business logic that modifies data, handles complex control flow, or processes transactions. In RAP, CDS views handle the data model while behavior classes handle the transactional logic — the two complement each other.

How do CDS Views relate to SAP Fiori?

Fiori apps built on the List Report and Object Page floorplans read their data directly from CDS consumption views annotated with @UI annotations. The Fiori Elements framework automatically generates the UI layout based on these annotations, without requiring custom frontend coding. This is why understanding CDS annotations is essential for any team building Fiori apps in S/4HANA.

What is the difference between ABAP CDS and Open SQL?

Open SQL is the query language used inside ABAP programs to read data from database tables. CDS views are persistent, named view objects that can be queried via Open SQL — but they also carry metadata (annotations), associations, and push-down logic that simple Open SQL SELECT statements cannot express. Think of CDS views as reusable, annotated data models built on top of the same database tables that Open SQL reads.

References


Similar
Blog

Your mail has been sent successfully. You will be contacted as soon as possible.

Your message could not be delivered! Please try again later.