2008/10/14

FOR ALL Entries ZZ

Use of FOR ALL Entries

Use of FOR ALL Entries

http://www.thespot4sap.com/articles/SAPABAPPerformanceTuning_ForAllEntries.asp

Outer join can be created using this addition to the where clause in a select statement. It speeds up the performance tremendously, but the cons of using this variation are listed below

  1. Duplicates are automatically removed from the resulting data set. Hence care should be taken that the unique key of the detail line items should be given in the select statement.
  2. If the table on which the For All Entries IN clause is based is empty, all rows are selected into the destination table. Hence it is advisable to check before-hand that the first table is not empty.
  3. If the table on which the For All Entries IN clause is based is very large, the performance will go down instead of improving. Hence attempt should be made to keep the table size to a moderate level.

Not Recommended

            Loop at int_cntry.

             Select single * from zfligh into int_fligh

 where cntry = int_cntry-cntry.

 Append int_fligh.

            Endloop.

 

Recommended

            Select * from zfligh appending table int_fligh

            For all entries in int_cntry

            Where cntry = int_cntry-cntry.

No comments: