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: 

Scrolling to a specific row in an ALV grid using CL_SALV_TABLE

tamas_hoznek
Employee
Employee
0 Kudos

I have an ALV grid that utilizes the CL_SALV_TABLE class (so the simple OO ALV handling method). When displaying the grid content, I need to scroll to a specific row and have that row as the first line that appears in the grid.

I was looking but could not find a way to do it. It appears this functionality is not supported. Class CL_GUI_ALV_GRID does seem to have this feature though (method SET_FIRST_VISIBLE_ROW), but I rather wouldn't re-write the whole program just because of this.

Does anybody have a way to programmatical scroll with CL_SALV_TABLE?

Thanks.

This will be even more interesting when there are sort criteria and filters defined... not really sure how would it work in those cases.

1 REPLY 1

Clemenss
Active Contributor
0 Kudos

Yes, there is no method directly avaliable with SALV.

I did not try this specific task, but it should be possible if you get access to the CL_GUI_ALV_GRID object which is hidden in the SALV object. Then you may

CALL METHOD lo_grid->set_current_cell_via_id
      EXPORTING
        is_row_no = l_row_no.

The way to get the CL_GUI_ALV_GRID object is described in a blog to [Overcome the Restrictions of SALV Model|http://tknight.org/sdn/show/12187]

I tried this to get access to the field catalog, it should work also for the scrollbar moving.

Regards,

Clemens