<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Display Nested table data in an ALV format in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/display-nested-table-data-in-an-alv-format/m-p/6740768#M1458562</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simple answer is SAP query. Check the T-codes SQ01/SQ02/SQ03 or SQVI. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you declare your internal table as type table of your table, it will automatically inherit fields from all the structures that table has.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Mar 2010 16:09:35 GMT</pubDate>
    <dc:creator>vinod_vemuru2</dc:creator>
    <dc:date>2010-03-02T16:09:35Z</dc:date>
    <item>
      <title>Display Nested table data in an ALV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/display-nested-table-data-in-an-alv-format/m-p/6740765#M1458559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to display nested table data in an ALV format. This table has 20-30 structures in it and there is no way to create a common structure using all the fields. Kindly let me know what is the best way to display the nested structure data. &lt;/P&gt;&lt;P&gt;Thanks a lot for your responce.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Priti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2010 14:58:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/display-nested-table-data-in-an-alv-format/m-p/6740765#M1458559</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-26T14:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Display Nested table data in an ALV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/display-nested-table-data-in-an-alv-format/m-p/6740766#M1458560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;20 - 30 strucutre&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What kind of structure would you like display ?    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2010 18:33:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/display-nested-table-data-in-an-alv-format/m-p/6740766#M1458560</guid>
      <dc:creator>StMou</dc:creator>
      <dc:date>2010-02-26T18:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Display Nested table data in an ALV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/display-nested-table-data-in-an-alv-format/m-p/6740767#M1458561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;

REPORT  yh_alvtreedemo1.
TYPE-POOLS : fibs,stree.
TYPE-POOLS:slis.
DATA : t_node TYPE snodetext.
DATA : it_node LIKE TABLE OF t_node,
       wa_node LIKE t_node.
DATA: t_fieldcat    TYPE slis_t_fieldcat_alv,
      fs_fieldcat   TYPE slis_fieldcat_alv.
DATA:w_repid LIKE sy-repid.
*Internal Table declarations
DATA: BEGIN OF fs_scarr,
        carrid LIKE scarr-carrid,
      END OF fs_scarr.
DATA:BEGIN OF fs_spfli,
        carrid LIKE spfli-carrid,
        connid LIKE spfli-connid,
     END OF fs_spfli.
DATA:BEGIN OF fs_sflight,
        carrid LIKE sflight-carrid,
        connid LIKE sflight-connid,
        fldate LIKE sflight-fldate,
     END OF fs_sflight.
DATA:BEGIN OF fs_sbook,
        carrid LIKE sbook-carrid,
        connid LIKE sbook-connid,
        fldate LIKE sbook-fldate,
        bookid LIKE sbook-bookid,
     END OF fs_sbook.
DATA:t_scarr LIKE TABLE OF fs_scarr,
     t_spfli LIKE TABLE OF fs_spfli,
     t_sflight LIKE TABLE OF fs_sflight,
     t_sbook LIKE TABLE OF fs_sbook.
START-OF-SELECTION.
  PERFORM get_data.
  PERFORM build_tree.
  PERFORM display_tree.
*&amp;amp;----------------------------------------------------------------*
*&amp;amp;      Form  get_data
*&amp;amp;----------------------------------------------------------------*
FORM get_data .
  SELECT carrid
         FROM scarr
         INTO TABLE t_scarr.
  SELECT carrid
          connid
          FROM spfli
          INTO TABLE t_spfli
          FOR ALL ENTRIES IN t_scarr
          WHERE carrid EQ t_scarr-carrid.
ENDFORM.                    " get_data
*&amp;amp;----------------------------------------------------------------*
*&amp;amp;      Form  build_tree
*&amp;amp;----------------------------------------------------------------*
FORM build_tree .
  CLEAR: it_node,
         wa_node.
  SORT: t_scarr BY carrid,
        t_spfli BY carrid connid,
        t_sflight BY carrid connid fldate,
        t_sbook BY carrid connid fldate bookid.
  wa_node-type = 'T'.
  wa_node-name = 'Flight Details'.
  wa_node-tlevel = '01'.
  wa_node-nlength = '15'.
  wa_node-color = '4'.
  wa_node-text = 'Flight'.
  wa_node-tlength ='20'.
  wa_node-tcolor = 3.
  APPEND wa_node TO it_node.
  CLEAR wa_node.
  LOOP AT t_scarr INTO fs_scarr.
    wa_node-type = 'P'.
    wa_node-name = 'CARRID'.
    wa_node-tlevel = '02'.
    wa_node-nlength = '8'.
    wa_node-color = '1'.
    wa_node-text = fs_scarr-carrid.
    wa_node-tlength ='20'.
    wa_node-tcolor = 4.
    APPEND wa_node TO it_node.
    CLEAR wa_node.
    LOOP AT t_spfli INTO fs_spfli WHERE carrid EQ fs_scarr-carrid.
      wa_node-type = 'P'.
      wa_node-name = 'CONNID'.
      wa_node-tlevel = '03'.
      wa_node-nlength = '8'.
      wa_node-color = '1'.
      wa_node-text = fs_spfli-connid.
      wa_node-tlength ='20'.
      wa_node-tcolor = 4.
      APPEND wa_node TO it_node.
      CLEAR wa_node.
    ENDLOOP.
  ENDLOOP.
