cancel
Showing results for 
Search instead for 
Did you mean: 

How to force scroll to top of standard table

Former Member
0 Kudos

Hi All,

I have a standard table in web dynpro in my view. This table displays 10 lines at a time and has scrolling enabled. We allow the users to add

a new line to the table and my requirement is to add it to the top of the list. THis is working fine as long as you are within the first 10 rows. If you add

a line and you are on say the 15th row then the line gets added and selected but it is not visable to the user unless they scroll up. Is there any way to

reset the scrolling in the view when I add the new line? I have tried setting the lead selection which gets set but the scrooling does nto get refreshed. I

have also invalidated the table and redid the binding but it is still not taking me to the top,

Regards,

Tom

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello,

Best solution for this as i have used in my project.

Append new line in start, and rebind the UI table with that internal table, so new line will be in starting and no need to scroll and once user saved all data sort data based on your condition.

demo code.

Read Existing data of UI Table in Itab.

Make copy of Itab without data.(itab_copy).

append a new line (WA) to Itab_copy.

append lines of itab into itab_copy.

and Bind UI table wth(Itab_copy).

BR

Chandra..

former_member184958
Active Participant
0 Kudos

Hi Thomas,

As per my knowledge, Inside the row appended action find the the total number of line using Describe table lt_table lines tot.

Then append the row into that table.

Then add the one to that tot variable.

Then set the index to visible the particular row.

Hope this will helpful to you.

Regards,

John.