Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

CL_GUI_ALV_GRID DATA_CHANGED event E_UCOMM

Former Member
0 Kudos

Hi,

At the ALV event handler DATA_CHANGED, I want to capture the user command on the screen other than the alv toolbar. But E_UCOMM holds nothing when I press a button on the screen. How can I capture screen function code?

Best regards,

ts

3 REPLIES 3

Former Member
0 Kudos

Hi,

  Have you declared function code in the PF-status of the screen.

Former Member
0 Kudos

Hi,

Below are the steps to achieve this functionality. you have to handle the event to catch the ucomm

1. Register the event:

*--for tab   

     CALL METHOD go_alv->register_edit_event

         EXPORTING

           i_event_id = cl_gui_alv_grid=>mc_evt_modified.

*-- for enter

       CALL METHOD go_alv->register_edit_event

         EXPORTING

           i_event_id = cl_gui_alv_grid=>mc_evt_enter.

2. Get the changed row,with this below code your changed data row will be selected :


     CALL METHOD go_alv->check_changed_data.

3. Handle the event:


   

     SET HANDLER go_respond_events->handle_data_changed_finish FOR go_alv.

4. You have to create the class for this before. In this class you have to update that value:

CLASS respond_events DEFINITION FINAL .

   PUBLIC SECTION .

     METHODS: handle_data_changed_finish FOR EVENT data_changed_finished

              OF cl_gui_alv_grid.

ENDCLASS .                    "respond_events definition

CLASS respond_events IMPLEMENTATION .

   METHOD handle_data_changed_finish.

     LOOP AT <your intarnal tablewhich used for display> INTO <ls_>.

      **jwrite your code here

     ENDLOOP.

   ENDMETHOD. "handle_data_changed

ENDCLASS .               "respond_events implementation

Regards,

Supratik

Former Member
0 Kudos

Thread closed.