In ABAP What is the Use of "FOR ALL ENTRIES" Clause & when
it is being used. And what it really does?

Answers were Sorted based on User's Feedback



In ABAP What is the Use of "FOR ALL ENTRIES" Clause & when it is being used. And wha..

Answer / raghunath

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 ?    78 Yes 4 No

In ABAP What is the Use of "FOR ALL ENTRIES" Clause & when it is being used. And wha..

Answer / arasumani

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 ?    21 Yes 10 No

In ABAP What is the Use of "FOR ALL ENTRIES" Clause & when it is being used. And wha..

Answer / sunil panghal

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 ?    11 Yes 0 No

In ABAP What is the Use of "FOR ALL ENTRIES" Clause & when it is being used. And wha..

Answer / rajesh

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 ?    5 Yes 2 No

In ABAP What is the Use of "FOR ALL ENTRIES" Clause & when it is being used. And wha..

Answer / sreehari patnaik

"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 5 No

In ABAP What is the Use of "FOR ALL ENTRIES" Clause & when it is being used. And wha..

Answer / naresh

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 2 No

In ABAP What is the Use of "FOR ALL ENTRIES" Clause & when it is being used. And wha..

Answer / goutham

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 ?    1 Yes 2 No

In ABAP What is the Use of "FOR ALL ENTRIES" Clause & when it is being used. And wha..

Answer / poorna

to avoid duplaction of records

Is This Answer Correct ?    12 Yes 24 No

In ABAP What is the Use of "FOR ALL ENTRIES" Clause & when it is being used. And wha..

Answer / sunil

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 ?    18 Yes 32 No

Post New Answer

More SAP ABAP Interview Questions

How to get the status of an IDOC in a report without using WE02 transaction ?

1 Answers  


How many tables are there in sap?

0 Answers  


What are the different functions used in sap script? What are the parameters used in each function?

0 Answers  


Wh bapi u have used in rfc?

1 Answers  


2)In production what is the user exit?

0 Answers  






What is parameter id? Where you can find parameter id for a field?

2 Answers   IBM,


how do u add one more field searchhelp screen ?

1 Answers   IBM,


Types of windows and Difference between them in Scripts

2 Answers   EDS,


What is the exact difference between RFC and BAPI ?

9 Answers   HP,


1 . how do u design technical documentation in abap ? 2 . what u currently devloped in sap abap ?

0 Answers   Bristle Cone,


What are the diferent types of internal table available? How can we know the size of the internal tables?

1 Answers   Genpact,


What is the difference between call transaction method and the session method? : abap bdc

0 Answers  


