ReadData
This command executes a read-only SQL statement against the ERP system. Note: In the case of SAP, the business function RFC_READ_TABLE is used and it is not an officially released BAPI and has significant limitations. Therefore it may not work with all versions of SAP. If this is the case, please contact support for a solution.
Group: Enterprise Resource Planning Extensions
Syntax: [bValue =] ERP.ReadData(sSQL, sCols, sRows)
bValue (Boolean) Optional – A True/False notification that the command processed successfully
sSQL (String) the SQL statement to be executed on the ERP table
sCols (String) a variable containing the columns of the resulting data
sRows (String) a variable containing the rows of resulting data
SAP Limitations – since the RFC_READ_TABLE function is used, SQL statements must specify at least 1 field. Using an asterisk (*) or a function will not be accepted. Examples are “select * ”, “select count(*) “, select SUM(QTY) …”, etc. Only a comma-delimited list of field names is acceptable. Finally you may only specify 1 table in the SQL statement, no joins.
For example, if you would like to retrieve the Material numbers from a table, such as the Material Documents table within SAP, specify the following:
Example:
Dim bValue As Boolean
bValue = ERP.ReadData("select MATNR from MSEG", sCols, sRows)