Technical Articles
Fiori Elements-Value help on a selection field within a value help dialog
This is about featuring the capability of Value help on a selection field within a value help dialog in Fiori Elements based List Report.
(For more information on Fiori Elements check this link)
Business Scenario
Let’s consider Business scenario where Fiori Elements based List Report displays Purchase Order with Vendor as one of the selection field.
“Vendor can be further filtered based on selected countries.”
Technical Explanation
- Develop main consumption CDS For List Report and add relevant UI annotations for Line Items, Selection Fields.
Please refer link for Basic Fiori Elements based List Report development.
2. Add Value help specific annotation for the selection field, provide reference of Value help CDS using annotation “@Consumption.valueHelpDefinition:
3. To bring “Value help within a value help dialog”, Add further value help CDS reference inside the value help CDS used in step 3.
4.Data Model can be understood as below:
5. CDS can be exposed as ODATA or SEGW reference data source and generate the Fiori elements-based application.
Detailed Explanation
Let’s create the supplier Value help CDS(ZI_SUPPLIER_VH), Inside this give the reference of Standard CDS I Country for the countries list.
Now, Lets create the main consumption CDS for the List Report (ZC_PurchaseOrder). Add UI annotation for Line Items and selection fields. Give the reference of ZI_SUPPLIER_VH.
Code snippet FOR the Consumption CDS
Value Help CDS
Demo (Output)
Fiori Elements with Vendor as selection parameter
Select Country for further value help
Selected country become available for searching the supplier further
And Finally, selected Supplier available in the List Report selections parameter
Thanks for sharing !!! Great
Good job Mohit, keep sharing your knowledge. 🙂
Thanks for the share!.
Check the below annotations which are available with ABAP Restful programming model. You can have "Collective search help" like in abap 🙂 🙂 which is awesome.
https://help.sap.com/viewer/c0d02c4330c34b3abca88bdd57eaccfc/Cloud/en-US/d640711b0b504ae8b857c913002ed6b6.html#loio587e48c30dbf41d1829d32049b393af9
Nice work Mohit! This does look like a useful functionality for quite a lot of UIs 🙂
Great Job Mohit! Very clearly written 🙂
Well done Mohit!
Straight to the pool room! (ask Sascha W. 🙂 )
I have added this to the Fiori elements wiki
https://wiki.scn.sap.com/wiki/display/Fiori/Fiori+elements
HI Mohit,
Thanks for sharing this.
Regards,
Sarbjeet Singh
Great job Mohit.. ?
Nice and clear explanation..
Keep it up..
Waiting for your blog on BOPF creation using cds views
If I have Country field in Purchase order and it present on filter toolbar of PurchaseOrder and user enter value into Country field (or select one from Country value help) - how to pass Country value to Supplier value help?
Hello Mohit,
thank you very much for sharing your knowledge!
I’m having one question i.e., can we do value help using local annotations?
Eagerly waiting for your reply
Simple answer is yes you can. Try putting the following lines in "code editor" of your annotation file.
<Annotations Target="<ODATA service>.<entity type>/<field name>">
</Annotations>
Now switch to Annotation modeler. You should be able to use "Common.valuelist" to play around with value help.
Hi Mohit,
Thanks for sharing this!
My question is can we have type-ahead functionality on such value helps based on CDS views?
Awaiting response.
Thank You.
Thanks for the blog Mohit,
I am trying the create a search help for Companycode (BUKRS) using I_CompanyCode as data source.
But i get the error "Use of entity I_CompanyCode is not permitted". The same when replaced with I_Country works fine. Can you please help on this.
Thank you
Ishita