‎2011 Jan 13 11:07 AM
Hello ABAP Expert,
I have to set the first row displayed in an ALV grid using ABAP.
In fact the list contains a lot of lines but the user need that the list after refresh keep the position without to repeat the scrolling from the top of the list.
The ALV is displayed using FM REUSE_ALV_GRID_DISPLAY_LVC.
I have try several methods but without success.
Our help is welcome.
Christophe
‎2011 Jan 13 11:39 AM
Hi Christophe,
Try to fill the field NO_SCROLLING of structure SLIS_LAYOUT_ALV with "X".
But use the FM REUSE_ALV_LIST_DISPLAY, becasue the FM REUSE_ALV_GRID_DISPLAY_LVC does not have the field NO_SCROLLING into structure IS_LAYOUT_LVC.
Regards,
João Henrique
Edited by: João Henrique Luz Alves de Araujo on Jan 13, 2011 9:40 AM
‎2011 Jan 13 11:39 AM
Hi Christophe,
Try to fill the field NO_SCROLLING of structure SLIS_LAYOUT_ALV with "X".
But use the FM REUSE_ALV_LIST_DISPLAY, becasue the FM REUSE_ALV_GRID_DISPLAY_LVC does not have the field NO_SCROLLING into structure IS_LAYOUT_LVC.
Regards,
João Henrique
Edited by: João Henrique Luz Alves de Araujo on Jan 13, 2011 9:40 AM
‎2011 Jan 13 1:00 PM
This option will desable the possibility to scroll ? this is not the objective.
I need to keep the last page of the list on the screen after refresh.
Christophe
‎2011 Jan 13 1:43 PM
‎2011 Jan 13 1:45 PM
Hello REUSE_ALV_GRID_DISPLAY_LVC
You can achieve your goal using fm REUSE_ALV_GRID_DISPLAY_LVC (although it would be much easier to use class CL_GUI_ALV_GRID).
The EXIT routine for command handling (parameter I_CALLBACK_USER_COMMAND) has a parameter R_UCOMM with the following fields (and more of them):
refresh : (exporting) list is to be refreshed
col_stable:(exporting) keep column positions in refresh
row_stable:(exporting) keep row positions in refresh
If you set COL_STABLE = 'X' and ROW_STABLE = 'X' you achieve the same when using go_grid->REFRESH_TABLE_DISPLAY ( using parameter IS_STABLE).
Regards
Uwe
PS: See documentation of fm REUSE_ALV_LIST_DISPLAY.
‎2011 Jan 13 2:38 PM
I have the solution :
when i call the method REFRESH_TABLE_DISPLAY
:
DATA : W_STABLE TYPE LVC_S_STBL.
W_STABLE-ROW = 'X'.
CALL METHOD WV_REF_GRID->REFRESH_TABLE_DISPLAY
EXPORTING
IS_STABLE = W_STABLE.
Using this setting the list keep the current position after the refresh.
Thanks for your help.