Fiori Elements List report- Selection fields(Smart Filterbar) sharing filter values
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.
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,
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?
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 🙂
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 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.
Is it possible to achieve this through annotations from backend or frontend in anyway?
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).
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
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.
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).
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?
Hi Mahesh Kumar Palavalli ,
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?
By the way, here is the link to this question that was also posted in the community:
Welcome 🙂 , I have replied in your question..
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.
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 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 ?.