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,