Skip to Content

Is it possible to use scripts to scroll the window to the top in SAP Personas?

Oct 09, 2017 at 07:23 PM


avatar image
Former Member

We're making a Persona with a vertical layout that causes some screens to be pretty tall.

We have NEXT and PREVIOUS script buttons at the bottom of the screen... these buttons primarily change the content that appears in the main window. If possible, we would also like to have the window scroll all of the way to the top when these buttons are pressed.

Typically, you can use javascript to control window scroll, but the methods we've tried have had no effect. Normally, either of these two methods would work:

window.scrollTop = 0;

When those didn't work, we tried targeting the window itself by ID...

session.findById("wnd[0]").scrollTop = 0;

... and then tested targeting the "user area" instead of the window:

session.findById("wnd[0]/usr").scrollTop = 0;

None of the above methods caused the window to scroll.

Is it possible to control window scroll with scripting? Thanks!


We're currently running:

Personas Version: 3.05.20170727154054
Kernel 745_REL Patch 419

scroll-to-top.jpg (60.5 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Tamas Hoznek
Oct 10, 2017 at 12:02 AM

There is no way to do this from a Personas script as far as I'm aware.

10 |10000 characters needed characters left characters exceeded
Script Man Oct 10, 2017 at 08:03 AM

I use the following commands within SAP GUI Scripting:

    session.findById("wnd[0]").sendVKey 80 'Ctrl + PageUp
    session.findById("wnd[0]").sendVKey 81 'PageUp
    session.findById("wnd[0]").sendVKey 82 'PageDown
    session.findById("wnd[0]").sendVKey 82 'Ctrl + PageDown
Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

That's a solution I wouldn't have thought of, thanks!

Former Member

Script Man, can you share more details about how you got this to work? I tried using 80 and 81 in my script, but neither caused the window to scroll up.


I tried this too and it didn't work in a Personas script. Referring to "wnd[0]" only, it resulted in a script error, and using "wnd[0]/usr" had no effect.

Probably specific to SAP GUI scripting only.