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: 

function module REUSE_ALV_GRID_DISPLAY - get displayed data

Former Member
0 Kudos

Hey guys,

i am looking for way to retrieve (a handle) to the displayed data from the reuse alv grid. What i have done is to insert a new fcode for my own search. My search is looking for some data on database and appending on the search result i want to select a specific line in the alv grid. The routine which do the search is placed in my program and the reuse alv is placed in a class. I get a handle to the grid with function module GET_GLOBALS_FROM_SLVC_FULLSCR. But how can i get a handle to the data which ist displayed? Is there a way? I tried with a 'dirty assigned' which is not working. Any other ideas?

thx, M.

3 REPLIES 3

rdiger_plantiko2
Active Contributor
0 Kudos

Hi Wei-Ming,

you own the data yourself that you are requesting for! Don't search for your data in the depths of the ALV display code! You have them yourself.

When you call the REUSE_ALV_GRID_DISPLAY function module, you pass the data table. So your own program has the data table.

Organize your code in such a way that the callback can access the original data. A "classical" approach is to have the data table as a global field gt_... in a report, and the callback being a subroutine inside of this same report.

Regards,

Rüdiger

0 Kudos

Hi Rüdiger,

thank you for your reply. You are right i own the data by my self. But the point is that i want to highlight some lines of the displayed grid after my search. I don't want to close the grid and reopen it with the highlighted lines.....

regards, M.

Former Member
0 Kudos

Hi Wei-Ming,

As side by Rudiger Use REUSE_ALV_GRID_DISPLAY in the user command pass the below

i_callback_user_command  = 'USER_COMMAND'

create a routine user_command.

FORM user_command USING ucomm TYPE sy-ucomm
                        rs_selfield TYPE slis_selfield.

case ucomm.

read table it_final into wa_final index rs_selfield-tabindex.

in wa_final you will be getting which record you have selected.

Regards,

Anand Raj.S