Code: Alles auswählen.
CREATE OBJECT alv
EXPORTING
i_parent = cont
i_appl_events = 'X'.
Code: Alles auswählen.
CALL METHOD alv->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
Code: Alles auswählen.
CALL METHOD alv->check_changed_data.
Code: Alles auswählen.
i_appl_events = 'X'
Code: Alles auswählen.
CALL METHOD alv->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
Code: Alles auswählen.
CLASS my_grid DEFINITION INHERITING FROM cl_gui_alv_grid.
PUBLIC SECTION.
METHODS dispatch REDEFINITION.
ENDCLASS.
CLASS my_grid IMPLEMENTATION.
METHOD dispatch.
super->dispatch( EXPORTING
cargo = cargo
eventid = eventid
is_shellevent = is_shellevent
is_systemdispatch = is_systemdispatch
EXCEPTIONS
cntl_error = 1
OTHERS = 2 ).
IF eventid = mc_evt_enter.
cl_gui_cfw=>set_new_ok_code( EXPORTING
new_code = 'Grid:ENTER' ).
ENDIF.
ENDMETHOD.
ENDCLASS.
Code: Alles auswählen.
DATA: lv_shellid_i TYPE i,
lo_subscriber TYPE REF TO cl_gui_control.
TRY.
SPLIT ok_code AT space INTO DATA(dummy) DATA(shellid_c) DATA(lv_eventid).
lv_shellid_i = shellid_c.
cl_gui_cfw=>get_subscriber_by_id( EXPORTING shellid = lv_shellid_i
IMPORTING subscriber = lo_subscriber ) .
IF lo_subscriber = alv AND lv_eventid = cl_gui_alv_grid=>mc_evt_enter.
BREAK-POINT.
ENDIF.
CATCH cx_root.
ENDTRY.
@black_adept: Dickes DANKE, tut wie Sau! Das ist genau das, was wir brauchten!black_adept hat geschrieben:Code: Alles auswählen.
CLASS my_grid DEFINITION INHERITING FROM cl_gui_alv_grid. PUBLIC SECTION. METHODS dispatch REDEFINITION. ENDCLASS. CLASS my_grid IMPLEMENTATION. METHOD dispatch. super->dispatch( EXPORTING cargo = cargo eventid = eventid is_shellevent = is_shellevent is_systemdispatch = is_systemdispatch EXCEPTIONS cntl_error = 1 OTHERS = 2 ). IF eventid = mc_evt_enter. cl_gui_cfw=>set_new_ok_code( EXPORTING new_code = 'Grid:ENTER' ). ENDIF. ENDMETHOD. ENDCLASS.