Categories
  • SAP Basis Interview Questions SAP Basis (1262)
  • SAP ABAP Interview Questions SAP ABAP (3939)
  • SAPScript Interview Questions SAPScript (236)
  • SAP SD (Sales & Distribution) Interview Questions SAP SD (Sales & Distribution) (2716)
  • SAP MM (Material Management) Interview Questions SAP MM (Material Management) (911)
  • SAP QM (Quality Management) Interview Questions SAP QM (Quality Management) (99)
  • SAP PP (Production Planning) Interview Questions SAP PP (Production Planning) (523)
  • SAP PM (Plant Maintenance) Interview Questions SAP PM (Plant Maintenance) (252)
  • SAP PS (Project Systems) Interview Questions SAP PS (Project Systems) (138)
  • SAP FI-CO (Financial Accounting & Controlling) Interview Questions SAP FI-CO (Financial Accounting & Controlling) (2766)
  • SAP HR (Human Resource Management) Interview Questions SAP HR (Human Resource Management) (1180)
  • SAP CRM (Customer Relationship Management) Interview Questions SAP CRM (Customer Relationship Management) (432)
  • SAP SRM (Supplier Relationship Management) Interview Questions SAP SRM (Supplier Relationship Management) (132)
  • SAP APO (Advanced Planner Optimizer) Interview Questions SAP APO (Advanced Planner Optimizer) (92)
  • SAP BW (Business Warehouse) Interview Questions SAP BW (Business Warehouse) (896)
  • SAP Business Workflow Interview Questions SAP Business Workflow (72)
  • SAP Security Interview Questions SAP Security (597)
  • SAP Interfaces Interview Questions SAP Interfaces (74)
  • SAP Netweaver Interview Questions SAP Netweaver (282)
  • SAP ALE IDocs Interview Questions SAP ALE IDocs (163)
  • SAP Business One Interview Questions SAP Business One (110)
  • SAP BO BOBJ (Business Objects) Interview Questions SAP BO BOBJ (Business Objects) (388)
  • SAP CPS (Central Process Scheduling) Interview Questions SAP CPS (Central Process Scheduling) (14)
  • SAP GTS (Global Trade Services) Interview Questions SAP GTS (Global Trade Services) (21)
  • SAP Hybris Interview Questions SAP Hybris (132)
  • SAP HANA Interview Questions SAP HANA (700)
  • SAP PI (Process Integration) Interview Questions SAP PI (Process Integration) (113)
  • SAP PO (Process Orchestration) Interview Questions SAP PO (Process Orchestration) (25)
  • SAP BI (Business Intelligence) Interview Questions SAP BI (Business Intelligence) (174)
  • SAP BPC (Business Planning and Consolidation) Interview Questions SAP BPC (Business Planning and Consolidation) (38)
  • SAP BODS (Business Objects Data Services) Interview Questions SAP BODS (Business Objects Data Services) (49)
  • SAP BODI (Business Objects Data Integrator) Interview Questions SAP BODI (Business Objects Data Integrator) (26)
  • SAP Ariba Interview Questions SAP Ariba (9)
  • SAP Fiori Interview Questions SAP Fiori (45)
  • SAP EWM (Extended Warehouse Management) Interview Questions SAP EWM (Extended Warehouse Management) (58)
  • Sap R/3 Interview Questions Sap R/3 (150)
  • SAP FSCM Financial Supply Chain Management Interview Questions SAP FSCM Financial Supply Chain Management (101)
  • SAP WM (Warehouse Management) Interview Questions SAP WM (Warehouse Management) (31)
  • SAP GRC (Governance Risk and Compliance) Interview Questions SAP GRC (Governance Risk and Compliance) (64)
  • SAP MDM (Master Data Management) Interview Questions SAP MDM (Master Data Management) (0)
  • SAP MRS (Multi Resource Scheduling) Interview Questions SAP MRS (Multi Resource Scheduling) (0)
  • SAP ESS MSS (Employee Manager Self Service) Interview Questions SAP ESS MSS (Employee Manager Self Service) (13)
  • SAP CS (Customer Service) Interview Questions SAP CS (Customer Service) (0)
  • SAP TRM (Treasury and Risk Management) Interview Questions SAP TRM (Treasury and Risk Management) (0)
  • SAP Web Dynpro ABAP Interview Questions SAP Web Dynpro ABAP (198)
  • SAP IBP (Integrated Business Planning) Interview Questions SAP IBP (Integrated Business Planning) (0)
  • SAP OO-ABAP (Object Oriented ABAP) Interview Questions SAP OO-ABAP (Object Oriented ABAP) (70)
  • SAP S/4 HANA Finance (Simple Finance) Interview Questions SAP S/4 HANA Finance (Simple Finance) (143)
  • SAP FS-CD (Collections and Disbursements) Interview Questions SAP FS-CD (Collections and Disbursements) (0)
  • SAP PLM (Product Lifecycle Management) Interview Questions SAP PLM (Product Lifecycle Management) (0)
  • SAP SuccessFactors Interview Questions SAP SuccessFactors (33)
  • SAP Vistex Interview Questions SAP Vistex (0)
  • SAP ISR (IS Retail) Interview Questions SAP ISR (IS Retail) (28)
  • SAP IdM (Identity Management) Interview Questions SAP IdM (Identity Management) (0)
  • SAP IM (Investment Management) Interview Questions SAP IM (Investment Management) (0)
  • SAP UI5 Interview Questions SAP UI5 (59)
  • SAP SCM (Supply Chain Management) Interview Questions SAP SCM (Supply Chain Management) (51)
  • SAP XI (Exchange Infrastructure) Interview Questions SAP XI (Exchange Infrastructure) (49)
  • SAP Cloud Platform Interview Questions SAP Cloud Platform (34)
  • SAP Testing Interview Questions SAP Testing (89)
  • SAP SolMan (Solution Manager) Interview Questions SAP SolMan (Solution Manager) (63)
  • SAP MaxDB Interview Questions SAP MaxDB (116)
  • SAP GUI Interview Questions SAP GUI (15)
  • SAP AllOther Interview Questions SAP AllOther (329)