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: 
former_member187457
Active Contributor

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
5 Comments
Labels in this area