<?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: Creating a hirearchy report in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-hirearchy-report/m-p/1752963#M326433</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should probably look at the example of REUSE&lt;STRONG&gt;HIER&lt;/STRONG&gt; report.&lt;/P&gt;&lt;P&gt;Also, look at the examples of tree controls in DWDM transaction. That should give you a starting point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note - Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Nov 2006 12:33:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-29T12:33:23Z</dc:date>
    <item>
      <title>Creating a hirearchy report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-hirearchy-report/m-p/1752962#M326432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friend I have to creat a report to display all the sales order in the node.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When a user selects the particular node (order number), it should expand and give customer details like ship to party sold to party. please help me. I am new to hirearchy reporting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont know how sould I start.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2006 12:28:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-hirearchy-report/m-p/1752962#M326432</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-29T12:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a hirearchy report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-hirearchy-report/m-p/1752963#M326433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should probably look at the example of REUSE&lt;STRONG&gt;HIER&lt;/STRONG&gt; report.&lt;/P&gt;&lt;P&gt;Also, look at the examples of tree controls in DWDM transaction. That should give you a starting point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note - Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2006 12:33:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-hirearchy-report/m-p/1752963#M326433</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-29T12:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a hirearchy report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-hirearchy-report/m-p/1752964#M326434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FU RS_TREE_LIST_DISPLAY&lt;/P&gt;&lt;P&gt;____________________________________________________&lt;/P&gt;&lt;P&gt;Text&lt;/P&gt;&lt;P&gt;Display hierarchy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Functionality&lt;/P&gt;&lt;P&gt;Function module enabling you to display and interactively manipulate hierarchies and graphs in which unused graphical links are displayed in a different color as link nodes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A hierarchy must exist, at least in its initial state, before you can use this module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have three possibilites:&lt;/P&gt;&lt;P&gt;   - You can create a hierarchy with root nodes using module&lt;/P&gt;&lt;P&gt;     RS_TREE_CREATE.&lt;/P&gt;&lt;P&gt;   - You can copy a complete hierarchy to the function group using the&lt;/P&gt;&lt;P&gt;     RS_TREE_CONSTRUCT module. All the parent-child relationships must&lt;/P&gt;&lt;P&gt;     be calculated explicitly.&lt;/P&gt;&lt;P&gt;   - You can use module RS_TREE_SET_CURRENT_TREE to copy a data cluster&lt;/P&gt;&lt;P&gt;     which you have already procured using module&lt;/P&gt;&lt;P&gt;     RS_TREE_GET_CURRENT_TREE to the function group. This cluster is&lt;/P&gt;&lt;P&gt;     already in the correct format for internal display and may not be&lt;/P&gt;&lt;P&gt;     changed. This is used exclusively for internal management (INDX&lt;/P&gt;&lt;P&gt;     format).&lt;/P&gt;&lt;P&gt;     The modules RS_TREE_GET_LINKTAB and RS_TREE_SET_LINKTAB also exist&lt;/P&gt;&lt;P&gt;     for graph management.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have the option of displaying the hierarchy in a list dialog box.&lt;/P&gt;&lt;P&gt;The SCREEN* parameters are used for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters&lt;/P&gt;&lt;P&gt;CALLBACK_PROGRAM&lt;/P&gt;&lt;P&gt;CALLBACK_USER_COMMAND&lt;/P&gt;&lt;P&gt;CALLBACK_TEXT_DISPLAY&lt;/P&gt;&lt;P&gt;CALLBACK_MOREINFO_DISPLAY&lt;/P&gt;&lt;P&gt;CALLBACK_COLOR_DISPLAY&lt;/P&gt;&lt;P&gt;CALLBACK_TOP_OF_PAGE&lt;/P&gt;&lt;P&gt;CALLBACK_GUI_STATUS&lt;/P&gt;&lt;P&gt;CALLBACK_CONTEXT_MENU&lt;/P&gt;&lt;P&gt;STATUS&lt;/P&gt;&lt;P&gt;CHECK_DUPLICATE_NAME&lt;/P&gt;&lt;P&gt;COLOR_OF_NODE&lt;/P&gt;&lt;P&gt;COLOR_OF_MARK&lt;/P&gt;&lt;P&gt;COLOR_OF_LINK&lt;/P&gt;&lt;P&gt;COLOR_OF_MATCH&lt;/P&gt;&lt;P&gt;LOWER_CASE_SENSITIVE&lt;/P&gt;&lt;P&gt;MODIFICATION_LOG&lt;/P&gt;&lt;P&gt;NODE_LENGTH&lt;/P&gt;&lt;P&gt;TEXT_LENGTH&lt;/P&gt;&lt;P&gt;TEXT_LENGTH1&lt;/P&gt;&lt;P&gt;TEXT_LENGTH2&lt;/P&gt;&lt;P&gt;RETURN_MARKED_SUBTREE&lt;/P&gt;&lt;P&gt;SCREEN_START_COLUMN&lt;/P&gt;&lt;P&gt;SCREEN_START_LINE&lt;/P&gt;&lt;P&gt;SCREEN_END_COLUMN&lt;/P&gt;&lt;P&gt;SCREEN_END_LINE&lt;/P&gt;&lt;P&gt;SUPPRESS_NODE_OUTPUT&lt;/P&gt;&lt;P&gt;LAYOUT_MODE&lt;/P&gt;&lt;P&gt;USE_CONTROL&lt;/P&gt;&lt;P&gt;F15&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exceptions&lt;/P&gt;&lt;P&gt;Function Group&lt;/P&gt;&lt;P&gt;SEUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2006 12:37:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-hirearchy-report/m-p/1752964#M326434</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-29T12:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a hirearchy report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-hirearchy-report/m-p/1752965#M326435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Abhay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be you can make use of the following code, which would display your report in an ALV TREE control....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;[code][code]=======================================================
