title: loop into loop with dynamic field name
body: <p>THE PROBLEM: I have 2 tables like this:</p>
  <p>TABLE 1: HR table with many columns and rows</p>
  <p>TABLE 2 :
  table with list of columns that i need to read from table 1</p>
  <p><a href="https://i.stack.imgur.com/7kujX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7kujX.png" alt="MY TABLES IMAGE" /></a></p>
  <p>In table 1 I need to loop all row and I need to check all the fields from table 2, if it has &quot;X&quot; in the field, i need print the field description from table 2.</p>
  <p>I try do it with nested loop (loop table 1, and each loop iteration loop table 2 and check all the fields of the row) and I can't use variable on table- (i need variable for the loop in  ).</p>
  <p>MY CODE:</p>
  <pre><code>LOOP AT lt_hrp9229  INTO ls_hrp9229 
    LOOP AT lt_otype_fields INTO ls_otype_fields .
     IF ls_hrp9229-ls_otype_fields-FIELD_NAME = 'X'.
      ev_descript_data = ev_descript_data &amp;&amp; ','  &amp;&amp;  ls_otype_fields-Field_description.
     ENDIF.
   ENDLOOP.
  ENDLOOP.
  </code></pre>
  <p>I have problem in this row:</p>
  <pre><code>IF ls_hrp9229-ls_otype_fields-FIELD_NAME = 'X'
  </code></pre>
  <p>i can't use dynamic field name from the loop.</p>
  <p>thanks.</p>