Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
linda_peruzzi
Participant

Purpose of this Blog


 

As part of building Analytics against S/4HANA using SAP Analytics Cloud (SAC), it is important to understand what objects SAC can consume in both Live Data scenarios and when Importing (Replicating) Data from S/4 HANA to SAC.

It is also helpful to understand how to search for objects based on the use case KPIs or dimensions.  There is a wealth of information on the internet about S/4HANA Core Data Services (CDS views) but this blog is geared specifically for requirements for SAP Analytics Cloud Enterprise to help customers and partners to get started.

This blog:

  1. Is focused on the SAP Analytics Cloud Enterprise edition and not the Embedded SAP Analytics Cloud delivered within S/4HANA. Click here for more details on the difference.

  2. Will not cover how to create custom CDS views.



Understand Live vs Import Connections 


 

For information on the difference between Live and Import data with respect to SAP Analytics Cloud and the pre-requisite setup requirements, see the following link:  https://saphanajourney.com/sap-analytics-cloud/data-connections/

Note: There are differences in connectivity pre-requisites between SAP S/4HANA on-premise and S/4HANA Cloud.

There are a few things to consider when deciding to use SAP Analytics Cloud Live vs Import Data.  See the following link for more details: Choosing a Live Connection or Importing Data

Ultimately, best practice is to use a Live connection with Single Sign On unless there is an SAC Planning scenario where import of data is required with the current version of SAC.

A major consideration around connectivity is also around authorizations to the objects in S/4HANA from SAC.

  • For Live connections,

    • Single Sign On is recommended. This means that the user logged into SAC will be mapped to the corresponding user querying the data in S/4HANA so objects and data level security on S/4HANA will determine what a user will see. No extra authorizations are required in SAC for data level security.

    • The list of objects available from S/4HANA will also be based on the authorizations of the logged in user so missing objects could indicate they don't have required authorizations.



  • For Import connections,

    • One user will be setup in the import connection to S/4HANA to replicate the data into SAC. Data imported will be based on this user’s authorizations in S/4HANA. Therefore, additional authorizations may need to be set up in SAC both at the object or folder level and/or data level of the SAC model otherwise users will see all imported data in reports.

    • The list of objects available from the S/4HANA connection will be based on the authorizations of the user id configured in the connection.





S/4HANA Objects consumed in SAP Analytics Cloud


 
S/4HANA Live Connection to CDS views

SAP Analytics Cloud can consume queries based both on SAP Delivered and Custom Core Data Services (CDS views) from S/4HANA Cloud or On-Premise. Only CDS View Type CONSUMPTION is consumable and must have the annotation @analytics.query:true to generate a transient query automatically to expose the CDS view to the analytic manager.

In SAP Analytics Cloud, creation of a connection based on S/4HANA Live will access these transient queries.
S/4HANA Import Connection to OData generated from CDS view

Where data is replicated from S/4HANA to SAP Analytics Cloud, the CDS view (along with criteria shown above) must also have the OData annotation @Odata.publish:true to generate an OData service.

The generated OData service must also be activated in SAP Gateway within the S/4HANA system.  More information is available in the following links: Activate OData Service in the SAP Gateway Hub and Test the Activated OData Service.
BW Live and Import Connection

S/4HANA also has an embedded BW 7.5 component so technically BW queries can be consumed for both Live and Import and BW Info providers for Import Only. CDS views, being transient providers, will also be listed for live connectivity however it is recommended to connect to CDS views using the previous options.

The BW option only makes sense if you are creating specific content within BW and then can consume that content in SAC.

For more information on the types of CDS views that are supported along with the required annotations, please see the following KBA 2595552 .


How to explore available CDS views in your S/4HANA system


 
Option 1 View Browser of S/4HANA Fiori Dashboard for both SAP and Custom CDS views

 

The first option is to go through the View Browser of the Fiori Dashboard (Fiori Launchpad URL).  Any CDS views that have the @analytics.query:true should be displayed including both SAP delivered and custom CDS views.  The Fiori dashboard would have to be set up already and the user must have the required authorizations to be able to run this application (see View Browser). Search by entering in terms for the name of the query or for query fields.

For instance, if I wanted to search for any queries related to Sales Orders, I would get a list as follows:


Fiori Dashboard Browser


Consumption based SAP delivered CDS views will typically start with the string C_.

  • Test the CDS view and view the corresponding data by selecting the view name selection box and clicking on Open for Analysis.

  • The Definition of the Query and related annotations can be seen clicking on the View Name



Definition


Under the Annotation tab, you can find the annotations used in the CDS view as well as the SQLViewName that you can search for in SAC.  Again, for “Analytics-Incoming Sales Order”, you can see that it has the required pre-requisites for usage in SAC.  For Live, it is type CONSUMPTION and has the Analytics.Query:True.  You can also use this CDS view for Import as the ODATA.PUBLISH:true has been assigned.


Annotations



Option 2 SAP Standard Documentation based on the S/4HANA version to search SAP Delivered CDS views

 

For a list of SAP delivered CDS views available, go to the following documentation Link and choose the S/4HANA version.


SAP S/4HANA Documentation


The CDS views are grouped by Line of Business or Areas (Finance, HR etc.) or by industry and may include information such as the authorizations required and the type of CDS views.

Keep in mind that SAC can only consume CDS views with type Consumption. Basic, Composite, Cube etc. are not exposed.   The other requirement is that API State Visibility: Released.

As an example, doing a search “Sales Order CDS”, the search result will include the Analytics – Incoming Sales Orders CDS consumption view under LOB Sales. 


In SAP Analytics Cloud, if you do a search on the Description of “Analytics - Incoming Sales Orders” or enter the SQLVIEWNAME “2CCSDSLSORDERITEMQ”, you will see the exposed CDS that you can use in the Live scenario.

Extra Tip:  If for some reason the documentation doesn’t give you the SQLVIEWNAME in the documentation, in the S/4HANA system, you can navigate to the standard table that stores all the CDS views created in a system called RSODPABAPCDSVIEW in transaction SE16.  If you enter the Technical name in into the DDLNAME, you will see the SQLVIEWNAME which you can use in the search window in SAC to find the related view. You could also use this to search for all CDS views based on a specific string.


 
Option 3 Eclipse or SAP HANA Studio for both SAP and Custom CDS views

 

For a more detailed view of coding for CDS views, it is best to go through Eclipse or HANA Studio.  For Eclipse, from the menu choose Navigate > Open ABAP Development Object or press CTRL + SHIFT + A.  To find an SAP delivered consumption CDS view, enter in C_* type:ddls for a general list.  You may need to put in additional strings to narrow down the search.


Choosing the CDS view, you can see the details including the annotations as well as the logic.


The CDS transient query can also be tested by going to transaction RSRT using the ABAP interface in Eclipse, adding 2C as a prefix to the SQL view and see the results.  This can also be done using SAPGUI.




Additional Information


2761862 - CDS views do not appear when creating a model using an import or live connection to SAP S/...

2595552 - Cannot access Core Data Services (CDS) View from SAP S/4HANA in SAP Analytics Cloud (SAC)

https://wiki.scn.sap.com/wiki/display/BOC/SAP+Analytics+Cloud+Connectivity+Guidelines

 
5 Comments