Retrieve filtered data from ALV

Viewed 7667

Is there an easy way of retrieving the ALV data that is displayed when there are also filters used on that ALV?

The ALV used is an object of CL_GUI_ALV_GRID. When showing it to the user, there is a filter placed on it by default. The user also has a button that processes the data in the ALV. How can I make sure the process only works with the data that is displayed, even if the user places his own filters on the ALV?

e.g: An ALV gets created from an itab that has 10 rows, but because there is also a filter passed on the ALV, only 8 rows are showing. When pressing a button, I only want to work with the 8 rows currently showing to the user.

I have tried finding a function module for this purpose but I can only find a FM which works with the selected rows in an ALV.

EDIT: Further, there is a method called get_filtered_entries, but it only retrieves those entries that are NOT displayed. Using this will be quite time-consuming to make the translation to displayed entries. get_filtered_entries

Thanks in advance.

1 Answers
Related