Application Development and Automation 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: 

ALV ABAP: only need to read the table which is visible in ALV.

former_member209920
Active Participant
0 Kudos
289

Hi,

I have created a simple ALV using class CL_GUI_ALV_GRID. I have a requirement that I need to read the displayed ALV in the way it appears.

For example if user has sorted the ALV, then I need the internal table in that sort order only

OR

If user have set a filter on some fields, then I need the rows that are in display only

OR

If user have made some fields hidden than I need the internal table with those fields only ( may be with visible fields in structure or hidden fields as blank in actual internal table structure).

In short, I only need to read the table which is visible in ALV.

Please provide some solution.

Thanks

Manu B

3 REPLIES 3

kesavadas_thekkillath
Active Contributor
0 Kudos
229

In reuse alv we can use the function REUSE_ALV_GRID_LAYOUT_INFO_GET and in cl_gui_alv_grid there are methods like get_filtered_entries,get_sort_criteria,get_frontend_layout etc from which you can do a research.

0 Kudos
229

That means do I need to to first find out in how many ways the ALV grid can be changed/ modified. Then use different methods of class to filter the internal table according to the criteria fetched from these methods ?

Is there any method or ways for which I need not to fetch what exactly user has done with the list and can get the displayed table directly, since there could be numerous ways of changing the ALV grid display.

Thanks

Manu B

0 Kudos
229

Why are you doing this? I think knowing the purpose will help know what is needed versus what is possible.