Académique Documents
Professionnel Documents
Culture Documents
Shivankit Bisht
more by this author
SAP S/4HANA
SAP HANA abapcdsDatabasehanaMaster Data Managements/4hanasapsap hana
share 0
share 0
tweet
share 14
Follow
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.
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:
No latency
Full ABAP Lifecycle Integration
No data duplication
Supports ERP authorizations
Integration scenarios with SAP BW
Supports ERP hierarchies
Ready to use content
Part of the general Extensibility concept
Supports more business cases
(Analytics, search, Fact sheets, planning…)
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.
Besides this, a great video by Björn Goerke, Executive Vice President and Corporate Officer, Head of
Technology in Products and Innovation on CDS
Alert Moderator
3 Comments
You must be Logged on to comment or reply to a post.