Application Development and Automation 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: 
Read only

For all entries

Former Member
0 Likes
856

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
834

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.

6 REPLIES 6
Read only

Former Member
0 Likes
835

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.

Read only

former_member69765
Contributor
0 Likes
834

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 !!

Read only

Former Member
0 Likes
834

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

Read only

Former Member
0 Likes
834

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

Read only

Former Member
0 Likes
834

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

Read only

Former Member
0 Likes
834

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