RWatermelon
RWatermelon

Reputation: 63

Silent logon to SAP BW server via Excel VBA script and bexanalyzer

We are running SAP BW with BExAnalyzer 7.5. I've been trying for days to establish a connection to the SAP BW server, but unfortunately I am not even receiving an error message. So it seems the logon has succeeded, but no data from BW is fetched, so I am assuming there is a problem in the logon. Please help!

Function LogonToServer() As Boolean
   LogonToServer = False
   Dim myConnection As Object
   Set myConnection = Run("'C:\Program Files (x86)\Common Files\SAP Shared\BW\BExAnalyzer.xla'!SAPBEXgetConnection")
   With myConnection
      .client = "xxx"
      .user = "xxx"
      .Password = "xxxx"
      .Language = "DE"
      .systemnumber = "xxx"
      .system = "xxx"
      .ApplicationServer = "xxx"
      .SAProuter = ""
      .Logon 0, True
   End With
   If myConnection.IsConnected <> 1 Then
      'launch the Logon Dialog for manual connection
      myConnection.Logon 0, False
         If myConnection.IsConnected <> 1 Then
            MsgBox "something went wrong ..."
            Exit Function
         End If
   End If
   If myConnection.IsConnected = 1 Then
      LogonToServer = True
   End If
   Run "BExAnalyzer.xla!SAPBEXinitConnection"
End Function

Upvotes: 1

Views: 2242

Answers (1)

mperry
mperry

Reputation: 91

SAP Note 2541995 says that the cause is that the Password property is not available in 7.5. It suggests that you can reconnect if you are using Single Sign On (SSO). It also points to note 2635165 that is a front end patch that may fix the issue with the password property. The code you attached does work with version 7.4 and I experienced similar issues with 7.5 but do not have access to download the patch. I'll try and get the front end patch and test again and update my answer with the results.

Upvotes: 1

Related Questions