If you want to create automated reports with data from an SAP ERP or Business Warehouse system, you first need to connect to a SAP system. The connection can be used later to access system tables in the ERP or Business Warehouse or to trigger various other action.
Dim myConnection As Object
Set myConnection = CreateObject("SAP.Functions")
.Connection.System = "ABC" 'Systemname
.Connection.client = "100" 'Client
.Connection.user = "xyz" 'User
.Connection.password = "123" 'Password
.Connection.Language = "DE" 'Language
.Connection.systemnumber = "00" 'Systemnumber
.Connection.hostname = "" 'Hostname
If myConnection.Connection.logon(0, False) <> True Then Exit Function
Due to the parameters False in the connection following Logon screen appears. Should this not be displayed, the parameter must be changed from False to
Since Analysis Office the connection is a little bit different, you now have to use the Analysis Office API command SAPLogon. Here is an example Application.Run("SAPLogon", "DS_1", "MyClient", "MyUser", "MyPWD", "EN")
These posts might also be interesting:
You want to know SAP Analysis Office in a perfect detail?
You want to know how to build an Excel Dashboard with your Query in Analysis Office?
You want to know how functions in SAP Analysis Office works?
Then you have to take a look into Analysis Office - The Comprehensive Guide.