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 cursor problems

Former Member
0 Likes
746

Hi ,

I want to set cursor on particulat cell of an ALV , I am using below method

set_current_cell_via_id

CALL METHOD <ref.var. to CL_GUI_ALV_GRID > ->set_current_cell_via_id

EXPORTING

IS_ROW_ID = <structure of type LVC_S_ROW >

IS_COLUMN_ID = <structure of type LVC_S_COL >

IS_ROW_NO = <structure of type LVC_S_ROID >.

but cursor is not moving to required cell , please let me know if need to pass some thing else or

what should be method that i should use to focus cursor on a particular cell of an alv

Thanks ,

Ramesh

3 REPLIES 3
Read only

Former Member
0 Likes
546

Hi,

Check This code.


 CALL METHOD GRID->REFRESH_TABLE_DISPLAY.

  ROW-INDEX = LV_LINES.               "Your row num where the cursor should be placed
  COL-FIELDNAME = 'VBELN'.           "Field on which the cursor should be placed.

  CALL METHOD GRID->SET_CURRENT_CELL_VIA_ID
    EXPORTING
      IS_ROW_ID    = ROW
      IS_COLUMN_ID = COL.

.

Regards,

R K.

Read only

Former Member
0 Likes
546

Hi,

its better to use the method 'SET_CURRENT_CELL_ROWPOS_COLID'

or,

please check if you have specified your field name.

Or,

Please try this code



 READ TABLE LT_DATA INTO LS_DATA_EXT INDEX I.
    IF SY-SUBRC eq 0.
      L_START_POS   = LS_DATA_EXT-FDPOS + 1.
      L_END_POS     = L_START_POS + L_LENGTH - 1.
      CALL METHOD ME->SET_CURRENT_CELL
                  EXPORTING I_START_POSITION = L_START_POS
                            I_END_POSITION   = L_END_POS
                            I_ROW            = LS_DATA_EXT-ROW_POS
                            I_COLUMN         = LS_DATA_EXT-COL_POS.

Read only

Former Member
0 Likes
546

Hi,

Your PBO should contain a call to the method 'REFRESH_TABLE_DISPLAY' and your PAI should contain a call to method 'CHECK_CHANGED_DATA' whenver you are dealing with editable ALV grids functionalities.

Regards,

Ankur Parab