Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Products

Products Industries
Industries Services
Services and Support
Support Training
Training Community
Community Developer
Developer

Partner
Partner About
About

10

Ask a Question Write a Blog Post

Technical Articles

Rahul Keshav
June 6, 2019 5 minute read

Embedded CDS View exposure to Fiori


Follow RSS feed Like

7 Likes 1,795 View 4 Comments

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
i. These views fetch the data and apply all the business logic in CDS views
Pasteii.URL
These views are further classified as Basic Views & Composite views
# or type to search
 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

i. Create Material VDM Basic CDS View as follows:


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

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


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 PR
- #COMSUMPTION - Exposed to external platform such as OData, Fiori, and BW. It uses only #B

@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 sometim

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
Alert Moderator

Assigned tags

SAP Fiori for SAP S/4HANA | ABAP Development | analytics | CDS to Fiori | Embedded CDS Views |
SAP Fiori for SAP S/4HANA | ABAP Development | analytics | CDS to Fiori | Embedded CDS Views |

Related Blog Posts

Leading S/4HANA UX - Solving No Data Available for Smart Business Apps


By Jocelyn Dart , Oct 25, 2017

Create Fiori List App Report with ABAP CDS view - PART 1
By Ravi Dasari , Jun 25, 2018

Fiori apps not returning data


By David Foshee , May 27, 2018

Leading S/4HANA UX - Solving No Data Available for Smart Business Apps


By Jocelyn Dart , Oct 25, 2017

Create Fiori List App Report with ABAP CDS view - PART 1
By Ravi Dasari , Jun 25, 2018

Fiori apps not returning data


By David Foshee , May 27, 2018

Related Questions
FIORI- My Inbox - Modifying annotation of field in standard CDS
By Former Member , Mar 23, 2017

Node expand not working in Hierarchy CDS view consumed in Fiori List Repport
By Vivek Ramasamy , Jul 28, 2018

Unsupported DefaultAggregation: #AVG in analytical CDS


By Former Member , May 07, 2018

FIORI- My Inbox - Modifying annotation of field in standard CDS


By Former Member , Mar 23, 2017

Node expand not working in Hierarchy CDS view consumed in Fiori List Repport
By Vivek Ramasamy , Jul 28, 2018

Unsupported DefaultAggregation: #AVG in analytical CDS


By Former Member , May 07, 2018

4 Comments

pragyan pradeepta panigrahi

June 25, 2019 at 8:34 am


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

Like (0) Reply Alert Moderator


Sebastiano Marchesini

July 2, 2019 at 6:52 am


Hi Pragyan,

the error is being spoken.


Is ZV_CDS_EMB_LAND exist ?

Could I see that ?

Best regards,
Sebastiano

Like (0) Reply Alert Moderator

pragyan pradeepta panigrahi

July 2, 2019 at 11:19 am


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.

Like (0) Reply Alert Moderator

Rahul Keshav | Post author

July 17, 2019 at 8:09 am


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

Like (0) Reply Alert Moderator

Add Comment

Share & Follow

Privacy Terms of Use

Legal Disclosure Copyright

Trademark Preferencias para cookies

Preferencias para cookies

Sitemap Newsletter

You might also like