Fiori Elements List report- Selection fields(Smart Filterbar) sharing filter values
Dear All,
Foreground:
Users wanted to pass the filters from one selection field to another selection field in the List report app that was developed.
Steps user wants to perform:
step 1: User selects the company code in selection field 1.
step 2: when user open the help for selection field 2, it should take the company code in selection field 1 and perform the search in selection field 2 help.
Solution:
Here we dont have the required sap components & upgrades in our system to use the latest abap programming model achieve this., so went a head using the annotations provided by SAP Webide.
The solution given by SAP is pretty neat and simple. By using the annotation ValueListParameterIn.
I will show clearly with the below example.
- Create annotation for the property:
- Now create the Value list annotation for the same
- In the above screen shot, I’ve added ValueListParameterIn annotation, which again has two properties ‘LocalDataProperty’ & ‘ValueListProperty’
- ‘LocalDataProperty’ is used to get the filters that are available from the filterbar, here I mentioned as ‘Bukrs’ which the property of the my list report entityset.
- ‘ValueListProperty’ is the property to which the filters from the mainentityset needs to be passed in order to perform the search.
Once you add this, we are good to go, we can pass multiple filters as well by adding multiple ‘valuelistparmeterin’ annotation.
The same can also be done from the SAP odata gateway annotation editor as well.
Hope this will be useful for someone who is searching for similar requirement.
Thanks & Best Regards,
Mahesh
Hi Mahesh,
Is it possible to also show the company code also as one of the value in the items List?
We have a similar requirement, where I am not able to show the company code in the items list( similar to the one in the screen you have shared).
Do you have any idea how may we show that up?
Thanks,
Shiny
Hi SHINY NICKITHA CHELLAM J,
I've tried Mahesh. It doesn't work when this is passed to self
The above screenshot I shared is working perfectly, maybe some issue with the annotation definitions, I already commented on your question, please update your question accordingly.
Nice work Mahesh - I've added this blog to the Fiori elements wiki.
Thanks Jocelyn for the feedback 🙂
Hi Mahesh,
Really useful blog. Thanks for sharing the information.
I have a requirement like inside the Smart Filter Field’s Value help of a Standard List Report Template, i need to define a Tree table to display the search results. Kindly guide me how to control the tableType property inside that value help request.
Thanks,
Happy
Thanks for the feedback 🙂 .
As per my knowledge, I don't think it is possible. You can extend it and add a custom field and handle the f4 help manually using the tree table.
BR,
Mahesh
Hello Mahesh,
Is it possible to achieve this through annotations from backend or frontend in anyway?
Thanks,
Happy
Like I've mentioned, I don't think it is possible, You might have to manually call the dialog box popup and show the tree table inside(Here you can probably use the annotations to display the tree table).
BR,
Mahesh
Hi,
I have 2 entities.
Order entity: customerID, siteID, Date.
Site entity: siteID, siteName
I am using valuehelp for siteID on order entity. So far I can type siteID in the field and it pop up a table with siteID and siteName.
But my issue is: i would like to search by siteName as well. Now it is only work on siteID. Is there a way to do it? Thank you
you can use a join with the siteName and expose it via the order entity and show it in the filter bar.. or you can see the below discussion
https://answers.sap.com/questions/758309/fiori-elements-filter-based-on-association-propert.html
Thanks for the reply.
What do you mean join with the siteName?
I am using annotation for the Fiori elements. There is a associate between order.siteID = site.siteID.
I am wondering if there is setting or extension i can use to filter not only siteID but also siteName.
Hi Mahesh,
thanks for the useful blog. It works like a charm so far.
I have multiple values in selecton field 1. And following your instructions all values are displayed in the filter of the value help (see screenshot)
But to make it more user friendly I would like to render this values as DropDown list. Unfortunately once I do that, the list is emtpy (see screenshot).
Do you have an idea on how to get the values from selection field 1 as Dropdown list in the value help filter?
Info: to make the filter of the ValueHelp a DropDown List I use the DEFINE Method in the oData Service to set_value_list to 'F' (fixed-values).
Thanks, Christophe.
Sorry for the late reply Christoph Bühlmann, as far as i know it should work fine, but you will loose the dependent filtering, Hope you got the solution by now, if not, you can post a question about this in the community, so it will attract wide audience
Hello Mahesh Kumar Palavalli ,
Thanks for nice blog. It's very informative.
I tried following the same and I am able to generate Value Help out of the main Entityset I am using to generate the list Report.
But the value list which is getting generated is having duplicate values for the same entry. May be because the DataSet is having multiple records for the Bukrs on which I am trying to implement the ValueList Annotation.
My Question is -> Is it possible to bind distinct value for particular property, i.e., Bukrs using ValueList annotation?
Best Regards,
Shyam Vasani
Hi Mahesh Kumar Palavalli ,
Good day.
Thank you for this guide.
We are trying to make this work using SmartMultiInput but could not successfully pass the data to ValueListParameterIn.
Would you have any suggestions on what we should do or check?
Thank you.
By the way, here is the link to this question that was also posted in the community:
https://answers.sap.com/questions/13299092/smart-multi-input-as-valuelistparameterin.html
Best Regards,
Ezra P.
Welcome 🙂 , I have replied in your question..
Cheers!
Mahesh
Hi Mahesh,
Thanks for the nice blog!
I have a scenario where we have developed a Standard OData service (Not 4.0) with entities. The front end developer has used the entity to create a smart table with smart filter.
In the smart filter we are not able to get Value help (F4) working. How do we get this working, can you please provide some pointers.
Thanks,
Arul
Hi Mahesh,
It's very informative. Thank for sharing
Is it possible to pass filter from custom filter to standard one.
for Example Company Code I have taken as custom filter and If I select it and I have to pass that filter for business Entity standard Filter value Help Dialog.
Thanks
Hemil 🙂
Hi Mahesh,
Thanks for having shared this.
Would you know how could I achieve the same if both search help fields were custom fields created
in customFilter.fragment.xml and they were not created by annotations ?.
Regards,
Javier
Hi Mahesh Kumar Palavalli ,
I have a similar requirement for smartfields in a smartform. But the valuelistparameterIn work is not working.
Also i have tried the same in LROP template too. Still dependent filter is not working. Any inputs will be helpful,
Here is the link to this question that I have posted in the community:
https://answers.sap.com/questions/13940237/filter-smartfields-value-help-based-on-user-input.html
Thanks.
Hi Mahesh Kumar Palavalli ,
I have a similar requirement, where I'm using two smart fields, one for Company code and the other for G/L Account. Here I need to filter the value in the "G/L Account" value help based on the selected Company Code, i.e I'm trying to pre-fill the search filter "Company-Code" inside value help of "G/L Account" based on the value in "Company code" smart field like the image shown below(image 2),
For obtaining the CDS annotation for both the G/L Account and Company code I'm using "/sap/opu/odata/sap/FAC_GL_DOCUMENT_POST_SRV/" OData Service and the Entity set used is "FinsPostingGLItems"
1. Smart field for Company Code
2. Smart field for G/L Account
Below are the annotation structures for company code and GL Account
3.Annotation structure for Company Code
4.Annotation structure for GL Account
ValueListParameterInOut property already exist in the standard annotation and still not obtaining the value of Company code inside the valuehelp of GL Account. Can you please help with this?
Regards,
Mredula