Skip to Content
author's profile photo Former Member
Former Member

Refresh ALV & set focus

Hi,

I have a refresh option on my screen. It will bring latest data from database. After displaying data in ALV and scrolling down (lets assume scrolled down 10 records). if I select refresh, I am reloading data to ALV. But focus is going to first record. I have again scrool down to 11th record to check the data. How I can set focus to 11th record after repopulating data on ALV. I am using classes for ALV.

I will appriciate any inputs.

Regards,

Venkat.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 03, 2007 at 11:26 PM

    Hi,

    Try using the method SET_CURRENT_CELL_VIA_ID by passing the row number..

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 03, 2007 at 11:38 PM

    Hi,

    Check this example of using the method set_current_cell_via_id.

    DATA: ROWNO TYPE LVC_S_ROID.

    ROWNO-ROW_ID = 25.

    • Set the focus on the row number 25.

    CALL METHOD <b>grid1->set_current_cell_via_id</b>

    EXPORTING

    IS_ROW_NO = rowno.

    Hope this helps..

    THanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 04, 2007 at 12:24 AM

    Hi,

    I tried this it worked for me..Please let me know if it works for you..

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello Venkat

      As the names imply

      - I_STABLE-ROW = 'X' means current row position (e.g. if you have used the horizontal scroll bar) remains stable after refresh and

      - I_STABLE-COL = 'X' means current column position (e.g. if you have used the vertical scroll bar) remains stable after refresh

      Regards

      Uwe

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 02:41 PM

    not to go to first row. use refresh with stable option.

    e.g.:-

    data:g_stable type LVC_S_STBL.

    • Refresh the screen without changing the view

    g_stable-row = '1'.

    call method g_alv_grid->refresh_table_display

    exporting IS_STABLE = g_stable.

    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.