05-13-2008 10:06 AM
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
05-13-2008 10:39 AM
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.
05-13-2008 10:39 AM
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.
05-13-2008 12:12 PM
Hi,
thanks for your answer.
My internal table remains still empty. Are the others ideas how this could be solved?
Thanks and regards,
Martin