Core Data Services (CDS) is a key technology in SAP’s data modeling framework, enabling the creation of semantic views directly on SAP HANA or within the ABAP layer. CDS views allow developers to define rich, reusable data models using a SQL-like language. In the context of SAP HANA Live and SAP S/4HANA, CDS views have largely replaced older approaches such as SAP HANA Live views and traditional database views for operational reporting.
This article introduces basic CDS view development, focusing on the foundational concept of SELECT statements within CDS.
A CDS view is a definition of a virtual data model that is processed by the underlying database. It defines what data should be selected and how it should be structured, combining tables, views, and other CDS views using SQL-like syntax enhanced with annotations for better semantic and UI integration.
At its core, a CDS view uses a SELECT statement to specify which data to retrieve. The syntax is similar to SQL but embedded within the ABAP environment (in ABAP CDS) or directly in HANA CDS.
@AbapCatalog.sqlViewName: 'ZV_CUSTOMER'
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view ZCustomerBasic
as select from KNA1
{
key KUNNR,
NAME1,
ORT01,
LAND1
}
{ ... } specifies the fields to retrieve.You can filter data within the CDS view using the WHERE clause.
define view ZCustomerGermany
as select from KNA1
{
key KUNNR,
NAME1,
ORT01,
LAND1
}
where LAND1 = 'DE'
This view restricts customers to those with country code 'DE' (Germany).
You can join multiple tables using the JOIN keyword.
define view ZCustomerSales
as select from KNA1
inner join VBAK on KNA1.KUNNR = VBAK.KUNNR
{
key KNA1.KUNNR,
KNA1.NAME1,
VBAK.VBELN,
VBAK.AUART
}
This example combines customer master data with sales order header information.
In SAP HANA Live, the earlier approach was to create Calculation Views with complex SQL modeling on HANA Studio. CDS views now provide a more streamlined, ABAP-integrated way to define semantic data models, promoting reusability and integration with SAP Fiori and embedded analytics.
Mastering basic SELECT statements in CDS is the first step toward building powerful, reusable data models that enable real-time analytics in the SAP ecosystem.