0% found this document useful (0 votes)
72 views41 pages

D-Code Presentation - Core Data Services

This document introduces Core Data Services (CDS) on SAP HANA as a next generation approach for data definition and access. CDS aims to reduce the semantic gap between conceptual data tasks and SQL implementation by providing a unified abstraction layer across platforms. It also aims to minimize coding by integrating with platform lifecycle management. CDS brings the conceptual and implementation levels closer together to simplify application development.

Uploaded by

Mohit Pandya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views41 pages

D-Code Presentation - Core Data Services

This document introduces Core Data Services (CDS) on SAP HANA as a next generation approach for data definition and access. CDS aims to reduce the semantic gap between conceptual data tasks and SQL implementation by providing a unified abstraction layer across platforms. It also aims to minimize coding by integrating with platform lifecycle management. CDS brings the conceptual and implementation levels closer together to simplify application development.

Uploaded by

Mohit Pandya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

DEV202 – Core Data Services – Next Generation

Data Definition and Access on SAP HANA

Jasmin Gruschke, SAP SE Walldorf


Martin Huvar, SAP SE Walldorf
Andreas Grünhagen, SAP SE Walldorf
Disclaimer

This presentation outlines our general product direction and should not be relied on in making a
purchase decision. This presentation is not subject to your license agreement or any other agreement
with SAP. SAP has no obligation to pursue any course of business outlined in this presentation or to
develop or release any functionality mentioned in this presentation. This presentation and SAP's
strategy and possible future developments are subject to change and may be changed by SAP at any
time for any reason without notice. This document is provided without a warranty of any kind, either
express or implied, including but not limited to, the implied warranties of merchantability, fitness for a
particular purpose, or non-infringement. SAP assumes no responsibility for errors or omissions in this
document, except if such damages were caused by SAP intentionally or grossly negligent.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 2


Core Data Services (CDS)
Overview and Concepts
The SAP HANA platform - More than just another database

Big Data
Predictive takes advantage of the And changed the way of developing
Analysis
latest technology developments and executing

100% In-Memory computing No Aggregates


OLTP & OLAP in real-time On-the-fly data models
without duplicates
SAP HANA
(Main Memory)
+ Column and row storage Less Indices
Flexible and fast
retrieval of the dataset

5-50x Compression
Based on column storage
Less Code lines
Less complexity in data
models and code
Text Mining

Calculation Analytics / 10-10,000x Acceleration Parti- Mass data analysis


Engine Transactions Massive parallelization tioning

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 4


Paradigm Changes in Application Programming

Data-To-Code:
Intensive
computations <code>

in APPLICATION
layer

Code-To-Data:
Intensive
computations
in DATABASE
layer

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 5


Transformation of Application Design

Data-Centric
Classic Applications Applications

UI Rendering UI Tier
UI & Client Side
Application Logic
UI Application Logic

Service Logic Middle Tier Service Layer

Data-Centric Logic
SAP HANA
Database
Database Relational Database

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 6


Core Data Services (CDS): Building Block for Timeless Software

Next generation data definition and access for


database centric applications
Cross-platform unified abstraction layer – similar
to OData for UI abstraction
Maximum transparency for different programing
HANA XS

models
ABAP

Java

Integrates with platform lifecycle-management

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 7


Motivation for Core Data Services

? Can’t everything be done with SQL

In principle yes, but …


!
© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 8
Issue 1: Large Semantic Gap between Task and SQL Code Today

Conceptual Level

Task: Get the id, name and the respective zip code of the home address for all
employees in org-unit 4711

Large Semantic Gap

Implementation Level

SQL: 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’
WHERE orgunit=4711;

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 9


Issue 2: SQL Complexity Leads to Imperative Code

Conceptual Level

Issue: Due to the complexity of SQL, developers are using code instead of SQL

Performance gaps: Loops in loops, nested queries with


many round trips, …

Implementation Level

Code: employees = SELECT * FROM Employee WHERE orgunit=4711


foreach c in employees do
write c.id
write c.name
addresses = SELECT * FROM Address a, $Employee2Address c2a
WHERE a.id = c2a.address AND c2a.employee = :c.id
foreach a in addresses do
if a.type = ‘homeAddr’ then write a.zipCode
end
end
© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 10
CDS Brings Conceptual and Implementation Level Closer Together

Conceptual Level

Task: Get the id, name and the respective zip code of the home address for all
employees in org-unit 4711

Small Semantic Gap,


No Coding required

Implementation level

CDS: SELECT id, name, homeAddress.zipCode FROM Employee


WHERE orgunit=4711;

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 11


CDS Key Motivation No. 1

CDS extends SQL to capture business intent in the data


model instead of technical complexity in query

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 12


CDS enables a consistent SAP Platform Story

Applications

SAP High
SAP BW SAP HANA Cloud
Business Performance Platform
on HANA Applications
Suite

Core Edge
ABAP Native SAP HANA (XS) Java

Core Data Services

