通过excel vba脚本和bexanalyzer静默登录到SAP BW服务器

时间:2018-07-06 16:09:31

标签: excel vba sap

我们正在使用BExAnalyzer 7.5运行SAP BW。我一直在尝试建立与SAP-Server的连接的几天,但不幸的是,我什至没有收到错误消息。因此,似乎登录已成功,但是未从BW提取任何数据,因此我假设登录中存在问题。请帮忙!

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

1 个答案:

答案 0 :(得分:1)

SAP Note 2541995说,原因是7.5中的密码属性不可用。如果您使用的是单一登录(SSO),则建议您可以重新连接。它还指出了注意事项2635165,这是一个前端补丁程序,可以解决password属性的问题。您随附的代码确实适用于7.4版,而7.5版也遇到了类似的问题,但是没有下载修补程序的权限。我将尝试获取前端补丁并再次进行测试,并用结果更新答案。

相关问题