Skip to main content

Load an ERP Table

Introduction

SAP ERP essentially keeps all of its data in a relational schema. This means that all the data is stored in tables and the relationships between the tables are defined by foreign keys. This is a very common approach in the database world and is also used by many other ERP systems. The main difference between SAP ERP and other ERP systems is that SAP ERP is highly customizable. This means that the tables and their relationships can be changed by the customer. In this document we show you

  • How to show you available ERP tables, their columns and data types
  • How to get texts and other metadata for the columns
  • How to query ERP tables directly from DuckDB

Get yourself prepared

Required authority objects (RFC)

To query a table, far reaching access has to be granted to the user issuing the query. For more information, refer our documentation which designated authority objects (RFC) must be created.

List all available ERP tables

A typical SAP ERP system contains thousands of tables. To find the table you are looking for, you can use the sap_rfc_show_tables function. This function returns a list of all available tables in the SAP ERP system. The function has the following signature:

SELECT * FROM sap_rfc_show_tables()

This will return a (long) list of tables. To find a specific table, you can supply a search string to the function. The search string is matched against the table name and the table description. For example, to find all tables starting with FLIGHT you can use the following query:

SELECT * FROM sap_rfc_show_tables()
WHERE table_name LIKE '%SPFL%'

The star operator * is a wildcard and matches any number of characters. Supplying no search string is equvivalent to *. The result of the query will look like this:

[Continue reading the full documentation...]