DATA lt_sort TYPE slis_t_sortinfo_alv. "sort catalog
DATA ls_sort TYPE slis_sortinfo_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'ITAB_S'
i_inclname = sy-repid
* i_bypassing_buffer = 'X'
CHANGING
ct_fieldcat = gt_fieldcat[].
******lt_sort tablosuna hangi alan bazında toplayacaksak onu yazıyoruz..
ls_sort-spos = 1.
ls_sort-fieldname = 'AUFNR'.
ls_sort-tabname = 'ITAB_S' .
ls_sort-up = 'X'.
ls_sort-subtot = 'X'.
APPEND ls_sort TO lt_sort.
***hangi alanı toplayacaksak onu da fieldcat te yazıyoruz.
READ TABLE gt_fieldcat WITH KEY fieldname = 'GMNGA'.
IF sy-subrc = 0.
gt_fieldcat-col_pos = '4'.
gt_fieldcat-hotspot = 'X'.
gt_fieldcat-do_sum = 'X'.
MODIFY gt_fieldcat INDEX sy-tabix.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* i_bypassing_buffer = 'X'
i_callback_program = sy-repid
i_callback_user_command = 'F_USER_COMMAND'
i_callback_pf_status_set = 'F_SET_EKRAN'
i_callback_top_of_page = 'F_ALV_INFO'
it_fieldcat = gt_fieldcat[]
is_layout = gs_layout
it_sort = lt_sort[]
i_save = 'A'
TABLES
t_outtab = itab_s
EXCEPTIONS
program_error = 1
OTHERS = 2.
***************************************************************
Serkan AKKAVAK
Bilgisayar Mühendisi
serkurumsal@yandex.com
SAP ve ABAP ile ilgili tüm sorun ve sorularınızı gönderebilirsiniz.
Social Plugin