Start of Content Area

Background documentation Set Sorting  Locate the document in its SAP Library structure

Use

Using the Set Sorting command (SET_SORTING), you can specify whether the data is to be sorted in ascending or descending order. This enables you to sort by characteristic texts, keys, or values.

Command Parameters

The following information lists the command parameters in the same sequence that they appear in the command wizard when you insert the command:

Parameter

Description

Target Data Providers (TARGET_DATA_PROVIDER_REF_LIST)

You enter a list of all data providers on which the command is based.

You specify the individual data providers in the Data Provided Affected parameter (TARGET_DATA_PROVIDER_REF).

Characteristic (CHARACTERISTIC)

You use this parameter and the input help dialog to select the characteristic for which the characteristic value (SORT_BY_CHARCTERISTIC_MEMBER) is to be sorted.

When the system sorts by attribute members (SORT_BY_ATTRIBUTE_MEMBER), this characteristic must be specified in order to obtain a valid characteristic and attribute combination.

When the system sorts by values (SORT_BY_VALUE), it sorts at the group level for the selected characteristic. A characteristic must therefore be specified.

Sorting Type (SORTING_TYPE)

You use this parameter to specify the type of sorting:

      Sort By Characteristic Member (SORT_BY_CHARCTERISTIC_MEMBER)

      Sort By Attribute Member (SORT_BY_ATTRIBUTE_MEMBER)

      Sort By Value (SORT_BY_VALUE)

      Sort By Selection (SORT_BY_SELECTION)

The characteristic values are sorted according to the sequence of the set filter values. If no filter values are set, the values are sorted according to keys.

      Sort By Hierarchy (SORT_BY_HIERARCHY)

Depending on the value you select for the Sorting Typeparameter (SORTING_TYPE), you need to set the following additional parameters:

Sort By Characteristic Member (SORT_BY_CHARCTERISTIC_MEMBER)

Parameter

Description

Member Presentation (MEMBER_PRESENTATION)

You use this parameter to specify what sorting is to be based upon:

      Key (KEY)

      Text (TEXT)

Direction (DIRECTION)

You use this parameter to specify the sorting order:

      Ascending (ASCENDING)

      Descending (DESCENDING)

Presentation Area (PRESENTATION_AREA)

You use this parameter to specify the display area of the characteristic values:

      All Areas (ALL)

If you choose this option, the characteristic values are displayed in the input help and in the results area.

      Result Set (RESULT_SET)

If you choose this option, the characteristic values are displayed in the results area only.

      Member Access (MEMBER_ACCESS)

If you choose this option, the characteristic values are displayed in the input help dialog box only.

Sort By Attribute Member (SORT_BY_ATTRIBUTE_MEMBER)

Parameter

Description

Attribute Name (INFO_OBJECT_ATTRIBUTE)

You use this parameter to specify the display attribute, the value of which is to be used in sorting.

Member Presentation (MEMBER_PRESENTATION)

You use this parameter to specify what sorting is to be based upon:

      Shortest Text Available (TEXT)

      Short Text (SHORT_TEXT)

      Medium-Length Text (MIDDLE_TEXT)

      Long Text (LONG_TEXT)

      Not Compounded Characteristic Value in External Display (DISPLAY_KEY_NOT_COMPOUND)

      Compounded Characteristic Value in External Display (DISPLAY_KEY)

      Characteristic Value in Internal Display (KEY_COMP)

      Non-Compounded Characteristic Value in Internal Display (KEY_NOT_COMPOUND)

Direction (DIRECTION)

You use this parameter to specify the sorting order:

      Ascending (ASCENDING)

      Descending (DESCENDING)

Presentation Area (PRESENTATION_AREA)

You use this parameter to specify the display area of the attribute values:

      All Areas (ALL)

If you choose this option, the attribute values are displayed in the input help and in the results area.

      Result Set (RESULT_SET)

If you choose this option, the attribute values are displayed in the results area only.

      Member Access (MEMBER_ACCESS)

If you choose this option, the attribute values are displayed in the input help dialog box only.

