‎2006 Oct 11 1:56 PM
Hi Guys,
I am looking for help regarding performance of the program.
In my Program I am using one internal table with Where condition ,because of the given where condition The process is very slow
"loop at itab where*****"
is there any other solution to improve the performance.
Can I use hash table or sorted internal table, if so specify me how to do this.
Thanks in advance
‎2006 Oct 11 2:00 PM
if you need more than 1 entry to read you have to loop.
if you know how much you have to read you can leave the loop using "exit".
but in the case you are sure you need to get only 1 entry or the first one (after sort) use "read table itab with key field1 = value1 field2 = value2..."
i hope it answer your question.
‎2006 Oct 11 2:09 PM
Read the Rob Burbank blog from early February (7th? 2006).
Sorted table, read first record with key, loop from TABIX until key changes.
‎2006 Oct 11 3:25 PM
And here's the URL:
/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops
Rob
‎2006 Oct 11 2:22 PM
hi Sai,
Try Including all the key fields in the where condition and make sure that you declare your internal table fields in the order as they are in the data base table ...
Reward if it helps,
Regards,
Santosh
‎2006 Oct 11 2:27 PM
Hi,
use below logic to improve performance of loop
use read table with binary search addition./
sort itab1 by matnr.
loop at itab.
read table itab1 with key matnr = itab-matnr
binary search.
if sy-subrc eq 0.
data lv_index type sy-tabix.
clear lv_index.
lv_index = sy-tabix.
loop at itab1 from lv_index.
if itab-matnr <> itab1-matnr.
clear itab.
exit.
endif.
endloop.
endif.
endif.
endloop.
Regards
amole