08-03-2009 12:34 PM
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
08-03-2009 1:01 PM
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
08-03-2009 1:33 PM
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