Skip to Content

ALV set row and column position

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2011 at 11:13 AM

    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!

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • Posted on Feb 05, 2013 at 04:30 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 07, 2009 at 12:44 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 14, 2009 at 07:01 AM

    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,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 13, 2014 at 11:26 AM

    This message was moderated.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.