2007 Sep 12 11:44 AM
Hi All,
I ahve doubt regarding Where clause in LOOP.
Which one will give better performance.
1. LOOP AT i_tab INTO wa_tab WHERE ......conditions
..Processing.
ENDLOOP.
2. LOOP AT i_tab INTO wa_tab.
IF conditions
..Processing.
ENDIF.
ENDLOOP.
Is it depends on total number of records/no of records that satisfy where clause in any way?
Regards,
Vinod.
Hi Vinod,
actually it depends on the indexing of the table, if indexing is well defined than first will be better else both are nearly same..
Regards
Anuj
2007 Sep 12 11:46 AM
Hi,
LOOP AT i_tab INTO wa_tab WHERE ......conditions
..Processing.
ENDLOOP.
is the best way at any time.
it doesn't depend on the number of records.
rgds,
bharat.
2007 Sep 12 11:46 AM
Hi,
This will give better performance..
1. LOOP AT i_tab INTO wa_tab WHERE ......conditions
..Processing.
ENDLOOP.
Regards,
Nagaraj
2007 Sep 12 11:47 AM
hi
the first option would be better,
at the begining of the loop only, all the not required rows are removed.
always prefer the 1st option for performance issue.
Regards,
Prasant
*reward if useful
2007 Sep 12 11:49 AM
Hi Vinod,
actually it depends on the indexing of the table, if indexing is well defined than first will be better else both are nearly same..
Regards
Anuj
2007 Sep 13 6:46 AM
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |