Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

difference between inner join and for all entries

Former Member
0 Kudos

hi

experts

please answer me

difference between inner join and for all entries

2 REPLIES 2

Former Member
0 Kudos

hi,

Inner Join : here you are going to use two database tables having common fields, on the basis of which you will fetch the data.

ex. select afield1 bfield2 a~field3 into table itab where DB1 as a join DB2 as b on <specify the condtion on common field>

For all entries: Here at first you are going to fetch data from Db1 into itab1 for specified condition. then again you will use one more select query to fetch the values from DB2 for the corresponding entries in internal table itab1.

Ex select f1 f2 field into table itab1 from DB1 where <condition>

select f3 f4 into tabe itab2 from DB2 for all entries in itab1

where field = itab1-field and <other conditions>

Former Member
0 Kudos

Hi,

Inner Join: Retrieves data from Data base tables based on the 'WITH KEY' fields which you have mentioned in your 'SELECT' query. It also depends on the 'WHERE' condition. In total the 'Inner Join' is filtering the data at DATABASE LEVEL.

for all entries: let us take a simple example to disclose the beauty of 'FOR ALL ENTRIES'.

IT_KNA1 is an internal table which has been used to retrieve the customers from KNA1 table.

IT_VBAK is an internal table which, you are going to use to retrieve the sales orders from VBAK table for the IT_KNA1 internal table customers.

slect vbeln

erdat

from VBAK

for all entries IT_KNA1

where erdat in s_erdat.

the above select query can extracts the Sales Orders for the customers in IT_KNA1 based on the selection screen input S_ERDAT.

if IT_KNA1 is empty....what would happend to the above select query.

The above select query will work fine, provided it will extract all the data(for all customers in KNA1 table) in between the selection screen input S_ERDAT, which is one way or other way burden on the data base.

SO WHILE USING 'FOR ALL ENTRIES', ITS USERS RESPONSIBILITY TO CHECK THE INITIALITY OF THE FIRST INTERNAL TABLE. (IT_KNA1 IN OUR CASE).