The Join functionality allows to join many tables (and views) on the SAP side and to extract the result.
Possible scenarios would be to join tables for header and item data (for example, a purchase order or invoice) or tables for master data and texts (for example, a material).
To do this, the corresponding SQL command is generated dynamically and executed on the SAP server.
The prerequisite for use is the installation of function module Z_THEO_READ_TABLE in SAP.
Note: Joins of cluster and pool tables are not supported, but can be extracted as individual tables.
To define table joins, follow the steps below:
In the example, the tables MARA and MAKT are to be joined. To do this, add the two tables using the Tables dialog.
Then select the required fields in the tables. The aggregation functions described under Tables and fields are available for selection.
Here is an example of how to return the number of language fields (SPRAS) in table MAKT.
If you switch to the Joins dialog, an Inner Join between the two tables is already predefined. The terms Inner Join and Outer Join are explained here.
Click on the pencil icon for details. In the example the table MARA (left table) was merged with the table MAKT (right table) using the fields MATNR and MANDT with the join type “Inner”.
The settings and links offered are only default values. All components, that is, Left Table, Right Table, Join Type and Join Mapping can be changed subsequently.
- To add more field links, click Add.
- Existing links can be removed with Remove (trash can icon).
- More tables can be added using the Tables and Fields dialog. We recommend that you do not join more than five tables.
Example of a join with a third table:
Auto mapping function
The Auto-map button deletes existing mapping values and performs a new field mapping of identically named fields. This step is optional and may be necessary, for example, if the reference table is only added at the end.