I want to send data from Excel via a RFC-Connector to SAP software.
For the RFC function module, I must fill a table as an input parameter. Comparable to the RFC function module STFC_DEEP_TABLE
.
My VBA code stops at the with statement with the error:
“Object variable or With block variable not set”.
Sub RFC_DEEP_TABLE()
Dim sapConn As Object
Set sapConn = CreateObject("SAP.Functions")
If sapConn.Connection.Logon(0, False) <> True Then
MsgBox "Cannot Log on to SAP"
End If
Dim objRfcFunc As Object
Set objRfcFunc = sapConn.Add("STFC_DEEP_TABLE")
With objRfcFunc
.Exports.Item("IMPORT_TAB").value("STR") = "X" 'Objectvariable oder With-Blockvariable nicht festgelegt
End With
If objRfcFunc.Call = False Then
MsgBox objRfcFunc.Exception
End If
End Sub