Tuesday, 26 June 2018

How to log in to SAP server using user ID & password.

You can use the SAPGuiutil object to open connections. All you need to do is to pass the server name taht you want to log into followed by userid and password. Please find the below code

Sapguiutil.OpenConnection “A:Test Server”
SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("User").Set UserID
SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("Password").SetSecure Password
SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiButton("Enter").Click