What Are CDS Views?
Core Data Services (CDS) views are ABAP-managed database views that define the data model at the database level. They push computation to the database layer (code pushdown) for better performance and are the foundation of S/4HANA's Virtual Data Model (VDM).
Creating a Basic CDS View
@AbapCatalog.sqlViewName: 'ZV_SALES'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Sales Order CDS View'
define view Z_CDS_SALES_ORDER
as select from vbak as header
inner join vbap as item
on header.vbeln = item.vbeln
{
key header.vbeln as SalesOrder,
key item.posnr as ItemNumber,
header.erdat as CreationDate,
header.kunnr as Customer,
item.matnr as Material,
item.netwr as NetValue,
header.waerk as Currency
}
CDS Annotations
Annotations control the behavior and metadata of CDS views:
@UIÔÇö Define Fiori UI layout and field behavior@SearchÔÇö Enable fuzzy search capabilities@ObjectModelÔÇö Define associations and compositions@AnalyticsÔÇö Mark views for analytical processing
CDS View Types in VDM
- Interface Views (I_) ÔÇö Stable reusable data models
- Consumption Views (C_) ÔÇö Tailored for specific UI consumption
- Basic Views ÔÇö Direct table abstractions
- Composite Views ÔÇö Combine multiple basic views
Performance Benefits
CDS views leverage SAP HANA's in-memory processing. Calculations, joins, and aggregations run at the database level, dramatically improving performance compared to traditional ABAP SELECT statements with application-level processing.