SAP GUI script inputbox

session.findById("wnd[2]/usr/subBLOCK1:SAPLFKL0:0413/sub:SAPLFKL0:0413/ctxtRFKL0-VONSL[0,0]").text = inputbox("Enter filter for period.","kk",,,1)


I am using the SAP GUI scripting; when I use the inputbox in SAP the stupid thing opens up behind the session (must be some kind of German logic). Does anyone know how to make it so the inputbox opens up on top of the session so I can enter data? The code is below but that isn't the problem because I have tried different way to connect to the session the stupid thing always opens behind the session.



  Set SapGuiAuto = GetObject("SAPGUI")  'generic
      Set SapAppl = SapGuiAuto.GetScriptingEngine   'generic
      Set CollCon = SapAppl.Connections()       'connection

      '-Loop over connections-------------------------------------------
        For q = 0 To CollCon.Count() - 1

          Set oCon = SapAppl.Children(CLng(q))  'childeren
          If Not IsObject(oCon) Then
                 MsgBox "Issue found not GUIAuto"
          End If

          Set CollSes = oCon.Sessions()     'session
          If Not IsObject(CollSes) Then
                 MsgBox "Issue found not GUIAuto"
          End If
       
          '-Loop over sessions------------------------------------------
            For p = 0 To CollSes.Count() - 1
       
              Set oSes = oCon.Children(CLng(p))
              If Not IsObject(oSes) Then
                     MsgBox "Issue found not GUIAuto"
              End If
                Set oSesInf = oSes.Info()
                SID = oSesInf.SystemName()
            
                Trans = oSesInf.Transaction()
                    If SID = "REP" And Trans = "FPL9" Then
                        Set Connection = CollCon
                        Set session = oSes
'x = GUICtrlCreateInput("Some text 1", 10, 10, 200, 20)




session.findById("wnd[0]").resizeWorkingPane 142,55,false
session.findById("wnd[0]/usr/lbl[0,2]").setFocus
session.findById("wnd[0]/usr/lbl[0,2]").caretPosition = 29
session.findById("wnd[0]/tbar[1]/btn[5]").press
session.findById("wnd[1]/tbar[0]/btn[12]").press
session.findById("wnd[0]/tbar[1]/btn[9]").press
session.findById("wnd[0]/tbar[1]/btn[5]").press
session.findById("wnd[1]/usr").verticalScrollbar.position = 9
session.findById("wnd[1]/usr/sub:SAPLFKL0:0400/chkRFKL0-XSUCH[4,0]").selected = true
session.findById("wnd[1]/usr/sub:SAPLFKL0:0400/chkRFKL0-XSUCH[4,0]").setFocus
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[2]/usr/subBLOCK1:SAPLFKL0:0413/sub:SAPLFKL0:0413/ctxtRFKL0-VONSL[0,0]").text = inputbox("Enter filter for period.","kk",,,1)
session.findById("wnd[2]/usr/subBLOCK1:SAPLFKL0:0413/sub:SAPLFKL0:0413/ctxtRFKL0-VONSL[0,0]").caretPosition = 4
session.findById("wnd[2]/tbar[0]/btn[0]").press
  If session.FindById("wnd[0]/sbar").messageType = "E" Or session.FindById("wnd[0]/sbar").text = "Search was unsuccessful" Then
      msgbox "Your search was unsuccessful.", vbcancel
end if
                    End If
            Next
        Next
faquueAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

faquueAuthor Commented:
Disable Notify when a script attaches to SPA GUI
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Software

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.