Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 

A data model represents framework of what relationships are in a database. Data models are the foundation of software development. They provide a standardized method for defining and formatting database contents consistently across systems, enabling different applications to share the same data.
Professional data modeling tools provide a way to generate SQL from a modeled ER diagram although some developers often prefer writing SQL directly. Below is a look of a data model.


 


Virtual Data Model
The concept of the Virtual Data Model (VDM) was introduced with HANA Live three years ago. SAP HANA Live is a Virtual data model on top of suite tables which uses native SAP HANA SQL views called Calculation views for real-time operational Reporting. This came with certain issues:




  • This model didn’t support hierarchies properly. Hierarchies help businesses to analyze their data in a tree structure through different layers with drilldown capability. For example, a time hierarchy consists comprises of levels such as fiscal year, fiscal quarter, fiscal month and so on.

  • Since, the HANA Live virtual data models were defined in the HANA database layer itself as HANA calculation views it led to duplication of security roles between Business Suite for transactional processing and HANA database for operational reporting.


With S/4HANA, SAP launched S/4HANA Analytics as an upgrade to HANA Live. S/4HANA supports a new data model by providing a ready-to-use content using CDS view. The CDS data model used by SAP S/4HANA can be considered a successor to the virtual data model used by SAP HANA Live as the new CDS provides certain advantages over VDM which are discussed later in this blog.


 As for our customers, which are the current users of HANA Live nothing changes unless they migrate to S/4 HANA. The existing virtual data models will continue to be supported by SAP. Once customers migrate to S/4HANA, the new CDS-based views can be used and upgraded against the simplified data model in S/4HANA.


Core Data Services
With the availability of the SAP HANA platform there has been a paradigm shift in the way business applications are developed at SAP. The rule-of-thumb is: Do as much as you can in the database to get the best performance.

To take advantage of SAP HANA for application development, SAP introduced a new data modeling infrastructure known as core data services. With CDS, data models are defined and consumed on the database rather than on the application server. CDS also offers capabilities beyond the traditional data modeling tools, including support for conceptual modeling and relationship definitions, built-in functions, and extensions


 



Technically, CDS is an enhancement of SQL which provides a Data Definition Language (DDL) for defining semantically rich database tables/views (CDS entities) and user-defined types in the database. Some .of the enhancements are:




  • Expressions used for calculations and queries in the data model

  • Associations on a conceptual level, replacing joins with simple path expressions in queries

  • Annotations to enrich the data models with additional (domain specific) metadata


CDS Value Proposition for Customers
CDS offers a SQL based layer that extends the SQL-92 standard with features that bridge and unify the traditional OLTP and OLAP models of data definition, data query, and data manipulation. Supported natively in both ABAP and SAP HANA, the data models are expressed in data definition language (DDL) and are defined as CDS views, which can be used in ABAP programs via Open SQL statements to enable access to the database. CDS provides a range of advantages for businesses and developers, including:



Semantically rich data models
CDS builds on the well-known entity relationship model and is declarative in nature, very close to conceptual thinking.
Compatibility across any database platform
CDS is generated into managed Open SQL views and is natively integrated into the SAP HANA layer. These views based on Open SQL are supported by all major database vendors
Efficiency
CDS offers a variety of highly efficient built-in functions — such as SQL operators, aggregations, and expressions — for creating views.
Support for annotations.
The CDS syntax supports domain-specific annotations that can be easily evaluated by other components, such as the UI, analytics, and OData services.
Support for conceptual associations
CDS helps you define associations that serve as relationships between different views. Path expressions can be used to navigate along relations. Introducing an abstraction of foreign key relationships and joins, associations make navigation between entities consumable
Extensibility.
Customers can extend SAP-defined CDS views with fields that will be automatically added to the CDS view along with its usage hierarchy.















SAP HANA Live(based upon VDM)    



SAP S/4 Analytics ( based upon CDS )




  • No latency

  • No data duplication

  • Integration scenarios with SAP BW

  • Ready to use content



    Best of HANA Live Features
        +




  • Full ABAP Lifecycle Integration

  • Supports ERP authorizations

  • Supports ERP hierarchies

  • Part of the general Extensibility concept

  • Supports more business cases
    (Analytics, search, Fact sheets, planning...)




VDM to CDS Migration
In order to ensure a smooth migration from HANA Live VDM Model to S/4 HANA VDM CDS Model, SAP provides a migration roadmap tailored for the Customer businesses. In the past a lot of effort was spent to define and implement the HANA Live Virtual Data Model based on HANA Calculation Views. This is used as a starting point for the definition and implementation of the CDS Data Model. CDS views are generated for the Calculation views. Please note, after the generation additional effort is necessary to adapt the generated views to the new approach (CDS). Typical tasks which might be necessary are:




  • Adding needed CDS annotations for analytical or other scenarios. Annotations allow to enhance the core Meta model with consumer-specific vocabularies.

  • Restructuring or renaming the views to support the higher level of reuse which shall be reached with the new approach (Using naming convention like I view for public view, P for Private and C for Consumption views).

  • Adapting the views that as parts of the original functionality could not be migrated due to missing or different features in CDS. 

  • Adapting the views to changed view behavior (if on running the view, a different result for the views is displayed).


However, not all of these manual tasks are necessary for each migrated calculation view. In particular, “simple” views can often be left unchanged after generation.


Example: Calculation View “sap.hba.ecc.BusinessTransactionType”
The calculation view “BusinessTransactionType” has a text join node “Join_1” with the join condition “TJ01.VRGNG = TJ01T.VRGNG” .




