Skip to Content
0
Former Member
Nov 30, 2011 at 08:40 AM

Hierarchical List Display Sorting Issue

78 Views

Hello experts,

Iu2019m using REUSE_ALV_HIERSEQ_LIST_DISPLAY to display header and item details. I need to sort header table in ascending order with respect to u2018categoryu2019 field and item table in descending order with respect to u2018failed_linesu2019 field. Iu2019m using below code for this purpose.

lv_alv_sort-spos = '1'.
    lv_alv_sort-fieldname = 'CATEGORY'.
    lv_alv_sort-tabname = 'OTABH'.
    lv_alv_sort-up = 'X'.
    APPEND lv_alv_sort TO alv_sort.
    CLEAR: lv_alv_sort.

    lv_alv_sort-spos = '2'.
    lv_alv_sort-fieldname = 'FAILED_LINES'.
    lv_alv_sort-tabname = 'OTABD'.
    lv_alv_sort-down = 'X'.
    APPEND lv_alv_sort TO alv_sort.

In the above code, header table (otabh) is working properly and displaying in ascending order. But the item table (otabd), even though descending order is mentioned( lv_alv_sort-down = 'X'.), it is displaying in ascending order. Could anyone help me with other possible ways to achieve this?

Regards,

Ramya.