ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> ERP CRM >> SAP >> ABAP
 
 


 

 
 Basis interview questions  Basis Interview Questions (812)
 ABAP interview questions  ABAP Interview Questions (2422)
 SAPScript interview questions  SAPScript Interview Questions (127)
 SD interview questions  SD Interview Questions (1944)
 MM interview questions  MM Interview Questions (348)
 QM interview questions  QM Interview Questions (8)
 PP interview questions  PP Interview Questions (133)
 PM interview questions  PM Interview Questions (21)
 PS interview questions  PS Interview Questions (20)
 FI CO interview questions  FI CO Interview Questions (1645)
 HR interview questions  HR Interview Questions (434)
 SAP CRM interview questions  SAP CRM Interview Questions (261)
 SRM interview questions  SRM Interview Questions (11)
 APO interview questions  APO Interview Questions (18)
 Business Warehouse interview questions  Business Warehouse Interview Questions (622)
 Business Workflow interview questions  Business Workflow Interview Questions (9)
 SAP Security interview questions  SAP Security Interview Questions (332)
 SAP Interfaces interview questions  SAP Interfaces Interview Questions (4)
 Netweaver interview questions  Netweaver Interview Questions (144)
 SAP ALE IDocs interview questions  SAP ALE IDocs Interview Questions (47)
 SAP B1 interview questions  SAP B1 Interview Questions (57)
 SAP AllOther interview questions  SAP AllOther Interview Questions (90)
Question
In ABAP What is the Use of "FOR ALL ENTRIES" Clause & when 
it is being used. And what it really does?
 Question Submitted By :: ABAP
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
In order to avoid nested select statements we can go
for "FOR ALL ENTRIES".First fetch values from database
table to internal table and only for the values in the
internal table we can fetch values from other database
table based on conditions in the where clause.

it is mandetory that we have to declare allthe primary keys
in either select Stmt or in where condition. orelse
duplicate records will not get selected.
 
Is This Answer Correct ?    65 Yes 2 No
Raghunath
 
Answer
# 2
All abap programers and most of the dba's that support abap
programmers are familiar with the abap clause "for all
entries". Most of the web pages I visited recently, discuss
3 major drawbacks of the "for all entries" clause:

1. duplicate rows are automatically removed
2. if the itab used in the clause is empty , all the rows in
the source table will be selected .
3. performance degradation when using the clause on big tables.

In this post I'd like to shed some light on the third issue.
Specifically i'll discuss the use of the "for all entries"
clause as a means to join tables in the abap code instead of
in db2.

Say for example you have the following abap code:
Select * from mara
For all entries in itab
Where matnr = itab-matnr.

If the actual source of the material list (represented here
by itab) is actually another database table, like:
select matnr from mseg
into corresponding fields of table itab
where .

Then you could have used one sql statement that joins both
tables.
Select t1.*
From mara t1, mseg t2
Where t1.matnr = t2.matnr
And T2..

So what are the drawbacks of using the "for all entires"
instead of a join ?

At run time , in order to fulfill the "for all entries "
request, the abap engine will generate several sql
statements (for detailed information on this refer to note
48230). Regardless of which method the engine uses (union
all, "or" or "in" predicates) If the itab is bigger then a
few records, the abap engine will break the itab into parts,
and rerun an sql statement several times in a loop. This
rerun of the same sql statement , each time with different
host values, is a source of resource waste because it may
lead to re-reading of data pages.

returing to the above example , lets say that our itab
contains 500 records and that the abap engine will be forced
to run the following sql statement 50 times with a list of
10 values each time.
Select * from mara
Where matnr in ( ...)

Db2 will be able to perform this sql statement cheaply all
50 times, using one of sap standard indexes that contain the
matnr column. But in actuality, if you consider the wider
picture (all 50 executions of the statement), you will see
that some of the data pages, especially the root and
middle-tire index pages have been re-read each execution.

Even though db2 has mechanisms like buffer pools and
sequential detection to try to minimize the i/o cost of such
cases, those mechanisms can only minimize the actual i/o
operations , not the cpu cost of re-reading them once they
are in memory. Had you coded the join, db2 would have known
that you actually need 500 rows from mara, it would have
been able to use other access methods, and potentially
consume less getpages i/o and cpu.

