Technical Articles
Dropdown List in Fiori Elements
Adding a dropdown list in a Fiori Element based app is somewhat tricky before. We had a requirement in our project and have checked all these blogs, and one could normally find the solution as redefining the method of class MPC_EXT, as mentioned in the blog
But we can simply achieve this with an annotation.
@ObjectModel.resultSet.sizeCategory: #XS
Most of you might know how to use this, anyways I shall just explain it for a quick understanding for newbies.
Here we are bringing the dropdown list as a filter in a List Report.
Add the mentioned annotation in the CDS which will be consumed as a valueHelp for the respective filter in List Report.
![]() |
Association is added in the Main CDS where the above CDS is consumed.
![]() |
Valuehelp is assigned inside select.
![]() |
Mentioned as selectionField in Metadata Extension. This can be mentioned in CDS also as shown above.
![]() |
Generate application and Execute. The filter field is displayed as Dropdown List.
![]() |
thanks for the good tip.
Thanks for the great tip.
What version is required for @ObjectModel.resultSet.sizeCategory-Annotation? This is not working for me, resultset is not recognized.....
Hello,
Same for me. I followed the simple instruction and it doesn’t work
I’m using Web IDE of SCP… Obvioulsy latest version of SAP UI5 lib.
I have a nice liveSearch result when I enter something but no Dropdown.
Thanks for any advice,
Luc
the annotation (@ObjectModel.resultSet.sizeCategory:#XS ) works only starting from NW 7.52 version for S/4HANA – version 7.51 does not support this annotation
the annotation (@ObjectModel.resultSet.sizeCategory:#XS ) works only starting from NW 7.52 version for S/4HANA – version 7.51 does not support this annotation
Hi Vladyslav,
Thanks for your answer. I'm working on SAP Web IDE and deploying on SCP. The current version is 1.64. You means that I need S/4Hana and not only SCP ?
Luc
Hi Luc,
1.64 it is UI5 version for front end part
NW 7.52 it Back ends part ( for CDS annotation @ObjectModel.resultSet.sizeCategory:#XS) .
you could check version list on
https://sapui5.hana.ondemand.com/versionoverview.html
Hi Vladyslav,
Thanks now I got my mistake...
The UI annotations of the CDS View are calculated (rigth word ?) with SADL (is it true) of the Backend system, not the Gateway/SCP one...
In our case, we are in 7.50. That's crystal clear 🙂
Luc
Thanks Abyson- I've added this blog to the Fiori elements wiki.
thanks a lot~
Hello.
I want to show more than 100 entries in the drop-down list.
I've tried this: @ObjectModel.resultSet.sizeCategory: #S
Unfortunately, no success.
The annotation ObjectModel.resultSet.sizeCategory expects a String(3), but #S has the length 2.
Can someone help me there?
Olga
Thanks for sharing this!
I have explored it , It works fine ! Thanks for sharing...
But dropdown only shows first 100 columns , can you suggest to show all the items in dropdown box ?
Very good. You saved my week! Thanks
Thanks alot for the efforts, it helped me. Just one additional requirement.
I have key and text, my requirement is to display the text but when the call is made to Backend in filter I should get the key.
I'm not getting description if I map only code
Hi. I have exactly the same requirement. Key and value should be displayed.
Hi Patrik,
I've found the solution to it; it was pretty easy actually. Need to assign text element to the value field in the CDS.
It will display "Description" but store/transmits "Value".