Total No. Of Records Processed Is: 8,882
Total Time Taken To Process Data Is (In ms): 4,294

CASE III:

If the internal table definition is changed to:

DATA: it_marc TYPE SORTED TABLE OF x_marc WITH NON-UNIQUE KEY matnr.

OUTPUT:

Total No. Of Records Processed Is: 8,882
Total Time Taken To Process Data Is (In ms): 3,192

CASE IV:

If the internal table definition is changed to:

DATA: it_marc TYPE SORTED TABLE OF x_marc WITH NON-UNIQUE KEY werks.

OUTPUT:

Total No. Of Records Processed Is: 8,882
Total Time Taken To Process Data Is (In ms): 1,607

Looking at all the cases, we can now see that CASE IV is the most effective way of using sorted table for better efficiency. Here the key partly contains the table key and hence the access is efficient.

Please mail all your contributions to administrator@abapmadeeasy.com We request you to mention your Name, Designation, Experience & Organization you are working for. Your posts will be verified and posted in this site with your name.