Skip to content

Read SAP Tables Directly

The following sample shows how to use the ReadTable class to select data from the SAP table MAKT and how to process the ADO.NET result table object.


This sample reads the material description texts of the SAP table MAKT.

  • Read the columns MATNR (material number) and MAKTX (material text).
  • Add a corresponding WHERE statement SPRAS='EN' to make sure only the English language texts are read (SPRAS is the column that contains the language keys).

Read Table

Table MAKT
using System;
using System.Data;
using ERPConnect;
using ERPConnect.Utils;

// Set your ERPConnect license

// Open the connection to SAP
using var connection = new R3Connection(
    host: "",
    systemNumber: 00,
    userName: "user",
    password: "passwd",
    language: "EN",
    client: "001")
    Protocol = ClientProtocol.NWRFC,


var table = new ReadTable(connection)
    WhereClause = "SPRAS = 'EN'",
    TableName = "MAKT",
    RowCount = 10

// Select columns to read

// Specify a function module that is used to read the table


DataTable result = table.Result;
for (int i = 0; i < result.Rows.Count; i++)
    Console.WriteLine($"{result.Rows[i]["MATNR"]} {result.Rows[i]["MAKTX"]}");



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