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.
Showing results for 
Search instead for 
Did you mean: 
Cheers ABAP Folks!

Have you ever asked yourself what Embedded Analytics is all about and how your company can benefit from it? In this blog post I, want to give you an insight into Embedded Analytics done with the lately announced ABAP Cloud.


Conceptual Basics

Alright, first I need to admit: Yes - there are numerous different possibilities to do analytical reporting for data stored in ABAP-based systems. And yes, each of them has its benefits. For example, for a distributed system landscape it makes sense to have a dedicated solution, like SAP BW/4HANA or SAP Data Warehouse Cloud, which brings all the scattered data of your different systems together. However, some just want to have an analytical reporting for their data stored in their central core system. And here Embedded Analytics comes into the game.

Embedded Analytics is an easy-to-use reporting strategy, which allows to aggregate and display data of your core ABAP solution – without any cross-system overhead. And do you know what’s the best about it? It’s already included in the most common ABAP-Cloud-based solutions like Steampunk or SAP S/4HANA powered Embedded Steampunk. All those solutions have the required analytical engine, modeling tools and, depending on the concrete application, a publicly released Core Data Service (CDS) model shipped – ready to be exploited by you!


It’s all about ABAP Core Data Services

With ABAP Cloud based Embedded Analytics, the foundation of all analytical reporting is the data model defined by Core Data Services (CDS). Most data models of applications built in the ABAP universe are separated in different layers. On the very bottom, there are the classical ABAP Dictionary database tables, which store all the data, and which are kept private in ABAP Cloud. On top of that there's a CDS-based reuse layer, which allows publicly released read-only access to those database tables. And on top of that, there are scenario-specific applications that make use of those data models. Either transactional RAP applications, which allow data maintenance, or analytical applications, which allows reporting of the underlying data.

Ok – but what’s the big deal about using the same data model for all kinds of applications? What sounds trivial to the most of you, wasn't usual in the past. Transactional and analytical applications often didn't share the same data persistence, leading to mandatory data replications even for embedded scenarios. Today, with the column storage technology of SAP HANA and the Core Data Services in the ABAP Server, the same underlying data structures can be used, without any performance penalties for analytical applications.

It’s even getting better: You as an ABAP developer are empowered to either build your own CDS-based application from scratch or to build your own analytical reporting on top of released CDS models by SAP or partners. And that’s all without the need to subscribe to any further stand-alone solutions outside the ABAP system.


Great – I’m in, but how to get started? 

First, we need to understand how an analytical application is built with CDS. Let’s imagine we've a simple shop application that manages sales orders of various products. A sales order of this application has an amount (called measure in analytical contexts) as well as some further attributes like a concrete customer, an order date or a concrete related product (called dimensions in analytical contexts), which can have further related attributes.

Those different attribute classifications are important, because measures are numeric fields, which we're interested in, as soon as they're aggregated. For a CEO, it would be the summed-up turnover at the end of a year. However, dimensions are fields that allow us to fine-tune our reporting by defining the attributes relevant for aggregation. With that, we can split up the turnover based on the customer's location, based on the year or even based on the products sold. There might also be scenarios in which we want to combine those dimensions, because the CEO exactly wants to know how many MyPad 7 were sold back in 2020 in Seattle.

But that’s by far not all. Due to the data model defined with ABAP Core Data Services, it's even possible to define different aggregation levels, which can be accessed via so called drill-down / rollup actions. This means hierarchical data models (some of them are already available within each ABAP platform) can be used to roll up from a city to a region to a country. By that the concrete reporting can't only be defined for Seattle, but also for all orders created in Canada.

The same is of course possible vice versa for other dimensions, like a concrete order date.

All those technical capabilities and relations are defined in a dedicated CDS entity, which is called a multidimensional cube view. It’s the heart of your analytical application, which spans up all capabilities. The great thing is you as an ABAP developer may also use standard cubes to build your own reporting on top of SAP or partner applications. So, keep your eyes open for released content, which can easily be exploited!

Further, foreign key fields mentioned in the cube may have their own CDS entities with further dimension-like fields or again further relationships to more detailed sub entities and hierarchies. If we would display those entities in an Entity Relationship Diagram, it would look like a star. And there, also the name comes from: Analytical Star Schema. This schema is the foundation for all reporting done in your analytical application and is always accessed via the Multidimensional Cube View.

However, to create a concrete reporting for our CEO, we need to define a projective query on top of such a cube. Those queries are called CDS analytical projection views. There, you now define

  1. which concrete measures you're interested in, by projecting the corresponding measure of the cube

  2. by which dimensions those measure should be aggregated

  3. further calculations and restricted measures

  4. display capabilities for dimensions and measures and

  5. filter conditions for dimensions

What happens in ABAP stays in ABAP?

Definitely not. ABAP CDS is used to define the core data model, as well as the technical instructions, which aggregations should be done on execution of your CDS analytical projection view. However, we haven't defined a pretty UI yet, which is usually the most important part for a CEO presentation!

With Embedded Analytics in ABAP Cloud, you've multiple possibilities to display your analytical query. Of course, you can use embedded ABAP technologies like Web Dynpro Grid. However, you also have the possibility to expose your analytical model by a service, so it can be accessed also from Fiori clients or other systems across your landscape. Sounds strange, because it’s labeled as embedded, right? No, not at all. The data model and the executing engine are embedded inside the ABAP server. However, we provide functionalities to execute those queries remotely, by creating a live data connection to SAP Analytics Cloud, which provides further UI capabilities for building nice and fancy dashboards. Trust me, this will make your CEO happy.

Ugh – That’s all? Pretty high level!

Do you like it? If yes, stay tuned for the upcoming parts in which we're going to deep dive into the implementation of cubes, queries, and hierarchies, based on Core Data Services in ABAP Cloud!

In the meantime, feel free to check out the following links to gather further information about this topic:

Blog Post: CDS Analytical Projection Views – the new Analytical Query Model

Blog Post: Developing for Analytics with the SAP BTP ABAP Environment

Documentation: Analytical Data Modeling & Live Data Connection to SAP Analytics Cloud


Cheerio ABAP Folks!


Subsequent Parts

Embedded Analytics with ABAP Cloud – The Multidimensional Cube (Part 2)