class lcl_tree_event_receiver definition.
  public section.
*Define an event handler method for each event you want to react to.
      methods handle_node_double_click
          for event node_double_click of cl_gui_alv_tree
          importing node_key sender.
* 'sender' is an implicit event parameter that is provided by
* ABAP Objects runtime system. It contains a reference to the
* object that fired the event. You may directly use it to
* call methods of this instance.
endclass.               "LCL_TREE_EVENT_RECEIVER

class lcl_tree_event_receiver implementation.
*Implement event handler methods.
    method handle_node_double_click.
        data: lt_children type lvc_t_nkey.
*      first check if the node is a leaf.

        call method sender-&amp;gt;get_children
            exporting i_node_key  = node_key
            importing et_children = lt_children.
        if not lt_children is initial.
            call method sender-&amp;gt;expand_node
                exporting  i_node_key    = node_key
                           i_level_count = 2      .
        endif.
    endmethod.
endclass.

========================================================
    perform create_field_catalog changing gt_fieldcatalog .

    call screen 9001.
========================================================
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  PBO_9001  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module pbo_9001 output.
  set pf-status 'ZSTATUS'.
  set titlebar 'ZTITLE'.
  if g_alv_tree is initial.
      perform init_tree.
      call method cl_gui_cfw=&amp;gt;flush
          exceptions cntl_system_error = 1
                     cntl_error        = 2.
      if sy-subrc ne 0.
          call function 'POPUP_TO_INFORM'
          exporting
              titel = 'Automation Queue failure'(013)
              txt1  = 'Internal error:'(014)
              txt2  = 'A method in the automation queue'(015)
              txt3  = 'caused a failure.'(016).
      endif.
  endif.
endmodule.                 " PBO_9001  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  init_tree
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
form init_tree .
* create container for alv-tree
  data: l_tree_container_name(30) type c,
        l_variant type disvariant       .

  l_tree_container_name = 'CCONTAINER01'.
  create object g_custom_container
  exporting
        container_name = l_tree_container_name
  exceptions
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5.
  if sy-subrc &amp;lt;&amp;gt; 0.
    message e208(00) with 'ERROR'(100).
  endif.
