Filters and Value Helps in Virtual Data Model - Part 2
Filters and Value Helps in Virtual Data Model - Part 2
Shares
In our other tutorial, we learned that Embedded Analytics means Built-in Analytics in S/4
System. Core Data Service and Virtual Data Model Models are one of the pillars of
Programming Models in S/4HANA. In this tutorial, we will try to learn the simple yet very
practical concepts viz: Value Help, Filters
Filter and Annotations in Fiori and Analytical Tools.
If you are not aware of VDM and Embedded Analytics. Please refer to my previous article on
Virtual Data Model.
How to Create Value Helps in Fiori, Analytical Tools, and usage of Different
Annotations.
Based on foreign key associations – With this approach, only the key fields and the
text elements of a help value provider view are exposed as value help related fields.
Based on modeled value help views – The second option is to precisely define the
value help-relevant fields by creating a dedicated CDS view (modeled view) that is
associated as the value help in the consuming CDS view.
https://sapyard.com/vdm-2-s-4hana-embedded-analytics-using-cds-virtual-data-model-value-helps-annotations/ 1/16
6/26/2020 Filters and Value Helps in Virtual Data Model - Part 2 |
Shares
For our exercise today, we will create CDS Views for Value Help and Filters.
Filter Created
Basic CDS views on VBAK (YVDM_C_SOH – Consumption CDS view),
YVDM_KUNNR_VH (Value Help CDS view) and used Standard views
I_DistributionChannel, I_SalesOrganization, I_Country in the mentioned CDS views.
1. Annotations:
Used below annotation to achieve the value help and filter functionality. We have
not used all annotations in my example but we used standard views. In the
standard views all these annotations are used.
@Consumption.filter:
filter This annotation enables the selection option variable and filtering
filter
elements
Shares of the underlying view. We can give default value, range, multiple selections and
mandatory, etc.
@Search.fuzzinessThreshold: 0.8: How fuzzy the text search applied to the annotated
field should be, For example, value 0.8 refers to a similarity of 80%.
Semantics Annotations:
@Semantics.currencyCode: This annotation tags a field containing a currency code
TEXT View:
https://sapyard.com/vdm-2-s-4hana-embedded-analytics-using-cds-virtual-data-model-value-helps-annotations/ 3/16
6/26/2020 Filters and Value Helps in Virtual Data Model - Part 2 |
@Semantics.language: True: The language field that is used in the text view must be a
key field and The language field Should be annotated.
@Semantics.text:
Shares true: At least one non-key field has to be defined as a text field in a
text view.
Example of an Association:
https://sapyard.com/vdm-2-s-4hana-embedded-analytics-using-cds-virtual-data-model-value-helps-annotations/ 4/16
6/26/2020 Filters and Value Helps in Virtual Data Model - Part 2 |
Shares
Note: Value Help and Text Views are NOT categories of views. These are just typed
and used for better understanding.
YVDM_KUNNR_VH Download
Shares
YVDM_C_SOH Download
Execute the t-code /n/iwfnd/maint_service and press the Add Service button. In the
Add Selected Services, a screen provides a System Alias and then presses the Get Services
button. The Technical Service Name field, YVDM_C_SOH (Consumption View from above
step), can be provided to filter the results if necessary. Selecting the service should result
in the Add Service dialog appearing. Here you can assign it a package and choose the enter
button to complete the process.
Also Read: CDS Part 3. Expose CDS Views as OData Service through Annotation
Select Project from the template in the SAP WebIDE Full-Stack and select the List Report
Application
https://sapyard.com/vdm-2-s-4hana-embedded-analytics-using-cds-virtual-data-model-value-helps-annotations/ 6/16
6/26/2020 Filters and Value Helps in Virtual Data Model - Part 2 |
Shares
Select the S/4Hana System and OData Service and click on the finish button.
https://sapyard.com/vdm-2-s-4hana-embedded-analytics-using-cds-virtual-data-model-value-helps-annotations/ 7/16
6/26/2020 Filters and Value Helps in Virtual Data Model - Part 2 |
Shares
https://sapyard.com/vdm-2-s-4hana-embedded-analytics-using-cds-virtual-data-model-value-helps-annotations/ 8/16
6/26/2020 Filters and Value Helps in Virtual Data Model - Part 2 |
Shares
Sold-To-Party and Sales Organization fields are mandatory as we used Mandatory: True as
shown in the below annotation.
@Consumption.filter:
filter { selectionType: #INTERVAL, multipleSelections:
true,mandatory: true}
https://sapyard.com/vdm-2-s-4hana-embedded-analytics-using-cds-virtual-data-model-value-helps-annotations/ 9/16
6/26/2020 Filters and Value Helps in Virtual Data Model - Part 2 |
Note: Consumption Annotation can be used in Fiori and Analytical tools (BW
queries, Analysis For Office and Other Tools) but UI Annotations can be used only in
Shares
Fiori.
@Search annotation is used in the Value Help View and because of it, the below search
button was displayed.
https://sapyard.com/vdm-2-s-4hana-embedded-analytics-using-cds-virtual-data-model-value-helps-annotations/ 10/16
6/26/2020 Filters and Value Helps in Virtual Data Model - Part 2 |
Shares
Final Output:
Input the CDS SQL View and Not the CDS Entity View Name and Execute it.
https://sapyard.com/vdm-2-s-4hana-embedded-analytics-using-cds-virtual-data-model-value-helps-annotations/ 11/16
6/26/2020 Filters and Value Helps in Virtual Data Model - Part 2 |
Shares
Sales Org Value Help and Sold to Party are displaying in the report. But did you notice,
Distribution Channel selection is not showing in the analytical queries? Why?
https://sapyard.com/vdm-2-s-4hana-embedded-analytics-using-cds-virtual-data-model-value-helps-annotations/ 12/16
6/26/2020 Filters and Value Helps in Virtual Data Model - Part 2 |
Shares
If you are using @Anlytical.query: True (BW Query – Transient Query) then you can write
the below annotations to GET the fields automatically but below annotations will NOT
work for annotation @Analytics.dataCategory: #CUBE(Transient Provider)
@AnalyticsDetails.query.axis: #ROWS
@AnalyticsDetails.query.axis: #COLUMNS
@AnalyticsDetails.query.axis: #FREE
CDS views with the annotation @Analytics.query: true are transient queries which can be
interpreted by the Analytic Engine.
Try some Quizzes and Hands on Exercise on ABAP CDS – From our Oct and Nov
2019 Batches.
This is my second article on Virtual Data Model. Do provide your feedback and suggestions.
Based on your comments, I will plan my next tutorial. Please keep visiting our page and
sharing.
Do join 5735+ SAP Technical Consultants in this Telegram SAP Technical Discuss
Group. Ask, Answer and Learn is our Motto. You need to install Telegram App first
in your mobile or desktop and then click the joining link.
Please SUBSCRIBE to SAPYard’s Youtube Channel for Free End to End SAP Video
Course and Training.
https://sapyard.com/vdm-2-s-4hana-embedded-analytics-using-cds-virtual-data-model-value-helps-annotations/ 13/16
6/26/2020 Filters and Value Helps in Virtual Data Model - Part 2 |
VDM 2 – S/4HANA Embedded Analytics Using CDS Virtual Data Model – Value Helps &
Annotations
CDS Part 18 – Bar Chart & Donut Chart using CDS Views
VDM 3 – S/4HANA Embedded Analytics Using CDS Virtual Data Model – Meta Data
Shares Extensions(MDE)
https://sapyard.com/vdm-2-s-4hana-embedded-analytics-using-cds-virtual-data-model-value-helps-annotations/ 14/16
6/26/2020 Filters and Value Helps in Virtual Data Model - Part 2 |
ABAP on SAP HANA. Part XII. Open SQL, CDS or AMDP, which Code to Data Technique to
use?
CDS Part 6. Basic Expressions & Operations Available for CDS View – I
CDS Part 7. Basic Expressions & Operations Available for CDS View – II
CDS Part 11. How to Consume CDS View in Smart Business Service KPI Fiori Apps?
CDS Part 14. ABAP Annotations for Translatable Texts in CDS Views
CDS Part 17. How to Overcome GUID Mismatch Linking Problem in ABAP CDS?
VDM 2 – S/4HANA Embedded Analytics Using CDS Virtual Data Model – Value Helps &
Annotations
CDS Part 18 – Bar Chart & Donut Chart using CDS Views
VDM 3 – S/4HANA Embedded Analytics Using CDS Virtual Data Model – Meta Data
Extensions(MDE)
ABAP Programming Model for SAP Fiori – 13 – How to Preview and Download PDF in Fiori
Apps
https://sapyard.com/vdm-2-s-4hana-embedded-analytics-using-cds-virtual-data-model-value-helps-annotations/ 15/16
6/26/2020 Filters and Value Helps in Virtual Data Model - Part 2 |
Venkat Boddu
Shares Extensively worked on ABAP, ABAP on HANA , ODATA with 13+ Years of Experience in the Industry.
https://sapyard.com/vdm-2-s-4hana-embedded-analytics-using-cds-virtual-data-model-value-helps-annotations/ 16/16