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 grid

Former Member
0 Likes
1,303

Hi,

Is it possible to place the cursor on a row of a ALV grid ( the row number is determined at the runtime)?

Please tell the method that can be used to achieve this ?

Regards,

Ajit

Hai,

Use this Method: get_selected_rows.

Ex: call method grid2->get_selected_rows

importing

et_index_rows = lt_rows_2.

read table lt_rows_2 into ls_rows_2 index 1.

ls_rows_2-index has the number of the row.

To be able to use this, set the sel_mode of the layout to 'A'.

Best Regards,

rama

9 REPLIES 9
Read only

Former Member
0 Likes
1,267

Hai,

Use this Method: get_selected_rows.

Ex: call method grid2->get_selected_rows

importing

et_index_rows = lt_rows_2.

read table lt_rows_2 into ls_rows_2 index 1.

ls_rows_2-index has the number of the row.

To be able to use this, set the sel_mode of the layout to 'A'.

Best Regards,

rama

Read only

0 Likes
1,267

Hi Rama,

My problem is not to get the selected row, I have to place the cursor on a row (which is determined at the runtime)

Regards,

Ajit

Read only

0 Likes
1,267

Yes you can there is a method set_selected_rows with this method u can select rows in runtime.

Read only

0 Likes
1,267

hi

hope this link would be useful to u - not to place cursor but highlight particular row

Regards

Sajid

Read only

0 Likes
1,267

Hai Ajit,

Okay, check this method GET_CURRENT_CELL_ROW_ID of the Class CL_GUI_ALV_GRID.

All the best.

Best Regards,

rama

Read only

0 Likes
1,267

Hi,

is there any method to set the cursor on a particular cell of a ALV grid ?

Regards,

Ajit

Read only

0 Likes
1,267

Yeah Ajit, have a look at this method SET_CURRENT_CELL_ID of the class CL_GUI_ALV_GRID.

Best Regards,

rama

Read only

Former Member
0 Likes
1,267

Hi,

Did you try the [get_current_cell|http://help.sap.com/saphelp_nwpi71/helpdata/EN/0a/b552f7d30911d2b467006094192fe3/frameset.htm] method ?

BR,

Advait

Read only

0 Likes
1,267

Hello,

Please check the type group SLIS.

You have a TYPE slis_selfield which says "information cursor position ALV".

You can try using the fields row_stable and col_stable.

Cheers,

Balaji