1
PUBLIC
PUBLIC
Introduction to
ABAP Core Data Services
ABAP Platform Product Management, SAP SE
May 2024
2
PUBLIC
MODERN ABAP DEVELOPMENT
ABAP CORE DATA SERVICES (CDS) OVERVIEW
CDS IN ABAP APPLICATION PROGRAMMING
SUMMARY
Agenda
3
PUBLIC
MODERN ABAP DEVELOPMENT
4
PUBLIC
SAP
BUSINESS
SUITE
& SAP NetWeaver products
like SAP BW, SAP PI, …
ABAP Platform – Foundation of SAP’s ERP applications
ABAP Cloud based
SAP BTP solutions &
extensions
INTEGRATE
Improvements
Maintenance ends
2027/2030
RISE with SAP
ONE COMMON ABAP PLATFORM INNOVATION CODELINE
ABAP Platform 2023
Every 2 years a new release
SAP HANA only
SAP
S/4HANA
any premise
Maintenance until 2040
GROW with SAP
ABAP Platform
Cloud
Half-yearly releases
SAP HANA only
SAP
S/4HANA
Cloud
Private
Edition
SAP NetWeaver
No new releases, only patches
Any database
SAP BTP ABAP
Environment
Quarterly releases
SAP HANA Cloud only
SAP
S/4HANA
Cloud
Public
Edition
5
PUBLIC
Modern ABAP application development
Must learn topics: UX, SAP HANA, state of the art development, Cloud
Stable Cloud extensions
In-app and side-by-side
Released APIs
Cloud ready apps
Cloud
Secure app development,
high code quality
Agile & test driven
Customer code
management
Efficient
development
Utilize SAP HANA
capabilities
ABAP-managed
Code Pushdown
Advanced application and
Function libraries
Focus on
User Experience
On any device
Role based
Device switch and
collaboration
Browser based
SAP Fiori and SAPUI5,
ABAP RESTful Application
Programming Model
ABAP SQL,
Core Data Services,
SAP HANA breakouts
ABAP language and tools,
Development methodology
In-App extensibility,
Developer extensibility,
SAP BTP
6
PUBLIC
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
More in this blog
7
PUBLIC
Modern ABAP application development
Golden rules for SQL programming – Priority shift on SAP HANA
More in this blog
Keep result sets small
Minimize amaount of transferred data
Minimize number of data transfered
Minimize search overgead
Keep load away from database
UNCHANGED
MORE IMPORTANT One aspect of code-to-data paradigm
MORE IMPORTANT One aspect of code-to-data paradigm
LESS IMPORTANT Still relevant for some use cases
LESS IMPORTANT Code-to-data paradigm where applicable
8
PUBLIC
Modern ABAP application development on SAP HANA
ABAP Core Data Services (CDS)
ABAP SQL (fka Open SQL)
ABAP Managed Database Procedures
(AMDP) – Procedures and Functions
CDS Table Functions
SAP HANA BREAKOUTS
MAINSTREAM
ABAP
managed
code
pushdown
9
PUBLIC
Evolution of ABAP CDS and Open/ABAP SQL
SAP HANA
CLOUD QUALITIES
(Key User) Extensibility
Allowlisting-support for
CDS & AMDPs
DB Administration
Supportability
ABAP RESTful Programming
Model support
ANYDB
BREAKOUTS1
SQL
ANYDB
SQL SQL SQLScript
SAP HANA
SQL
Windowing
CTE
SQLScript
SQL Extensions
Hierarchies
GEO Spatial Support
DB Tuning Objects
(view caches)
Specialized Engines
Graph
OPTIMIZED and SPECIALIZED ACCESS
for SAP HANA
CLASSIC
ACCESS
BREAKOUTS1
OPTIMIZED ACCESS
for SAP HANA
CDS / OPEN SQL CDS / OPEN SQL CDS / ABAP SQL2
Release 7.4 Release 7.50 – 7.52 Release ≥ 7.53
1*AMDP procedures and functions, CDS table functions, and CDS hierarchies
2*Open SQL was renamed to ABAP SQL starting with ABAP Platform 1809
10
PUBLIC
Debugging, profiling, tracing
Static and dynamic logging
Runtime monitoring and analysis
Static code checks (ATC, CVA) with
remote and local scenarios
Unit testing incl. isolation frameworks
Test seams and injections
Fully eclipse-based
Syntax check, code completion
Navigation, search, quick fixes
Full support for the ABAP RESTful
Application Programming Model and CDS
Efficient ABAP development in Eclipse
MODERN DEVELOPMENT TOOLSET
QUALITY ASSURANCE
SUPPORTABILITY
HIGH DEVELOPER PRODUCTIVITY ON-PREMISE AND IN THE CLOUD
11
PUBLIC
ABAP CDS OVERVIEW
12
PUBLIC
ABAP CDS – Next generation data modeling and access
For all application domains
Rich set of built-in functions
Code pushdown capabilities
Declarative access control
Reduced complexity
Extending SQL
Semantically rich
Declarative
Close to conceptual thinking
COMMON DATA MODEL
IMPROVED PROGRAMMING MODEL
CAPTURE BUSINESS INTENT
13
PUBLIC
NATIVE CONSUMPTION
ABAP CDS data models
DATA
MODELING
TUNING OBJECTS CDS DATA MODELS
SAP HANA tuning objects
ABAP tuning objects Domain specific data models
CDS modeling entities
CDS table functions for SAP HANA native
objects (procedures, functions)
CDS types
SERVICE PROJECTIONS AND INTERFACES
SERVICE DEFINITION
SERVICE BINDING
BUSINESS SERVICE
EXPOSURE
& DATA ACCESS
SERVICE CONSUMPTION
CONSUMPTION
ABAP SQL AMDP
CDS SAP Fiori UI Analytical client Web APIs SQL
CDS projection views
EML
EXTENSIBILITY
Business
events
CDS access
controls
14
PUBLIC
Category ABAP CDS Entity Type ABAP CDS Statement
Standard view building CDS View Entity
CDS Projection View
CDS Projection View – Analytical Query
CDS DDIC-based View (deprecated)
DEFINE VIEW ENTITY
DEFINE VIEW ENTITY AS PROJECTION ON
DEFINE TRANSIENT VIEW ENTITY AS PROJECTION ON
DEFINE VIEW (deprecated)
Advanced view building – External implementation CDS Custom Entity
CDS Abstract Entity
DEFINE CUSTOM ENTITY
DEFINE ABSTRACT ENTITY
Advanced view building – SAP HANA breakout CDS Table Function
CDS Hierarchy
CDS Scalar Function
2
DEFINE TABLE FUNCTION
DEFINE HIERARCHY
DEFINE SCALAR FUNCTION
Type definition CDS Simple Type
2
CDS Enumerated Type
2
DEFINE SIMPLE TYPE
DEFINE TYPE ENUM
Transactional behavior definition of business objects built
with the ABAP RESTful Application Programming Model
CDS Behavior Definition (and Projection) DEFINE BEHAVIOR
Modification-free extension CDS View Entity Extension
CDS Custom Entity Extension
CDS Abstract Entity Extension
CDS DDIC-based View Extension (deprecated)
CDS Metadata Extension
CDS Behavior Extension
EXTEND VIEW ENTITY
EXTEND CUSTOM ENTITY
EXTEND ABSTRACT ENTITY
EXTEND VIEW (deprecated)
ANNOTATE VIEW
EXTEND BEHAVIOR
Access control definition CDS Access Control DEFINE ROLE
ABAP CDS – Overview of supported CDS entity types1
1 Status from Q2/2024 | 2 Available on-prem starting with Release 2023
15
PUBLIC
ABAP CDS view entity – Example
Selection
Data source
Element annotations
Associations
ABAP Flight Reference Scenario -
Example available in package /DMO/FLIGHT_DRAFT
View annotations
View definition
16
PUBLIC
Built-in SQL functions and expressions
GENERIC/
AGGREGATION
CONVERSION DATE/TIME
STRING
NUMERIC
17
PUBLIC
CDS annotations for domain-specific frameworks
Enrich meta model with consumer-specific
vocabularies
Reusable and unified view model for all use
cases
Enabling flexible usage in different contexts
Separation of concern using CDS metadata
extensions for UI-specific annotations
Vital part of new ABAP programming models
CDS
ANNOTATION
DOMAINS
ANALYTICS
BI-TOOLS
PLANNING
SEARCH
SAP FIORI
ELEMENTS
…
18
PUBLIC
CDS associations
WHERE
CLAUSE
PROJECTION
LIST
HAVING
CLAUSE
GROUP BY
CLAUSE
LEFT
OUTER
JOIN
FROM
CLAUSE
INNER
JOIN
Capturing the relationships between entities
in the data model
Used associations are implicitly translated
into SQL joins
Reuse of generated joins when semantically
identical
Can be queried in CDS views and ABAP SQL
Navigate thru entity using path expressions
19
PUBLIC
Nested CDS views and extensibility
Hierarchical view-on-view concept
Optimized result sets with minimum
data transfer
Modification-free append of additional
columns, arithmetic expressions or
literals to result set
Basic view
entity
View on View
Consumer Extensions
C1
V1
&
Consumer Consumer
C2 C3
View on View
V2
20
PUBLIC
CDS Hierarchy defines a CDS entity as a
hierarchy in the CDS DDL
A CDS hierarchy has a tabular results set
whose rows construct parent-child
relationships from hierarchical data sets
A CDS hierarchy can be accessed as the data
source of an ABAP SQL query, and it is
handled like a hierarchy in which additional
hierarchy columns can be selected
CDS hierarchies – Build hierarchies on SAP HANA
CDS source view
Self association
ABAP CDS hierarchy
CDS source view
Filter results
21
PUBLIC
DECLARATIVE APPROACH
CLASSICAL APPROACH
Declarative access control with CDS roles
<Code>
<Code>
ABAP SQL
Authorization
check
PFCG
<Code>
<Code>
ABAP SQL
PFCG
CDS role
CDS entities
&
Declarative instead of coded approach
Using CDS Data Control Language (DCL)
Explicitly defined for each CDS entity
Based on PFCG conditions, literal
conditions, user conditions, and
inheritance conditions
Defined once and automatically used
everywhere
Authorizations pushed down to the
database
22
PUBLIC
CDS development in Eclipse
Eclipse-based CDS Tooling
Source-based editor
Part of ABAP Development tools
01
Development support
Syntax check
Code completion
Syntax highlighting, pretty printing
Element info and navigation
Quick fixes
02
Supportability
Enhanced data preview
Dependency analyser
Activation graph / Dictionary log
Active annotations view
Unit testing
03
23
PUBLIC
SAP HANA Breakouts
24
PUBLIC
Why code breakouts for SAP HANA make sense
UNLEASH THE FULL POTENTIAL OF YOUR SAP HANA DATABASE
Some scenarios require
selective measures
Highest performance requirements
e.g. with complex calculations
Use of database/analytical engine
specific functions required
ABAP SQL and plain CDS views are not sufficient to solve problem efficiently
25
PUBLIC
ABAP managed database procedures (AMDP) for SAP HANA
EASY ACCESS TO
SAP HANA ADVANCED
ENGINES / LIBRARIES
Like predictive analysis, financials, text
mining, calculation engine
INTEGRATED IN THE
ABAP INFRASTRUCTURE
Development, runtime error analysis,
enhancement, transport
SAP HANA SQLScript coding
embedded in ABAP classes
Seamless integration into CDS via
CDS table functions
UTILIZE NATIVE
SAP HANA ENTITIES
Stored procedures, database
functions and scalar functions
supported
Expression of complex logic
Parameterized requests and
multiple result sets
26
PUBLIC
CDS table functions – Seamless AMDP integration into CDS
CDS table function definition
Parameter list
Return Parameter
Reference to implementing method
AMDP function
Implementation
Runtime for table function
Runs stored SQLScript procedure
generated from AMDP on database
tables
SAP HANA
Database
DDL
Source
AMDP
class
Includes SQLScript based
database function body
27
PUBLIC
AMDP development in Eclipse
DEVELOPMENT
Eclipse-based source code editor
SQLScript syntax highlighting
Static syntax check
Error handling via class-based exceptions
Modification-free extension via AMDP BAdIs
SUPPORTABILITY
Autonomous AMDP debugger in ADT
Detailed runtime errors integrated in ST22 dumps
28
PUBLIC
CORE DATA SERVICES IN
ABAP APPLICATION PROGRAMMING
29
PUBLIC
ABAP Cloud big picture
DOMAIN-SPECIFIC MODELS
CDS2 entity, RAP3 Business Object, CDS analytical provider
DOMAIN-SPECIFIC LOGIC
ABAP, CDS
INTEGRATION SERVICES
for process and data integration
(OData, business events, HTTP, SOAP, RFC, SQL)
BUSINESS
SERVICE
EXPOSURE
UI SERVICES
for SAP Fiori and analytical clients
(OData and InA1)
DOMAIN-SPECIFIC
IMPLEMENTATION
INTEGRATION SERVICES
for process and data integration
(OData, business events, HTTP, SOAP,
RFC, SQL)
BUSINESS
SERVICE
CONSUMPTION
SAP HANA
(SQL and SQLScript)
DATABASE
REUSE
SERVICES
AND
LIBRARIES
Output
management,
jobs.,
XCO,
...
BUILT-IN
QUALITIES
Cloud-readiness,
IAM
4
,
BC
5
,
extensibility,
security,
...
LIFECYCLE
MANAGEMENT
Git
based
transport
management
with
gCTS
and
abapGit
TOOLS
ADT
6
,
BAS
7
,
key
user
&
monitoring
tools
3 ABAP RESTful application programming model
4 Identity & Access Management
5 Business Configuration
6 ABAP Development Tools
1 Information access
2 Core Data Services
7 Business Application Studio
APP
SAP FIORI APPS
ANALYTICAL APPS
30
PUBLIC
ABAP RESTful
APPLICATION
PROGRAMMING
MODEL (RAP)
31
PUBLIC
Evolution of the ABAP programming model
CDS as vital part of SAP S/4HANA and SAP BTP ABAP Environment
ABAP PLATFORM ≤ 7.5
CLASSIC ABAP
PROGRAMMING
Best practice freestyle ABAP
programming, (Web) Dynpro,
CDS1
ABAP PLATFORM ≥ 7.5
ABAP PROGRAMMING
MODEL FOR
SAP FIORI
CDS, CDS-based BOPF,
SEGW/@OData annotation
with Referenced Data Source
SAP BTP
ABAP ENVIRONMENT
SAP S/4HANA ≥ 1909
ABAP RESTful
APPLICATION
PROGRAMMING
MODEL (RAP)
CDS, Behavior Definition &
Implementation, Business
Services
1 starting with release 7.4 SPS05
Safe investments!
32
PUBLIC
SERVICE BINDING
Service Definition, Service Projection, Event Binding
ABAP RESTful application programming model – Big picture
At the heart of ABAP Cloud for transactional scenarios
DOMAIN-SPECIFIC MODELS
CDS1 entity, RAP2 Business Object
DOMAIN-SPECIFIC LOGIC
ABAP, CDS
INTEGRATION SERVICES
for process and data integration
(OData based Web API, business events)
BUSINESS
SERVICE
EXPOSURE
UI SERVICES
for SAP Fiori and analytical clients
(OData)
DOMAIN-SPECIFIC
IMPLEMENTATION
SAP HANA
(SQL and SQLScript)
DATABASE 1 Core Data Services
2 ABAP RESTful application
programming model
APP SAP FIORI APPS
33
PUBLIC
SAP S/4HANA & SAP S/4HANA Cloud
SAP S/4HANA Core Tables (ECC)
> 40 000 Tables
(technical, cryptic, unrelated)
Virtual Data Model (VDM) for application data in SAP S/4HANA
VDM is a set of views on SAP S/4HANA application data
Business-oriented
Understandable & semantically rich
Reusable & stable
Executed on SAP HANA
Implemented as ABAP CDS views
VDM is the data model and source for all types of apps
Transactional
Analytical
External interfaces
Customers and partners can develop on released VDM views
Customer
Material
SalesOrder
SalesOrderItem
CLIENTS
34
PUBLIC
CDS in SAP S/4HANA – Recommendations
When implementing your own CDS views, follow the
SAP S/4HANA’s Virtual Data Model (VDM) implementation pattern
for best reuse and interoperability
Clarify your data model before starting your implementation
Start with the implementation of basic interface views
Adapt names and add semantical information already on this level
35
PUBLIC
ANALYTICS
36
PUBLIC
Motivation for embedded analytics
Transactional Simple Analytics Multi Dimensional Embedded Analytics
Intention Daily business tasks Fast and easy insights Interactive analysis
Daily business tasks
Fast insights & access to
interactive analysis
Interactivity Linear Static Highly dynamic On demand
Complexity
Low
Single data sets
Low-medium
Aggregating single sets
High
Lots of data sets
Mixed
Aggregations Very few Yes
Dynamic: different types on
different levels
All
Requests
Simple requests
Few data
One request
Complexity varies
Each interaction may
trigger a complex request
Both
Request Types CRUD Read Read Both
Data Sources Live data
Live data
May be precalculated
Replicated data
& live data
Live data
37
PUBLIC
ABAP analytics – Big picture
At the heart of ABAP Cloud for analytical scenarios
DOMAIN-SPECIFIC DATA MODELING
CDS2 analytical provider
SERVICE BINDING
Service Definition, Service Projection
UI SERVICES
UI services for analytical clients
(InA1)
DOMAIN-SPECIFIC LOGIC
ABAP, CDS
BUSINESS
SERVICE
EXPOSURE
DOMAIN-SPECIFIC
IMPLEMENTATION
1 Information access
2 Core Data Services
INTEGRATION SERVICES
for data integration
(SQL)
BUSINESS
SERVICE
CONSUMPTION
SAP HANA
(SQL and SQLScript)
DATABASE
APP ANALYTICAL APPS
38
PUBLIC
ABAP
CDS
InA
Service
Clients
Standard development flow
DOMAIN-SPECIFIC MODEL
Analytical star schema in ABAP CDS
SERVICE DEFINITION
SERVICE BINDING
BUSINESS SERVICE EXPOSURE
For Information Access Protocol (InA)
SERVICE CONSUMPTION
In Multi-Dimensional Analytical Clients
SAC-Story
= X
O
SAP Fiori
Multi-dimensional analysis
= X
O
Ext. usage
Cube
Query
Dimension
Dimension
Dimension
Dimension
41
PUBLIC
SUMMARY
42
PUBLIC
Key takeaways
ABAP Core Data Services (CDS)
Code pushdown is the ABAP programming paradigm on SAP HANA
Further enhancements and optimizations will be delivered with future ABAP platform releases
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
CDS is the next generation data modelling infrastructure on the ABAP platform
CDS offers advanced capabilities to fully leverage SAP HANA’s power in ABAP applications
43
PUBLIC
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
More information
SAP training and certification opportunities
❖ www.sap.com/education
SAP Help Portal
❖ ABAP Platform 2021 | ABAP CDS Developer Guide | ABAP Keyword Documentation
44
PUBLIC
Contact information:
© 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.
Thank you.
Name
Email

