
Applies to: SAP BW (INA Provider) connections.
This API enables you to connect to a query and to set the query variables, if any.
Using the Variables and Variable values parameters, if you do not specify all the variables to be set for the query, the dialog box Set Variables is displayed and enables you to specify the variables.
| Parameter | Description |
|---|---|
| ConnectionString As String |
Connection. Mandatory. For details about the syntax you must use, see ConnectionString Parameter - Syntax |
| Login As String |
Login to the connection. Optional |
| Password As String |
Password to the connection. Optional |
|
Variables As String |
Specify in a table the variables to be set for the query. Note that the table must contain at least one value |
|
Variable values As String |
Specify in a table the values corresponding to the variables specified. Note that the table must contain at least one value. |
Example with variables:
Sub test()
Dim cofCom As Object
Dim api As Object
Dim connectionString As String
Dim variableKeys(3) As String
Dim variableValues(3) As String
Set cofCom = Application.COMAddIns("SapExcelAddIn").Object
Set api = cofCom.GetPlugin("com.sap.epm.FPMXLClient")
variableKeys(0) = "variable1"
variableKeys(1) = "variable2"
variableKeys(2) = "variable3"
variableValues(0) = "ValueForVariable1"
variableValues(1) = "ValueForVariable2"
variableValues(2) = "ValueForVariable3"
connectionString = "SAP BW ConnectionStringWithVariable"
api.ConnectQuery connectionString, "user", "password", variableKeys, variableValues
End SubExample without variables:
Sub test()
Dim cofCom As Object
Dim api As Object
Dim connectionString As String
Dim variableKeys(0) As String
Dim variableValues(0) As String
Set cofCom = Application.COMAddIns("SapExcelAddIn").Object
Set api = Application.COMAddIns("FPMXLClient.Connect").Object
connectionString = "SAP BW ConnectionStringWithoutVariable"
api.ConnectQuery connectionString, "user", "pass", variableKeys, variableValues
End Sub