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

ALV Row position

Former Member
0 Likes
1,313

Hi All,

I have an ALV Grid display. I am using hot-spot to uncheck all lines pertaining to a particular id even if we click it on one check-box. Once this is done the grid is refreshed and the control goes back to the first line. And I have to scroll down all the way to find where the cursor was last there.

READ TABLE i_output INTO wa_output INDEX p_selfield-tabindex.

CHECK sy-subrc = 0.

l_zuonr = wa_output-zuonr.

IF wa_output-check_box EQ 'X'.

CLEAR wa_output-check_box.

MODIFY i_output FROM wa_output TRANSPORTING check_box

WHERE zuonr = l_zuonr.

ELSE.

wa_output-check_box = 'X'.

MODIFY i_output FROM wa_output TRANSPORTING check_box

WHERE zuonr = l_zuonr.

ENDIF.

p_selfield-refresh = 'X'.

My requirement is to display the Grid with the cursor back to the next line or the same line where it was last.

Is there a way to capture the last cursor position and bring the control there, so the user can start scrolling from there downwards?

Thanks,

Payel

Hi All,

I have an ALV Grid display. I am using hot-spot to uncheck all lines pertaining to a particular id even if we click it on one check-box. Once this is done the grid is refreshed and the control goes back to the first line. And I have to scroll down all the way to find where the cursor was last there.

READ TABLE i_output INTO wa_output INDEX p_selfield-tabindex.

CHECK sy-subrc = 0.

l_zuonr = wa_output-zuonr.

IF wa_output-check_box EQ 'X'.

CLEAR wa_output-check_box.

MODIFY i_output FROM wa_output TRANSPORTING check_box

WHERE zuonr = l_zuonr.

ELSE.

wa_output-check_box = 'X'.

MODIFY i_output FROM wa_output TRANSPORTING check_box

WHERE zuonr = l_zuonr.

ENDIF.

p_selfield-refresh = 'X'.

My requirement is to display the Grid with the cursor back to the next line or the same line where it was last.

Is there a way to capture the last cursor position and bring the control there, so the user can start scrolling from there downwards?

Thanks,

Payel

4 REPLIES 4
Read only

Former Member
0 Likes
821

Hello

in List programming

Get Cursor field

regards

Chris

Read only

Former Member
0 Likes
821

this is simple. use row stable and column stable.

p_selfield-refresh = 'X'.
p_selfield-row_stable= 'X'.  "For Row 
p_selfield-col_stable = 'X'.  " For Coloumn

.

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
821

Hello,

Try with the method:

cl_gui_alv_grid=>GET_SELECTED_ROWS.

Regards,

Sandeep

Read only

Former Member
0 Likes
821

Hi,

try using system field,

sy-curow-Vertical cursor position on the screen display of a screen. Counting begins at line 1.