* create tree control
  create object g_alv_tree
  exporting
      parent              = g_custom_container
      node_selection_mode = cl_gui_column_tree=&amp;gt;node_sel_mode_single
      item_selection      = 'X'
      no_html_header      = ''
      no_toolbar          = ''
  exceptions
      cntl_error                   = 1
      cntl_system_error            = 2
      create_error                 = 3
      lifetime_error               = 4
      illegal_node_selection_mode  = 5
      failed                       = 6
      illegal_column_name          = 7.
  if sy-subrc &amp;lt;&amp;gt; 0.
      message e208(00) with 'ERROR'.     "#EC NOTEXT
  endif.
  perform build_hierarchy_header changing l_hierarchy_header.
  clear gt_alv.
  perform comment_build using  gt_list_top_of_page.
  l_variant-report = sy-repid.
  call method g_alv_tree-&amp;gt;set_table_for_first_display
  exporting
           i_save               = 'A'
           it_list_commentary   = gt_list_top_of_page
           is_hierarchy_header  = l_hierarchy_header
           is_variant           = l_variant
  changing
           it_fieldcatalog      = gt_fieldcatalog
           it_outtab            = gt_alv.  "table is empty !
  perform populate_alv_table tables gt_alv2
                                    gt_covp
                                    gt_prps.
  if gt_alv2[] is initial.
      message i001(00) with 'No Wage Data Found'.
      exit.
  endif.
  perform create_hierarchy tables gt_alv2.
  perform register_events.
* Update calculations which were initially defined by field DO_SUM
* of the fieldcatalog.
  call method g_alv_tree-&amp;gt;update_calculations.

* Send data to frontend.
  call method g_alv_tree-&amp;gt;frontend_update.
endform.                    " init_tree
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  PAI_9001  INPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module pai_9001 input.
  save_ok = ok_code.
  clear ok_code.
  case save_ok.
      when 'EXIT' or 'BACK' or 'CANC'.
          perform exit_program.
      when others.
          call method cl_gui_cfw=&amp;gt;dispatch.
  endcase.
  call method cl_gui_cfw=&amp;gt;flush.
endmodule.                 " PAI_9001  INPUT
=========================================================
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  create_field_catalog
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
form create_field_catalog changing lt_fieldcat type lvc_t_fcat.
  data ls_fcat type lvc_s_fcat.
  constants:
      lc_owaer(5) value 'TWAER'.
* Generates a fieldcatalog according to a given structure.
  call function 'LVC_FIELDCATALOG_MERGE'
  exporting
      i_structure_name = 'ZSTRWWWAGES'
  changing
      ct_fieldcat      = lt_fieldcat.
  define m_fcat_modify.
      ls_fcat-do_sum         = &amp;amp;1.
      ls_fcat-no_out         = &amp;amp;2.
      ls_fcat-key            = &amp;amp;3.
      ls_fcat-h_ftype        = &amp;amp;4.
  end-of-definition.
  loop at lt_fieldcat into ls_fcat.
      case ls_fcat-fieldname.
          when 'VERNA' or 'PSPID' or 'POSID'.
              m_fcat_modify space gc_x gc_x space.
          when  'POST1' or 'ENAME'.
              m_fcat_modify space space space space.
          when 'B_WOGBTR'  or 'O_WOGBTR' or 'S_WOGBTR'  or 'A_WOGBTR'
            or 'GR_WOGBTR' or 'ER_NI'    or 'ER_PEN'    or 'TO_WOGBTR'
              or 'VA_WOGBTR' .
              m_fcat_modify gc_x space space 'SUM'.
          when 'WAG_BUDG'  or 'NI_BUDG' .
              m_fcat_modify gc_x space space 'SUM'.
          when 'OBJ_CURKEY' or 'POST2' or 'ZINDEX'.
              m_fcat_modify space gc_x space space.
      endcase.
      modify lt_fieldcat from ls_fcat.
  endloop.
endform.                    " create_field_catalog
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  FORM build_hierarchy_header
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
form build_hierarchy_header changing
                               p_hierarchy_header type treev_hhdr.
  p_hierarchy_header-heading   = 'Totals/Contract/Intem/Employee'(006).
  p_hierarchy_header-tooltip   = 'Wages of Employees'(007).
  p_hierarchy_header-width     = 50.
  p_hierarchy_header-width_pix = ''.
endform.                    " FORM build_hierarchy_header
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  create_hierarchy
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
form create_hierarchy tables pt_alv structure zstrwwwages.
  data: ls_alv type zstrwwwages,
        lv_verna(25),
        lv_verna_last(25),
        lv_pspid(24),
        lv_pspid_last(24),
        lv_posid(24),
        lv_posid_last(24),
        lv_ename(40),
        lv_ename_last(40)..

  data: lv_verna_key type lvc_nkey,
        lv_pspid_key type lvc_nkey,
        lv_posid_key type lvc_nkey,
        lv_last_key  type lvc_nkey,
        lv_top_key   type lvc_nkey,
        lv_ename_key type lvc_nkey.