SAP HANA Database

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 13


Availability of CDS in SAP Platforms

SAP NetWeaver 7.4 SP05

SAP HANA SPS6

SAP Business Suite EHP7 (Suite on HANA)

Smart Financials 1.0

SAP Business Warehouse 7.3

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 14


CDS Key Motivation No. 2

Harmonize the programming model across all SAP


platforms to ensure reuse and interoperability

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 15


CDS: Two Ways of Database Integration

ABAP CDS benefits: ABAP SAP HANA (XS)

Leverage DDIC Core Data SAP HANA Benefits:


Services
semantics
Native Integration in
Infrastructure ensures DDL QL DCL SAP HANA Core
Any DB support Engine
Consistent Lifecycle Maximum
Management and performance based
extensibility as with all (S)QL Engine (S)QL Engine
on in-memory
other ABAP artifacts technology
SQL Script
Single reusable
Calc Engine
implementation for all
SAP HANA based
Any DB SAP HANA DB
products

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 16


CDS Key Motivation No. 3

CDS provides stack optimized database programming


models

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 17


CDS: Common Basis for Domain-Specific Frameworks

Reusable and unified


view model for all use
cases
Annotations enabling
flexible usage in different
contexts
Supporting ABAP and
SAP HANA deployment
Efficient development

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 18


CDS Key Motivation No. 4

CDS provides a unified data model across all application


domains

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 19


Core Data Services
Details
Core Data Services – A Family of Domain Specific Languages

DDL QL DCL
Data Definition Language Query Language Data Control Language

Data modelling and retrieval Consume CDS entities via Define authorizations for CDS
on a higher semantic level platform embedded SQL (e.g views
OpenSQL in ABAP)
Extends native SQL means Modelled and declarative
for higher productivity Fully transparent SQL approach
extensions
Integrates with classic
authorization concepts

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 21


CDS Data Definition Language (DDL)

CDS DDL

Entities with structured and custom-defined types

Associations i.e. captured relationships


SQL DDL
Calculated Fields pre-defined in data models

Annotations to extend the meta models

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 22


Core Data Services – Entities & Associations

Custom-defined Type
type Amount { Entities are
value : Decimal; essentially
currency : Currency;
structured types with
}
an underlying
Entity persistency and a
entity Address {
streetAddress; zipCode; city; // snipped types uniquely identifying
kind : enum { home, business }; key
}

entity Employee {
Association
addresses : Association[0..*] to Address;
Calculated Field
homeAddress = addresses[kind=home];
Structured Field
salary : Amount;
}
* Current implementations on ABAP and SAP HANA may have different feature sets. Please refer to CDS documentation.
© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 23
Core Data Services – Annotations
Annotation
@Scope: #ANY
Definition annotation EndUserText {
Typed annotations allow
label : String; to enhance the core meta
quickInfo : String; model with consumer-
documentation : Boolean default true;};
specific vocabularies
Annotation
Usage @EndUserText : {label: ‘Sales Order Header’, They are essentially
quickInfo: ‘SO Header that contains data record literals of
relevant for all items’,
documentation : true } metadata entities defined
using standard CDS DDL
entity SalesOrderHeader {
...
@EndUserText.label: ‘Date of Order’
orderDate : Date;
...
};

* Current implementations on ABAP and SAP HANA may have different feature sets. Please refer to CDS documentation.
© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 24
Core Data Services – Views as ‘First Class Citizens’
define view EmployeesInOrg as
Query in CDS QL SELECT from Employee { Views are projections on
ID, name, other entities – hence,
salary,
orgunit { following the concept of
name, reflexive view definitions
manager, in standard SQL
},
homeAddress
} They result in entities
Resulting Entity {ID; name; // skipped type defs with signatures
Signature salary : Amount; // structured type Amount containing extended CDS
Orgunit : { // anonymous structured type
name;
types like structured
manager; types, Associations, etc.
};
homeAddress : Association to Address;}

* Current implementations on ABAP and SAP HANA may have different feature sets. Please refer to CDS documentation.
© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 25
Hierarchy of Views and Extensions

Hierarchical view-on-view
concept

Optimized result-sets with


Consumer Consumer Consumer Extensions
C1 C2 C3 minimum data transfer

Extensions allow to append


additional columns,
View on View View on View & arithmetic expressions or
V1 V2
literals to result set

Basic View
B1

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 26


CDS Query Language (QL)

CDS QL

Path expressions along Associations

Filter expressions in paths


SQL Select
Nested projection clauses for structured result sets

Some more features

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 27


Core Data Services – Query Language Features

Path Expression
SELECT id, name, deliveryAddress.zipCode FROM Customer WHERE ...

Filter Expression
SELECT name, addresses[type=deliveryAddr].city AS deliveryAddress,
addresses[type=invoiceAddr].city AS invoiceAddress FROM Customer …

Projection Clause
SELECT id, name, deliveryAddress { streetAddress, zipCode, city }
FROM Customer WHERE ...

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 28


