Core Data Services comes with SAP HANA as a new SAP ABAP Application programming paradigm based on Code-To-Data.
Let’s first define the paradigm changes in SAP ABAP development. Then demystify the Core Data Services in SAP HANA.
Paradigm Changes in Application Programming
SAP HANA brings some new paradigms to SAP ABAP Application Programming.
The Old Development paradigm in SAP is based on Data-To-Code. The Data-
To-Code paradigm supports Intensive computations in APPLICATION layer and minimaze Database layer use.
The New Development paradigm coming with SAP HANA is Code-To-Data.
Code-To-Data paradigm involves Intensive computations in DATABASE layer and less processing on Application layer.
Core Data Services Concept
Core Data Services (CDS) aims to Build Block for Timeless Software. it is the Next generation data definition and access for database centric applications.
It provides Cross-platform unified abstraction layer ? similar to OData for UI abstraction.
It helps build a Maximum transparency for different programing models ABAP.
It can be easily integrated with platform lifecycle-management.
If you check the picture on the top, it is a Graph Representation of a Data Model using the Association as Edges: The presentation of Data.
ABAP sample using Core Data Services
credit for sample in the link provided in the end of the article.
Let take this Business Requirement
Get the id, name and the respective zip code of the home address for all employees in org-unit 4711
In SQL, the Query while be
SELECT e.id, e.name, a.zipCode FROM Employee e
LEFT OUTER JOIN Employee2Address e2a ON e2a.employee = e.id
LEFT OUTER JOIN Address a ON e2a.address = a.id AND a .type=' homeAddr'
In ABAP, the classic implementation will a Select query for the first table and an other Select in the loop.
the ABAP Implementation will look like:
SELECT * FROM Employee INTO TABLE it_empl WHERE orgunit = 4711.
LOOP AT it_empl.
SELECT * FROM Addresse INTO TABLE it_addrs WHERE id = employees-id.
LOOP AT it_addrs.
IF it_addrs-type = 'HOMEADDR'.
With CDS, there is no extra code to be implementated. The Query will be
SELECT id, name, homeAddress.zipCode FROM Employee
Core Data Service and ABAP
Core Data Service is intergrated in ABAP and provides:
- Leverage DDIC semantics
- Infrastructure ensures Any DB support
- Consistent Lifecycle Management and extensibility as with all other ABAP artifacts
- Highly reusable and extensible CDS artifacts
Core Data Services vs SAP Plateforms
Core Data Services (CDS ) have been available in SAP Platforms since:
- SAP NetWeaver 7.4 SP05
- SAP HANA SPS6
- SAP Business Suite EHP7 (Suite on HANA)
- SAP Business Warehouse 7.3
CDS also available in native SAP HANA
Domain Specific Languages for CDS
Data Definition Language DDL
- Data modelling and retrieval on a higher semantic level
- Extends native SQL means for higher productivity
Query Language QL
- Consume CDS entities via Open SQL in ABAP
- Fully transparent SQL extensions
Data Control Language
- Define authorizations for CDS views
- Modelled and declarative approach
- Integrates with classic authorization concepts
CDS Development Environment
CDS Development Environnement is Based on Eclipse platform and therefore integrated in ABAP in Eclipse.
CDS developement Environnement in Eclipe provides:
- Textual and graphical editor
- Rich feature set for fast development
- Code completion
- Enhanced data preview
- Quick-Fix function Syntax highlighting
Check the full presentation on DEV200 : Core Data Services (Next-Generation Data Definition and Access on SAP HANA) on SAP TechEd 2015.