Read Tables
The following sample shows how to use the ReadTable class to read data from an SAP table and how to process the ADO.NET result table object.
Read Data From Tables
Follow the steps below to read tables from SAP:
- Connect to the SAP system using
R3Connection
. - Create a table object using
ReadTable()
. - Specify the name of the SAP table using
TableName
. - Specify the columns you want to read using
AddField()
. - Optional: Specify additional parameters, e.g., WHERE Clause (
WhereClause
or maximum number of rowsRowCount
). - Optional: Specify the function module that is used to read the table using
SetCustomFunctionName()
. The default is RFC_READ_TABLE. - Read the SAP table using
Run()
. - Access the table using the
Result
attribute.
Output:
000000000000000023 Pawan Kalyan_08
000000000000000038 Test US colleagues upd4
000000000000000043 English Check 25_01
000000000000000058 Ventilation, complete build
000000000000000059 Filter Ereteam
000000000000000068 a portable 1 ton crane
000000000000000078 Component Full Repair Service ...
000000000000000088 AS-100 T-shirt XL
000000000000000089 AS-100 T-shirt
000000000000000098 PCB Subassembly
Related Links
- Samples: Transfer data packets with ReadTable class
- Samples: Get meta data of a table
- Samples: Get CostCenter hierarchies
Last update: May 21, 2024