2008 Jun 12 7:56 AM
hi all,
can anyone please tell me that what is the purpose of for all entries? suppose our ITAB is empty and i m using for all entries then what will happen? i will get data or not?
regards saurabh.
2008 Jun 12 7:59 AM
hi,
~for all entries is used to get data from the target table for all the entries in soruce table.it does the work of Join in 2 steps.
first u get the data from table1 and for all the entries fetched u get the data from table2. Using JOIN, it is done by joining 2 tables, table1 and table2 giving the JOIN conditions.
~ if the source table data(itab1) is empty, it will fetch all the data from the db table into itab2.
This is why u check if the source table is empty before fetching the data from the table2.
hi all,
can anyone please tell me that what is the purpose of for all entries? suppose our ITAB is empty and i m using for all entries then what will happen? i will get data or not?
regards saurabh.
2008 Jun 12 7:59 AM
hi,
~for all entries is used to get data from the target table for all the entries in soruce table.it does the work of Join in 2 steps.
first u get the data from table1 and for all the entries fetched u get the data from table2. Using JOIN, it is done by joining 2 tables, table1 and table2 giving the JOIN conditions.
~ if the source table data(itab1) is empty, it will fetch all the data from the db table into itab2.
This is why u check if the source table is empty before fetching the data from the table2.
2008 Jun 12 8:00 AM
You will get data... but all the data !!
Its similar to having a query without any condition !
Purpose of for all entries:
Say you have 10 entries in ITAB1 and you want to select some data from DB1 based on a where condition such that some field F1 = field F2 of ITAB1.
If you had to write .. one way would be to loop on ITAB1 and do a SELECT
But this would be very expensive !! So we do FOR ALL ENTRIES.
ABAP kernel in this case processes the QUERY very fast. Its like a SELECT where F1 = VAL_1 or F1 = VAL_2 or .... (for all entries in the table ITAB1)
I hope you got it !!
2008 Jun 12 8:01 AM
Hi,
When using FOR ALL ENTRIES the number of matching records is restricted to the number of records in the internal table. If the number of records in the database tables is too large then join would cause overheads in performance. Additionally a JOIN bypasses the table buffering.
So for all entries is used for filtering out the data from the two tables based on the entries in them.
check this link
/community [original link is broken]
Thanks
2008 Jun 12 8:01 AM
Hi,
When using FOR ALL ENTRIES the number of matching records is restricted to the number of records in the internal table. If the number of records in the database tables is too large then join would cause overheads in performance. Additionally a JOIN bypasses the table buffering.
So for all entries is used for filtering out the data from the two tables based on the entries in them.
check this link
/community [original link is broken]
Thanks
2008 Jun 12 8:06 AM
Hi,
For all entries command is usefull for combining 2 or more tables.
if first internal table is empty the second internal table values do not consider if the statement like this.
*first select quary
select .....
endselect.
if sy-sybrc ne 0.
for all entries itab1 where<condition>
*Second select statement
if first select statment is empty it is not consider the second select statement
Thanks,
Murali
2008 Jun 12 8:12 AM
Hi,
The internal table itab must not be empty,if it is empty then it will fetch all the records from the tables.
go through this links:
http://www.thespot4sap.com/articles/SAPABAPPerformanceTuning_ForAllEntries.asp
http://www.sapdevelopment.co.uk/tips/tips_select.htm
Regards
Adil