on 2018 Mar 02 11:33 PM
Experts,
I am trying VBA RFC call to SAP from MS Excel,
Please help me with the VBA code as it not getting the expected results:
------------------------------------------------------------------------------------------------------------------
Set sap = CreateObject("SAP.Functions")
Set rfc = sap.Add("rfc_read_table")
rfc.Exports("QUERY_TABLE") = "T001"
[Error 1: The following 2 lines does not stop the code but results include the entire table]
rfc.Tables("OPTIONS").Rows.Add
rfc.Tables("OPTIONS").Value(1, "TEXT") = "BUKRS EQ 'US71'"
If rfc.Call() = True Then
total_rec = rfc.Tables("DATA").RowCount
MsgBox total_rec
End If
So to sum it up:
1) If I add ROWS to OPTIONS: these lines are not processed
2) If I add ROWS to FIELDS: RFC call fails.
Can you please help me resolve this
Request clarification before answering.
User | Count |
---|---|
78 | |
12 | |
9 | |
8 | |
7 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.