Quantcast
Channel: SCN: Message List - ABAP Development
Viewing all articles
Browse latest Browse all 10425

cl_gui_alv_grid distinguish between events mc_evt_modified and mc_evt_enter

$
0
0

Hi all,

 

I use cl_gui_alv_grid and respond to some events and am looking for a way to distinguish the event datachanged from the event enter. I came up with he code below, making both events going to the same method, but what do I need to do to make it go to different methods?

 

CLASS cl_event_handler DEFINITION.
PUBLIC SECTION.
    METHODS: 
handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING er_data_changed,

endclass.

 

CLASS cl_event_handler IMPLEMENTATION.

    METHOD  handle_data_changed.
         PERFORM handle_data_changed.
    ENDMETHOD.

endclass.

 

Data  o_event_handler TYPE REF TO cl_event_handler.

    CREATE OBJECT o_cont   EXPORTING        container_name = 'CONT1_0100'.
    CREATE OBJECT o_grid    EXPORTING        i_parent = o_cont.

    CREATE OBJECT o_event_handler.
    SET HANDLER o_event_handler->handle_data_changed FOR o_grid.

    CALL METHOD o_grid->register_edit_event
      EXPORTING
        i_event_id = cl_gui_alv_grid=>mc_evt_enter.

    CALL METHOD o_grid->register_edit_event
      EXPORTING
        i_event_id = cl_gui_alv_grid=>mc_evt_modified.

Thanks all,

Best regards,

Tim van Steenbergen.

 


Viewing all articles
Browse latest Browse all 10425

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>