In this blog we will lay out the technical aspects of S/4HANA Embedded Analytics, specifically how to get from a process to the apps and eventually the underlying CDS-views and tables. This is called data lineage. This information can be helpful when an issue arises in an app or the dataset needs to be adjusted or expanded.
When implementing S/4HANA, the organization starts with capturing the processes. When the processes have been outlined, the corresponding S/4 reporting functionality can be found. There are three possible scenarios to do this:
The client uses a standard Fiori Analytical App (top flow)
The customer uses a (custom) Query (bottom flow)
Functionality is tailor-made
Depending on the scenario there is different method applicable to analyze the data lineage. The third scenario is not discussed in this blog.
A graphical representation of the complete process is presented below.
We start by determining the process. To find the appropriate app we use the SAP Best Practices Explorer via https://rapid.sap.com/bp/. Click on S/4HANA and then SAP Best Practices for SAP S/4HANA (on premise). In menu item Solution Scope you will have the option to select the Scope Items per Line of Business. These Scope Items cover the standard processes as defined in SAP S/4HANA. For this blog we will use Scope Item Procurement of Direct Materials (J45) as an example
When opening the Scope Item, a description of the S4/HANA standard process is shown. This includes a document called Test script. In this document, the process of the Scope Item is described in detail including the business roles involved in the execution of this process. The Business Roles form the basis of what Fiori app is used for which part of the process. A user has to be assigned a business role to use the Fiori Apps that fall within this Scope Item.
In the Test script you will find a chapter called Roles, in which the business roles of the process are shown. Logically, many of the roles within Procurement of Direct Materials are related to Purchasers, Inventory Managers and Accounts Payable Accountants, as you can see in the role description in the screenshot below.
Once the business roles within the scope item are known, the Fiori Apps that are included in this role can be requested. Since we are discussing Embedded Analytics, we focus on the Fiori Analytical Apps, the built-in Fiori apps aimed at reporting and analytics. In our example, the role of Purchaser (SAP_BR_PURCHASER) is used.
To find the Fiori Analytical Apps for the purchasing role, we can use the SAP Fiori Apps Reference Library via the link https://fioriappslibrary.hana.ondemand.com/sap/fix/externalViewer.
Click on All apps for SAP S/4HANA in the menu on the left side of the screen and select by Roles. At the top left a search bar will appear where a business role can be entered. As shown in the screenshot below, this role has 149 apps. Via the filter button, only the Analytical Type SAP Fiori - Analytical can be selected, after which only the reporting apps are shown. When selecting an app, more information about this Fiori Analytical app (read: report) is shown.
In this example, the analytical app Monitor Materials Without Purchase Contract was selected. When assigning the business role SAP_BR_PURCHASER to the user, this user can immediately start using this standard report which shows all materials without a purchase contract.
But where is the data in the report come from?
To find the source data of an app, the first step is to find the name of the OData service. This can be done in two ways:
Via the Fiori Apps library
Via the app's Manifest.json file.
In the App Details of the Fiori app the OData service of the app can be found under Implementation information -> Configuration -> OData Service(s).
If it is not listed in the Fiori App Library, the OData service can be found in the app's manifest.json file. The technical name of the SAPUI5 application can be used for this.
Open the SAP GUI and start transaction SE80. Select BSP Application and enter the technical name of the SAPUI5 application. In section Page Fragments you will find the file manifest.json. The OData service can be found in the code of this file under “dataSources”. Please note, this option is available in the S/4HANA on-premise and private cloud variant only.
Once we found the OData service that supplies the Fiori app with data, the underlying CDS views found as well. Depending on the naming convention of the OData Service, this can be done in three ways:
OData service with suffix _CDS
Take the name of the OData service without the suffix _CDS.
The Data Definition of this can be found in Eclipse. Please note, this is only possible in the S/4HANA on-premise or private cloud variant.
For the OData services with naming convention _SRV, an additional step is required. First step is to take the OData service without the suffix _SRV.
Open the SAP GUI, go to the SAP Gateway Service Builder (transaction SEGW) and open the OData service. This shows the data model of the OData service. Click on the hierarchy to show the Entity Types this will show the CDS views. Copy the technical name of the CDS view without the suffix Type and you can find the CDS view in Eclipse. This step is also only possible in S/4HANA on-premise or private cloud.
To retrieve the underlying CDS views of an OData service with naming convention CB_, the first step is to go to transaction /IWFND/MAINT_SERVICE in the SAP GUI. The OData service can be searched via the filter button. When found, select the service, and click Service Implementation at the bottom right.
Open the Data Provider class.
Go to the method GET_ENTITYSET and search within the ABAP code for the technical names of the CDS views.
If you have an OData service that does not fall within these naming conventions, there is another way to determine the underlying CDS views. To do this, go to transaction /IWFND/MAINT_SERVICE again and click on Service Implementation. This time, open the Model Provider Class.
Search within the class for the method IF_SADL_GW_MODEL_EXPOSURE_DATA~GET_MODEL_EXPOSURE.
Search in the code for dataSource type=”CDS” and after binding= you will find the names of the CDS views.
This is the data lineage process of a Fiori Analytical app to the CDS views. But what if it is not a standard Fiori app that is used, but a query?
Open the Query Browser app in S/4HANA and type in a keyword of the data you are looking for, like Product. The Query Browser now lists all queries that have product in the view name.
When the query is found, the underlying views can be retrieved in the S/4HANA app View Browser. Since the query itself is also a view, the technical name of the query can be looked up directly. A query is always of View Type Consumption.
Click on the view and select the Cross reference tab to see the CDS views.
Another way, only available for S/4HANA on-premise and private cloud, is to search for the technical name of the query view directly in Eclipse.
Finding the CDS view is not the end of our journey. CDS views often take data from other CDS views, that in turn read their data from SAP source tables. To get an overview of the relations between various CDS views and source tables the Dependency Analyzer can be used.
This is done by searching for the CDS view in eclipse. By right clicking in the code, you can select Open with --> Dependency Analyzer.
Working with our customers we see many scenarios where standard S/4HANA processes do not fully align with the customer’s way of working. With this blog we have shown how to find the data source that feed into apps and reports. The next step is to dive deeper into the possibilities to start customizing the standard reports in order to meet the customer needs. The available options and how to use them will be described in our upcoming blog.
If you would like to know more about how S/4HANA Embedded Analytics can impact your organization, please contact Victor Brosens (+31628253979).