title: How to export an ALV tree to excel?
body: <p>I have to construct and then export a tree that has 4 levels into an excel sheet just like shown in this picture : </p>
  
  <p><img src="https://i.stack.imgur.com/dByX9.png" alt="expected hierarchy in Excel"></p>
  
  <p>I have the different nodes data in my database tables, I made the tree using the Function <code>RS_TREE_CONSTRUCT</code> and I used the function <code>RS_TREE_LIST_DISPLAY</code> to see if it looks like intended, everything is as it should be, but now I can't find a way to export it so that it looks the way I described on the picture.</p>
  
  <p>These are the 2 functions I used after I filled the LT_NODE table with the required data :</p>
  
  <pre><code>CALL FUNCTION 'RS_TREE_CONSTRUCT'
      TABLES
        NODETAB            = LT_NODE
      EXCEPTIONS
        TREE_FAILURE       = 1
        ID_NOT_FOUND       = 2
        WRONG_RELATIONSHIP = 3
        OTHERS             = 4.
    IF SY-SUBRC &lt;&gt; 0.
      WRITE 'Error in Tree Construction'.
    ENDIF.
  ***Display TREE
    CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
      EXPORTING
        CALLBACK_PROGRAM = SY-REPID.
  </code></pre>
  
  <p>The expected result would be as shown on the picture, but the actual one is a normal table (LT_NODE) which has multiple columns like ID, TYPE, NAME, TLEVEL etc.</p>