Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
kschoudary
Participant
Introduction:

In this blog post, I would like to explain various reporting options available for developers. I have been developing several reports in S/4HANA systems for the last one year and thought of sharing my ideas and experiences in this blog post. These reports are also called 'embedded analytics' in S/4HANA and they do not need a separate BW system and display results from real time data.

We can develop feature rich reports combined with KPIs, Visual Filters with Charts, Charts and tables in a single Analytical report with Realtime Data and users have lot of flexibility to customize the reports as per their needs. And the charts act as filters to display the data in the table.

We can categorize these reports into 3 groups.

  1. Query Views (similar to BW Query using Virtual Data Model (VDM))

  2. List Reports with Object Page (LROP)

  3. Analytical List Reports (ALP)


All these reports are developed using ABAP CDS Views in Eclipse using ABAP Development Tools (ADT)

The first one in the list - 'Query Views' is very simple, easy and does not need any additional tools other than Eclipse with ADT. They run in Fiori Launchpad (FLP) from the SAP standard tile - 'Query Browser'.

The second and third in the above list need additional tools like SAP WebIDE or VS Code for end-to-end development. Also these need series of steps after initial development like creating Semantic Objects, adding a new tile in FLP ETC.

I have already published a blog post back in Nov-2020 in detail to develop the second one (LROP) -  End-to-End Development of Fiori App using ABAP RAP, Fiori Elements and VS Code

I am planning to publish another blog post for the third one (ALP) but then I decided to first cover the basic reporting, which is Query Views.

I initially started developing the reports using Query Views and then slowly moved to work on LROP and ALP as I learned using VS Code from my FinTech course last year and also has both ABAP and BW experience of several years.

I am explaining in this blog post the steps for developing and running the Query Views. The Query views in this approach are similar to BW BEX Queries and the CDS views that are developed create a Virtual Data Model (VDM) which includes Dimensions, Cubes and Queries. Since there is no data loaded, which is one of the main function in BW, this is called Virtual. Yes, there is no data loads and the query runs on DB tables using the views, so the results displayed are  real time data and not staged data.

There are several blog posts available already for detailed steps to create CDS views, so I am listing the required steps here and providing the links to the blog posts at the end. I also refer these blog posts from time to time.

SAP recommends the following structure while creating the CDS Views for VDM and Query.

  1. A Basic view to read data from Database tables. End users should not be given access to this view.

  2. A Composite view that connects all the Basic views using Associations. End users should not be given access to this view.

  3. A Consumption view that reads from Composite view. This Consumption view is available to end user to run the report using SAP Standard tile - Query Browser after activation of the view. (See, how easy and simple it is!)

  4. So it is as easy as 1-2-3 and there are no additional steps in this option. (ODATA is not used here, but it is used in the LROP and ALP Reports)

  5. Developer can also use existing CDS views, so there is no need to develop everything that a report requires, like Master data objects - Material, Business Partner etc., where we can use them to display the descriptions, using associations.


Steps to create Query Views:

  1. Identify the database table(s) that are needed for the report. I recommend start with just one table to get familiar with the process then slowly add additional tables to the model.

  2. Create a basic CDS view (Interface) in Eclipse / ADT of type Data Definition using template  'Define View' on the selected table(s) and mark it as  'Dimension'. And insert the below 2 annotations on top of the define statement.
    @VDM: {viewType: #BASIC}
    @Analytics:{dataCategory: #DIMENSION}​


  3. Depending on the number of tables needed for the report, additional views may be required.

  4. Create a second CDS view (Composite) using the above view(s) and mark it as Cube. And insert the below 2 annotations on top of the define statement.
    @VDM: {viewType: #COMPOSITE}
    @Analytics:{dataCategory: #CUBE}​


  5. Create a third CDS view (Consumption) using the above view and mark it as Query. And insert the below 2 annotations on top of the define statement.
    @VDM: {viewType: #CONSUMPTION}
    @Analytics.query: true​


  6. Once all the above views are activated, the final Consumer CDS view is available in Fiori Launchpad

  7. Login to Fiori Launchpad, go to Query Browser (SAP Standard Folder and Tile), and search for the newly created report. Users might need to request a role (Fiori Role:- SAP_BR_EMPLOYEE ) to be assigned, if this Folder/Tile is not available.

  8. The report can be run from here and from the results screen, the users can also save it as a tile in the homepage. Next time, the users can run the report from this tile, skipping the query browser.

  9. The report results can be filtered, exported to Excel etc.


 

Conclusion:

The purpose of this blog post is to explain the series of steps to easily develop an 'embedded  analytics report' in S/4HANA using CDS views and run it from FLP using SAP Standard 'Query Browser' tile.

Hope you enjoyed reading this blog post and appreciate any comments/suggestions/feedback.

 

References:

Courtesy to all the below blog owners:

  1. SAP Developers Tutorial: Create a Simple ABAP CDS View in ADT

  2. SAP Blog post by Felipe de Mello Rodrigues , This blog post has very detailed steps -  Create an analytical model based on ABAP CDS views

  3. SAP 11 part Blog series by Sanjeev Kumar. I initially started my journey with these blog posts and has developed all the objects by copy/paste code from the blog posts! and revisit frequently for details. Link to Part-1. SAP CDS Views Demystification and this blog post has links to all remaining blogs in this series.

Labels in this area