csehz
asked on
Login to SAP with VBScript
Dear Experts,
Could you please have a look at the attached file and code, it is an VBScript file which is able to login to SAP.
My short question would be that how to continue and for example enter a transaction after?
For example the transaction MMBE, how to call through it?
thanks,
Could you please have a look at the attached file and code, it is an VBScript file which is able to login to SAP.
My short question would be that how to continue and for example enter a transaction after?
For example the transaction MMBE, how to call through it?
thanks,
set WshShell = CreateObject("WScript.Shell")
Set proc = WshShell.Exec("C:\Program Files\SAP\FrontEnd\SAPgui\saplogon.exe")
Do While proc.Status = 0
WScript.Sleep 100
Loop
Set SapGui = GetObject("SAPGUI")
Set Appl = SapGui.GetScriptingEngine
Set Connection = Appl.Openconnection("Test SAP", True)
Set session = Connection.Children(0)
session.findById("wnd[0]/usr/txtRSYST-BNAME").Text = "User"
session.findById("wnd[0]/usr/pwdRSYST-BCODE").Text = "Password11"
session.findById("wnd[0]/usr/txtRSYST-LANGU").Text = "E"
session.findById("wnd[0]").sendVKey 0
VBS-SAP-login.vbs
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
So if somebody will need such solution in the future, the attached code is able to go to SE16 and download a table content in excel automatically
thanks,
Open in new window