08-22-2007 9:36 AM
Hi,
WHAT R THE EFFECTS OF ISSUING NESTED LOOPS STATEMENTS INSIDE A PROGRAM?HOW TO OVERCOME THAT PROBLEM?
08-22-2007 9:41 AM
hI Basu
use read statement instead of loop....
please close u r previous threads which are opened
08-22-2007 10:14 AM
hi,
It will affect on performance, so use read statement within loop instead of nested loop.
Thanks,
Prashant
08-22-2007 2:43 PM
In nested loop
for every outer loop, it wants to match the inner loop.
so no of hit is MxN.
u should avoid it.
08-22-2007 2:46 PM
select from table1 to an internal table it1.
select from table2 to an internal table it2 for all entries in table it1.
now
loop at it2.
read table it1 matching common key.
if sy-subrc eq 0.
put inanother internal table.
endif.
endloop.
08-22-2007 4:11 PM
hi
good
Loops
In a loop, a statement block is executed several times in succession. There are four kinds of loops in ABAP:
· Unconditional loops using the DO statement.
· Conditional loops using the WHILE statement.
· Loops through internal tables and extract datasets using the LOOP statement.
· Loops through datasets from database tables using the SELECT statement.
This section deals with DO and WHILE loops. SELECT is an Open SQL statement, and is described in the Open SQLsection. The LOOP statement is described in the sections on internal tables and extract datasets.
http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3564358411d1829f0000e829fbfe/content.htm
thanks
mrutyun^