Application Development and Automation 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: 
Read only

Set ALV first row

Former Member
0 Likes
1,571

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,130

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

5 REPLIES 5
Read only

Former Member
0 Likes
1,131

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

Read only

0 Likes
1,130

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

Read only

0 Likes
1,130

Ok, now I get your point.

This thread may help you -> [;

Read only

0 Likes
1,130

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.

Read only

0 Likes
1,130

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.