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: 

Reading ALV Grid data on clicking button

Former Member
0 Kudos

Hi Experts,

I have created an editable ALV. Once the user changes the data, On click of submit button on the same screen,

i.e in the PAI, I want to read the data changed/entered by the user.

I have tried using the 'DATA_CHANGED_FINISHED' event but it is not getting triggered of cell value change.

Can read the latest content of ALV in PAI ?

Thanks Deep

2 REPLIES 2

MarcinPciak
Active Contributor
0 Kudos

Welcome on SCN!

This is correct event, but you need to register it like


  "activate data_changed and data_changed_finished events
  CALL METHOD g_alv_grid_ref->register_edit_event
    EXPORTING
      i_event_id = cl_gui_alv_grid=>mc_evt_enter "trigger event after ENTER is pressed

"now handler class definition
CLASS lcl_gui_alv_event_receiver DEFINITION.
   PUBLIC SECTION.
       METHODS: handle_data_changed_finished FOR EVENT data_changed_finished OF cl_gui_alv_grid
                                                            IMPORTING e_modified.
ENDCLASS.

"...and implementation
CLASS lcl_gui_alv_event_receiver IMPLEMENTATION.
  METHOD handle_data_changed_finished .
    "here your custom code
  ENDMETHOD .     

data:  g_alv_event_ref TYPE REF TO lcl_gui_alv_event_receiver.

"last thing is to set handler method for this event
SET HANDLER  g_alv_event_ref->handle_data_changed_finished FOR g_alv_grid_ref.

Regards

Marcin

0 Kudos

Hi,

In addition to what Marcin stated; you have to call the method CHECK_CHANGED_DATA in the PAI so that data changed on the grid is available in you internal table.

Regards,

Ankur Parab