In other words , when you use the "for all entries " clause
instead of coding a join , you are depriving the database of
important information needed to select the best access path
for your application. Moreover, you are depriving your DBA
of the same vital information. When the DBA monitors & tunes
the system, he (or she) is less likely to recognize this
kind of resource waste. The DBA will see a simple statement
that uses an index , he is less likely to realize that this
statement is executed in a loop unnecessarily.

In conclusion I suggest to "think twice" before using the
"for all entries" clause and to evaluate the use of database
views as a means to:
a. simplify sql
b. simplify abap code
c. get around open sql limitations.
 
Is This Answer Correct ?    20 Yes 8 No
Arasumani
 
 
 
Answer
# 3
IT IS THE ANOTHER TYPE OF JOINING TECHNIQULE WHARE WE CAN
JOIN MASTER TO HEADER AND HEADER TO ITEM AND SO ON.
INNER JOIN FOR ALL ENTRIES PROVIDES HIGER PERFORMANCE IN
TERMS OF PROCESSING SPEED
 
Is This Answer Correct ?    8 Yes 0 No
Sunil Panghal
 
Answer
# 4
"for all entries" is used when a developer wants to join a
transparent table with a cluster table so as to avoid the
nesting of select statements. It increases the performance
of the program.
 
Is This Answer Correct ?    7 Yes 3 No
Sreehari Patnaik
 
Answer
# 5
For all entry is used to increase the performance at the
time of selecting data from data base, because once
selecting data from the data base and finally put data into
internal table
 
Is This Answer Correct ?    4 Yes 0 No
Rajesh
 
Answer
# 6
FOR ALL ENTRIES IN IS NOTHING BUT INNER JOINS, INNER JOINS IS EXTRACTING A DATA FROM TWO DEPEND TABLES( PRIMARY AND FOREIGN) BUT IN FOR ALL ENTRIES IN EXTRACTING FROM MORE THAN TWO TABLES . MAIN ADVANTAGE OF FOR ALL ENTRIES IN IS IMPROVING PERFORMANCE OF SYSTEM (HOW)..
WE ARE SUPPURATION THE TABLES, AND USING THE INNER TABLE WITH REFERENCE OF FIELD STRINGS TYPE...AND CREATING A FINAL TABLE, IT CONTAINING A TOTAL FIELDS WHICH ARE YOU SELECTED IN
DEPENDENT TABLES ...
 
Is This Answer Correct ?    1 Yes 0 No
Naresh
 
Answer
# 7
One of the major disadvantage of using inner Join on the
database table directly will bypass the buffer in the Appl
layer instead it hits the database directly,which is
performance costly operation.
 
Is This Answer Correct ?    0 Yes 1 No
Goutham
 
Answer
# 8
to avoid duplaction of records 
Is This Answer Correct ?    11 Yes 22 No
Poorna
 
Answer
# 9
For ALL Entries is used to join two different tables. By
tables i mean the internal tables. For All Entries has an
internal where condition in it. which makes the selection
process much faster. But still it is always better to use
inner joins when you have to join two database tables.
 
Is This Answer Correct ?    16 Yes 30 No
Sunil
 

 
 
 
Other ABAP Interview Questions
 
  Question Asked @ Answers
 
hai iam srinivas. I have done client copy in sccl for 800 client and i have stopped the process in middle unexceptedely and after some time iam unable to login into the client 800. error message is incorect password or inclient username. how to refresh the client or solve the problem. please me out in it.   3
what are performence analysis techniques?   2
what is the syntax for eliminating duplicate values in internal table. IBM 5
What is direct input method ?   1
what is template in smartform? Cap-Gemini 5
What type of transport requests? Wipro 2
What type of user exits have you written? Deloitte 3
24) Can we create more than one main window in scripts?   4
what are use of ok_code in bdc Unilogic-Software 4
what are userexits?? how to use it?? whats the importance of them?? can it be used in interactive reporting to directly come to basic list?? Essar 2
Difference between select and select single statement   1
wahts is the diff between the transaction... VD01 and XD01???   1
 
For more ABAP Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com