ABAP CDS in SAP BW
ABAP Core Data Services (CDS) Views were introduced with SAP ABAP 7.40 SP05. CDS allows the creation of rather complex views that by far exceed the capabilities of database views created in SE11. Besides their role in the ABAP Programming Language, CDS Views are the technology behind the virtual data model on top of the SAP S/4HANA application tables which, e.g. is used in SAP S/4HANA Analytics.
This aspect – the role of CDS in SAP S/4HANA Analytics – frequently brings up the question whether or how CDS might be used in the context of SAP BW powered by SAP HANA or SAP BW/4HANA.
The purpose of this blog is to clarify the role of CDS in SAP BW.
ABAP CDS in SAP BW – the reporting perspective
Since CDS is used to build the Virtual Data Model in SAP S/4HANA, a frequently asked question is, whether CDS Views could also be used to build a virtual layer on top of BW InfoProviders, most prominently Advanced DSOs, which could be consumed in analytic front end tools like in the SAP S/4HANA environment. Or, whether CDS could be used to enhance a SAP BW data model with data from a Z-table. The clear answer to this is – for a number of reasons: No.
The SAP BW data model
Anyone familiar with the way SAP BW generates database tables from its high level (InfoObject based) data model, knows that SAP BW entities typically are split into multiple tables with implicit relationships managed by the BW application. In addition, many of these tables contain technical fields which are of critical importance when writing to or reading from the object. All the logic that is required to correctly interpret these fields and deliver correct and consistent query results, is part of the BW application which creates the correct JOINs and filters at query runtime. All the SAP BW modeling artefacts (e.g. CompositeProviders, Advanced DSOs) are built such that they are aware of all these aspects and relieve the user from a detailed understanding.
The SAP BW security concept
SAP BW secures data from un-authorized access via Analysis Authorizations. This is again a concept specifically designed with the SAP BW data model in mind and it differs significantly from standard filter-based database security concepts. And just as with the data model aspects above, the evaluation and interpretation of Analysis Authorizations is done in the SAP BW application. Therefore, accessing SAP BW data via SQL or OpenSQL (which is the standard way to consume CDS views), would completely bypass the security layers of SAP BW and open the way for un-authorized access, which is prohibitive in pretty much any real world scenario.
These aspects have since long been the main reasons why SAP does not support direct consumption of SAP BW generated tables. As you may be aware, SAP BW powered by SAP HANA or SAP BW/4HANA provide capabilities addressing specifically this point – opening up SAP BW for SQL consumption. The approach taken here is to generate SAP HANA Calculation Views from the SAP BW data model that incorporate all the dependencies within the data model and the correct interpretation of all the technical fields and creating SAP HANA Analytic Privileges from SAP BW Analysis Authorizations to ensure security.
Conversely, when it comes to integrating non-BW data (e.g. in a Z-table or Z-view) with the SAP BW data model, this is done via Open ODS Views, which – conceptually – put a “SAP BW-shell” around a table or view.
Thus, also in this environment, CDS does not play a role in SAP BW.
SAP BW Technical Content
Tracking and monitoring the operations of a SAP BW system is one of the areas, where CDS in fact is playing a role. For example, SAP BW comes with tables containing statistics on loading and querying data, status information about load requests, etc. With SAP BW 7.5 SP04, CDS based technical content is shipped that provides administrators/modelers with such information. Being built on CDS, this content is much leaner and simpler than traditional SAP BW technical content, does not require loading of the data to a SAP BW InfoProvider, or even activation of SAP BW objects.
Details about the scope of this technical content can be found here.
Consuming CDS Views in SAP BW
SAP BW can, however, leverage content built using CDS Views – most prominently SAP S/4HANA Analytics. For one, there is a dedicated Source System type ODP-CDS in SAP BW (since release 7.4) that allows to load data from a CDS View into SAP BW. This integration currently does not provide all services known from the classic extractor based data provisioning, but in certain scenarios it can be a valid option. Secondly, SAP S/4HANA Analytics content can be virtually consumed and combined with data in SAP BW via Open ODS Views. More details on this can be found here.
ABAP CDS in SAP BW – the ETL perspective
One specific use case where CDS views can play a role are the SQL expert routines in SAP BW Transformations. To simplify, for example, a complex look-up on customer specific Z-tables in a transformation, it can be very useful to define a CDS view on top of these tables and use that CDS view within the SQL export routine.
To summarize, CDS and SAP BW modeling have only very few touch points. For operational reporting scenarios directly on application tables – as in the case of SAP S/4HANA Analytics, but also when monitoring a SAP BW system – the CDS approach is the way to go. When it comes to building a SAP BW data model, especially a virtual data model, then SAP BW’s CompositeProviders are the right approach, possibly in combination with Open ODS View when data outside of SAP BW has to be integrated.