2011 Nov 30 8:40 AM
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.
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.
2011 Nov 30 8:58 AM
Hi,
Try sort item table just before list.
SORT otabd by category ASCENDING failed_line DESCENDING.
I didn't try. Let me know the result.
Çağatay
2011 Nov 30 9:08 AM
Hi Cagatay,
Thanks for your reply, but..
'Category' is from header table(otabh) and 'failed_lines' is from item table(otabd).
I also tried sorting item table(otabd) just before the function call, but it did not work.
Regards,
Ramya.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |