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: 

Checking values of a row before deletion from ALV

Former Member
0 Kudos

Hi,

I have to implement a function for a ALV list which enables the user to delete rows from the list. The tricky thing is, that I have to check some values of the selected row in order to determine if the user can delete the row or not.

So far I added a new button to the toolbar. When the user presses the button, I check which row is selected. For this I use the method cont_co_alv->get_selected_rows. This method returns the ID of the selected row. Now I should check the values of this row, but I didn't find a way how to access the data. I already tried to loop over the table which I sent to ALV for output. But the table seems to be empty.

Has anybody an idea how this could be solved?

Thanks in advance and regards,

Martin

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi!

If you are using an editable ALV and you want to check the changed value before deleting the row,use the following method after user clicks on delete:

grid->check_changed_data.

This will update your internal table with the values in the grid.

Then call the method

grid->get_selected_rows. This will return you the index of the row which user has selected.Read your internal table with the same index returned by the above method.Now check the values according to your conditions.

2 REPLIES 2

Former Member
0 Kudos

Hi!

If you are using an editable ALV and you want to check the changed value before deleting the row,use the following method after user clicks on delete:

grid->check_changed_data.

This will update your internal table with the values in the grid.

Then call the method

grid->get_selected_rows. This will return you the index of the row which user has selected.Read your internal table with the same index returned by the above method.Now check the values according to your conditions.

0 Kudos

Hi,

thanks for your answer.

My internal table remains still empty. Are the others ideas how this could be solved?

Thanks and regards,

Martin