Read Tables
This section shows how to use the ReadTable class.
A recurrent task when working with SAP and .NET applications is to read directly from tables of the SAP system. The ReadTable class enables access to that data.
Read Data From Tables
To read tables from SAP using ERPConnect:
- 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 (
WhereClauseor 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
Resultattribute.
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
Data Type Mapping
The following table shows the data type mapping between ABAP / RFC and .NET.
| ABAP | ABAP Dictionary | ERPConnect | .NET | Remarks |
|---|---|---|---|---|
| b | INT1 | RFCTYPE INT1 | System Byte | |
| s | INT2, PREC | RFCTYPE INT2 | System Int16 | |
| i | INT4 | RFCTYPE INT | System Int32 | |
| p | DEC, CURR, QUAN | RFCTYPE BCD | System Decimal | Max. supported length is 28 digits |
| decfloat16 | DF16_DEC, DF16_RAW, DF16_SCL | RFCTYPE BYTE | System Byte[] | No ReadTable support |
| decfloat34 | DF34_DEC, DF34_RAW, DF34_SCL | RFCTYPE BYTE | System Byte[] | No ReadTable support |
| f | FLTP | RFCTYPE FLOAT | System Double | |
| c | CUKY, UNIT, CHAR, LCHR, CLNT, LANG | RFCTYPE CHAR | System String | |
| string | STRING | RFCTYPE STRING | System String | No ReadTable support |
| n | NUMC, ACCP | RFCTYPE NUM | System String | Only characters 0_9 ACCP format is YYYYMM |
| d | DATS | RFCTYPE DATE | System String | Format is YYYYMM |
| t | TIMS | RFCTYPE TIME | System String | Format is HHMMSS |
| x | RAW, LRAW | RFCTYPE BYTE | System Byte[] | |
| xstring | RAWSTRING | RFCTYPE XSTRING | System Byte[] | No ReadTable support |
Related Topics
- Samples: Transfer data packets with ReadTable class
- Samples: Get meta data of a table
- Samples: Get CostCenter hierarchies
Last update: June 25, 2026