class lcl_event_receiver definition.
public section.
methods:
Handle_data_changed
FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed,
Handle_data_changed_finished
for event data_changed_finished of cl_gui_alv_grid
importing e_modified,
handle_double_click
for event double_click of cl_gui_alv_grid
importing e_row e_column es_row_no.
endclass.
class LCL_EVENT_RECEIVER implementation.
method handle_data_changed.
perform handle_data_changed using er_data_changed.
endmethod.
method handle_data_changed_finished.
perform handle_data_changed_finished using e_modified.
endmethod.
METHOD handle_double_click.
PERFORM double_click USING e_row e_column es_row_no.
endmethod.
endclass.
form handle_data_changed using er_data_changed
type ref to cl_alv_changed_data_protocol.
data: ls_mod_cell type lvc_s_modi,
lv_value type lvc_value.
clear ls_mod_cell_t.
clear ls_mod_cell_t[].
loop at er_data_changed->mt_mod_cells
into ls_mod_cell
where fieldname = 'XX'.
append ls_mod_cell to ls_mod_cell_t.
endloop.
endform.
form handle_data_changed_finished using e_modified type char01.
data ls_mod_cell type lvc_s_modi.
data is_stable type lvc_s_stbl.
is_stable-row = 'X'.
is_stable-col = 'X'.
if e_modified = 'X'.
loop at ls_mod_cell_t into ls_mod_cell.
.....
endloop.
call method grid_chg->refresh_table_display
exporting
is_stable = is_stable
.
endif.
endform.
之前写的代码。FYI