ENDFORM.                    " build_tree
*&amp;amp;----------------------------------------------------------------*
*&amp;amp;      Form  display_tree
*&amp;amp;----------------------------------------------------------------*
FORM display_tree .
  CALL FUNCTION 'RS_TREE_CONSTRUCT'
    TABLES
      nodetab = it_node.
  w_repid = sy-repid.
  CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
    EXPORTING
      callback_program      = w_repid
      callback_user_command = 'USER_COMMAND'
      callback_gui_status   = 'SET_PF'.
ENDFORM.                    " display_tree
*&amp;amp;----------------------------------------------------------------*
*&amp;amp;      Form  pick
*&amp;amp;----------------------------------------------------------------*
*      --&amp;gt;COMMAND    text
*      --&amp;gt;NODE       text
*-----------------------------------------------------------------*
FORM user_command    TABLES pt_nodes         STRUCTURE seucomm
                   		USING pv_command       TYPE c
               		CHANGING pv_exit        TYPE c
                       		 pv_list_refresh  TYPE c.
  pv_list_refresh = 'X'.
  IF pt_nodes-tlevel = '03'.
    CLEAR t_fieldcat[].
    SELECT carrid
           connid
           fldate
           FROM sflight
           INTO TABLE t_sflight
           WHERE connid EQ pt_nodes-text.
    fs_fieldcat-col_pos = 1.
    fs_fieldcat-fieldname = 'CARRID'.
    fs_fieldcat-seltext_m = 'Airlinecarrier'.
    fs_fieldcat-key = 'X'.
    fs_fieldcat-hotspot = 'X'.
    APPEND fs_fieldcat TO t_fieldcat.
    CLEAR fs_fieldcat.
    fs_fieldcat-col_pos = 2.
    fs_fieldcat-fieldname = 'CONNID'.
    fs_fieldcat-seltext_m = 'Connection No'.
    fs_fieldcat-key = 'X'.
    fs_fieldcat-hotspot = 'X'.
    APPEND fs_fieldcat TO t_fieldcat.
    CLEAR fs_fieldcat.
    fs_fieldcat-col_pos = 3.
    fs_fieldcat-fieldname = 'FLDATE'.
    fs_fieldcat-seltext_m = 'Flight Date'.
    fs_fieldcat-key = 'X'.
    fs_fieldcat-hotspot = 'X'.
    APPEND fs_fieldcat TO t_fieldcat.
    CLEAR fs_fieldcat.
    w_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        i_callback_program = w_repid
        it_fieldcat        = t_fieldcat[]
      TABLES
        t_outtab           = t_sflight.
  ENDIF.
ENDFORM.                    "pick
*&amp;amp;----------------------------------------------------------------*
*&amp;amp;      Form  set_pf
*&amp;amp;----------------------------------------------------------------*
*       text
*-----------------------------------------------------------------*
FORM set_pf.
  SET PF-STATUS 'MYPF'.
ENDFORM.                    "set_pf


&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Mar 2010 10:56:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/display-nested-table-data-in-an-alv-format/m-p/6740767#M1458561</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-02T10:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Display Nested table data in an ALV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/display-nested-table-data-in-an-alv-format/m-p/6740768#M1458562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simple answer is SAP query. Check the T-codes SQ01/SQ02/SQ03 or SQVI. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you declare your internal table as type table of your table, it will automatically inherit fields from all the structures that table has.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Mar 2010 16:09:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/display-nested-table-data-in-an-alv-format/m-p/6740768#M1458562</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2010-03-02T16:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Display Nested table data in an ALV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/display-nested-table-data-in-an-alv-format/m-p/6740769#M1458563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2011 03:30:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/display-nested-table-data-in-an-alv-format/m-p/6740769#M1458563</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-21T03:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Display Nested table data in an ALV format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/display-nested-table-data-in-an-alv-format/m-p/6740770#M1458564</link>
      <description>&lt;P&gt;Have a look &lt;A href="https://github.com/tewari-d/alv_util"&gt;https://github.com/tewari-d/alv_util&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jan 2022 13:03:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/display-nested-table-data-in-an-alv-format/m-p/6740770#M1458564</guid>
      <dc:creator>former_member1321</dc:creator>
      <dc:date>2022-01-23T13:03:38Z</dc:date>
    </item>
  </channel>
</rss>

