Automatic Logon in SAP Bexanalyzer by Vbaproject

Asked

Viewed 866 times

4

(UPDATED)

In excel I have a supplement that gives access to the BI system, to access / stratify data in a query already specified / structured. In my Vbaproject I am referencing the Add-in to call some specific functions of this Add-in in an Auto_open, IE, initialize now when opening the spreadsheet.

In the research I did, the closest I got was the following script:

Sub LogonToBEx2()
Application.AutomationSecurity = msoAutomationSecurityLow

logonToBW3
End Sub
Function logonToBW3() As Boolean

logonToBW3 = False

On Error Resume Next

Dim myConnection As Object
Set myConnection = Run("BExAnalyzer.XLA!SAPBEXgetConnection")

With myConnection
 .client = "800"
 .user = "usuario"
 .Password = "senha"
 .Language = PT
 .systemnumber = 1
 .system = "B1P"
 .systemid = ""
 .ApplicationServer = "B1PGroup"
 .SAProuter = ""
 .LogOn 0, True
 If .IsConnected <> 1 Then
 .LogOn 0, False
 If .IsConnected <> 1 Then
 MsgBox "something went wrong with LogOn"
 Exit Function
 End If
 End If
End With
End Function

Login window prompts the user:

Mandate: User: Password: Language:

The window already comes with the data I called in the script, but the logon does not run automatically, and even giving OK, the following error is presented:

SAP_CMINIT# : rc=20 > Connect to SAP gatway failed

Besides the above mentioned error, calling the Logon function is not enough. I need, somehow, to structure the script to feed the information of the variants and follow with OK.

1 answer

0

Good afternoon. From what I understand of the function call you can pass only the parameters referring to what you need for the login. Ex.:

dim myUser as String

myUser = "Usuário"

Call LogOn(iUser:= myUser)

Makes sense to you?

  • makes sense Edu, I haven’t tested yet but I will return soon.

  • I went deeper into the Edu survey, and the closest I got was the post update I just did. but of qqr way, test the call logon, but it just does not possess in this function Logon the argument for iPassword.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.