2009 Feb 11 6:24 AM
Hi Experts,
ALthough I have found many posts for the problem of DO_SUM and Sort. But I have applied all the suggestions in my program. But I am not able to find out the SUM and SORT fields . I have to DO_SUM on one field "GROSS INVOICE'. and I want to SORT some fields. Cna anybody help me in that. I am using
REUSE_ALV_BLOCK_LIST_INIT
REUSE_ALV_BLOCK_LIST_APPEND
REUSE_ALV_BLOCK_LIST_DISPLAY
Your help would be beneficial for me.
Thanks a lot in advance.
2009 Feb 11 6:33 AM
Hi,
try this for sorting.
data w_sort TYPE lvc_s_sort,
t_sort TYPE lvc_t_sort.
w_sort-spos = '1'.
w_sort-fieldname = 'CITYFROM'.( mention fieldnames)
w_sort-down = 'X'.( w_sort-up can be used for ascending sort)
APPEND w_sort TO t_sort.
CLEAR w_sort.
w_sort-spos = '2'.
w_sort-fieldname = 'CARRID'.(mention fieldnames )
w_sort-down = 'X'.
APPEND w_sort TO t_sort.
CLEAR w_sort.
CALL METHOD r_alv_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'FS'
is_layout = w_lay
CHANGING
it_outtab = itab
it_fieldcatalog = t_cat
it_sort = t_sort
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks
2009 Feb 11 7:53 AM
Hi Shree Sudha,
But you are teling me about Class. I am working on REUSE_ALV_BLOCK_LIST_APPEND. This will not be helpful. Please I need more help.