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: 

Using recursivity in ALV list to handle data changed

Former Member
0 Kudos
123

Hi folks

I am trying to use a kind of recursivity to handle ALV data changed.

The method HANDLE_DATA_CHANGED is triggered whenever I change a certain cell and press Enter.

Inside this method, I want to force the content of another cell to be changed and want this method HANDLE_DATA_CHANGED to be called recursively, so that the same logic fills the rest of the line as it does when I really modify the 1st cell.

The logic of HANDLE_DATA_CHANGED starts with a loop on lt_mod_cells. lt_mod_cells is filled the following way:

lt_mod_cells = er_data_changed->mt_mod_cells, where er_data_changed is an instance of CL_ALV_CHANGED_DATA_PROTOCOL.

If I simply add a line to lt_mod_cells, I get a short dump because inside method HANDLE_DATA_CHANGED there is a call to

er_data_changed->MODIFY_CELL.

And inside the instance er_data_changed, there is only the relevant information about the cell I manually changed in the frontend, but nothing related to the cell I added via ABAP to lt_mod_cells.

And by the way, it doesn't seem very trivial to manually fill all the necessary tables inside instance er_data_changed, so that my manually added line gets properly changed.

Any suggestions??

Thanks

Marcelo

1 REPLY 1

Clemenss
Active Contributor
0 Kudos
46

Hi Marcello,

you may make use of

handle_data_changed_finished
FOR EVENT data_changed_finished OF cl_gui_alv_grid
IMPORTING e_modified

and possibly raise event data_changed again after applying the changes to the data. But this won't be easy because the changed data should come from the frontend (manually entered).

I don't think it is useful to trigger chack_changed_data for data you set by program. You can set them directly in the table displayed and call the refresh method.

Regards,

Clemens