cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori Elements Dropdown Filter Description

jmattfeld
Participant

Creating value help in the consumption CDS view:

ObjectModel.foreignKey.association: '_StatusValueHelp'
ObjectModel.text.association: '_StatusValueHelp'Status

This creates a nice value help dialog and autocompletion, showing all possible values for the status attribute.

Using the right annotations, Fiori Elements automatically shows this filter as dropdown [1]. I annotated my value help CDS view, to get the fixed-values metadata annotation sap:value-list="fixed-values":

@ObjectModel.resultSet.sizeCategory:#XS

This works great, but the dropdown only shows keys, not the associated text descriptions - quite hard for a user to understand what to select.

The created metadata looks like texts should be displayed (DisplayOnly), but they are not:

            <Annotations Target="SalesOrderType/Status" 
                xmlns="http://docs.oasis-open.org/odata/ns/edm">
                <Annotation Term="Common.ValueList">
                    <Record>
                        <PropertyValue Property="Label" String="Status"/>
                        <PropertyValue Property="CollectionPath" String="I_Status"/>
                        <PropertyValue Property="SearchSupported" Bool="true"/>
                        <PropertyValue Property="Parameters">
                            <Collection>
                                <Record Type="Common.ValueListParameterInOut">
                                    <PropertyValue Property="LocalDataProperty" PropertyPath="Status"/>
                                    <PropertyValue Property="ValueListProperty" String="Status"/>
                                </Record>
                                <Record Type="Common.ValueListParameterDisplayOnly">
                                    <PropertyValue Property="ValueListProperty" String="Name"/>
                                </Record>
                            </Collection>
                        </PropertyValue>
                    </Record>
                </Annotation>
            </Annotations>

Has anyone managed to show a nice dropdown with texts, optionally directly from a CDS annotation?

[1] https://answers.sap.com/questions/452881/change-filter-field-to-dropdown-in-fiori-elements.html

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

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor

ObjectModel.text.element

did you try this in your text view cds for the valuehelp cds?

jmattfeld
Participant
0 Kudos

I did not. And now that I did, it just works. Thank you!

afordham
Participant
0 Kudos

Hi,

Just to be difficult 🙂 is there a way of getting both the Key and the Description in the filter dropdown using CDS annotations?

Thanks,

Andrew

former_member667037
Discoverer
0 Kudos

Hi Andrew,

Were you able to achieve adding both Key and description to filter dropdown using CDS annotations?

afordham
Participant
0 Kudos

Hi Jyotsna,

I couldn't get both key and description by using annotations to drive the filters, but instead we manually specified the initial filters in an XML view containing a smartfilterbar.

pmcfarling
Participant
0 Kudos

Can you not create a field in your search help that is a concatenation of of the key/description then point ObjectModel.text.element to that?

0 Kudos

Thanks it was very helpful

Answers (1)

Answers (1)

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

0 Kudos

Hi Olga , did you find the solution to show more than 100 items in drop-down list? since i have the same issue ?

serdarican
Explorer
0 Kudos

Hi Olga,

It must be #XS.

@ObjectModel.resultSet.sizeCategory: #XS

Serdar