Sub test()
If Not IsObject(sapApp) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set sapApp = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(Connection) Then
Set Connection = sapApp.Children(0)
End If
If Not IsObject(session) Then
Set session = Connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject sapApp, "on"
End If
session.findById("wnd[0]").resizeWorkingPane 127, 28, False
session.findById("wnd[0]/usr/ctxtRP50G-PERNR").Text = "86619365"
session.findById("wnd[0]/usr/ctxtRP50G-PERNR").caretPosition = 8
session.findById("wnd[0]").sendVKey 0
End Sub