cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.scrollTo(0,0);
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

Accepted Solutions (1)

Accepted Solutions (1)

tamas_hoznek
Product and Topic Expert
Product and Topic Expert

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

0 Kudos

Hi Tomas,

Do you know if this is possible in Personas 3.0 SP10?

Answers (1)

Answers (1)

script_man
Active Contributor

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
Former Member
0 Kudos

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

Former Member
0 Kudos

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.

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.