Data Control Language Overview *

Classical DCL
Declarative Approach

Based on CDS modeling objects PFCG PFCG

<Code> <Code>
End-to-end authorization from DCL
entity to user

Generates standard SQL SQL


& SQL
authorizations (SAP HANA)
Authorization CDS
Authorizations as part of Check View
generated SELECT statement
(ABAP) <Code> <Code>

* DCL is planned for later releases and not part of the current shipment
© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 29
CDS Development Environment

Based on Eclipse platform

Integrated in SAP HANA Studio and


in ABAP in Eclipse

Textual editor

Rich feature set for fast


development
Code completion
Enhanced data preview
Quick-Fix function
Syntax highlighting

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 30


CDS Development Steps

Define view in CDS editor


Textual or graphical
SQL Client

View definition persisted and


managed in DDIC / SAP HANA SQL Engine
Catalog
CDS Editor CDS Models SQL View
Activation creates corresponding
SQL view in database (SAP HANA)
Eclipse DDIC / Catalog Database

Consumption via SQL statements


Embedded in ABAP / XS code
Reference to DDL view name (not to
SQL view)

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 31


Consumption of CDS Views in ABAP and SAP HANA XS

CDS view invocation from “ABAP Example


ABAP or SAP HANA XS
coding “Some ABAP coding before …

Fully integrated in SELECT customer_id,


development workflow (SAP inv_counter,
Reference to CDS view inv_created_at_month
HANA Studio or ABAP FROM zdev265_invoice_info
Development Tools for SAP INTO CORRESPONDING FIELDS OF TABLE @et_invinfo
HANA) OpenSQL WHERE customer_id = @iv_bupaid
ORDER BY inv_created_at_month ASCENDING.
Reference to CDS view name
"do some meaningful stuff here.
Optimized execution of view
hierarchy during runtime

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 32


CDS Integration with Gateway and Service Adaptation Description
Language (SADL)

Define view in CDS editor or reuse


existing CDS views Eclipse
OData Client
(http, REST)
CDS Editor
Import CDS view to Gateway
Service Builder (SEGW)

Activate / Register Gateway Service


Import
Gateway
CDS Views
Service
Consumption
Gateway Service
DDIC Builder

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 33


Core Data Services
Summary
Conclusion: Core Data Services

CDS extends SQL to capture business intent in the data model


instead of technical complexity in query

CDS harmonizes the programming model across all SAP platforms to


ensure reuse and interoperability

CDS provides stack optimized database programming models

CDS provides a unified data model across all application domains

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 35


Core Data Services at a Glance

Semantically Rich Data-Models Common Basis for Domain-Specific


Domain specific languages (DDL, QL, DCL) Frameworks e.g. UI, Analytics, Odata, BW,…
Declarative, close to conceptual thinking @AnalyticsDetails.aggregationBehaviour: SUM

CDS is completely based on SQL Associations


Any ‘Standard SQL’ features directly available Simplified definition of views on top of views
like joins, unions, build-in functions, … Path expressions to navigate along relations

Fully Compatible with Any DB Extensible


Generated and managed SQL Views On model level thru extensions
Native integration in SAP HANA On meta-model level thru annotations

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 36


SAP d-code Virtual Hands-on Workshops and SAP d-code Online
Continue your SAP d-code education after the event!

SAP d-code Virtual Hands-on Workshops SAP d-code Online


 Access hands-on workshops post-event  Access replays of keynotes, Demo Jam, SAP d-code
 Starting January 2015 live interviews, select lecture sessions, and more!
 Complementary with your SAP d-code registration  Hands-on replays
http://sapdcodehandson.sap.com http://sapdcode.com/online

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 37


Further Information

SAP Public Web


scn.sap.com
www.sap.com

SAP Education and Certification Opportunities


www.sap.com/education

Watch SAP d-code Online


www.sapcode.com/online

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 38


Feedback
Please complete your session evaluation for
DEV202.

Thanks for attending this SAP TechEd && d-code session.


©©2014
2014SAP
SAPAG
SEororan
anSAP
SAPaffiliate
affiliatecompany.
company.All
Allrights
rightsreserved.
reserved. Public 3939
Thank you

Contact information:

Martin Huvar
Product Management of SAP Technology Platform
martin.huvar@sap.com

© 2014 SAP AG or an SAP affiliate company. All rights reserved.


© 2014 SAP AG or an SAP affiliate company. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG or an SAP affiliate company.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG (or an SAP affiliate
company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional trademark information and notices.

Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.

National product specifications may vary.

These materials are provided by SAP AG or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP AG or its
affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP AG or SAP affiliate company products and services
are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an
additional warranty.

In particular, SAP AG or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or
release any functionality mentioned therein. This document, or any related presentation, and SAP AG’s or its affiliated companies’ strategy and possible future
developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP AG or its affiliated companies at any time for
any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-
looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place
undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 41

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy