Skip to Content
Sep 22, 2016 at 12:38 AM

How to avoid ALV going to the top of list after refresh?


Hi guys.

I have a technical issue regarding an ALV with saving options. I set a column as editable checkbox and I am using not OO ALV reporting, specifically REUSE_ALV_GRID_DISPLAY. I coded the user_command form. After a checkbox is selected (or deselected), I fill some non-editable columns of the checked line with relevant data (like the current user ID and date). The process of doing that is described here: (answers from Mihaela and Susmitha are good ones) but the point is that after a change in a line of report is done, the report should be refreshed to show the new data like the actual checkbox tick and the user name or new color of line. If the ALV report is big (many lines) and a checked line is reached only using the scroll bar (scrolling down at least 1 time), after instructions CALL METHOD lr_grid->refresh_table_display or rs_selfield-refresh = 'X' the ALV is going to the top of the list. I meant, for every click on the checkbox column, I have to do a refresh in order to show the data changes on this line and the problem is when line is not in the first page of the listing, it will not be visible anymore because ALV report is going to the top (the "first page" of results) due refreshing process and user will need to scroll down again if s/he wants to see the change s/he just did. Thats annoying. Do you know a way to avoid this behavior? Please help. Thanks!