title: Concatenate fields of a dynamic structure
body: <p>How do we concatenate fields of a dynamic work area? The idea is in the below code:</p>
  
  <pre><code>LOOP AT lt_final INTO DATA(ls_final).
    CONCATENATE ls_final-field1
                ls_final-field2
                ls_final-field3
                ls_final-field4
                ls_final-field5
           INTO ls_attachment SEPARATED BY lc_tab.   "lc_tab is horizontal tab
  
    APPEND ls_attachment TO lt_attachment.
    CLEAR: ls_attachment.
  ENDLOOP.
  </code></pre>
  
  <p>(This code will be used for sending email attachment.) Now, my problem is, the internal table in the above code is a dynamic internal table, therefore I am not sure how many fields will be there and the field names as well.
  <br> <br> How do I concatenate the fields? Any idea, please help..</p>
  
  <pre><code>LOOP AT &lt;dynamic_table&gt; INTO DATA(ls_final).
    CONCATENATE ls_final-(?)
                ls_final-(?)
                ls_final-(?)
                ls_final-(?)
                ls_final-(?) 
                "or more fields insert here depending on dynamic table
           INTO ls_attachment SEPARATED BY lc_tab.   "lc_tab is horizontal tab
  
    APPEND ls_attachment TO lt_attachment.
    CLEAR: ls_attachment.
  ENDLOOP.
  </code></pre>