‎2008 May 02 5:49 AM
Hi Experts,
I have a requirement where in i want to check whether each of the programs stored in one internal table are called from any of the programs stored in another internal table. In this case i am looping on two internal tables (Loop within a loop) which is causing a major performance issue. Program is running very very slow.
Can any one advise how to resolve this performance issue so that program runs faster.
Thanks in advance.
Regards,
Chetan.
‎2008 May 02 6:00 AM
Hi,
How are your internal tables defined? Is either table defined as SORTED or HASHED?
If not, that would help a lot with performance.
Regards, Andy
‎2008 May 02 7:33 AM
hi,
Use Paraller Cursor Cursor concept it will reduce the time very much
[http://www.saptechnical.com/Tutorials/ABAP/ParallelCursor.htm]
This link would help u to understand better
Regards,
priya
‎2008 May 02 9:44 AM
Forget the parallel cursur stuff, it is much to complicated for general usage and helps nearly nothing. I will publish a blog in the next days where this is shown in detail.
Loop on loop is no problem if the inner table is a hashed or sorted table.
If it must be a standard table, then you must make a bit more effort and faciliate a binary search (read binary search / loop from index exit)
see here the exact coding Measurements on internal tables: Reads and Loops:
/people/siegfried.boes/blog/2007/09/12/runtimes-of-reads-and-loops-on-internal-tables
And don't forget, the other table must not be sorted, the loop reaches anyway every line. The parallel cursor requires both tables to be sorted. The additional sort
consumes nearly the whole advantage of the parallel cursor compared to the simple but good loop in loop solutions.
Siegfried