* sort table according to conceived hierarchy
  sort pt_alv by verna pspid posid.
* Define one top node to calculate values for the whole hierarchy.
  call method g_alv_tree-&amp;gt;add_node
  exporting
      i_relat_node_key = space
      i_relationship   = cl_gui_column_tree=&amp;gt;relat_last_child
      i_node_text      = text-008
  importing
      e_new_node_key = lv_top_key.

  loop at pt_alv into ls_alv.
    lv_verna = ls_alv-verna.
    lv_pspid = ls_alv-pspid.
    lv_posid = ls_alv-posid.
    lv_ename = ls_alv-ename.
* check not lv_verna is initial." or lv_verna_last is initial.
    if lv_verna &amp;lt;&amp;gt; lv_verna_last.      "on change of Supervisor
        lv_verna_last = lv_verna.
* Supervisor nodes
        perform add_supervisor using    lv_verna
                                        lv_top_key
                               changing lv_verna_key.
* clear lv_pspid_last because this is a new supervisor
        clear lv_pspid_last.
    endif.
* Contract nodes:
    if lv_pspid &amp;lt;&amp;gt; lv_pspid_last.      "on change of contract
        lv_pspid_last = lv_pspid.
        perform add_contract_line using   ls_alv
                                         lv_verna_key
                                changing lv_pspid_key.
    endif.
* Item nodes:
    if lv_posid &amp;lt;&amp;gt; lv_posid_last.      "on change of Item
        lv_posid_last = lv_posid.
        perform add_item_line using    ls_alv
                                       lv_pspid_key
                              changing lv_posid_key.
    endif.
* Leaf:
    perform add_complete_line using  ls_alv
                                     lv_posid_key
                            changing lv_last_key.
  endloop.
endform.                               " create_hierarchy
*&amp;amp;---------------------------------------------------------------------*

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  add_supervisor
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --&amp;gt;P_LV_VERNA  text
*      --&amp;gt;P_LV_TOP_KEY  text
*      &amp;lt;--P_LV_VERNA_KEY  text
*----------------------------------------------------------------------*
form add_supervisor  using    p_lv_verna
                              p_lv_top_key
                     changing p_lv_verna_key.
  data: l_node_text type lvc_value,
        ls_alv type zstrwwwages.
  l_node_text = p_lv_verna.
* add node
  call method g_alv_tree-&amp;gt;add_node
  exporting
      i_relat_node_key = p_lv_top_key
      i_relationship   = cl_gui_column_tree=&amp;gt;relat_last_child
      i_node_text      = l_node_text
      is_outtab_line   = ls_alv
  importing
      e_new_node_key = p_lv_verna_key.
endform.                    " add_supervisor
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  add_contract_line
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --&amp;gt;P_LS_ALV  text
*      --&amp;gt;P_LV_VERNA_KEY  text
*      &amp;lt;--P_LV_PSPID_KEY  text
*----------------------------------------------------------------------*
form add_contract_line  using    p_ls_alv type zstrwwwages
                                 p_lv_verna_key
                        changing p_lv_pspid_key.
  data: l_node_text type lvc_value,
        ls_alv type zstrwwwages.
* add node
  l_node_text =  p_ls_alv-pspid.
  call method g_alv_tree-&amp;gt;add_node
  exporting
      i_relat_node_key = p_lv_verna_key
      i_relationship   = cl_gui_column_tree=&amp;gt;relat_last_child
      i_node_text      = l_node_text
      is_outtab_line   = ls_alv
  importing
      e_new_node_key = p_lv_pspid_key.
endform.                    " add_contract_line
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  add_employee
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --&amp;gt;P_LV_ENAME  text
*      --&amp;gt;P_LV_POSID_KEY  text
*      &amp;lt;--P_LV_ENAME_KEY  text
*----------------------------------------------------------------------*
form add_employee  using    p_ls_alv type zstrwwwages
                            p_lv_posid_key
                   changing p_lv_ename_key.
  data: l_node_text type lvc_value,
        ls_alv type zstrwwwages.
