SAP CDS Views – The primary data delivery technology for SAP HANA
During almost every SAP implementation or more complex development project, a fundamental question is what new reports business users will need as a result of the changes. In this article, we highlight how SAP HANA can change the way these types of questions are answered and, if development is required, how CDS Views-based solutions can be implemented in a development environment.
With the introduction of the HANA database manager, SAP has created a number of new opportunities on which a whole new era of technology- and application environment is now built. SAP HANA’s column-oriented data storage concept, together with its in-memory hardware backbone, has significantly reduced the response time of database queries, enabling a number of solutions in transactional (ERP) systems that would previously have been only conceivable in stand-alone data warehouses and business intelligence tools.
In addition, the benefits of more efficient database use have been further enhanced by SAP’s “code push-down” (or “code-to-data”) approach, which means that computationally intensive tasks are executed in the database layer, freeing up resources at the application server layer while utilizing more capacity on the database servers, which obvious also has a positive effect on performance. One of these basic tasks is the retrieval of data stored in the database.
SAP delivers data for its new type of programs, which are built with the OpenUI5 framework and run in Fiori, using Core Data Services (CDS) technology, which is how SAP puts the concept outlined above into practice. CDS Views are the core of the various CDS objects, the other objects mainly support the proper functioning of the underlying data model. These views are effectively queries and can be made available to users other than developers. However, when a new report is needed, standard views often do not provide a perfect solution for a given user-need.
Overview of the existing CDS views
Prior to deployment, it is a good idea to review what is in the SAP S/4HANA solution’s CDS Views catalog. To do this, the View Browser application in Fiori Applications has to be launched, where the CDS views can be searched based on a number of parameters. For queries that can be launched and displayed immediately, the “Released Views for Key Users” option has to be selected instead of the automatically offered “Standard” filtering, and the CDS Views of type “Query” has to be launched.
CDS Views can also be developed into complex data cubes (CDS Analytical Projection Views), of which there are also a number available by default. These can be found in another application, the Query Browser.
Of course, these queries can provide information not only to end users, but also to a program. However, it is worth mentioning that it is technically possible to modify, delete or extend the data directly, but this is not recommended, as these changes are not reflected in the usual notes of the application environment, and therefore, as the name CDS Views suggests, this technology basically supports reading the database. Nevertheless, the report result can be processed by the program using it, for example, through an ABAP component, and can also call transactions related to these activities or other non-ABAP codes.
However, the amount of data to be processed in this way under the code-to-data approach can be reduced beforehand, since some of the selection, sorting and computation logic can be performed earlier in the database layer. It is possible to request parameters from the user or to receive parameters from the calling program without the need to develop a front-end program beforehand.
Development and technological environment of SAP CDS views
Development can take place on multiple platforms and in multiple forms, determined first and foremost by the intended use of the CDS Views and the architecture of the system. If the views are to be used exclusively in a HANA environment, i.e. ABAP programs will not work with them, so-called HANA CDS objects will be created, otherwise ABAP CDS will be created.
Figure 1 – Editing CDS View using SAP Business Application Studio (Source: Author’s edit)
If we are not satisfied with the capabilities of the development environment offered by SAP Business Application Studio, the given development system can be integrated with Microsoft Visual Studio Code. SAP provides a number of up-to-date plug-ins to support development activities in this environment as well, of course not only supporting the editing of CDS objects.
Figure 2 – SAP HANA CDS view editing using VS Code (Source: blogs.sap.com)
However, in the case of an on-premises system, by default we do not have access to the SAP Business Technology Platform, including SAP Business Application Studio, so we have to work with the SAP Application Development Tools (ADT) development package built in Eclipse. The advantage of this is that we have direct visibility and access to the ABAP development objects known from the traditional SAP ERP system, and although we can also use this platform for HANA CDS development, SAP recommends using Business Application Studio for those development processes. Previously, this platform also offered the possibility of graphical modelling, but this was discontinued by SAP a few years ago, so that we can now only manage ABAP CDS view objects at code level within the OpenSQL technology framework. Eclipse has very detailed documentation for this, and like the SAP GUI, we can access the development support documentation by pressing the F1 key. The searchable and hierarchically structured documentation allows even those without deep OpenSQL knowledge to quickly learn the basics of development.
If for some reason it is deemed necessary, it is also possible to use ABAP CDS views as traditional ABAP Views, as the system will create and then automatically regenerate these types of views on demand. This can be useful, for example, if you have a custom-built program that uses ABAP Views and they do not perform as expected. By simply replacing them with database views of the same structure, but derived from ABAP CDS Views, the operational logic is preserved, but performance can be significantly improved with relatively little developer time, given the capacity of HANA.
Since SAP CDS technology is application-independent and serves a fundamental purpose in SAP HANA-based systems, it can be used in a wide range of applications. Its biggest advantages include that queries are fast and relatively easy to implement and accessible on all platforms. If we are facing performance problems, we have to build reports in a short time, or require data for an application development, SAP CDS is most likely the solution.
Onespire Ltd.’s SAP experts are constantly exploring new types of technologies, including the opportunities and benefits offered by SAP CDS Views-based reporting. In addition to our deep theoretical knowledge, our staff has also gained extensive practical experience in a number of previous projects. This enables us to provide effective support in the development of SAP CDS Views-based reports, from the survey to the implementation.
If you have questions about SAP CDS Views technology, contact our experts!
SAP CDS Views – The primary data delivery technology for SAP HANA
by Onespire Ltd.
Images made with generative AI by Vanda Kocsis
Discover our other posts in this category!
We examine how processes managed in enterprise resource planning systems can be supported using AI.
In this post, we discuess the data-level processing of different types of business documents.
We outline the database and data management options of the SAP BTP solution.