form fill_it_sort.
iw_sort-spos = '1'.
iw_sort-fieldname = 'AUFNR'.
iw_sort-up = 'X'.
"iw_sort-subtot = 'X'.
append iw_sort to it_sort_lvc.
clear iw_sort .
iw_sort-spos = '2'.
iw_sort-fieldname = 'ARBPL'.
"iw_sort-up = 'X'.
" iw_sort-subtot = 'X'.
append iw_sort to it_sort_lvc.
clear iw_sort .
iw_sort-spos = '3'.
iw_sort-fieldname = 'KOSTL'.
"iw_sort-up = 'X'.
"iw_sort-subtot = 'X'.
append iw_sort to it_sort_lvc.
clear iw_sort .
iw_sort-spos = '4'.
iw_sort-fieldname = 'BUDAT'.
"iw_sort-up = 'X'.
" iw_sort-subtot = 'X'.
append iw_sort to it_sort_lvc.
clear iw_sort .
iw_sort-spos = '5'.
iw_sort-fieldname = 'BUDAT'.
"iw_sort-up = 'X'.
" iw_sort-subtot = 'X'.
append iw_sort to it_sort_lvc.
clear iw_sort .
endform.
form alv_disp.
perform fill_fieldcat using it_fieldcat.
perform fill_it_sort.
call function 'REUSE_ALV_GRID_DISPLAY_LVC'
exporting
i_callback_program = sy-repid
"i_callback_pf_status_set = 'PF_status'
i_callback_user_command = 'USER_COMMAND'
it_fieldcat_lvc = it_fieldcat
"is_layout_lvc = it_layout
i_save = 'A'
it_sort_lvc = it_sort_lvc
tables
t_outtab = gt_excel
exceptions
program_error = 1
others = 2.
endform.