You are on page 1of 4

http://sap4tech.

net/core-data-services-cds-sap-hana-overview/

Core Data Services (CDS) on SAP


HANA Overview
Core Data Services comes with SAP HANA as a new SAP ABAP Application
programming paradigm based on Code-To-Data. Lets first define the paradigm
changes in SAP ABAP development. Then demystify the Core Data Services in SAP
HANA.

Contents [show]

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.

Check also How to Update SAP Product Hierarchy Category on SAP CRM
with full ABAP Code

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

1 SELECT e.id, e.name, a.zipCode FROM Employee e


2 LEFT OUTER JOIN Employee2Address e2a ON e2a.employee = e.id
3 LEFT OUTER JOIN Address a ON e2a.address = a.id AND a .type=homeAddr
4 WHERE orgunit=4711.

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:

1 SELECT * FROM Employee INTO TABLE it_empl WHERE orgunit = 4711.


2
3 LOOP AT it_empl.
4 WRITE it_empl-id.
5 WRITE it_empl-name.
6
7 SELECT * FROM Addresse INTO TABLE it_addrs WHERE id = employees-id.
8
9 LOOP AT it_addrs.
10 IF it_addrs-type = HOMEADDR.
11 WRITE it_addrs-zipcode.
12 ENDIF.
13 ENDLOOP.
14
15 ENDLOOP.

With CDS, there is no extra code to be implementated. The Query will be

1 SELECT id, name, homeAddress.zipCode FROM Employee


2 WHERE orgunit=4711.

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)
S/4HANA
SAP Business Warehouse 7.3

Check also How to link STKO and STPO for BOM in SAP

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.