ALV显示后,如果用户做了筛选,然后点击全选或者取消全选,不应该影响过滤掉的数据
主要代码:
gr_alvgrid
TYPE
REF
TO
cl_gui_alv_grid ,
METHODhandle_user_command.
DATA: lv_cont TYPE i,
lv_tabix TYPE sy-tabix.
DATA: lt_filtered TYPE lvc_t_fidx.
CASE e_ucomm.
WHEN 'ALL'.
CALL METHOD gr_alvgrid->get_filtered_entries
IMPORTING
et_filtered_entries = lt_filtered.
LOOP AT it_tabla INTOwa_tabla.
lv_tabix = sy-tabix.
READ TABLE lt_filtered WITH KEYTABLE_LINE = lv_tabix TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
wa_tabla-checkbox = 'X'.
MODIFYit_tabla FROM wa_tabla INDEX lv_tabix.
ENDIF.
ENDLOOP.
WHEN 'NONE'.
CALL METHOD gr_alvgrid->get_filtered_entries
IMPORTING
et_filtered_entries = lt_filtered.
LOOP AT it_tabla INTOwa_tabla.
lv_tabix = sy-tabix.
READ TABLE lt_filtered WITH KEYTABLE_LINE = lv_tabix TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
CLEAR wa_tabla-checkbox.
MODIFYit_tabla FROM wa_tabla INDEX lv_tabix.
ENDIF.
ENDLOOP.
ENDCASE.
CALL METHOD gr_alvgrid->refresh_table_display.
ENDMETHOD. "handle_user_command