Skip to Content
avatar image
Former Member

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

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

scroll-to-top.jpg (60.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 10, 2017 at 12:02 AM

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

    Add comment
    10|10000 characters needed characters exceeded

  • 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
    
    Add comment
    10|10000 characters needed characters exceeded

    • 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.