VBS script to login to SAP
Set WshShell = CreateObject("WScript.Shell")
Set proc = WshShell.Exec("C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe")
WScript.Sleep 4000
Set SapGui = GetObject("SAPGUI")
Set application = SapGui.GetScriptingEngine
Set connection = application.OpenConnection("SAP System Name as per GUI", True)
Set Session = connection.children(0)
session.findById("wnd[0]/usr/txtRSYST-BNAME").text = "USERID"
session.findById("wnd[0]/usr/pwdRSYST-BCODE").text = "PASSWORD"
session.findById("wnd[0]").sendVKey 0