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: 

Cursor postion on alv

Former Member
0 Kudos

Hi Expert,

In module pool I am using alv display in subscreen. I am using cl_gui_alv_grid. which have one editable coulmn to enter quantity.

Now  once I execute main screen and its all ALV subscreen. Requirment is cursor should place only that row and coulmn which have remaining qty to enter Or which are in EDIT mode.

I have try using o_grid->set_current_cell_via_id also set_focus method.

But cusrsor not going to ALV editable fields.

Thanks in Advance.

Anupam

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi anupam,

Try this following code to move cursor to the specified field.

DATA: ls_row    TYPE i,
          ls_value  TYPE c,
          ls_col    TYPE i,
          ls_row_id  TYPE LVC_S_ROW,
          ls_col_id TYPE  LVC_S_COL,
          es_row_no TYPE LVC_S_ROID.

CALL METHOD go_grid->get_current_cell
   IMPORTING          e_row     = ls_row
   e_value   = ls_value
   e_col     = ls_col
   es_row_id = ls_row_id
   es_col_id = ls_col_id
   es_row_no = es_row_no.

   ls_col_id = 'ERSDA'.  "cursor will go this field.


   CALL METHOD go_grid->refresh_table_display.
   CALL METHOD go_grid->set_current_cell_via_id
   EXPORTING     is_column_id ls_col_id
   is_row_no  es_row_no.

10 REPLIES 10

Former Member
0 Kudos

hi anupam,

Try this following code to move cursor to the specified field.

DATA: ls_row    TYPE i,
          ls_value  TYPE c,
          ls_col    TYPE i,
          ls_row_id  TYPE LVC_S_ROW,
          ls_col_id TYPE  LVC_S_COL,
          es_row_no TYPE LVC_S_ROID.

CALL METHOD go_grid->get_current_cell
   IMPORTING          e_row     = ls_row
   e_value   = ls_value
   e_col     = ls_col
   es_row_id = ls_row_id
   es_col_id = ls_col_id
   es_row_no = es_row_no.

   ls_col_id = 'ERSDA'.  "cursor will go this field.


   CALL METHOD go_grid->refresh_table_display.
   CALL METHOD go_grid->set_current_cell_via_id
   EXPORTING     is_column_id ls_col_id
   is_row_no  es_row_no.

0 Kudos

Hi ,

Using above code its just highlist the editable field cursor still on main screen field.

0 Kudos

Hi Abdul,

Try using following method.

CALL METHOD LR_ALV_GRID->SET_SELECTED_CELLS_ID

   EXPORTING

     IT_CELLS = LT_CELL


Regards,

Vijay

0 Kudos

Thank you very mucha, I solved mi problem

Former Member
0 Kudos

Hi Vijay,

Same result . just highlight that row and coulmn.

main problem is I am giving some input to main screen and after executing main screen its giving ALV in subscreen. subscreen is also part of main screen. So my cursor still on main screen input field.

Regards,

Anupam

0 Kudos

Hi Anupam,

Have you refreshed the ALV after setting cursor position. What I believe is, above method is called with reference of ALV so Sub-screen doesn't matter.

Try refreshing ALV.

grid->refresh_table_display( i_soft_refresh = 'X' ).

Regards,

Vijay

0 Kudos

Hi Vijay,

First I refresh only after that I use 2 FM . Here is my senario.

********************************

Selection screen

Input 1 Cursor is here

Input 2 then cursor is here                    Input 3.                                          Execute button

Now its displaying ALV which have 2-3 toolbaar button

Button 1    Button 2      Button 3

Once I execute its calling subscreen ALV and  initialy cursor going to first input field of ALV.

Now once I press buttn 1 which have some functionalty after this I am calling same metod's. Now cursor is going to Button 1 only rether go to input field.

Thanks Anupam

0 Kudos

Hi,

Any answer . Did not got Exact solution?

Regards,

Anupam

0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Venkat,

Please read ques. I am not talking about screen field. Here something different talking abut editable  ALV in subscreen.