* add node
  l_node_text =  p_ls_alv-ename.
  call method g_alv_tree-&amp;gt;add_node
  exporting
      i_relat_node_key = p_lv_posid_key
      i_relationship   = cl_gui_column_tree=&amp;gt;relat_last_child
      i_node_text      = l_node_text
      is_outtab_line   = ls_alv
  importing
      e_new_node_key = p_lv_ename_key.
endform.                    " add_employee
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  add_item_line
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --&amp;gt;P_LV_POSID  text
*      --&amp;gt;P_LV_PSPID_KEY  text
*      &amp;lt;--P_LV_POSID_KEY  text
*----------------------------------------------------------------------*
form add_item_line  using    p_ls_alv type zstrwwwages
                             p_lv_pspid_key
                    changing p_lv_posid_key.
  data: l_node_text type lvc_value,
        ls_alv type zstrwwwages.
* add node
  l_node_text =  p_ls_alv-posid.
  call method g_alv_tree-&amp;gt;add_node
  exporting
      i_relat_node_key = p_lv_pspid_key
      i_relationship   = cl_gui_column_tree=&amp;gt;relat_last_child
      i_node_text      = l_node_text
      is_outtab_line   = ls_alv
  importing
      e_new_node_key = p_lv_posid_key.
endform.                    " add_item_line

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  add_complete_line
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --&amp;gt;P_LS_ALV  text
*      --&amp;gt;P_LV_PSPID_KEY  text
*      &amp;lt;--P_LV_LAST_KEY  text
*----------------------------------------------------------------------*
form add_complete_line  using    p_ls_alv type zstrwwwages
                                 p_lv_posid_key
                        changing p_lv_last_key.
  data: l_node_text type lvc_value.
  l_node_text = p_ls_alv-posid.
  call method g_alv_tree-&amp;gt;add_node
  exporting
      i_relat_node_key = p_lv_posid_key
      i_relationship   = cl_gui_column_tree=&amp;gt;relat_last_child
      is_outtab_line   = p_ls_alv
      i_node_text      = l_node_text
  importing
      e_new_node_key = p_lv_last_key.
endform.                    " add_complete_line

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  exit_program
*&amp;amp;---------------------------------------------------------------------*
*       free object and leave program
*----------------------------------------------------------------------*
form exit_program.
  call method g_custom_container-&amp;gt;free.
  leave program.
endform.                               " exit_program
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  register_events
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
form register_events .
  data: lt_events type cntl_simple_events,
        l_event type cntl_simple_event,
        l_event_receiver type ref to lcl_tree_event_receiver.

  call method g_alv_tree-&amp;gt;get_registered_events
  importing events = lt_events.
  l_event-eventid = cl_gui_column_tree=&amp;gt;eventid_node_double_click.
  append l_event to lt_events.
* Frontend registration(iii):provide new event table to alv tree
  call method g_alv_tree-&amp;gt;set_registered_events
  exporting
      events = lt_events
  exceptions
      cntl_error                = 1
      cntl_system_error         = 2
      illegal_event_combination = 3.
  if sy-subrc &amp;lt;&amp;gt; 0.
      message e208(00) with 'ERROR'.     "#EC NOTEXT
  endif.
* Register events on backend (ABAP Objects event handling)
  create object l_event_receiver.
  set handler l_event_receiver-&amp;gt;handle_node_double_click for g_alv_tree.
endform.                    " register_events

=========================================================&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;[/code][/code]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2006 12:38:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-hirearchy-report/m-p/1752965#M326435</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-29T12:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a hirearchy report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-hirearchy-report/m-p/1752966#M326436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try using this FM,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_HIERSEQ_LIST_DISPLAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps,&lt;/P&gt;&lt;P&gt;~srikant.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2006 13:02:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-hirearchy-report/m-p/1752966#M326436</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-29T13:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a hirearchy report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-hirearchy-report/m-p/1752967#M326437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Sajan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The coding was very helpful and I have also rewarded it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can u tell me, nw when I create my screen in SE51, wht exactly Do i need to do there? do i need to create a custom container? if yes how many? if other then what?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2006 13:20:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-hirearchy-report/m-p/1752967#M326437</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-29T13:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a hirearchy report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-hirearchy-report/m-p/1752968#M326438</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;You can check the simple sample program &amp;lt;b&amp;gt;BALVHD01&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2006 13:37:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-hirearchy-report/m-p/1752968#M326438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-29T13:37:23Z</dc:date>
    </item>
  </channel>
</rss>

