How To Create CDS Views in SAP HANA

A View is persistent and not a stand-alone entity, rather it can be defined to be a projection of other entities. You can create an SAP CDS View as a design-time file in the storage repository with the SAP HANA Extended Application Services (SAP HANA XS).

What are SAP CDS and SAP CDS View

Core Data Services (CDS) is a semantically rich definition language that has been created by SAP. Using SAP CDS View it is possible to define and consume models on the database without using the application server. For designing data models that can be moved outside the applications with OData services, CDS Views is considered to be one of the most specialized and optimized platforms.

SAP CDS is a framework for modeling data that ensures data models are defined and consumed on the database server and not on the common application server. It also meets the needs of real-time performance by leveraging the robust in-memory database of SAP HANA. This can be achieved by optimizing operations at the database level resulting in quick retrieval of databases and lowering application execution time. Data models can be created by SAP CDS and presented to clients as UI and SAP CDS View by application servers.

The Evolution of SAP CDS View

SAP introduced SAP CDS View as its new programming model. This virtual data model that is in-built into SAP HANA permits direct and quick access to the underlying tables of the HANA database. The goal is to enable logic from the application server to the client-side database named ‘Code-to-Data’ or ‘Code Pushdown’ by SAP. This logic is extracted by the SAP CDS Viewfrom the ABAP applications and executed on the database.

The arrival of SAP HANA has led to a comprehensive shift in the manner that applications are developed and data managed. The goal is to carry out as many operations as possible at the database level and HANA has met this expectation of business through its in-memory database and fast and real-time performance. Traditionally, the application server and not the database server has been used for data modeling. However, to leverage the advantages of HANA, SAP introduced a new infrastructure for data modeling done at the database level using Core Data Services (CDS), popularly termed SAP CDS View.

The SAP CDS View Functions

A very common need of any organization is to perform real-time data reporting and analytics on transactional data. Backed by the power of HANA, analytics (large queries) is now possible on S/4 HANA without the need for a separate data warehouse or any lack or degradation in performance. With SAP CDS View, VDMs (Virtual Data Models) can be created directly in ERP with a high level of performance to be used by various front-end tools.

Pre-delivered in SAP CDS View is SAP S/4 HANA Embedded Analytics which comes with several analytical features. These can be used to perform real-time data analytics on live transactional data even without knowing the underlying tables/structures. The views can be either combined with new views, both modified and enhanced, or consumed directly to create new data models.

SAP HANA XS (SAP HANA Extended Application Services) allows you to define a view in an SAP CDS View document which can be stored as a design-time file in the repository. These repository files can be read by specifically developed applications. Additionally, the repository files that include view definition can be moved to other SAP HANA systems like a delivery unit. 

Moreover, if an application refers to the design-time version of a view from the repository instead of, for example, a runtime view in the catalog, any changes made to the repository version of the file are visible once they are committed to the repository. Users do not have to wait for the activation of a runtime version of the view by the repository.

When a CDS document is activated, it generates a corresponding catalog object for each object defined in the document. The location in the catalog, however, is determined by the specific type of object generated. For instance, the corresponding catalog object in SAP HANA XS classic for an SAP CDS View definition is generated in the location <SID> Catalog <MYSCHEMA> Views.

Benefits of SAP CDS View

There are several benefits of SAP CDS View, some of which are as follows.

  • SAP CDS View is a code-to-data technology in ABAP where all computing and calculations are done on the database layer instead of the application server.
  • The features of SAP CDS View may be accessed outside the SAP native applications as they are less conventional in SE11 views.
  • CDS View on SAP can be operated on any database platform that is supported by SAP as it works independently of the database.
  • Client operations are supported automatically by CDS as it can publish ODATA service annotations directly from SAP CDS View.
  • CDS Views provide support for inner join, cross join, full join, outer join, and right outer join
  • SAP CDS View supports Aggregation and Numeric functionalities.
  • Automatic client handling is supported by SAP CDS View

Types of SAP CDS View

There are two types of SAP CDS View. They are HANA CDS Views and ABAP CDS Views. Previously the SAP HANA ecosystem only had the SAP CDS View but now CDS is also available in SAP NetWeaver as ABAP. Developers can, therefore, work with the ABAP programming layer while the execution layer is allotted to the database. SAP CDS View supports in-built extensions and functions, relationship definitions, and conceptual modeling, all of which are a vast improvement over the traditional data modeling tools. 

Leave a Reply

Back To Top