Introduction to ABAP Core Data Services (CDS).pdf

  • 1.
    1 PUBLIC PUBLIC Introduction to ABAP CoreData Services ABAP Platform Product Management, SAP SE May 2024
  • 2.
    2 PUBLIC MODERN ABAP DEVELOPMENT ABAPCORE DATA SERVICES (CDS) OVERVIEW CDS IN ABAP APPLICATION PROGRAMMING SUMMARY Agenda
  • 3.
  • 4.
    4 PUBLIC SAP BUSINESS SUITE & SAP NetWeaverproducts like SAP BW, SAP PI, … ABAP Platform – Foundation of SAP’s ERP applications ABAP Cloud based SAP BTP solutions & extensions INTEGRATE Improvements Maintenance ends 2027/2030 RISE with SAP ONE COMMON ABAP PLATFORM INNOVATION CODELINE ABAP Platform 2023 Every 2 years a new release SAP HANA only SAP S/4HANA any premise Maintenance until 2040 GROW with SAP ABAP Platform Cloud Half-yearly releases SAP HANA only SAP S/4HANA Cloud Private Edition SAP NetWeaver No new releases, only patches Any database SAP BTP ABAP Environment Quarterly releases SAP HANA Cloud only SAP S/4HANA Cloud Public Edition
  • 5.
    5 PUBLIC Modern ABAP applicationdevelopment Must learn topics: UX, SAP HANA, state of the art development, Cloud Stable Cloud extensions In-app and side-by-side Released APIs Cloud ready apps Cloud Secure app development, high code quality Agile & test driven Customer code management Efficient development Utilize SAP HANA capabilities ABAP-managed Code Pushdown Advanced application and Function libraries Focus on User Experience On any device Role based Device switch and collaboration Browser based SAP Fiori and SAPUI5, ABAP RESTful Application Programming Model ABAP SQL, Core Data Services, SAP HANA breakouts ABAP language and tools, Development methodology In-App extensibility, Developer extensibility, SAP BTP
  • 6.
    6 PUBLIC Modern ABAP applicationdevelopment 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 More in this blog
  • 7.
    7 PUBLIC Modern ABAP applicationdevelopment Golden rules for SQL programming – Priority shift on SAP HANA More in this blog Keep result sets small Minimize amaount of transferred data Minimize number of data transfered Minimize search overgead Keep load away from database UNCHANGED MORE IMPORTANT One aspect of code-to-data paradigm MORE IMPORTANT One aspect of code-to-data paradigm LESS IMPORTANT Still relevant for some use cases LESS IMPORTANT Code-to-data paradigm where applicable
  • 8.
    8 PUBLIC Modern ABAP applicationdevelopment on SAP HANA ABAP Core Data Services (CDS) ABAP SQL (fka Open SQL) ABAP Managed Database Procedures (AMDP) – Procedures and Functions CDS Table Functions SAP HANA BREAKOUTS MAINSTREAM ABAP managed code pushdown
  • 9.
    9 PUBLIC Evolution of ABAPCDS and Open/ABAP SQL SAP HANA CLOUD QUALITIES (Key User) Extensibility Allowlisting-support for CDS & AMDPs DB Administration Supportability ABAP RESTful Programming Model support ANYDB BREAKOUTS1 SQL ANYDB SQL SQL SQLScript SAP HANA SQL Windowing CTE SQLScript SQL Extensions Hierarchies GEO Spatial Support DB Tuning Objects (view caches) Specialized Engines Graph OPTIMIZED and SPECIALIZED ACCESS for SAP HANA CLASSIC ACCESS BREAKOUTS1 OPTIMIZED ACCESS for SAP HANA CDS / OPEN SQL CDS / OPEN SQL CDS / ABAP SQL2 Release 7.4 Release 7.50 – 7.52 Release ≥ 7.53 1*AMDP procedures and functions, CDS table functions, and CDS hierarchies 2*Open SQL was renamed to ABAP SQL starting with ABAP Platform 1809
  • 10.
    10 PUBLIC Debugging, profiling, tracing Staticand dynamic logging Runtime monitoring and analysis Static code checks (ATC, CVA) with remote and local scenarios Unit testing incl. isolation frameworks Test seams and injections Fully eclipse-based Syntax check, code completion Navigation, search, quick fixes Full support for the ABAP RESTful Application Programming Model and CDS Efficient ABAP development in Eclipse MODERN DEVELOPMENT TOOLSET QUALITY ASSURANCE SUPPORTABILITY HIGH DEVELOPER PRODUCTIVITY ON-PREMISE AND IN THE CLOUD
  • 11.
  • 12.
    12 PUBLIC ABAP CDS –Next generation data modeling and access For all application domains Rich set of built-in functions Code pushdown capabilities Declarative access control Reduced complexity Extending SQL Semantically rich Declarative Close to conceptual thinking COMMON DATA MODEL IMPROVED PROGRAMMING MODEL CAPTURE BUSINESS INTENT
  • 13.
    13 PUBLIC NATIVE CONSUMPTION ABAP CDSdata models DATA MODELING TUNING OBJECTS CDS DATA MODELS SAP HANA tuning objects ABAP tuning objects Domain specific data models CDS modeling entities CDS table functions for SAP HANA native objects (procedures, functions) CDS types SERVICE PROJECTIONS AND INTERFACES SERVICE DEFINITION SERVICE BINDING BUSINESS SERVICE EXPOSURE & DATA ACCESS SERVICE CONSUMPTION CONSUMPTION ABAP SQL AMDP CDS SAP Fiori UI Analytical client Web APIs SQL CDS projection views EML EXTENSIBILITY Business events CDS access controls
  • 14.
    14 PUBLIC Category ABAP CDSEntity Type ABAP CDS Statement Standard view building CDS View Entity CDS Projection View CDS Projection View – Analytical Query CDS DDIC-based View (deprecated) DEFINE VIEW ENTITY DEFINE VIEW ENTITY AS PROJECTION ON DEFINE TRANSIENT VIEW ENTITY AS PROJECTION ON DEFINE VIEW (deprecated) Advanced view building – External implementation CDS Custom Entity CDS Abstract Entity DEFINE CUSTOM ENTITY DEFINE ABSTRACT ENTITY Advanced view building – SAP HANA breakout CDS Table Function CDS Hierarchy CDS Scalar Function 2 DEFINE TABLE FUNCTION DEFINE HIERARCHY DEFINE SCALAR FUNCTION Type definition CDS Simple Type 2 CDS Enumerated Type 2 DEFINE SIMPLE TYPE DEFINE TYPE ENUM Transactional behavior definition of business objects built with the ABAP RESTful Application Programming Model CDS Behavior Definition (and Projection) DEFINE BEHAVIOR Modification-free extension CDS View Entity Extension CDS Custom Entity Extension CDS Abstract Entity Extension CDS DDIC-based View Extension (deprecated) CDS Metadata Extension CDS Behavior Extension EXTEND VIEW ENTITY EXTEND CUSTOM ENTITY EXTEND ABSTRACT ENTITY EXTEND VIEW (deprecated) ANNOTATE VIEW EXTEND BEHAVIOR Access control definition CDS Access Control DEFINE ROLE ABAP CDS – Overview of supported CDS entity types1 1 Status from Q2/2024 | 2 Available on-prem starting with Release 2023
  • 15.
    15 PUBLIC ABAP CDS viewentity – Example Selection Data source Element annotations Associations ABAP Flight Reference Scenario - Example available in package /DMO/FLIGHT_DRAFT View annotations View definition
  • 16.
    16 PUBLIC Built-in SQL functionsand expressions GENERIC/ AGGREGATION CONVERSION DATE/TIME STRING NUMERIC
  • 17.
    17 PUBLIC CDS annotations fordomain-specific frameworks Enrich meta model with consumer-specific vocabularies Reusable and unified view model for all use cases Enabling flexible usage in different contexts Separation of concern using CDS metadata extensions for UI-specific annotations Vital part of new ABAP programming models CDS ANNOTATION DOMAINS ANALYTICS BI-TOOLS PLANNING SEARCH SAP FIORI ELEMENTS …
  • 18.
    18 PUBLIC CDS associations WHERE CLAUSE PROJECTION LIST HAVING CLAUSE GROUP BY CLAUSE LEFT OUTER JOIN FROM CLAUSE INNER JOIN Capturingthe relationships between entities in the data model Used associations are implicitly translated into SQL joins Reuse of generated joins when semantically identical Can be queried in CDS views and ABAP SQL Navigate thru entity using path expressions
  • 19.
    19 PUBLIC Nested CDS viewsand extensibility Hierarchical view-on-view concept Optimized result sets with minimum data transfer Modification-free append of additional columns, arithmetic expressions or literals to result set Basic view entity View on View Consumer Extensions C1 V1 & Consumer Consumer C2 C3 View on View V2
  • 20.
    20 PUBLIC CDS Hierarchy definesa CDS entity as a hierarchy in the CDS DDL A CDS hierarchy has a tabular results set whose rows construct parent-child relationships from hierarchical data sets A CDS hierarchy can be accessed as the data source of an ABAP SQL query, and it is handled like a hierarchy in which additional hierarchy columns can be selected CDS hierarchies – Build hierarchies on SAP HANA CDS source view Self association ABAP CDS hierarchy CDS source view Filter results
  • 21.
    21 PUBLIC DECLARATIVE APPROACH CLASSICAL APPROACH Declarativeaccess control with CDS roles <Code> <Code> ABAP SQL Authorization check PFCG <Code> <Code> ABAP SQL PFCG CDS role CDS entities & Declarative instead of coded approach Using CDS Data Control Language (DCL) Explicitly defined for each CDS entity Based on PFCG conditions, literal conditions, user conditions, and inheritance conditions Defined once and automatically used everywhere Authorizations pushed down to the database
  • 22.
    22 PUBLIC CDS development inEclipse Eclipse-based CDS Tooling Source-based editor Part of ABAP Development tools 01 Development support Syntax check Code completion Syntax highlighting, pretty printing Element info and navigation Quick fixes 02 Supportability Enhanced data preview Dependency analyser Activation graph / Dictionary log Active annotations view Unit testing 03
  • 23.
  • 24.
    24 PUBLIC Why code breakoutsfor SAP HANA make sense UNLEASH THE FULL POTENTIAL OF YOUR SAP HANA DATABASE Some scenarios require selective measures Highest performance requirements e.g. with complex calculations Use of database/analytical engine specific functions required ABAP SQL and plain CDS views are not sufficient to solve problem efficiently
  • 25.
    25 PUBLIC ABAP managed databaseprocedures (AMDP) for SAP HANA EASY ACCESS TO SAP HANA ADVANCED ENGINES / LIBRARIES Like predictive analysis, financials, text mining, calculation engine INTEGRATED IN THE ABAP INFRASTRUCTURE Development, runtime error analysis, enhancement, transport SAP HANA SQLScript coding embedded in ABAP classes Seamless integration into CDS via CDS table functions UTILIZE NATIVE SAP HANA ENTITIES Stored procedures, database functions and scalar functions supported Expression of complex logic Parameterized requests and multiple result sets
  • 26.
    26 PUBLIC CDS table functions– Seamless AMDP integration into CDS CDS table function definition Parameter list Return Parameter Reference to implementing method AMDP function Implementation Runtime for table function Runs stored SQLScript procedure generated from AMDP on database tables SAP HANA Database DDL Source AMDP class Includes SQLScript based database function body
  • 27.
    27 PUBLIC AMDP development inEclipse DEVELOPMENT Eclipse-based source code editor SQLScript syntax highlighting Static syntax check Error handling via class-based exceptions Modification-free extension via AMDP BAdIs SUPPORTABILITY Autonomous AMDP debugger in ADT Detailed runtime errors integrated in ST22 dumps
  • 28.
    28 PUBLIC CORE DATA SERVICESIN ABAP APPLICATION PROGRAMMING
  • 29.
    29 PUBLIC ABAP Cloud bigpicture DOMAIN-SPECIFIC MODELS CDS2 entity, RAP3 Business Object, CDS analytical provider DOMAIN-SPECIFIC LOGIC ABAP, CDS INTEGRATION SERVICES for process and data integration (OData, business events, HTTP, SOAP, RFC, SQL) BUSINESS SERVICE EXPOSURE UI SERVICES for SAP Fiori and analytical clients (OData and InA1) DOMAIN-SPECIFIC IMPLEMENTATION INTEGRATION SERVICES for process and data integration (OData, business events, HTTP, SOAP, RFC, SQL) BUSINESS SERVICE CONSUMPTION SAP HANA (SQL and SQLScript) DATABASE REUSE SERVICES AND LIBRARIES Output management, jobs., XCO, ... BUILT-IN QUALITIES Cloud-readiness, IAM 4 , BC 5 , extensibility, security, ... LIFECYCLE MANAGEMENT Git based transport management with gCTS and abapGit TOOLS ADT 6 , BAS 7 , key user & monitoring tools 3 ABAP RESTful application programming model 4 Identity & Access Management 5 Business Configuration 6 ABAP Development Tools 1 Information access 2 Core Data Services 7 Business Application Studio APP SAP FIORI APPS ANALYTICAL APPS
  • 30.
  • 31.
    31 PUBLIC Evolution of theABAP programming model CDS as vital part of SAP S/4HANA and SAP BTP ABAP Environment ABAP PLATFORM ≤ 7.5 CLASSIC ABAP PROGRAMMING Best practice freestyle ABAP programming, (Web) Dynpro, CDS1 ABAP PLATFORM ≥ 7.5 ABAP PROGRAMMING MODEL FOR SAP FIORI CDS, CDS-based BOPF, SEGW/@OData annotation with Referenced Data Source SAP BTP ABAP ENVIRONMENT SAP S/4HANA ≥ 1909 ABAP RESTful APPLICATION PROGRAMMING MODEL (RAP) CDS, Behavior Definition & Implementation, Business Services 1 starting with release 7.4 SPS05 Safe investments!
  • 32.
    32 PUBLIC SERVICE BINDING Service Definition,Service Projection, Event Binding ABAP RESTful application programming model – Big picture At the heart of ABAP Cloud for transactional scenarios DOMAIN-SPECIFIC MODELS CDS1 entity, RAP2 Business Object DOMAIN-SPECIFIC LOGIC ABAP, CDS INTEGRATION SERVICES for process and data integration (OData based Web API, business events) BUSINESS SERVICE EXPOSURE UI SERVICES for SAP Fiori and analytical clients (OData) DOMAIN-SPECIFIC IMPLEMENTATION SAP HANA (SQL and SQLScript) DATABASE 1 Core Data Services 2 ABAP RESTful application programming model APP SAP FIORI APPS
  • 33.
    33 PUBLIC SAP S/4HANA &SAP S/4HANA Cloud SAP S/4HANA Core Tables (ECC) > 40 000 Tables (technical, cryptic, unrelated) Virtual Data Model (VDM) for application data in SAP S/4HANA VDM is a set of views on SAP S/4HANA application data Business-oriented Understandable & semantically rich Reusable & stable Executed on SAP HANA Implemented as ABAP CDS views VDM is the data model and source for all types of apps Transactional Analytical External interfaces Customers and partners can develop on released VDM views Customer Material SalesOrder SalesOrderItem CLIENTS
  • 34.
    34 PUBLIC CDS in SAPS/4HANA – Recommendations When implementing your own CDS views, follow the SAP S/4HANA’s Virtual Data Model (VDM) implementation pattern for best reuse and interoperability Clarify your data model before starting your implementation Start with the implementation of basic interface views Adapt names and add semantical information already on this level
  • 35.
  • 36.
    36 PUBLIC Motivation for embeddedanalytics Transactional Simple Analytics Multi Dimensional Embedded Analytics Intention Daily business tasks Fast and easy insights Interactive analysis Daily business tasks Fast insights & access to interactive analysis Interactivity Linear Static Highly dynamic On demand Complexity Low Single data sets Low-medium Aggregating single sets High Lots of data sets Mixed Aggregations Very few Yes Dynamic: different types on different levels All Requests Simple requests Few data One request Complexity varies Each interaction may trigger a complex request Both Request Types CRUD Read Read Both Data Sources Live data Live data May be precalculated Replicated data & live data Live data
  • 37.
    37 PUBLIC ABAP analytics –Big picture At the heart of ABAP Cloud for analytical scenarios DOMAIN-SPECIFIC DATA MODELING CDS2 analytical provider SERVICE BINDING Service Definition, Service Projection UI SERVICES UI services for analytical clients (InA1) DOMAIN-SPECIFIC LOGIC ABAP, CDS BUSINESS SERVICE EXPOSURE DOMAIN-SPECIFIC IMPLEMENTATION 1 Information access 2 Core Data Services INTEGRATION SERVICES for data integration (SQL) BUSINESS SERVICE CONSUMPTION SAP HANA (SQL and SQLScript) DATABASE APP ANALYTICAL APPS
  • 38.
    38 PUBLIC ABAP CDS InA Service Clients Standard development flow DOMAIN-SPECIFICMODEL Analytical star schema in ABAP CDS SERVICE DEFINITION SERVICE BINDING BUSINESS SERVICE EXPOSURE For Information Access Protocol (InA) SERVICE CONSUMPTION In Multi-Dimensional Analytical Clients SAC-Story = X O SAP Fiori Multi-dimensional analysis = X O Ext. usage Cube Query Dimension Dimension Dimension Dimension
  • 39.
  • 40.
    42 PUBLIC Key takeaways ABAP CoreData Services (CDS) Code pushdown is the ABAP programming paradigm on SAP HANA Further enhancements and optimizations will be delivered with future ABAP platform releases 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 CDS is the next generation data modelling infrastructure on the ABAP platform CDS offers advanced capabilities to fully leverage SAP HANA’s power in ABAP applications
  • 41.
    43 PUBLIC SAP Community ❖ ABAPDevelopment 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 More information SAP training and certification opportunities ❖ www.sap.com/education SAP Help Portal ❖ ABAP Platform 2021 | ABAP CDS Developer Guide | ABAP Keyword Documentation
  • 42.
    44 PUBLIC Contact information: © 2024SAP 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. Thank you. Name Email