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 focus on alv oo

Former Member
0 Likes
4,472

Hi all,

I want to implement the METHOD SET_FOCUS in ALV OO but it doens't work, the cursor always go to the first row? ... How can i set cursor on specific row ?

thanks .

Regards.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,092

Hi,

data : c_alv_grid type ref to CL_GUI_ALV_GRID,
       col type LVC_S_COL,
       row type LVC_S_ROID.

col-fieldname = <fieldname>. " as string.
col-row_id = <row_number>. "as integer


CALL METHOD c_alv_grid ->set_current_cell_via_id
   EXPORTING
      IS_COLUMN_ID =   col
      IS_ROW_NO    =   row

Regards,

Siddarth

3 REPLIES 3
Read only

former_member194669
Active Contributor
Read only

Former Member
2,092

On a screen, only one element can have the focus, be it a control or another kind of screen element such as an input field. The element with the focus is always the one to which the last set_focus method call or SET CURSOR statement was applied.

so before method set_focus use set cursor command

Read only

Former Member
0 Likes
2,093

Hi,

data : c_alv_grid type ref to CL_GUI_ALV_GRID,
       col type LVC_S_COL,
       row type LVC_S_ROID.

col-fieldname = <fieldname>. " as string.
col-row_id = <row_number>. "as integer


CALL METHOD c_alv_grid ->set_current_cell_via_id
   EXPORTING
      IS_COLUMN_ID =   col
      IS_ROW_NO    =   row

Regards,

Siddarth