If associations are used for join nodes and the resulting CDS view definition has following form: 
NAMESPACE sap.hba.ecc;
DEFINE VIEW BusTransType AS SELECT FROM "SAP_ECC".TJ01
ASSOCIATION [1, 0..1] TO "SAP_ECC".TJ01T as _Text ON TJ01.VRGNG = _Text.VRGNG
and _Text.SPRAS = $session.system.language


{
TJ01.VRGNG AS BusinessTransactionType,
TJ01T.TXT AS BusinessTransactionTypeName,
TJ01.WTKAT AS ControllingValueCategory,
TJ01.PSIKZ AS ControllingValueClassification
};




















 If standard SQL joins are used for join nodes the resulting CDS view definition looks like this: 
NAMESPACE sap.hba.ecc;
DEFINE VIEW BusTransType AS SELECT FROM "SAP_ECC".TJ01
LEFT JOIN "SAP_ECC".TJ01T
ON
TJ01.VRGNG = TJ01T.VRGNG and

TJ01T.SPRAS = $session.system.language

{
TJ01.VRGNG AS BusTransTypee,
TJ01T.TXT AS BusinessTransactionTypeName,
TJ01.WTKAT AS ControllingValueCategory,
TJ01.PSIKZ AS ControllingValueClassification
};


















CDS: Development Environment

CDS views can be developed and maintained in SAP HANA studio and in ABAP in Eclipse. The textual editor in eclipse provides rich feature set for fast development like:




  • Code completion

  • Data preview

  • Quick-fix function

  • Syntax highlighting










NOTE: To search for CDS view for an ABAP table, call se11 transaction. Enter the table name and click on Where used list. Select the type DDL source and the result list will show the views for that consume the table.


Consumption of CDS in an OData Service

Key Takeaways:

  • CDS provides a unified data model across all application domains

  • CDS provides one semantic layer for all use cases: search, operational and analytical

  • CDS extends SQL to capture the business intent instead of technical complexity.


Learn more about CDS from here:


My CDS view self study tutorial - Part 1 how to test odata service generated by CDS view


SAP HANA SPS 09: New Developer Features; Core Data Services

New Core Data Services Features in SAP HANA 1.0 SPS 10

 

Besides this, a great video by Björn Goerke, Executive Vice President and Corporate Officer, Head of Technology in Products and Innovation on CDS



 

 

 
11 Comments
D039507
Advisor
Advisor
Hi,
I'm also working with CDS-Views in the area of hana analytics.

I'm looking for a list of all CDS-Views that can be used for analytical use. There are pre-configured views for example in the package VDM_SD or VDM_LE.

But where can I find a list of all usable views (interface and consumption views)?

Thanks in advance and best regards
Thorsten
former_member195748
Participant
0 Kudos
Hey Thorsten,
Did you got the list, I am also looking for the same.
Regards,
Vivek
vcagrawal
Explorer
0 Kudos
Hi, Thanks for good blog. I have a question whether CDS views can be used to transfer data to Hadoop from S/4HANA?
Former Member
0 Kudos
Hi  Shivankit Bisht,

Nice blog !!

Two questions though:

1: from which release is CDS supported by S/4HANA ?

2: Where can we download de ready CDS content?

Thanks

 

Rabie
I056086
Advisor
Advisor
0 Kudos
 

Hello Rabie,

S/4 HANA comes with CDS by default from first release itself. CDS was introduced with ABAP 7.4 SP8 itself.

Thanks and Regards,

Mohit
radedeepak
Explorer
0 Kudos
S/4 HANA comes with CDS by default. Can we deploy HANA Live package in S4HANA ? If not then what is the alternative for the HANA live package, from where can we download it ?
Former Member
0 Kudos
Thank you for the article.

If we consider a standalone HANA pulling data from a non-HANA ECC, please help me out in understanding – So if I have to create data models in HANA, we have 2 options –

  1. Calculation Views

  2. HANA CDS views (I am not talking about the ABAP CDS here


So are you saying that whenever we have scenarios where the ABAP layer needs to read these views, we would use CDS as our strategy?

ANd by implication, if we have no ABAP layer and only native HANA, we just go along creating calculation views.

Am I correct?
sathishdhawan
Explorer
0 Kudos
Hi  Shivankit Bishtm,

 

Can you send me the exact difference between the Basic and Composite view....
Former Member
0 Kudos
HANA DB views created via HANA Studio are simple and straight forward when creating using graphical views.  The drawback is that defining HANA Analytic Privilege dynamic then requires procedure and custom tables to get hierarchy security to work.  This does not show hierarchy security works well, when defined at HANA DB level, as compared to how BW does this effortlessly.

It seems CDS views and security in ABAP layer together provide a potentially good solution to fix the hierarchy security challenges, by pushing back up to the app layer, but then we lose the graphical design in HANA Studio, since SQL must be written..  Seems like we gain new features, but then lose valuable features.  Thoughts?
Former Member
0 Kudos
Hi Sathish,

There are 3 types of views in S/4: Basic, Composite and Consumption. In a nut shell:

#BASIC – Used to pull data from the source tables as well as the other basic views but are not used in reporting.

#COMPOSITE – act as an interface between the basic and the consumption views. Can use source tables or different views to form a data set.

(The above 2 views are more or less the same. The difference is to do with the modeling methodology and the reusability of code.)

#CONSUMPTION – when the views have to be 'consumed' by the reporting layer.

 

In a different analogy (and more to do with the concept of modeling) think of these views as attribute(Basic) Analytic(Composite) and calculation(consumption) views.

 
0 Kudos
Nice Blog

I have a question whether CDS views can be used to transfer data to Hadoop from S/4 HANA?