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:
- LOOP AT itab ASSIGNING<wa>.
- IF<wa>-lang ='EN-US'.
- <wa>-lang ='EN-GB'.
- ENDIF.
- ENDLOOP.
or with:
- wa-lang ='EN-GB'.
- 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.