Application Development 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: 

Setting Cursor position in ALV Grid

Former Member
0 Kudos

Hi All,

I am using Object oriented ALV Grid .In Status bar of the screen i'v an button to create new record in the ALV Grid(NOT an Standard Create button which comes with ALV Grid). When clicking the New record BUTTON,it will create the new record in the itab which is showing ALV GRID.After adding a record to the ITAB,i called " refresh_table_display" Method to make newly created record to be visible in the ALV GRID.

But After calling this method the cursor goes to the First Column of the first record.I want to set the cursor in the first column of the newly created Record.Kindly help me to set this cursor in the first column of the newly created record...

Thanks in advance..

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Use Method set_current_cell_via_id of Class CL_GUI_ALV_GRID

FORM set_cursor_position  USING    p_wl_lines.
  DATA :  wl_is_row_id TYPE lvc_s_row,
          wl_is_column_id  TYPE lvc_s_col,
          wl_is_row_no  TYPE lvc_s_roid.

  wl_is_row_id     = p_wl_lines.
  wl_is_row_no-row_id     = p_wl_lines.

  CALL METHOD w_grid->refresh_table_display
    EXPORTING
      i_soft_refresh = 'X'.

  CALL METHOD w_grid->set_current_cell_via_id
    EXPORTING
      is_row_id    = wl_is_row_id           " Row No
      is_column_id = wl_is_column_id   " Column No
      is_row_no    = wl_is_row_no.        " Row No.

ENDFORM.                    " set_cursor_position

3 REPLIES 3

Former Member
0 Kudos

Use Method set_current_cell_via_id of Class CL_GUI_ALV_GRID

FORM set_cursor_position  USING    p_wl_lines.
  DATA :  wl_is_row_id TYPE lvc_s_row,
          wl_is_column_id  TYPE lvc_s_col,
          wl_is_row_no  TYPE lvc_s_roid.

  wl_is_row_id     = p_wl_lines.
  wl_is_row_no-row_id     = p_wl_lines.

  CALL METHOD w_grid->refresh_table_display
    EXPORTING
      i_soft_refresh = 'X'.

  CALL METHOD w_grid->set_current_cell_via_id
    EXPORTING
      is_row_id    = wl_is_row_id           " Row No
      is_column_id = wl_is_column_id   " Column No
      is_row_no    = wl_is_row_no.        " Row No.

ENDFORM.                    " set_cursor_position

Former Member
0 Kudos

Hi

ignore this post

Edited by: Hareesh Menon on Feb 25, 2009 2:02 PM

Edited by: Hareesh Menon on Feb 25, 2009 2:03 PM