Skip to content

Joins

This section shows how to set up a reusable SAP Table Join extraction.

The Join functionality allows joining between two and five tables and extracting the result of the join. The required SQL command is generated dynamically, and the join is executed on the SAP server.

Supported Join Types

  • Inner Join
  • Left Outer Join, also referred to as Left Join.

For more information on join types, see SAP Help: Inner Join and Outer Join.

Supported SAP Objects

  • Transparent tables
  • Views
  • ABAP CDS Views - CDS Views based on entities are not supported
  • HANA CDS Views

Note

Cluster or pool tables need to be extracted individually and joined in the destination.

Prerequisites

Before creating extractions, make sure to meet the following requirements:

  • The custom function module THEO/READ_TABLE is installed in the SAP source system.
  • A valid connection to an SAP system is available.
  • The SAP user of the SAP connection has sufficient user rights, see Knowledge Base Article: SAP Authorization Objects
  • A valid connection to a data destination is available.
  • Know the technical name and the columns of the SAP table you want to join.
  • Make sure the table fields you use in a join condition contain the same content/data. Different tables can have identical field / column names, so defining a join condition based on field names alone may not always deliver the expected result, e.g., VBAK~VBELN <> LIPS~VBELN.

Tip

You can fetch the names and descriptions of the tables in your SAP source system using the Xtract Core API.

Create a Join Extraction

Use the following endpoint to create a new table extraction:

POST /v1/extractions/join/{name}
POST /v1/extractions/join/maramakt HTTP/1.1
Host: localhost:1337
Content-Type: application/json
Content-Length: 529

{
  "Tables": [{"Name": ["MAKT","MARA"],"Columns": [["MATNR","MANDT"]]}],
  "Conditions": [{"Left":"MAKT","Right":"MARA","Operator":"inner","FieldMappings":[{"Left":"MATNR","Right":"MATNR"}]}],
  "Where": "MATNR = 000000000001",
  "Source": "s4hana",
  "Destination": "azure",
  "Columns": [["MATNR","MANDT"]],
  "FolderPath": "abcdefgh-1234-ijkl-5679-ijklmnopqrst/SOMETABLE/year=2025/month=12/day=19",
  "ResultName": "resultset"
}
curl -X POST \
     -d '"Tables":[{"Name":["MAKT","MARA"],"Columns":[["MATNR","MANDT"]]}],"Conditions":[{"Left":"MAKT","Right":"MARA","Operator":"inner","FieldMappings":[{"Left":"MATNR","Right":"MATNR"}]}],"Where":"MATNR = 000000000001","Source":"s4hana","Destination":"azure","Columns":[["MATNR","MANDT"]],"FolderPath":"abcdefgh-1234-ijkl-5679-ijklmnopqrst/SOMETABLE/year=2025/month=12/day=19","ResultName":"resultset"' \
     'http://localhost:1337/v1/extractions/join/mara'

fetch('http://localhost:1337/v1/extractions/join/mara', {
  "method": "POST",
  "body": JSON.stringify("Tables":[{"Name":["MAKT","MARA"],"Columns":[["MATNR","MANDT"]]}],"Conditions":[{"Left":"MAKT","Right":"MARA","Operator":"inner","FieldMappings":[{"Left":"MATNR","Right":"MATNR"}]}],"Where":"MATNR = 000000000001","Source":"s4hana","Destination":"azure","Columns":[["MATNR","MANDT"]],"FolderPath":"abcdefgh-1234-ijkl-5679-ijklmnopqrst/SOMETABLE/year=2025/month=12/day=19","ResultName":"resultset")"
});
[Content-Type: application/json] [Content-Length: 673]

Warning

RFC_ERROR_SYSTEM_FAILURE - Illegal access to the right table of a LEFT OUTER JOIN.
Using a WHERE clause on the right table of a LEFT OUTER JOIN is only possible as of SAP Release 7.40, SP05.

For more information about mandatory and optional parameters, refer to the API Reference: Join Extraction.


Last update: September 1, 2025