Show TOC

Default Sort OrderLocate this document in the navigation structure

You can define whether the default sort order of tables is ascending or descending using the com.sap.vocabularies.UI.v1.PresentationVariant annotation term and the SortOrder property as in the example below:
Sample Code Presentation Variant
<Annotations xmlns="http://docs.oasis-open.org/odata/ns/edm" Target="ZFAR_CUSTOMER_LINE_ITEMS2_SRV.Item">

    <Annotation Term="com.sap.vocabularies.UI.v1.PresentationVariant">

        <Record>

            <PropertyValue Property="Visualizations">

                <Collection>

                    <AnnotationPath>@UI.LineItem</AnnotationPath>

                </Collection>

            </PropertyValue>

            <PropertyValue Property="RequestAtLeast">

                <Collection>

                    <PropertyPath>Customer</PropertyPath>

                    <PropertyPath>CompanyCode</PropertyPath>

                </Collection>

            </PropertyValue>

            <PropertyValue Property="SortOrder">

                <Collection>

                    <Record>

                        <PropertyValue Property="Property" PropertyPath="CompanyCode"/>

                        <PropertyValue Property="Descending" Bool="true"/>

                    </Record>

                    <Record>

                        <PropertyValue Property="Property" PropertyPath="Customer"/>

                    </Record>

                </Collection>

            </PropertyValue>

        </Record>

    </Annotation>

</Annotations>
If nothing is defined for sort order the property value is Ascending.