‎2006 Jun 29 6:58 AM
Hi all,
I have generated report using nested loops.if i give some 200 hits ,it generates the report within 90 seconds.but if the hit limit increases above 500,the loop becomes infinite.i have checked the datas as well as select Queries,everything is fine.why it happens.please help me if u know the solution.
thanks in advance,
raj
‎2006 Jun 29 2:41 PM
Check this <a href="/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops">blog.</a>Rob
‎2006 Jun 29 7:00 AM
Hi,
1). Try to avoide nested loops.
2). Try using READ WITH BINARY SEARCH
3). Use a SORTED TABLE the access is fast
Post urt code to let u know where u can fine tune the program.
Cheers
VJ
‎2006 Jun 29 7:14 AM
Hi vijay & anirban,
I have implemented the solutins whatever u have given.i have cross verified with my colleagues also.but this situation behaves very strange.i ll post my code .just go through that code and let me know where ia have to fine tune
thanks
raj
‎2006 Jun 29 8:20 AM
‎2006 Jun 29 7:03 AM
There should be no reason why the program goes into an infinite loop pass with a larger number of records, unless there is some problem with one of the records it is trying to access.
It seems to me that one of the records in the 500 has some problem, and that is why the system behaves strangely in that case. You can do some trouble shooting, for eg, have the system download a file with the loop pass number, so that you know at which loop pass it went into an infinite loop, and analyze the same.
Hope this helps.
Sudha
‎2006 Jun 29 7:08 AM
Hi sudha,
I tried first 200 records,then 200 records like this i have checked upto 1000 records.the system produes the results within short time.but when i have checked above 500 ,it creates infinite loop.but sometimes the report comes after an 1 hour for 500 records.
thanks
raj
‎2006 Jun 29 7:05 AM
hi
There are couple of solutions to this
a) try defining a sarted internal table for the inside table with the keys that you define in the where clause of your inside loop.
b) You can try the below code
loop at itab1.
read table itab2 with key .......
l_tabix = sy-tabix.
loop at itab2 from l_tabix.
<check the validity condition>
endloop.this could kill about 3/4 of the time before
Hope this Helps
Anirban
‎2006 Jun 29 2:41 PM
Check this <a href="/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops">blog.</a>Rob