1
votes

I am trying to get data from SAP for analysis using RFC_READ_TABLE. It returns Fields correctly. However, when trying to get the rows it returns zero rows.

  theFunc = functionCtrl.Add("RFC_READ_TABLE") '  
    Dim returnFunc As Boolean
    Dim returnParam As Object
    Dim retTab As Object
     theFunc.exports("query_table") = "MSKA"
    theFunc.exports("DELIMITER") = ";"
    theFunc.exports("NO_DATA") = "TRUE"
    theFunc.exports("ROWCOUNT") = "50"

    returnFunc = theFunc.call

     retTab = theFunc.tables("DATA")

msgbox retTab.rows.count ' >>>>>> returns 0

Last step returns zero as records count. The table contains data.When I search for table FIELDS , it returns the table fields correclty. Is this related to security issues?

Regards, Waleed

1

1 Answers

3
votes

You're not getting any data returned because you're populating the NO_DATA parameter (which should be a single character anyway, not TRUE, for example). You're also not providing a WHERE clause (in the OPTIONS table parameter).

From the function module definition:

RFC_READ_TABLE

If you provide NO_DATA with a value of a single space (or omit it, as a single space is the default value) as well as a valid WHERE clause in OPTIONS, you should get data returned.