Code: Alles auswählen.
data: ls_f4 TYPE lvc_s_f4,
lt_f4 TYPE lvc_t_f4.
ls_f4-fieldname = <fs_fcat>-fieldname.
ls_f4-register = abap_true.
ls_f4-getbefore = abap_true.
INSERT ls_f4 INTO TABLE lt_f4.
Code: Alles auswählen.
CALL METHOD go_grid->register_f4_for_fields
EXPORTING
it_f4 = lt_f4.
Code: Alles auswählen.
handle_f4
FOR EVENT onf4
OF cl_gui_alv_grid
IMPORTING e_fieldname e_fieldvalue es_row_no er_event_data
et_bad_cells e_display.
Code: Alles auswählen.
field-symbols: <lt_modi> TYPE lvc_t_modi,
<ls_modi> TYPE lvc_s_modi.
ASSIGN er_event_data->m_data->* TO <lt_modi>.
APPEND INITIAL LINE TO <lt_modi> ASSIGNING <ls_modi>.
<ls_modi>-row_id = es_row_no-row_id.
<ls_modi>-fieldname = e_fieldname.
<ls_modi>-value = lv_value.
er_event_data->m_event_handled = abap_true.
Code: Alles auswählen.
SET HANDLER gcl_event_handler=>handle_f4 FOR go_grid.
Code: Alles auswählen.
* F4-Hilfe
PERFORM build_f4_table_for_alv USING gt_fcat
CHANGING lt_f4.
CALL METHOD go_data_0300->register_f4_for_fields
EXPORTING
it_f4 = lt_f4.
SET HANDLER gcl_event_handler=>handle_f4 FOR go_data_0300.
Code: Alles auswählen.
CLASS gcl_event_handler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_f4
FOR EVENT onf4
OF cl_gui_alv_grid
IMPORTING e_fieldname e_fieldvalue es_row_no er_event_data
et_bad_cells e_display.
ENDCLASS. "gcl_event_handler DEFINITION
CLASS gcl_event_handler IMPLEMENTATION.
METHOD handle_f4.
break-point.
ENDMETHOD. "handle_f4
ENDCLASS. "gcl_event_handler IMPLEMENTATION
Code: Alles auswählen.
ls_f4-fieldname = <fs_fcat>-fieldname.
ls_f4-register = abap_true.
ls_f4-getbefore = abap_true.
INSERT ls_f4 INTO TABLE lt_f4.