CONCEPTS OF INNER JOIN AND OUTER JOIN in SAP ABAP
CONCEPTS OF INNER JOIN AND OUTER JOIN:
I want to get the data from multiple tables than we have to go for joins. There are 2 types of joins available in SAP.They areā¦
1. Inner join.
2. Left outer join.
It is very important to remember that whenever we want to join the tables it is mandatory that there should be at least one common field between them. Without a common field between the tables we can not join the tables. For taking the common field you should not consider MANDT field. So common field may be primary key field / other field.
INNER JOIN - This is exactly like intersection / logical AND operator. Also this inner join will fetch the data from the tables if the record is available in all the tables that you are joining. So if it is not available in one of the tables, the data will not be fetched.
LEFT OUTER JOIN : This is like union. But it is not exactly like union. Whenever left outer join is used in select query, it will fetch all the records from left side table & the common records from right side table.
So Inner join between table 1 & table 2, where column D in both tables in the join condition is set the same:
Table 1: Table 2
\ /
\ /
\ /
\ /
Inner Join:
\ /
\ /
\ /
Inner Join:

2. Left outer join between table 1 & table 2 where column D in both tables set the join condition:
Table 1: Table 2:
\ /
\ /
\ /
\ /
\ /
Left Outer Join:
thanks
ReplyDelete