‎2010 Jul 15 8:04 AM
Hii,
I have a strange problem on hand.
I have nested loops which contains a lot of records approx 50,000
I have used parallel cursor technique which uses to sort the tables beforehand.
When I use parallel cursor I get wrong results due to the fact I'm sorting tables.
Which other techniques do I have to make this nested loop faster.
What about Field Symbols.
Varun
‎2010 Jul 15 8:06 AM
Try using READ Statememnt where ever possible
‎2010 Jul 15 8:10 AM
>
> Try using READ Statememnt where ever possible
There are possibilities of having multiple entries in both the tables.
I don't think read would suffice though let me check.
‎2010 Jul 15 8:42 AM
Hi,
Define inner loop table as sorted table with non unique key and apply where condition.
Both table have same data or not ?
Kind rgds
Ravi Lanjewar
‎2010 Jul 15 9:32 AM
Hi,
Parallel cursor is the best option for nested loop. It should work fine in all the cases. If you can post your code (Parallel cursor part) we could figure out.
Make sure, it is in the following way.
SORT gt_likp BY vbeln.
SORT gt_lips BY vbeln.
LOOP AT gt_likp INTO gwa_likp.
LOOP AT gt_lips INTO gwa_lips FROM gv_index.
IF gwa_likp-vbeln NE gwa_lips-vbeln.
gv_index = sy-tabix.
EXIT.
ENDIF.
" Inner loop Coding Here
ENDLOOP.
ENDLOOP.Field symbols do not help in your case.
‎2010 Jul 15 12:28 PM
> Parallel cursor is the best option for nested loop. It sho
incorrect
Use a sorted table as the inner table, this is the way to go!
Otherwise you must program the optimization with BINARY SEARCH by yourself, it is one of the most frequent recommendations.
Stay away from nested cursor, it is complicated and not worth the effort.
Use ASSIGNING for the LOOPs, this is a small improvement of top.