Skip to Content
Technical Articles
Author's profile photo Rahul Keshav

Embedded CDS View exposure to Fiori

1.    Introduction

As we are aware that in SAP S/4HANA system, most of the DDIC tables has been converted to CDS views or DDL SQL Views. SAP is trying to mold all the technical changes/ABAP using these CDS views.

Now question is, how to expose our custom CDS views to Fiori Launchpad without UI5 developer.

Solution is simple, VDM i.e. Virtual Data Model.

VDM consist of two type of views :

  1. Interface View
    1. These views fetch the data and apply all the business logic in CDS views
    2. These views are further classified as Basic Views & Composite views
      1. Basic Views are the CDS views which directly fetch the data from Database mainly master data
      2. Composite Views are the CDS views which fetch mainly transactional data and do associations(Joins) and apply business logic
  2. Consumption View
        1. These views use Interface views and connect to outer world
        2. It means, interface views are never expose to outer world which means our database is secure

 

Now next question is ..How to figure out which CDS view to set as basic view or composite view or consumption view.

ANNOTATIONS…are the key

SAP has provided lots of annotations which can be understood by any other platforms such as OData services, BI, Fiori, etc.

 

Annotation is a set of strings connected with DOT e.g.

@EndUserText.label 

@VDM.viewType


These are quite self-explanatory, we will see it in later section



2. Objective

Our objective is to display a Sales report at Fiori Dashboard.

Following are the steps

  1. Create a Basic CDS views
  2. Create Composite CDS Views
  3. Create Consumption Views
  4. Open Consumption view in Query Browser in Fiori Launchpad
  5. Create Tile at Home screen for Sales Report

3. Development

  1. CDS Views in Hana Studio

    1. Create Material VDM Basic CDS View as follows:

 

  1.  2. Enter Name & Description, rest will  come by default

 

  1. 3. Next->Next->Select your TR ->Next

 

  1. 4. Write the logic as follows:

 

Here we are using Annotations. Following are the details for main annotations:

@VDM.viewType- This annotation represent the CDS exposure type.

It has mainly 3 types:
	-	#BASIC – Expose to internal CDS views only, similar to PRIVATE section in our CLASSES
	-	#COMPOSITE - Expose to internal CDS views only and uses #BASIC CDS views, similar to PRIVATE section in our CLASSES
	-	#COMSUMPTION - Exposed to external platform such as OData, Fiori, and BW. It uses only #BASIC & #COMPOSITE CDS views


@Analytics.dataCategory-This annotation represent the data type.

It has mainly 3 types:
	-	#DIMENSION - It means this CDS view it accessing master data
	-	#FACT – It means this CDS view is accessing only transactional data
	-	#CUBE – It means this CDS view has joins/associations of the #FACT CDS views and sometimes with #DIMENSION CDS views as well


5. Create Customer VDM Basic CDS View as follows:   

 

 

6. Create Customer Country Name VDM Composite CDS View as follows

 

7. Create Sales-Customer VDM Composite CDS View as follows

 

8. Create Sales-Material VDM Composite CDS View as follows

 

 

9. Create CUBE VDM Composite CDS View as follows

 

10. Create Consumption CDS View as follows:

 

Here we are using other Annotations. Following are the details for main annotations:
@Analytics.query- This annotation represent that it is an analytic CDS view
@OData.publish- This annotation makes this CDS view available for OData services
@Consumption.filter- This annotation set the filter property for the particular field

 

4.2 Deployment in Fiori Launchpad

 

  1. Login to Fiori

 

2. Search for Query Browser App

 

3.Open Query Browser app and search for your consumption CDS View

 

4.You will get you CDS view as

 

5.Double click on the CDS view you will get all the fields from CDS view and the annotations as well.

 

6.Select your CDS view and click on Open in Design Studio at the bottom right hand side

 

7. You will get the report as follows:

 

and also graphic presentation- Pie Chart, Bar Chart, etc.

 

 

 

8. You can use filter option as well

 

9. We can save this report as tile in our dashboard as follows:

At the bottom right hand side, click on icon and select Save as Tile

 

 

 

4. Reference

For Annotation detail –https://help.sap.com/doc/saphelp_nw75/7.5.5/en-US/ef/e9c80fc6ba4db692e08340c9151a17/frameset.htm

 

 

5. Conclusion

With help of embedded analytics user can get the run-time data as good as Live data.

Using embedded CDS views, we can leverage the benefit of S/4HANA’s strong analytic capabilities and Fiori’s UX.

 

Thanks,

Rahul

Assigned tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo pragyan pradeepta panigrahi
      pragyan pradeepta panigrahi

      Hi Rahul , nice blog.I am getting one error while doing the same procedure what you did.

      Author's profile photo Sebastiano Marchesini
      Sebastiano Marchesini

      Hi Pragyan,

      the error is being spoken.
      Is ZV_CDS_EMB_LAND exist ?

      Could I see that ?

      Best regards,
      Sebastiano

      Author's profile photo pragyan pradeepta panigrahi
      pragyan pradeepta panigrahi

      Hi Sebastiano , actually ZV_CDS_EMB_LAND isn't exist.But in the blog it given as a code.now i changed that to ZV_CDS_CUST_LAND.I think it exist & when i try to activate i am getting this error now.

      Author's profile photo Rahul Keshav
      Rahul Keshav
      Blog Post Author

      Hi Pragyan,

      Sorry for late reply.

      You need to create 'zv_cds_emb_cust' & 'zv_cds_emb_land'  CDS views first and activate them.

      Then use these CDS views in 'zv_cds_cust_land' CDS view.

      Please let me know if any issues.

      Thanks.

      Rahul

       

      Author's profile photo Ronny Oviedo
      Ronny Oviedo

      The CDS view ZV_CDS_E_LAND  or ZV_CDS_EMB_LAND, should be created in this way: (query the T005T table)

       

      Best regards,

      Ronny Oviedo P.