2007 Jan 03 11:16 PM
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.
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.
2007 Jan 03 11:26 PM
Hi,
Try using the method SET_CURRENT_CELL_VIA_ID by passing the row number..
Thanks,
Naren
2007 Jan 03 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
2007 Jan 04 12:24 AM
Hi,
I tried this it worked for me..Please let me know if it works for you..
Thanks,
Naren
2007 Jan 04 1:01 PM
Hi Naren,
Thanks for your reply. Its working for some extent. selected line is in middile of screen once I do refresh the line is displaying the end of screen. The solution is surely better than displaying list from first. My exact requirement is if user select a row after refresh I want to see the row at the same position. Does it require any additional effort ?.
Regards,
Venkat.
2007 Jan 05 9:29 AM
Hello Venkat
You have to set I_STABLE-ROW = 'X' and I_STABLE-COL = 'X' when calling method go_grid->refresh_table_display.
Regards
Uwe
2007 Jan 08 4:58 PM
Hi Uwe,
Thanks for your response. What data I_STABLE table contains ?
Regards,
Venkat.
2007 Jan 08 5:01 PM
Naren,
Thanks for your response. Its working partially. When even i refresh my selected line is displaying moving to the end on alv screen, before refresh my selected line is in middle of alv screen.
Regards,
Venkat.
2007 Jan 09 7:29 AM
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
2007 Jan 11 2: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.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |