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: 

ALV set row and column position

jiri_faltin2
Explorer
0 Kudos

Hi Experts,

I have editable ALV, after edit I refresh ALV, but problem is, that position is set to position 1.1. I need to keep cursor at edited position.

I use ALV through function module REUSE_ALV_GRID_DISPLAY.

Thansk&regards,

Jirka

9 REPLIES 9

martin_voros
Active Contributor
0 Kudos

Hi,

how exactly do you refresh your table? For example the method REFRESH_TABLE_DISPLAY of class CL_GUI_ALV_GRID has optional parameter IS_STABLE where you can set up focused cell after refresh. So try to find similar option in your case.

Good luck

Former Member
0 Kudos

Hi

for reuse_alv_grid_display the field catalog to be passed is of type 'slis_t_fieldcat_alv '.

it has fields row_pos and col_pos -- set thm for the reqd field

type-pools: slis.

data:

t_fcat type slis_t_fieldcat_alv.

fs_fcat like line of t_fcat.

fs_fcat-fieldname = ' ...... '.

fs_fcat-row_pos = ' ' .

fs_fcat-col_pos = 4.(say)

modify t_fcat from fs_fcat transporting row_pos col_pos

where fieldname = ' ' .

Regards,

Former Member
0 Kudos

In the 'USER_COMMAND' callback routine you created for FM 'REUSE_ALV_GRID_DISPLAY' (import parameter I_CALLBACK_PROGRAM) , add the following lines....

move 'X' to rs_selfield-refresh.

move 'X' to rs_selfield-col_stable.

move 'X' to rs_selfield-row_stable.

Even easier than method calls!

0 Kudos

Hi Chris,

It's been a long time since the last reply at this subject, but I'm facing a issue with rows positioning on ALV when it's running on WEBGUI. The same application (transaction) executed using SAP GUI works perfectly (about ALV keeping the row positioning after a ALV refresh) and when its executed under Portal using WEBGUI (ITS) the row position is not retained after an ALV refresh.


I'll really appreciate any help or clue about this issue.

Thank you in advance,

Nelson Bertolino

surajarafath
Contributor
0 Kudos

In order to refresh the ALV and keep the scroll position, you have to read the scroll posiition before refresh and set the scroll position after the refresh..

Below code will help,.. Whenever you want to refresh the alv use these in your coding...

FORM refresh_alv_display.

DATA: li_rows    TYPE lvc_s_roid,

         li_col     TYPE lvc_s_col,

         lws_row_id TYPE lvc_s_roid,

         lws_col_id TYPE lvc_s_col,

         ls_col     TYPE lvc_s_col,

         ls_num     TYPE lvc_s_roid.

   CALL METHOD c_grid->get_current_cell

     IMPORTING

       es_col_id = li_col

       es_row_no = li_rows.

   CALL METHOD c_grid->get_scroll_info_via_id

     IMPORTING

       es_col_info = ls_col

       es_row_no   = ls_num.

   CALL METHOD c_grid->refresh_table_display.

   CALL METHOD c_grid->set_scroll_info_via_id

     EXPORTING

       is_col_info = ls_col

       is_row_no   = ls_num.

   lws_row_id-row_id    = li_rows-row_id.

   lws_col_id-fieldname = li_col-fieldname.

   CALL METHOD c_grid->set_current_cell_via_id

     EXPORTING

       is_column_id = lws_col_id

       is_row_no    = lws_row_id.

ENDFORM.

0 Kudos

You know, I made what you suggest. It works fine on SAP GUI environment. But, when I run the report on WEBGUI environment, it doesn't work. Although the ALV position is kept, the screen is refreshed and the ALV is positioned on top, again.

Do you have any clue about it. I think it will not work on WEBGUI environment.

Regards.

0 Kudos

Hello Nelson,

I had the same problem, an ALV works fine on SAP GUI, but it is positioned on top when refresh on WEBGUI, ¿how do you solved it?

Thanks in advance,

Fidel.

0 Kudos

Hello,

Finally the problem was with the nivel patch of kernel. We were in 401 and we had to upgrade to 500.

Fidel.

praveen_moolera2
Explorer
0 Kudos

This message was moderated.