cancel
Showing results for 
Search instead for 
Did you mean: 

RAP: SmartFilterBar Filter MultiComboBox Field Ordering

axel_brke3
Participant
0 Kudos
344

Hi, we are using a SmartFilterBar with a RAP Backend Service. 

This is the Annotation of the Field

 

 @Consumption: {
    valueHelpDefinition: [ { entity: { name: '/LUNEH/FR_CI_DFLST_INV_STAT_VH', element: 'Status' }, distinctValues: true } ],
    filter: { multipleSelections: true, selectionType: #SINGLE, hidden: false }
    }
    .fieldGroup: [{label: 'Status'}]
    @EndUserText.label: 'Status'  
    Status; 

 

Currently they are sorted alphabetically. We would like to sort the entries in a different order. Can I somehow do this without implementing a Custom Field?

 

View Entire Topic
junwu
Active Contributor

https://sapui5.hana.ondemand.com/sdk/#/topic/a5608eabcc184aee99e1a7d88b28816c.html

junwu_0-1723032902628.png

<Annotations Target="com.c_salesordermanage_sd.SalesOrderItem/Material">
    <Annotation Term="Common.FieldControl" Path="fieldControlType_item"/>
    <Annotation Term="Common.IsUpperCase" Bool="true"/>
    <Annotation Term="Common.Label" String="Material"/>
    <Annotation Term="Common.Text" Path="_Material/Material_Text"/>
    <Annotation Term="Common.ValueList">
        <Record Type="Common.ValueListType">
            <PropertyValue Property="CollectionPath" String="C_MaterialBySlsOrgDistrChnl"/>
            <PropertyValue Property="Label" String="Materials for Manage Sales Order"/>
            <PropertyValue Property="Parameters">
                <Collection>
                    <Record Type="Common.ValueListParameterInOut">
                        <PropertyValue Property="LocalDataProperty" PropertyPath="Material"/>
                        <PropertyValue Property="ValueListProperty" String="Material"/>
                    </Record>                
                    <Record Type="Common.ValueListParameterOut">
                        <PropertyValue Property="LocalDataProperty" PropertyPath="RequestedQuantityUnit"/>
                        <PropertyValue Property="ValueListProperty" String="RequestedQuantityUnit"/>
                    </Record>
                    <Record Type="Common.ValueListParameterDisplayOnly">
                        <PropertyValue Property="ValueListProperty" String="MaterialName"/>
                    </Record>
                </Collection>
            </PropertyValue>
            <PropertyValue Property="PresentationVariantQualifier" String="SortOrderPV"/>
        </Record>
    </Annotation>
</Annotations>
 
<Annotations Target="com.c_salesordermanage_sd.EntityContainer/C_MaterialBySlsOrgDistrChnl">
    <Annotation Term="UI.PresentationVariant" Qualifier="SortOrderPV">
        <Record Type="UI.PresentationVariantType">
            <PropertyValue Property="Visualizations">
                <Collection>
                    <AnnotationPath>@UI.LineItem</AnnotationPath>
                </Collection>
            </PropertyValue>
            <PropertyValue Property="SortOrder">
                <Collection>
                    <Record Type="Common.SortOrderType">
                        <PropertyValue Property="Property" PropertyPath="MaterialName"/>
                        <PropertyValue Property="Descending" Bool="false"/>
                    </Record>
                </Collection>
            </PropertyValue>
        </Record>
    </Annotation>
</Annotations>

 

axel_brke3
Participant
0 Kudos
Thank you so much for pointing me in the right direction! I solved this by adding the following annoation in the header of the Filter Dropdown CDS View:
axel_brke3
Participant
0 Kudos
@ui.presentationVariant: [{ sortOrder: [{ by: 'Status' }] }]