Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10671

Re: Performance: The optimal way to change the content of internal table

$
0
0

Thanks guys, let me specify the question with some example.

 

Let say I have an internal table, where one of the columns is a language, e.g. «EN-US», «EN-CA», «FR-CA» etc., now I want to replace all language values from «EN-US» to «EN-GB».

 

I can do it with:

  1. LOOP AT itab ASSIGNING<wa>.
  2.         IF<wa>-lang ='EN-US'.
  3.                 <wa>-lang ='EN-GB'.
  4.         ENDIF.
  5. ENDLOOP.

 

or with:

  1. wa-lang ='EN-GB'.
  2. MODIFY itab FROM wa TRANSPORTING lang WHERE lang ='EN-US'.

 

My question, what is the optimal approach from performance point of view to implement such logic for case with long and short itabs.

In some places I heard, that the second one is better, but I would like to get some theoretically supported explanation.

 

Thanks.


Viewing all articles
Browse latest Browse all 10671

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>