Refresh Table Display Moves Cursor to First Line

If you are making some changes in the ALV Output and refresh the ALV display using the method “REFRESH_TABLE_DISPLAY” the chances are it will go to the first line unless you call the refresh table display with the parameters. Use the below code to make the ALV stick to the current row even though you refresh it.

 DATA ls_stable TYPE lvc_s_stbl.
 ls_stable-row = 'X'.
 ls_stable-col = 'X'.
 CALL METHOD gr_alvgrid->refresh_table_display
      EXPORTING
        is_stable = ls_stable
      EXCEPTIONS
        finished  = 1
        OTHERS    = 2.
 IF sy-subrc <> 0.
 ENDIF.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: