Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member184611
Active Participant
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

https://blogs.sap.com/2016/04/16/how-to-build-a-drop-down-list-using-smart-template-cds-view/#jive_c...

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.

 









 
18 Comments
nabheetscn
Active Contributor
thanks for the good tip.
former_member598449
Discoverer
0 Kudos

Thanks for the great tip.

jan_nyfeler2
Explorer
What version is required for @ObjectModel.resultSet.sizeCategory-Annotation? This is not working for me, resultset is not recognized.....

 
Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
Thanks Abyson- I've added this blog to the Fiori elements wiki.
luc_olivier2
Explorer
0 Kudos

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

0 Kudos

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

0 Kudos

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

luc_olivier2
Explorer
0 Kudos
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
luc_olivier2
Explorer
0 Kudos
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
0 Kudos
thanks a lot~
former_member555408
Discoverer
0 Kudos
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
MioYasutake
Active Contributor
0 Kudos
Thanks for sharing this!
0 Kudos
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 ?

 
joo_mariano2
Participant
0 Kudos
Very good. You saved my week! Thanks
NooruBohra
Participant
0 Kudos
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

 

 
patrik_spiess
Participant
0 Kudos
Hi. I have exactly the same requirement. Key and value should be displayed.
NooruBohra
Participant
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".


 

 
Labels in this area