Skip to Content
Jun 29, 2020 at 10:07 AM

How to perform multiple SAP Login at back end without GUI


Hi Expert,

I am new in SAP GUI scripting. I would like to know how can perform

login session with no login window (back end login session) and multiple same username on my machine.

The username is able to do that manually. Below are my script. Currently it able to do single login session with logon popup GUI.

I have tried "TASKKILL /F /IM saplogon.exe" but does not works. Please help as I need to perform load and stress test to my SAP GUI on the server.

Option Explicit

Dim WSHShell, SAPGUIPath, SID, InstanceNo, WinTitle, SapGuiAuto, application, connection, session, skillword, vbHide, Shell

SID = "x.x.x.x"

InstanceNo = "00"

Set WSHShell = WScript.CreateObject("WScript.Shell")

If IsObject(WSHShell) Then

SAPGUIPath = "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\"

WSHShell.Exec SAPGUIPath & "SAPgui.exe " & SID & " " & _


WinTitle = "SAP"

End If

rem skillword = "TASKKILL /F /IM saplogon.exe"

rem Shell skillword, vbHide

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

If IsObject(WScript) Then

WScript.ConnectObject session, "on"

WScript.ConnectObject application, "on"

End If

session.findById("wnd[0]").resizeWorkingPane 108,20,false

session.findById("wnd[0]/usr/txtRSYST-BNAME").text = "username"

session.findById("wnd[0]/usr/pwdRSYST-BCODE").text = "password"

session.findById("wnd[0]").sendVKey 0