D-Code Presentation - Core Data Services
D-Code Presentation - Core Data Services
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.
Big Data
Predictive takes advantage of the And changed the way of developing
Analysis
latest technology developments and executing
…
5-50x Compression
Based on column storage
Less Code lines
Less complexity in data
models and code
Text Mining
Data-To-Code:
Intensive
computations <code>
in APPLICATION
layer
Code-To-Data:
Intensive
computations
in DATABASE
layer
Data-Centric
Classic Applications Applications
UI Rendering UI Tier
UI & Client Side
Application Logic
UI Application Logic
Data-Centric Logic
SAP HANA
Database
Database Relational Database
models
ABAP
Java
Conceptual Level
Task: Get the id, name and the respective zip code of the home address for all
employees in org-unit 4711
Implementation Level
Conceptual Level
Issue: Due to the complexity of SQL, developers are using code instead of SQL
Implementation Level
Conceptual Level
Task: Get the id, name and the respective zip code of the home address for all
employees in org-unit 4711
Implementation level
Applications
SAP High
SAP BW SAP HANA Cloud
Business Performance Platform
on HANA Applications
Suite
Core Edge
ABAP Native SAP HANA (XS) Java
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
CDS DDL
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
Basic View
B1
CDS QL
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 ...
Classical DCL
Declarative Approach
<Code> <Code>
End-to-end authorization from DCL
entity to user
* 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
Textual editor
Contact information:
Martin Huvar
Product Management of SAP Technology Platform
martin.huvar@sap.com
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.
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.