Sort By Value (SORT_BY_VALUE)

Parameter

Description

Data Cell (DATA_CELL)

When you sort by value, you must specify the data cell. You do this by specifying the relevant structure element for each query in the structure. You select the structure in the Characteristic parameter (CHARACTERISTIC). You enter the structure element in the Member Name parameter (MEMBER_NAME).

A structure element is generally a key figure.

Direction (DIRECTION)

You use this parameter to specify the sorting order:

      Ascending (ASCENDING)

      Descending (DESCENDING)

Sort By Selection (SORT_BY_SELECTION)

Parameter

Description

Direction (DIRECTION)

You use this parameter to specify the sorting order:

      Ascending (ASCENDING)

      Descending (DESCENDING)

Presentation Area (PRESENTATION_AREA)

You use this parameter to specify the display area of the characteristic values:

      All Areas (ALL)

If you choose this option, the attribute values are displayed in the input help and in the results area.

      Result Set (RESULT_SET)

If you choose this option, the attribute values are displayed in the results area only.

      Member Access (MEMBER_ACCESS)

If you choose this option, the attribute values are displayed in the input help dialog box only.

Sort By Hierarchy (SORT_BY_HIERARCHY)

Parameter

Description

Presentation Area (PRESENTATION_AREA)

You use this parameter to specify the display area of the characteristic values within the hierarchy:

      All Areas (ALL)

If you choose this option, the characteristic values are displayed in the input help and in the results area.

      Result Set (RESULT_SET)

If you choose this option, the characteristic values are displayed in the results area only.

      Member Access (MEMBER_ACCESS)

If you choose this option, the characteristic attributes are displayed in the input help dialog box only.

Examples

The first example uses the Set Sorting command (SET_SORTING) to sort the data according to characteristic 0D_PH2 in descending order.

<bi:SET_SORTING >

    <bi:TARGET_DATA_PROVIDER_REF_LIST type="ORDEREDLIST" >

        <bi:TARGET_DATA_PROVIDER_REF index="1" value="DP_1" />

    </bi:TARGET_DATA_PROVIDER_REF_LIST>

    <bi:CHARACTERISTIC value="0D_PH2" text="0D_PH2" />

    <bi:SORTING_TYPE type="CHOICE" value="SORT_BY_CHARACTERISTIC_MEMBER" >

        <bi:SORT_BY_CHARACTERISTIC_MEMBER type="COMPOSITE" >

            <bi:DIRECTION value="DESCENDING" />

            <bi:MEMBER_PRESENTATION value="TEXT" />

        </bi:SORT_BY_CHARACTERISTIC_MEMBER>

    </bi:SORTING_TYPE>

</bi:SET_SORTING>

The second example uses the Set Sorting command (SET_SORTING) to sort the data according to the values of a key figure column in ascending order.

<bi:SET_SORTING >

    <bi:TARGET_DATA_PROVIDER_REF_LIST type="ORDEREDLIST" >

        <bi:TARGET_DATA_PROVIDER_REF index="1" value="DP_1" />

    </bi:TARGET_DATA_PROVIDER_REF_LIST>

    <bi:CHARACTERISTIC value="0D_PH2" text="0D_PH2" />

    <bi:SORTING_TYPE type="CHOICE" value="SORT_BY_VALUE" >

        <bi:SORT_BY_VALUE type="COMPOSITE" >

            <bi:DATA_CELL type="UNORDEREDLIST" >

                <bi:CHARACTERISTIC_MEMBER type="COMPOSITE" index="1" >

                    <bi:CHARACTERISTIC

                           value="42AGEOXTLP19MEYIOMK8TPL2N"

                           text="42AGEOXTLP19MEYIOMK8TPL2N" />

                    <bi:MEMBER_NAME value="42AGEP5I4NMZ51HYUGML3RJSF" />

                </bi:CHARACTERISTIC_MEMBER>

            </bi:DATA_CELL>

        </bi:SORT_BY_VALUE>

    </bi:SORTING_TYPE>

</bi:SET_SORTING>

 

 

End of Content Area