title: LOOP itab vs VALUE FOR filtering, which is more efficient?
body: <p>I am trying to write a for-loop statement for the following scenario:</p>
  <p>I have used a select to get multiple <code>tvarvc</code> entries data into <code>T_TVARVC</code>.</p>
  <pre><code>LOOP AT t_tvarvc INTO DATA(s_tvarvc).
      CASE s_tvarvc-name.
        WHEN c_augru.
          s_tvarvc_range = CORRESPONDING #( s_tvarvc ).
          APPEND s_tvarvc_range TO t_augru.
  
        WHEN c_vkorg.
          s_tvarvc_range = CORRESPONDING #( s_tvarvc ).
          APPEND s_tvarvc_range TO t_vkorg.
      ENDCASE.
  ENDLOOP. 
  </code></pre>
  <p>This is what I have come up with:</p>
  <pre><code>DATA(t_augru) = VALUE tt_tvarvc( FOR s_tvarvc IN t_tvarvc
                                    WHERE ( name = c_augru )
                                    ( CORRESPONDING #( s_tvarvc ) ) ).
  
  DATA(t_vkorg) = VALUE tt_tvarvc( FOR s_tvarvc IN t_tvarvc
                                    WHERE ( name = c_vkorg )
                                    ( CORRESPONDING #( s_tvarvc ) ) ). 
  </code></pre>
  <p>My observation is that, by using <code>LOOP AT</code> and <code>CASE</code> statement combo, the number of iterations will be same as the number of entries in <code>T_TVARVC</code>. <br>
  But when using a <code>FOR</code> loop for each range table, <code>T_TVARVC</code> has to be traversed more times to reach the desired entry thus causing multiple iterations more than the first scenario.</p>
  <p>Can this be written in a more efficient way?</p>