Professional Documents
Culture Documents
Introduction To ABAP Core Data Services (CDS)
Introduction To ABAP Core Data Services (CDS)
PUBLIC
PUBLIC 1
Agenda
SUMMARY
PUBLIC 2
MODERN ABAP DEVELOPMENT
PUBLIC 3
ABAP Platform – Foundation of SAP’s ERP applications
Maintenance ends
Maintenance until 2040
2027/2030
PUBLIC 4
Modern ABAP application development
Must learn topics: UX, SAP HANA, state of the art development, Cloud
PUBLIC 5
Modern ABAP application development
Programming paradigm shift powered by SAP HANA
DATA-TO-CODE
Data-intensive
computations
in APPLICATION
layer
CODE-TO-DATA*
Data-intensive
computations
in DATABASE
layer
(*) aka Code Pushdown
PUBLIC 6
Modern ABAP application development
Golden rules for SQL programming – Priority shift on SAP HANA
Minimize amaount of transferred data MORE IMPORTANT One aspect of code-to-data paradigm
Minimize number of data transfered MORE IMPORTANT One aspect of code-to-data paradigm
Minimize search overgead LESS IMPORTANT Still relevant for some use cases
Keep load away from database LESS IMPORTANT Code-to-data paradigm where applicable
MAINSTREAM
ABAP managed code pushdown
PUBLIC 8
Evolution of ABAP CDS and Open/ABAP SQL
CLASSIC OPTIMIZED ACCESS OPTIMIZED and SPECIALIZED ACCESS
ACCESS for SAP HANA for SAP HANA
CLOUD QUALITIES
SQL SQL SQL SQLScript SQL SQL Extensions Specialized Engines SQLScript
Windowing Hierarchies Graph
CTE GEO Spatial Support
DB Tuning Objects
(view caches)
QUALITY ASSURANCE
Static code checks (ATC, CVA) with
remote and local scenarios
Unit testing incl. isolation frameworks
Test seams and injections
SUPPORTABILITY
Debugging, profiling, tracing
Static and dynamic logging
Runtime monitoring and analysis
PUBLIC 10
ABAP CDS OVERVIEW
PUBLIC 11
ABAP CDS – Next generation data modeling and access
Semantically rich
Declarative
Close to conceptual thinking
PUBLIC 12
ABAP CDS data models
SERVICE BINDING
SERVICE DEFINITION
EXTENSIBILITY
TUNING OBJECTS CDS DATA MODELS
PUBLIC 13
ABAP CDS – Overview of supported CDS entity types1
Category ABAP CDS Entity Type ABAP CDS Statement
Advanced view building – External implementation CDS Custom Entity DEFINE CUSTOM ENTITY
CDS Abstract Entity DEFINE ABSTRACT ENTITY
Advanced view building – SAP HANA breakout CDS Table Function DEFINE TABLE FUNCTION
CDS Hierarchy DEFINE HIERARCHY
2
CDS Scalar Function DEFINE SCALAR FUNCTION
2
Type definition CDS Simple Type DEFINE SIMPLE TYPE
2
CDS Enumerated Type DEFINE TYPE ENUM
Transactional behavior definition of business objects built CDS Behavior Definition (and Projection) DEFINE BEHAVIOR
with the ABAP RESTful Application Programming Model
PUBLIC 1 Status from Q2/2024 | 2 Available on-prem starting with Release 2023 14
ABAP CDS view entity – Example
View annotations
Associations
Element annotations
Selection
PUBLIC 15
Built-in SQL functions and expressions
GENERIC/
CONVERSION DATE/TIME
AGGREGATION
NUMERIC STRING
PUBLIC 16
CDS annotations for domain-specific frameworks
PUBLIC 17
CDS associations
FROM
CLAUSE
LEFT
OUTER
JOIN
PUBLIC 18
Nested CDS views and extensibility
Basic view
entity
PUBLIC 19
CDS hierarchies – Build hierarchies on SAP HANA
CDS source view
Self association
Filter results
PUBLIC 20
Declarative access control with CDS roles
PFCG PFCG
<Code> Declarative instead of coded approach
<Code>
Using CDS Data Control Language (DCL)
CDS role Explicitly defined for each CDS entity
ABAP SQL
Based on PFCG conditions, literal
conditions, user conditions, and
inheritance conditions
Authorization
ABAP SQL &
check Defined once and automatically used
everywhere
PUBLIC 21
CDS development in Eclipse
01 02 03
Development support Supportability
Syntax check Enhanced data preview
Code completion Dependency analyser
Eclipse-based CDS Tooling Syntax highlighting, pretty printing Activation graph / Dictionary log
Source-based editor Element info and navigation Active annotations view
Part of ABAP Development tools Quick fixes Unit testing
PUBLIC 22
SAP HANA Breakouts
PUBLIC 23
Why code breakouts for SAP HANA make sense
PUBLIC 24
ABAP managed database procedures (AMDP) for SAP HANA
EASY ACCESS TO
UTILIZE NATIVE INTEGRATED IN THE SAP HANA ADVANCED
SAP HANA ENTITIES ABAP INFRASTRUCTURE ENGINES / LIBRARIES
PUBLIC 25
CDS table functions – Seamless AMDP integration into CDS
AMDP
class
SAP HANA
DDL Database
Source
AMDP function
Implementation
Includes SQLScript based
database function body
PUBLIC 26
AMDP development in Eclipse
DEVELOPMENT
SUPPORTABILITY
PUBLIC 27
CORE DATA SERVICES IN
ABAP APPLICATION PROGRAMMING
PUBLIC 28
ABAP Cloud big picture
BUILT-IN QUALITIES
(OData and InA1)
TOOLS
DOMAIN-SPECIFIC MODELS
CDS2 entity, RAP3 Business Object, CDS analytical provider
DOMAIN-SPECIFIC
IMPLEMENTATION
BAS7,
DOMAIN-SPECIFIC LOGIC
ADT6,
ABAP, CDS
1 Information access 3 ABAP RESTful application programming model 5 Business Configuration 7 Business Application Studio
PUBLIC 29
2 Core Data Services 4 Identity& Access Management 6 ABAP Development Tools
ABAP RESTful
APPLICATION
PROGRAMMING
MODEL (RAP)
PUBLIC 30
Evolution of the ABAP programming model
CDS as vital part of SAP S/4HANA and SAP BTP ABAP Environment
Best practice freestyle ABAP CDS, CDS-based BOPF, CDS, Behavior Definition &
programming, (Web) Dynpro, SEGW/@OData annotation Implementation, Business
CDS1 with Referenced Data Source Services
1 starting with release 7.4 SPS05
Safe investments!
PUBLIC 31
ABAP RESTful application programming model – Big picture
At the heart of ABAP Cloud for transactional scenarios
APP SAP FIORI APPS
DOMAIN-SPECIFIC MODELS
CDS1 entity, RAP2 Business Object
DOMAIN-SPECIFIC
IMPLEMENTATION
DOMAIN-SPECIFIC LOGIC
ABAP, CDS
CLIENTS
VDM is the data model and source for all types of apps
Transactional
PUBLIC 33
CDS in SAP S/4HANA – Recommendations
PUBLIC 34
ANALYTICS
PUBLIC 35
Motivation for embedded analytics
PUBLIC 36
ABAP analytics – Big picture
At the heart of ABAP Cloud for analytical scenarios
APP ANALYTICAL APPS
UI SERVICES
UI services for analytical clients
BUSINESS (InA1)
SERVICE
EXPOSURE
SERVICE BINDING
Service Definition, Service Projection
= X = X
SERVICE CONSUMPTION
Clients
SERVICE BINDING
BUSINESS SERVICE EXPOSURE
For Information Access Protocol (InA) SERVICE DEFINITION
Query
ABAP CDS
PUBLIC 38
SUMMARY
PUBLIC 41
Key takeaways
CDS offers advanced capabilities to fully leverage SAP HANA’s power in ABAP applications
CDS is the next generation data modelling infrastructure on the ABAP platform
CDS is the cornerstone of the ABAP RESTful Application Programming Model (RAP)
CDS plays a vital role in SAP BTP ABAP environment and SAP S/4HANA on-premise as well as in the cloud
Further enhancements and optimizations will be delivered with future ABAP platform releases
PUBLIC 42
More information
SAP Community
❖ ABAP Development Community
❖ Landing pages: ABAP Platform 2021 | ABAP Platform 2020 | ABAP Platform 1909
| ABAP Platform 1809 | AS ABAP 7.52 | AS ABAP 7.51 | AS ABAP 7.50
❖ Getting started with ABAP development for SAP HANA
❖ Getting started with ABAP Core Data Services (CDS)
❖ Getting started with the ABAP RESTful Application Programming Model
❖ Developer center: https://www.sap.com/developer/topics/abap-platform.html
PUBLIC 43
Thank you.
Contact information:
Name
Email
PUBLIC
© 2024 SAP SE or an SAP affiliate company. All rights reserved. See Legal Notice on www.sap.com/legal-notice for use terms, disclaimers, disclosures, or restrictions related to this material. 44