Skip to Content

I'm not identify the name of the vertical scroll bar on the transaction QM02.

Hello Stefan,

First I would like to congratulate you for the excellent application "Tracker".

In short time of use could already get good results, thank you.

But today when trying to write a script I'm not identify the name of the vertical scroll bar on the transaction QM02, could you help me please.

Thank you.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Feb 16, 2016 at 06:53 AM

    Hello Marcio,

    welcome in the Scripting Language forum.

    The vertical scrollbar you are looking for has no own ID, it is part of the user screen - hope you mean this scrollbar.

    Here an example code:

    '-Begin-----------------------------------------------------------------

    '-Directives----------------------------------------------------------

    Option Explicit

    '-Global Variables----------------------------------------------------

    Dim SapGuiAuto, application, connection, session

    Dim UserArea, VScrlBar

    '-Main----------------------------------------------------------------

    If Not IsObject(application) Then

    Set SapGuiAuto = GetObject("SAPGUI")

    Set application = SapGuiAuto.GetScriptingEngine

    End If

    If Not IsObject(connection) Then

    Set connection = application.Children(0)

    End If

    If Not IsObject(session) Then

    Set session = connection.Children(0)

    End If

    Set UserArea = session.FindById("wnd[0]/usr")

    Set VScrlBar = UserArea.VerticalScrollbar

    MsgBox CStr(VScrlBar.Minimum) & vbCrLf & _

    CStr(VScrlBar.Maximum) & vbCrLf & _

    CStr(VScrlBar.PageSize) & vbCrLf & _

    CStr(VScrlBar.Position)

    '-End-------------------------------------------------------------------

    You can set the position of the scrollbar e.g. like this

    VScrlBar.Position = 106


    Cheers

    Stefan


    013.jpg (118.3 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • Hello Stefan!

      Worked perfectly! Now I'm able to control the position of the vertical scroll bar.

      * To run your script is presenting a syntax error, regardless, I took parts of the code.

      Thank you so much!

      Excuse me if some sentences are not concordances, my English is very basic. I'm using Google Translator.