Output of tree report to be downloaded to html format

Hi Techies,
           how to download output of a tree report( created using oo abap)  into HTML format.
Thanks,
Briteny.

Hi,
I don't think it can be done easily, you'll have to code it yourself (not so complex if it's a custom program, if you keep things simple with the UL and LI HTML elements, and maybe even by adding TABLE, TR and TD if it's a column tree). Is the ALV tree built by standard or custom program? Is it a simple tree, or a column tree, or even mixed with ALV, or what?
Sandra

Similar Messages

  • Report Downloading in HTML Format - Problem...

    Dear All,
    While I am downloading any report in HTML Format.
    At that time I want to cahnge the font format in SAP.
    please tell how to do this.
    Regards,
    Dharmesh

    Hi Dharmesh,
    Send me the ZPROGRAM you have developed.
    Darshan Patel

  • Where can I download WMA html format?

    Where can I download the Wireless Messaging API, HTML format? All I've seen so far is the PDF format.
    In case my request seems vague, please refer to the link below
    http://www.dccia.ua.es/dccia/inf/asignaturas/TW/practicas/wma/
    That's what I want to download. Is there a zip file so that I can download all those in one click? thanx in advance!

    Hi Malcom,
    I've asked our tech writer to look into this and respond here.
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect

  • Web pages will not download in html format, just a long listing of items on the page. How do I correct this?

    Firefox was working as normal. I downloaded the Password app from Firefox and all my web pages stopped downloading properly. I deleted the app, no change. I uninstalled and reinstalled Firefox. Nothing. This happened once before & I had to take it to a computer repair store to get it fixed. That time, it was caused by a program that I had downloaded. I tried restoring my system but that did not work either.

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    A possible cause is security software (firewall) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    *https://support.mozilla.org/kb/Server+not+found
    *https://support.mozilla.org/kb/Firewalls

  • Report can't fix all in HTML format

    Hi all,
    I got the report 6i patch 15 installed and try to generate the report into html format. But when generated, it seem like what you see is not what you get on print out. The report can' fix all in html format. But the same report I can view in PDF format without any problem. But just b'cos in the PDF format where I hv generated the graph can't really see all the color pattern and shading and that is why I switch to html cause I can see a nice pattern in the graph there but again I can't fix all my output in one piece of A4 paper.
    My report width is 180 character but it seem that only show 132 character in the report.
    desformat= htmlcss
    Rgds
    Lim

    Here you go:
    There are times where you’ll want to manually set your IP address in Mac OS X, so how do you do it?
    * Launch ‘System Preferences’ from the Apple menu (or Spotlight)
    * Click on the “Network” icon
    * In the lower right, click on the ‘Advanced’ button
    * In the pulldown menu next to “Configure IPv4″ select “DHCP with manual address"
    * Fill in the IP address, subnet mask, and router, as appropriate to the network you are accessing
    * Click ‘OK’
    * Click ‘Apply’
    Find out what is there first. You need to find out what you IP address is there.  Remeber you are only changing your laptop/desktop.  Nothing else.  You are only changing the last digits(numbers) in the very first box at the end.  Example: 192.168.1.XX or 192.168.0.XXX.  You may want to write the other numbers down, once you change it to manually the rest goes blank until you fill it in again then , click ok, apply. Hope it works for you

  • Force email download in HTML or text format on iPhone/iPad with ActiveSync (Exchange 2010 SP3)

    Hi,
    When an HTML email with attachment is received on iPhone/iPad (iOS 8.2),
    it can be downloaded in three cases of
    intermittents ways :
    - The full message is downloaded in HTML format
    - The message is download in text format and a
    "Download full message" link is displayed
    at the bottom of the message
    - The message is displayed in text format,
    but continues to download the rest of the message.
    When the download is complete, the message is displayed
    in HTML format.
    This behavior is intermittent. The Apple's support
    says it is a particular configuration on Exchange server
    that causes this behavior.
    I want to know if there is a way to fix
    this problem and force download email
    either in text or HTML format ?
    This problem occurs on iPhones/iPad
    (iOS8.2) with ActiveSync account (Exchange 2010
    SP3). It occurs also with Outlook.com account.
    On the Exchange 2010 SP3 server, The MaxEmailBodyTruncationSize
    and MaxEmailHTMLBodyTruncationSize settings are
    unlimited in ActiveSync policies.
    Thank you for your help.

    Hi,
    We can configure Exchange ActiveSync Mailbox Policy Properties to force device download HTML or text format email.
    Use the EMC to view or configure Exchange ActiveSync Mailbox Policy by the following steps:
    In the console tree, navigate to Organization Configuration >
    Client Access.
    In the result pane, click the Exchange ActiveSync Mailbox Policies tab, and then select the policy you want to view or configure.
    In the action pane, click Properties.
    Under the Sync Settings tab, check or uncheck the box
    Allow HTML-formatted e-mail. Select this check box to enable e-mail messages that are formatted in HTML to be synchronized to the mobile phone. If this check box isn't selected, all e-mail messages will be converted to plain text before synchronization.
    And use this command to configure whether allow text messaging on the mobile phone. The Exchange Enterprise Client Access License is required to change the values of this setting.
    Set-ActiveSyncMailboxPolicy -Identity PolicyName –AllowTextMessaging $True
    For more information, please refer to this document.
    https://technet.microsoft.com/en-us/library/bb123484(v=exchg.141).aspx
    Best Regards.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Lynn-Li
    TechNet Community Support

  • How to download the output of a report along with column header

    Hi,
    Could someone please tell me on how to download the output of a report along with column header to .txt format. A download option needs to be given to the user using physical and logical file names .The report basically contains header details and item details and requirement is to download the same format into an .txt format.

    Hello,
    Try this FM:
    Data: being of itab occurs 0,
    matnr like mara-matnr,
    maktx like makt-maktx,
    end of itab.
    data:begin of fld_tab occurs 0,
    fld_name(20),
    end of fld_tab.
    fld_tab = 'Material'.
    append fld_tab.
    fld_tab = 'Material Desc'.
    append fld_tab.
    CALL FUNCTION 'WS_DOWNLOAD'
       EXPORTING
            BIN_FILESIZE            = ' '
            CODEPAGE                = ' '
             FILENAME                = 'C:\1.txt '
             FILETYPE                = 'DAT'
            MODE                    = ' '
            WK1_N_FORMAT            = ' '
            WK1_N_SIZE              = ' '
            WK1_T_FORMAT            = ' '
            WK1_T_SIZE              = ' '
            COL_SELECT              = ' '
            COL_SELECTMASK          = ' '
            NO_AUTH_CHECK           = ' '
       IMPORTING
            FILELENGTH              =
         TABLES
              DATA_TAB                = itab
              FIELDNAMES              = fld_tab
       EXCEPTIONS
            FILE_OPEN_ERROR         = 1
            FILE_WRITE_ERROR        = 2
            INVALID_FILESIZE        = 3
            INVALID_TYPE            = 4
            NO_BATCH                = 5
            UNKNOWN_ERROR           = 6
            INVALID_TABLE_WIDTH     = 7
            GUI_REFUSE_FILETRANSFER = 8
            CUSTOMER_ERROR          = 9
            OTHERS                  = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards,
    Naimesh

  • Report download displays wrong format in excel

    I have a text field that is a number, dash, then four numbers 1-2345..
    in an interactive report, when I download to CSV or XLS this field is converted to a date field 1/1/2345..
    If I then change format to text it divides the numbers and gives me the output..
    the only workaround I can find is: save to csv.. rename extention to .txt... then when you open the txt the import wizard will run and you can change the column type to text before excel screws everything up...

    tried both already.
    same results opening the file..
    and using ''''||FIELD as ALIAS then doesnt show the data just the '
    fyi.. the field has both 1-2345 and 1-2345-B (the ones with the dash -B work correctly and they showed up when I added the ''''||FIELD)
    Edited by: Merlin128 on Oct 19, 2009 4:22 PM

  • Output of a Report program to excelsheet

    Hello,
    I am having a problem while saving the output of the report progam which is an ALV list, in the output, the SAVE option of the path SYSTEM--> LIST --> Save ..is not working. It is not active in the output. can you help me to activate that option or this any other process of saving the output.
    I want to know, is there any possibility of saving outputs of same program (which LIST and ALV grid) in a single excel file as different workbook.
    Please solvee my query regarding the issue.
    Thanx.

    hi,
    refer to this thread.
    Re: Excel sheet download problem from ALV
    http://www.jt77.com/development1/programming-24845.html
    regards,
    sreelakshmi

  • Drill down in tree report

    Hi gurus,
    This is regarding the drill down in the Tree report.
    My scenario is,
    i am doing a budget variance report which displays the report in tree format.
    i have texts for different nodes in the tree, along with that i have a 10 feilds which i display using fieldcat in output along with nodes.
    now i want to have the drill down to the 2 of the fields, where it has to go to some transaction.
    i tried with hotspot in fieldcat definition but it is not working.
    please can u tell me a solution as how can i do this drill down.
    thanks in advance.
    u will be rewarded heavily.

    Hi Vipin,
    You can try with following example:
    *& Report  ZPRG                                                *
    &--INTERACTIVE ALV REPORT PROGRAM--
    &This program displays order detais for a particular customer----
    REPORT  zprg                              .
    --TYPE POOLS--
    TYPE-POOLS slis.
    --TABLES--
    TABLES : kna1, vbak.
    --DATA TYPES--
    TYPES : BEGIN OF ty_vbak,
    vbeln TYPE vbak-vbeln,
    erdat TYPE vbak-erdat,
    netwr TYPE vbak-netwr,
    END OF ty_vbak.
    TYPES : BEGIN OF ty_vbap,
    posnr TYPE vbap-posnr,
    arktx TYPE vbap-arktx,
    werks TYPE vbap-werks,
    END OF ty_vbap.
    --WORK AREAS--
                              FOR FIRST PAGE                            *
    DATA w_fcat TYPE slis_fieldcat_alv.   "Used as Header for Field Catalog
    DATA w_vbak TYPE ty_vbak.             "Used as Header for Data Table
    DATA w_events TYPE slis_alv_event.    "Used as header for Events Table
    DATA w_comments TYPE slis_listheader. "Used as Header for Comments Table
                               SECOND PAGE                              *
    DATA w2_fcat TYPE slis_fieldcat_alv.   "Used as Header for Field Catalog
    DATA w2_vbap TYPE ty_vbap.             "Used as Header for Data Table
    DATA w2_events TYPE slis_alv_event.    "Used as header for Events Table
    DATA w2_comments TYPE slis_listheader."Used as Header for Comments Table
    --INTERNAL TABLES--
                              FOR FIRST PAGE                            *
    DATA t_fcat TYPE slis_t_fieldcat_alv.   "Table for Field Catalog
    DATA t_vbak TYPE ty_vbak OCCURS 1.      "Data Table
    DATA t_events TYPE slis_t_event.        "Table for events
    DATA t_comments TYPE slis_t_listheader. "Comments table
                               SECOND PAGE                              *
    DATA t2_fcat TYPE slis_t_fieldcat_alv.   "Table for Field Catalog
    DATA t2_vbap TYPE ty_vbap OCCURS 1.      "Data Table
    DATA t2_events TYPE slis_t_event.        "Table for events
    DATA t2_comments TYPE slis_t_listheader. "Comments table
    *****************VIPIN: START*****************************
    DATA: V_REPID LIKE SY-REPID.
    V_REPID = SY-REPID.
    *****************VIPIN: END*******************************
    --SELECTION SCREEN--
    PARAMETERS p_custno TYPE kna1-kunnr.
    --FILLING FIELD CATALOG--
                              FOR FIRST PAGE                            *
    w_fcat-col_pos = 1.
    w_fcat-fieldname = 'VBELN'.
    w_fcat-seltext_m = 'ORDER NUMBER'.
    APPEND w_fcat TO t_fcat.
    w_fcat-col_pos = 2.
    w_fcat-fieldname = 'ERDAT'.
    w_fcat-seltext_m = 'ORDER DATE'.
    APPEND w_fcat TO t_fcat.
    w_fcat-col_pos = 3.
    w_fcat-fieldname = 'NETWR'.
    w_fcat-seltext_m = 'ORDER VALUE'.
    APPEND w_fcat TO t_fcat.
                               SECOND PAGE                              *
    w2_fcat-col_pos = 1.
    w2_fcat-fieldname = 'POSNR'.
    w2_fcat-seltext_m = 'ITEM NUMBER'.
    APPEND w2_fcat TO t2_fcat.
    w2_fcat-col_pos = 2.
    w2_fcat-fieldname = 'ARKTX'.
    w2_fcat-seltext_m = 'ITEM DESCRIPTION'.
    APPEND w2_fcat TO t2_fcat.
    w2_fcat-col_pos = 3.
    w2_fcat-fieldname = 'WERKS'.
    w2_fcat-seltext_m = 'PLANT'.
    APPEND w2_fcat TO t2_fcat.
    --FILLING DATA TABLE--
                              FOR FIRST PAGE                            *
    SELECT vbeln
           erdat
           netwr
    FROM vbak
    INTO TABLE t_vbak
    WHERE kunnr = p_custno.
    SORT t_vbak BY vbeln.
                               SECOND PAGE                              *
    DATA FOR 2ND PAGE IS FILLED IN THE SUBROUTINE HANDLING USER_COMMAND *
    --FILLING EVENTS TABLE--
    w_events-name = 'TOP_OF_PAGE'.
    w_events-form = 'SUB1'.
    APPEND w_events TO t_events.
    w_events-name = 'USER_COMMAND'.
    w_events-form = 'SUB2'.
    APPEND w_events TO t_events.
    --FILLING COMMENTS TABLE--
    w_comments-typ = 'H'.
    w_comments-info = 'CUSTOMER ORDER INFORMATION'.
    APPEND w_comments TO t_comments.
    w_comments-typ = 'S'.
    w_comments-key = 'Sold To Party'.
    w_comments-info = p_custno.
    APPEND w_comments TO t_comments.
    -----PASSING FIELD CATALOG AND THE DATA TABLE TO THE FUNCTION-----
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        I_INTERFACE_CHECK                 = ' '
        I_BYPASSING_BUFFER                = ' '
        I_BUFFER_ACTIVE                   = ' '
          i_callback_program                = V_REPID
        I_CALLBACK_PF_STATUS_SET          = ' '
        I_CALLBACK_USER_COMMAND           = ' '
        I_CALLBACK_TOP_OF_PAGE            = ' '
        I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
        I_CALLBACK_HTML_END_OF_LIST       = ' '
        I_STRUCTURE_NAME                  =
        I_BACKGROUND_ID                   = ' '
        I_GRID_TITLE                      =
        I_GRID_SETTINGS                   =
        IS_LAYOUT                         =
          it_fieldcat                       = t_fcat
        IT_EXCLUDING                      =
        IT_SPECIAL_GROUPS                 =
        IT_SORT                           =
        IT_FILTER                         =
        IS_SEL_HIDE                       =
        I_DEFAULT                         = 'X'
        I_SAVE                            = ' '
        IS_VARIANT                        =
          it_events                         = t_events
        IT_EVENT_EXIT                     =
        IS_PRINT                          =
        IS_REPREP_ID                      =
        I_SCREEN_START_COLUMN             = 0
        I_SCREEN_START_LINE               = 0
        I_SCREEN_END_COLUMN               = 0
        I_SCREEN_END_LINE                 = 0
        IT_ALV_GRAPHICS                   =
        IT_HYPERLINK                      =
        IT_ADD_FIELDCAT                   =
        IT_EXCEPT_QINFO                   =
        I_HTML_HEIGHT_TOP                 =
        I_HTML_HEIGHT_END                 =
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER           =
        ES_EXIT_CAUSED_BY_USER            =
      TABLES
        t_outtab                          = t_vbak
      EXCEPTIONS
        PROGRAM_ERROR                     = 1
        OTHERS                            = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
                Subroutine for the Event TOP_OF_PAGE
    FORM sub1 .
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = t_comments
          i_logo                   = 'COMPANY LOGO'
      I_END_OF_LIST_GRID       =
    ENDFORM.                                                    " sub1
                Subroutine for the Event USER_COMMAND
    Here u_comm contains the function code of the selected function
    and slis_field is a structure containing cursor information
    FORM sub2 USING u_comm LIKE sy-ucomm rs_field TYPE slis_selfield.
    CASE u_comm.
        WHEN '&IC1'.
          IF rs_field-fieldname = 'VBELN'.
            SELECT posnr
                   arktx
                   werks
            FROM vbap INTO TABLE t2_vbap WHERE vbeln = rs_field-value.
          ENDIF.
      ENDCASE.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
        I_INTERFACE_CHECK                 = ' '
        I_BYPASSING_BUFFER                = ' '
        I_BUFFER_ACTIVE                   = ' '
        I_CALLBACK_PROGRAM                = ' '
        I_CALLBACK_PF_STATUS_SET          = ' '
        I_CALLBACK_USER_COMMAND           = ' '
        I_CALLBACK_TOP_OF_PAGE            = ' '
        I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
        I_CALLBACK_HTML_END_OF_LIST       = ' '
        I_STRUCTURE_NAME                  =
        I_BACKGROUND_ID                   = ' '
        I_GRID_TITLE                      =
        I_GRID_SETTINGS                   =
        IS_LAYOUT                         =
          it_fieldcat                       = t2_fcat
        IT_EXCLUDING                      =
        IT_SPECIAL_GROUPS                 =
        IT_SORT                           =
        IT_FILTER                         =
        IS_SEL_HIDE                       =
        I_DEFAULT                         = 'X'
        I_SAVE                            = ' '
        IS_VARIANT                        =
        IT_EVENTS                         =
        IT_EVENT_EXIT                     =
        IS_PRINT                          =
        IS_REPREP_ID                      =
        I_SCREEN_START_COLUMN             = 0
        I_SCREEN_START_LINE               = 0
        I_SCREEN_END_COLUMN               = 0
        I_SCREEN_END_LINE                 = 0
        IT_ALV_GRAPHICS                   =
        IT_HYPERLINK                      =
        IT_ADD_FIELDCAT                   =
        IT_EXCEPT_QINFO                   =
        I_HTML_HEIGHT_TOP                 =
        I_HTML_HEIGHT_END                 =
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER           =
        ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = t2_vbap.
      EXCEPTIONS
        PROGRAM_ERROR                     = 1
        OTHERS                            = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                                                    "sub2

  • ALV Tree Report without using ABAP Objects

    Hi all,
    I want to know the name of a function module to create ALV Tree in SE38 as a report. I am required to create this ALV Tree Report without using ABAP OBJECTS. Can u pls help me as early as possible.

    Hi
    see this link
    http://www.sapdev.co.uk/reporting/alv/alvtree.htm
    *& Report  ZBCALV_TREE
    REPORT  ZBCALV_TREE.
    class cl_gui_column_tree definition load.
    class cl_gui_cfw definition load.
    data tree1  type ref to cl_gui_alv_tree.
    data mr_toolbar type ref to cl_gui_toolbar.
    include <icon>.
    include bcalv_toolbar_event_receiver.
    include bcalv_tree_event_receiver.
    data: toolbar_event_receiver type ref to lcl_toolbar_event_receiver.
    data: gt_VBAK  type VBAK occurs 0,      "Output-Table
          gt_fieldcatalog type lvc_t_fcat, "Fieldcatalog
          ok_code like sy-ucomm.           "OK-Code
    start-of-selection.
    end-of-selection.
      call screen 100.
    *&      Module  STATUS_0100  OUTPUT
          text
    module STATUS_0100 output.
      SET PF-STATUS 'MAIN'.
    if tree1 is initial.
        perform Zinit_tree.
      endif.
      call method cl_gui_cfw=>flush.
    endmodule.                 " STATUS_0100  OUTPUT
    *&      Form  Zinit_tree
          text
    -->  p1        text
    <--  p2        text
    form Zinit_tree .
    perform Zbuild_fieldcatalog.
    create container for alv-tree
    data: l_tree_container_name(30) type c,
            l_custom_container type ref to cl_gui_custom_container.
      l_tree_container_name = 'TREE1'.
    if sy-batch is initial.
        create object l_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 <> 0.
          message x208(00) with 'ERROR'.                        "#EC NOTEXT
        endif.
      endif.
    create tree control
      create object tree1
        exporting
            parent              = l_custom_container
            node_selection_mode = cl_gui_column_tree=>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 <> 0.
        message x208(00) with 'ERROR'.                          "#EC NOTEXT
      endif.
    create Hierarchy-header
      data l_hierarchy_header type treev_hhdr.
      perform zbuild_hierarchy_header changing l_hierarchy_header.
    create info-table for html-header
      data: lt_list_commentary type slis_t_listheader,
            l_logo             type sdydo_value.
      perform Zbuild_comment using
                     lt_list_commentary
                     l_logo.
    repid for saving variants
      data: ls_variant type disvariant.
      ls_variant-report = sy-repid.
    create emty tree-control
      call method tree1->set_table_for_first_display
        exporting
          is_hierarchy_header = l_hierarchy_header
          it_list_commentary  = lt_list_commentary
          i_logo              = l_logo
          i_background_id     = 'ALV_BACKGROUND'
          i_save              = 'A'
          is_variant          = ls_variant
        changing
          it_outtab           = gt_VBAK "table must be emty !!
          it_fieldcatalog     = gt_fieldcatalog.
    create hierarchy
      perform Zcreate_hierarchy.
    add own functioncodes to the toolbar
      perform zchange_toolbar.
    register events
      perform zregister_events.
    endform.                    " Zinit_tree
    *&      Form  Zbuild_fieldcatalog
          text
    -->  p1        text
    <--  p2        text
    form Zbuild_fieldcatalog .
    get fieldcatalog
      call function 'LVC_FIELDCATALOG_MERGE'
        exporting
          i_structure_name = 'VBAK'
        changing
          ct_fieldcat      = gt_fieldcatalog.
      sort gt_fieldcatalog by scrtext_l.
    change fieldcatalog
      data: ls_fieldcatalog type lvc_s_fcat.
      loop at gt_fieldcatalog into ls_fieldcatalog.
        case ls_fieldcatalog-fieldname.
          when 'AUART' .
            ls_fieldcatalog-no_out = 'X'.
            ls_fieldcatalog-key    = ''.
        endcase.
        modify gt_fieldcatalog from ls_fieldcatalog.
      endloop.
    endform.                    " Zbuild_fieldcatalog
    *&      Form  zbuild_hierarchy_header
          text
         <--P_L_HIERARCHY_HEADER  text
    form zbuild_hierarchy_header changing
                                   p_hierarchy_header type treev_hhdr.
      p_hierarchy_header-heading = 'Hierarchy Header'.          "#EC NOTEXT
      p_hierarchy_header-tooltip =
                             'This is the Hierarchy Header !'.  "#EC NOTEXT
      p_hierarchy_header-width = 30.
      p_hierarchy_header-width_pix = ''.
    endform.                    " zbuild_hierarchy_header
    *&      Form  Zbuild_comment
          text
         -->P_LT_LIST_COMMENTARY  text
         -->P_L_LOGO  text
    form Zbuild_comment   using
                           pt_list_commentary type slis_t_listheader
                           p_logo             type sdydo_value.
    data: ls_line type slis_listheader.
    LIST HEADING LINE: TYPE H
      clear ls_line.
      ls_line-typ  = 'H'.
    LS_LINE-KEY:  NOT USED FOR THIS TYPE
      ls_line-info = 'ALV-tree-demo: flight-overview'.          "#EC NOTEXT
      append ls_line to pt_list_commentary.
    STATUS LINE: TYPE S
      clear ls_line.
      ls_line-typ  = 'S'.
      ls_line-key  = 'valid until'.                             "#EC NOTEXT
      ls_line-info = 'January 29 1999'.                         "#EC NOTEXT
      append ls_line to pt_list_commentary.
      ls_line-key  = 'time'.
      ls_line-info = '2.00 pm'.                                 "#EC NOTEXT
      append ls_line to pt_list_commentary.
    ACTION LINE: TYPE A
      clear ls_line.
      ls_line-typ  = 'A'.
    LS_LINE-KEY:  NOT USED FOR THIS TYPE
      ls_line-info = 'actual data'.                             "#EC NOTEXT
      append ls_line to pt_list_commentary.
      p_logo = 'ENJOYSAP_LOGO'.
    endform.                    " Zbuild_comment
    *&      Form  Zcreate_hierarchy
          text
    -->  p1        text
    <--  p2        text
    form Zcreate_hierarchy .
    data: ls_vbak type vbak,
          lt_vbak  type vbak occurs 0.
    get data
      select * from vbak into table lt_vbak
                            up to 200 rows .                "#EC CI_NOWHERE
      sort lt_vbak by AUART.
    add data to tree
      data: l_AUART_key type lvc_nkey.
    loop at lt_vbak into ls_vbak.
        on change of ls_vbak-AUART.
          perform Zadd_AUART_line using   ls_vbak
                                  changing l_AUART_key.
        endon.
      endloop.
    calculate totals
      call method tree1->update_calculations.
    this method must be called to send the data to the frontend
      call method tree1->frontend_update.
    endform.                    " Zcreate_hierarchy
    *&      Form  Zadd_AUART_line
          text
         -->P_LS_vbak  text
         -->P_0379   text
         <--P_L_AUART_KEY  text
    form Zadd_AUART_line  using    p_ls_vbak type vbak
                                   p_relat_key type lvc_nkey
                         changing  p_node_key type lvc_nkey.
      data: l_node_text type lvc_value,
            ls_vbak type vbak.
    set item-layout
      data: lt_item_layout type lvc_t_layi,
            ls_item_layout type lvc_s_layi.
      ls_item_layout-t_image = '@3P@'.
      ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
      ls_item_layout-style   =
                            cl_gui_column_tree=>style_intensifd_critical.
      append ls_item_layout to lt_item_layout.
    add node
      l_node_text =  p_ls_vbak-AUART.
      data: ls_node type lvc_s_layn.
      ls_node-n_image   = space.
      ls_node-exp_image = space.
      call method tree1->add_node
        exporting
          i_relat_node_key = p_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_vbak
          is_node_layout   = ls_node
          it_item_layout   = lt_item_layout
        importing
          e_new_node_key   = p_node_key .
    endform.                    " Zadd_AUART_line
    *&      Form  zchange_toolbar
          text
    -->  p1        text
    <--  p2        text
    form zchange_toolbar .
    get toolbar control
      call method tree1->get_toolbar_object
        importing
          er_toolbar = mr_toolbar.
      check not mr_toolbar is initial.
    add seperator to toolbar
      call method mr_toolbar->add_button
        exporting
          fcode     = ''
          icon      = ''
          butn_type = cntb_btype_sep
          text      = ''
          quickinfo = 'This is a Seperator'.                    "#EC NOTEXT
    add Standard Button to toolbar (for Delete Subtree)
      call method mr_toolbar->add_button
        exporting
          fcode     = 'DELETE'
          icon      = '@18@'
          butn_type = cntb_btype_button
          text      = ''
          quickinfo = 'Delete subtree'.                         "#EC NOTEXT
    add Dropdown Button to toolbar (for Insert Line)
      call method mr_toolbar->add_button
        exporting
          fcode     = 'INSERT_LC'
          icon      = '@17@'
          butn_type = cntb_btype_dropdown
          text      = ''
          quickinfo = 'Insert Line'.                            "#EC NOTEXT
    set event-handler for toolbar-control
      create object toolbar_event_receiver.
      set handler toolbar_event_receiver->on_function_selected
                                                          for mr_toolbar.
      set handler toolbar_event_receiver->on_toolbar_dropdown
                                                          for mr_toolbar.
    endform.                    " zchange_toolbar
    *&      Form  zregister_events
          text
    -->  p1        text
    <--  p2        text
    form zregister_events .
    define the events which will be passed to the backend
      data: lt_events type cntl_simple_events,
              l_event type cntl_simple_event.
    define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_checkbox_change.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_click.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
      append l_event to lt_events.
      call method tree1->set_registered_events
        exporting
          events                    = lt_events
        exceptions
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
      if sy-subrc <> 0.
        message x208(00) with 'ERROR'.                          "#EC NOTEXT
      endif.
    set Handler
      data: l_event_receiver type ref to lcl_tree_event_receiver.
      create object l_event_receiver.
      set handler l_event_receiver->handle_node_ctmenu_request
                                                            for tree1.
      set handler l_event_receiver->handle_node_ctmenu_selected
                                                            for tree1.
      set handler l_event_receiver->handle_item_ctmenu_request
                                                            for tree1.
      set handler l_event_receiver->handle_item_ctmenu_selected
                                                            for tree1.
    endform.                    " zregister_events
    *&      Module  USER_COMMAND_0100  INPUT
          text
    module USER_COMMAND_0100 input.
    ok_code  = sy-ucomm.
    clear sy-ucomm.
    case ok_code.
        when 'EXIT' or 'BACK' or 'CANC'.
          perform Zexit_program.
        when others.
          call method cl_gui_cfw=>dispatch.
      endcase.
      clear ok_code.
      call method cl_gui_cfw=>flush.
    endmodule.                 " USER_COMMAND_0100  INPUT
    *&      Form  Zexit_program
          text
    -->  p1        text
    <--  p2        text
    form Zexit_program .
      call method tree1->free.
      leave program.
    endform.                    " Zexit_program
    <b>Reward if usefull</b>

  • S_ALR_87012284 -  List Output - ALV Tree Control

    Dear Friends,
    In Standard Financial statement report when I use List output  -> ALV Tree Control  lay out. In the display area is it possible to save the expanded folders  in lay out. So that next time when I run the report with the same ALV Tree Contorl lay out, I would like to see folders expanded.
    Thanks,
    Venky

    Hi Venky,
    There is no way to have expanded tree list. You must hit Expand tree button to.
    You can also use ttrasaction code F.01 for balance sheet.
    Best regards

  • Output like Tree structure

    Hi
    I am having Data in one internal table
    BEGIN OF ty_box,
           vbeln LIKE vbak-vbeln, "Sales Order Document Number
           exidv LIKE vekp-exidv, "External Handling Unit Identification
           vegr4 LIKE vekp-vegr4, "Integration required if the value is INTR
           matnr LIKE lips-matnr, "Delivery Item-Material Number
           arktx LIKE lips-arktx, "Delivery Item-Short text for Material
    END OF ty_box.
    I want to Display output like tree structure
    integration required?
    () Sales order                                              
    () HU  -
    checkbox                                                                               
    Mat A       Description of A
    Mat B       Description of B
    Please give sample program for this type.  '-' indicate sapce
    Message was edited by:
            sudhakara reddy
    Message was edited by:
            sudhakara reddy

    hi,
    use ALV TREE
    check these links.
    http://www.erpgenie.com/sap/abap/SalesOrderFlow.htm
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_basic.htm
    Check these programs.
    BCALV_TREE_01 ALV tree control: build up the hierarchy tree
    BCALV_TREE_02 ALV tree control: event handling
    BCALV_TREE_03 ALV tree control: use an own context menu
    BCALV_TREE_04 ALV tree control: add a button to the toolbar
    BCALV_TREE_05 ALV tree control: add a menu to the toolbar
    BCALV_TREE_06 ALV tree control: Icon column and icon for nodes/items
    BCALV_TREE_DEMO Demo for ALV tree control
    BCALV_TREE_DND ALV tree control: Drag & Drop within a hierarchy tree
    BCALV_TREE_DND_MULTIPLE ALV tree control: Drag & Drop within a hierarchy tree
    RSDEMO_DRAG_DROP_TREE_MULTI
    BCALV_TREE_EVENT_RECEIVER Include BCALV_TREE_EVENT_RECEIVER
    BCALV_TREE_EVENT_RECEIVER01
    BCALV_TREE_ITEMLAYOUT ALV Tree: Change Item Layouts at Runtime
    BCALV_TREE_MOVE_NODE_TEST Demo for ALV tree control
    BCALV_TREE_SIMPLE_DEMO Program BCALV_TREE_SIMPLE_DEMO
    BCALV_TREE_VERIFY Verifier for ALV Tree and Simple ALV Tree
    Also please check the transaction DWDM This will give info also on trees.
    Check the links -
    drag drop required for alv column!
    drag and drop in a tree
    Drag&Drop within the Tree
    Drag&Drop within a tree
    Drag and drop in ALV tree

  • TREE Report for WBS Element

    hi gurus,
             can any one tell me how to generate the hierarchical (tree ) report for a purticular project.
    I should genarate a hierarchical report for all WBS (From top level to lower level WBS ).
    With Regards,
    Raj.

    Hi raj,
    check BCALV_TREE_02 for ALV TREE DISPLAY ( for more clarification debug it )
    * my final table structure
            BEGIN OF gty_fin ,
             posid TYPE ps_posid,
             pspnr TYPE ps_intnr,
             post1 TYPE ps_post1,
             ebeln TYPE ebeln,
             ebelp TYPE ebelp ,
             name1 TYPE name1,
             belnr TYPE mblnr ,
             cplan TYPE wtgxxx ,
             netpr TYPE ekpo-netpr ,
             dmbtr TYPE dmbtr ,
             obligo TYPE dmbtr,
             vefugt TYPE dmbtr,
             verfugbar TYPE dmbtr,
            END OF gty_fin ,
    * Coding starts here in ur PBO
    *do modification accordingly
    MODULE status_0100 OUTPUT.
        PERFORM init_tree.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    FORM init_tree .
    * create container for alv-tree
      DATA: l_tree_container_name(30) TYPE c.
      l_tree_container_name = 'CCONTAINER1'.
      CREATE OBJECT g_custom_container
        EXPORTING
          container_name              = l_tree_container_name
    * create tree control
      CREATE OBJECT g_alv_tree
        EXPORTING
          parent                      = g_custom_container
          node_selection_mode         = cl_gui_column_tree=>node_sel_mode_single
          item_selection              = ' '
          no_html_header              = 'X'.
      DATA l_hierarchy_header TYPE treev_hhdr.
      PERFORM build_hierarchy_header CHANGING l_hierarchy_header.
    * Hide columns and sum up values initially using the fieldcatalog
      PERFORM build_fieldcatalog.
      CALL METHOD g_alv_tree->set_table_for_first_display
        EXPORTING
          is_hierarchy_header = l_hierarchy_header
        CHANGING
          it_fieldcatalog     = git_fieldcatalog
          it_outtab           = git_edit. "table must be empty !
      PERFORM create_hierarchy.
      PERFORM register_events.
      CALL METHOD g_alv_tree->update_calculations.
    * Send data to frontend.
      CALL METHOD g_alv_tree->frontend_update.
    ENDFORM.                    "init_tree
    " INIT_TREE
    *&      Form  BUILD_HIERARCHY_HEADER
    FORM build_hierarchy_header  CHANGING
                                     p_hierarchy_header TYPE treev_hhdr.
      p_hierarchy_header-heading = 'Project Definition'(002).
      p_hierarchy_header-tooltip = 'Project Definition'(002).
      p_hierarchy_header-width = 35.
      p_hierarchy_header-width_pix = ''.
    ENDFORM.                    " BUILD_HIERARCHY_HEADER
    *&      Form  exit_program
    *       free object and leave program
    FORM exit_program.
      CALL METHOD g_custom_container->free.
      LEAVE PROGRAM.
    ENDFORM.                    "exit_program
    *&      Form  build_fieldcatalog
    FORM build_fieldcatalog.
      DATA: lwa_fieldcatalog TYPE lvc_s_fcat.
    * The following function module generates a fieldcatalog according
    * to a given structure.
      REFRESH git_fieldcatalog.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'ZDRK'       "  i created a structure same as final itab.
        CHANGING
          ct_fieldcat      = git_fieldcatalog.
      LOOP AT git_fieldcatalog INTO lwa_fieldcatalog.
        CASE lwa_fieldcatalog-fieldname.
    * hide columns which are already displayed in our tree
          WHEN 'POSID' OR 'PSPNR' OR 'EBELN' OR 'EBELP' OR 'POST1'.
            lwa_fieldcatalog-no_out = 'X'.
    ** Do some initial calculations:
    ** ALV Tree uses the field 'do_sum' to declare that a function
    ** for the corresponding column shall be calculated.
    ** Use 'h_ftype' to set the function type (MAX, MIN, SUM, AVG).
          WHEN 'DMBTR' OR 'OBLIGO'  OR 'VEFUGT' OR 'VERFUGBAR'. " 'CPLAN' OR
            lwa_fieldcatalog-do_sum = 'X'.
            lwa_fieldcatalog-h_ftype = 'SUM'.
          WHEN 'BELNR'.
            lwa_fieldcatalog-hotspot = 'X'.
            lwa_fieldcatalog-tooltip = 'Invoice Document Number'(003).
        ENDCASE.
        MODIFY git_fieldcatalog FROM lwa_fieldcatalog.
      ENDLOOP.
    ENDFORM.                               " build_fieldcatalog
    *&      Form  create_hierarchy
    FORM create_hierarchy.
      DATA: ls_fin TYPE gty_fin,
          lt_fin TYPE TABLE OF gty_fin,
          lv_posid1_last TYPE ps_posid,
          lv_ebeln TYPE ebeln,
          lv_post1 TYPE ps_post1,
          lv_ebeln_last TYPE ebeln,
          lv_ebelp TYPE ebelp.
      DATA: lv_ebeln_key TYPE lvc_nkey,
            lv_ebelp_key TYPE lvc_nkey,
            lv_last_key TYPE lvc_nkey,
            lv_top_key TYPE lvc_nkey,
            lv_node_text TYPE lvc_value,
            lv_text_psp TYPE char10 .
      lv_text_psp = 'Project'(004).
    * all my data is in final itab git_fin
      lt_fin[] = git_fin .
      lv_node_text = gv_proj.
      CALL METHOD g_alv_tree->add_node
        EXPORTING
          i_relat_node_key = ''
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = lv_node_text
        IMPORTING
          e_new_node_key   = lv_top_key.
      LOOP AT lt_fin INTO ls_fin.
        lv_posid1 = ls_fin-posid.
        lv_post1  = ls_fin-post1.
        lv_ebeln  = ls_fin-ebeln.
        lv_ebelp  = ls_fin-ebelp.
        IF lv_posid1 <> lv_posid1_last.     " on change of posid
          lv_posid1_last = lv_posid1.
    * PO- ebeln nodes
          PERFORM add_ebeln USING  lv_posid1
                                   lv_post1
                                   lv_top_key
                            CHANGING lv_ebeln_key.
        ENDIF.
        IF lv_ebeln <> lv_ebeln_last.  " On change of lv_ebeln
          lv_ebeln_last = lv_ebeln .
          PERFORM add_ebelp USING ls_fin
                                  lv_ebeln_key
                                  lv_ebeln
                        CHANGING  lv_ebelp_key .
        ENDIF.
    * Leaf:
        PERFORM add_complete_line USING  ls_fin
                                         lv_ebelp_key
                                         lv_ebelp
                              CHANGING   lv_last_key .
      ENDLOOP.
    * expand first node initially
      CALL METHOD g_alv_tree->expand_node
        EXPORTING
          i_node_key = lv_top_key.
    ENDFORM.                               " create_hierarchy
    *&      Form  ADD_EBELN
    FORM add_ebeln  USING    p_lv_posid1 TYPE ps_posid
                             p_lv_post1 TYPE  ps_post1
                             p_lv_top_key TYPE lvc_nkey
                    CHANGING p_lv_ebeln_key TYPE lvc_nkey.
      DATA : ls_fin TYPE gty_fin,
             lv_node_text TYPE lvc_value ,
             lv_text_psp TYPE char11.
      lv_text_psp =  'WBS Element'(005).
      lv_node_text =  p_lv_posid1.
      CONCATENATE p_lv_post1 lv_node_text
             INTO lv_node_text
        SEPARATED BY space.
    * add node
      CALL METHOD g_alv_tree->add_node
        EXPORTING
          i_relat_node_key = p_lv_top_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = lv_node_text  " 'WBS Element'
          is_outtab_line   = ls_fin
        IMPORTING
          e_new_node_key   = p_lv_ebeln_key.
    ENDFORM.                    " ADD_EBELN
    *&      Form  ADD_EBELP
    FORM add_ebelp  USING    p_ls_fin TYPE gty_fin
                             p_lv_ebeln_key TYPE lvc_nkey
                             p_lv_ebeln TYPE ebeln
                    CHANGING p_lv_ebelp_key TYPE lvc_nkey.
      DATA : ls_fin TYPE gty_fin ,
            lv_node_text TYPE lvc_value,
            lv_text_order TYPE char10 .
      lv_text_order = 'ORDER  '(006).
      lv_node_text = p_lv_ebeln  .
      CONCATENATE lv_text_order lv_node_text
             INTO lv_node_text
        SEPARATED BY space.
      CALL METHOD g_alv_tree->add_node
        EXPORTING
          i_relat_node_key = p_lv_ebeln_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = lv_node_text " 'EBELN
          is_outtab_line   = ls_fin
        IMPORTING
          e_new_node_key   = p_lv_ebelp_key.
    ENDFORM.                    " ADD_EBELP
    *&      Form  ADD_COMPLETE_LINE
    *       text
    *      -->P_LS_FIN  text
    *      -->P_LV_EBELP_KEY  text
    *      <--P_LV_LAST_KEY  text
    FORM add_complete_line  USING    p_ls_fin TYPE gty_fin
                                     p_lv_ebelp_key TYPE lvc_nkey
                                     p_lv_ebelp TYPE ebelp
                            CHANGING p_lv_last_key TYPE lvc_nkey.
      DATA :  lv_text_pos TYPE char10,
              lv_node_text TYPE lvc_value,
              lv_node_layn TYPE lvc_s_layn.
      lv_text_pos = 'Position '(007).
      lv_node_text = p_lv_ebelp  .
      IF p_lv_ebelp IS INITIAL .
        lv_node_text = 'PLAN'(008) .
        lv_node_layn-hidden = 'X'.
      ELSE.
        CONCATENATE lv_text_pos lv_node_text
               INTO lv_node_text
          SEPARATED BY space.
      ENDIF.
      CALL METHOD g_alv_tree->add_node
        EXPORTING
          i_relat_node_key = p_lv_ebelp_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          is_outtab_line   = p_ls_fin
          is_node_layout   = lv_node_layn
          i_node_text      = lv_node_text " Position of item
        IMPORTING
          e_new_node_key   = p_lv_last_key.
        CLEAR : lv_node_layn .
    ENDFORM.                    " ADD_COMPLETE_LINE
    Regards,
    Aby
    hope this might be useful.

  • How can I write a tree report?

    How can I write a tree report? If you have any document/ link can you please send that.
    Regards,
    Subhasish

    REPORT  zdemo_alv_tree.
    Demo program prepared for ****************
    CLASS cl_gui_column_tree DEFINITION LOAD.
    CLASS cl_gui_cfw DEFINITION LOAD.
    DATA tree1  TYPE REF TO cl_gui_alv_tree_simple.
    INCLUDE <icon>.
    INCLUDE bcalv_simple_event_receiver.
    DATA: gt_sflight      TYPE sflight OCCURS 0,   " Output-Table
          gt_fieldcatalog TYPE lvc_t_fcat,         " Field Catalog
          gt_sort         TYPE lvc_t_sort,         " Sorting Table
          ok_code         LIKE sy-ucomm.           " OK-Code
    END-OF-SELECTION.
      CALL SCREEN 100.
    *&      Form  BUILD_FIELDCATALOG
    This subroutine is used to build the field catalog for the ALV list
    FORM build_fieldcatalog.
    get fieldcatalog
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'SFLIGHT'
        CHANGING
          ct_fieldcat      = gt_fieldcatalog.
    change fieldcatalog
      DATA: ls_fieldcatalog TYPE lvc_s_fcat.
      LOOP AT gt_fieldcatalog INTO ls_fieldcatalog.
        CASE ls_fieldcatalog-fieldname.
          WHEN 'CARRID' OR 'CONNID' OR 'FLDATE'.
            ls_fieldcatalog-no_out = 'X'.
            ls_fieldcatalog-key    = ''.
          WHEN 'PRICE' OR 'SEATSOCC' OR 'SEATSMAX' OR 'PAYMENTSUM'.
            ls_fieldcatalog-do_sum = 'X'.
        ENDCASE.
        MODIFY gt_fieldcatalog FROM ls_fieldcatalog.
      ENDLOOP.
    ENDFORM.                               " BUILD_FIELDCATALOG
    *&      Form  BUILD_OUTTAB
    Retrieving the data from the table and filling it in the output table
    of the ALV list
    FORM build_outtab.
      SELECT * FROM sflight INTO TABLE gt_sflight.
    ENDFORM.                               " BUILD_OUTTAB
    *&      Form  BUILD_SORT_TABLE
    This subroutine is used to build the sort table or the sort criteria
    FORM build_sort_table.
      DATA ls_sort_wa TYPE lvc_s_sort.
    create sort-table
      ls_sort_wa-spos = 1.
      ls_sort_wa-fieldname = 'CARRID'.
      ls_sort_wa-up = 'X'.
      ls_sort_wa-subtot = 'X'.
      APPEND ls_sort_wa TO gt_sort.
      ls_sort_wa-spos = 2.
      ls_sort_wa-fieldname = 'CONNID'.
      ls_sort_wa-up = 'X'.
      ls_sort_wa-subtot = 'X'.
      APPEND ls_sort_wa TO gt_sort.
      ls_sort_wa-spos = 3.
      ls_sort_wa-fieldname = 'FLDATE'.
      ls_sort_wa-up = 'X'.
      APPEND ls_sort_wa TO gt_sort.
    ENDFORM.                               " BUILD_SORT_TABLE
    *&      Module  PBO  OUTPUT
    This subroutine is used to build the ALV Tree
    MODULE pbo OUTPUT.
      IF tree1 IS INITIAL.
        PERFORM init_tree.
      ENDIF.
      SET PF-STATUS 'ZSTATUS'.
    ENDMODULE.                             " PBO  OUTPUT
    *&      Module  PAI  INPUT
    This subroutine is used to handle the navigation on the screen
    MODULE pai INPUT.
      CASE ok_code.
        WHEN 'EXIT' OR 'BACK' OR 'CANC'.
          PERFORM exit_program.
        WHEN OTHERS.
          CALL METHOD cl_gui_cfw=>dispatch.
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                             " PAI  INPUT
    *&      Form  exit_program
          free object and leave program
    FORM exit_program.
      CALL METHOD tree1->free.
      LEAVE PROGRAM.
    ENDFORM.                               " exit_program
    *&      Form  register_events
    Handling the events in the ALV Tree control in backend
    FORM register_events.
    define the events which will be passed to the backend
      DATA: lt_events TYPE cntl_simple_events,
            l_event TYPE cntl_simple_event.
    define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_click.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
      APPEND l_event TO lt_events.
      CALL METHOD tree1->set_registered_events
        EXPORTING
          events                    = lt_events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
    set Handler
      DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
      CREATE OBJECT l_event_receiver.
      SET HANDLER l_event_receiver->on_add_hierarchy_node
                                                            FOR tree1.
    ENDFORM.                               " register_events
    *&      Form  build_header
          build table for header
    FORM build_comment USING
          pt_list_commentary TYPE slis_t_listheader
          p_logo             TYPE sdydo_value.
      DATA: ls_line TYPE slis_listheader.
    LIST HEADING LINE: TYPE H
      CLEAR ls_line.
      ls_line-typ  = 'H'.
    LS_LINE-KEY:  NOT USED FOR THIS TYPE
      ls_line-info = 'ALV TREE DEMO for ****************'.
      APPEND ls_line TO pt_list_commentary.
      p_logo = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "build_comment
    *&      Form  init_tree
    Building the ALV-Tree for the first time display
    FORM init_tree.
      PERFORM build_fieldcatalog.
      PERFORM build_outtab.
      PERFORM build_sort_table.
    create container for alv-tree
      DATA: l_tree_container_name(30) TYPE c,
            l_custom_container TYPE REF TO cl_gui_custom_container.
      l_tree_container_name = 'TREE1'.
      CREATE OBJECT l_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.
    create tree control
      CREATE OBJECT tree1
        EXPORTING
            i_parent              = l_custom_container
            i_node_selection_mode =
                                  cl_gui_column_tree=>node_sel_mode_multiple
            i_item_selection      = 'X'
            i_no_html_header      = ''
            i_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.
    create info-table for html-header
      DATA: lt_list_commentary TYPE slis_t_listheader,
            l_logo             TYPE sdydo_value.
      PERFORM build_comment USING
                     lt_list_commentary
                     l_logo.
    repid for saving variants
      DATA: ls_variant TYPE disvariant.
      ls_variant-report = sy-repid.
    register events
      PERFORM register_events.
    create hierarchy
      CALL METHOD tree1->set_table_for_first_display
        EXPORTING
          it_list_commentary = lt_list_commentary
          i_logo             = l_logo
          i_background_id    = 'ALV_BACKGROUND'
          i_save             = 'A'
          is_variant         = ls_variant
        CHANGING
          it_sort            = gt_sort
          it_outtab          = gt_sflight
          it_fieldcatalog    = gt_fieldcatalog.
    expand first level
      CALL METHOD tree1->expand_tree
        EXPORTING
          i_level = 1.
    optimize column-width
      CALL METHOD tree1->column_optimize
        EXPORTING
          i_start_column = tree1->c_hierarchy_column_name
          i_end_column   = tree1->c_hierarchy_column_name.
    ENDFORM.                    " init_tree

Maybe you are looking for

  • Master recipes operations not getting transfered in SNP PDS to APO from R3

    Hello APO Gurus, I am trying to transfer SNP PDS for master receipes from R3 to APO. Issue description:: The operation is not getting transfered correctly , some system default operation "010 generated Operation (from Planned Delive)" is getting gene

  • Jabber cannot Call - Integration with CUCM/AD

    Dear all, I installed CUCM 9.1.1 and CUPS 9.1.1 with Jabber client 9.0.1. when I run Jabber on a joined domain PC (login with AD username and password), there are no problem with the calling ability. But when I try to use a non-join domain PC (I am u

  • Can't remove apple mobile device support. need to for update?

    Every time I plug in my iPhone (3GS or my wife's 4) or my iPad2 I get a message telling me to update Apple mobile devise support and to do so I need to uninstall it and iTunes and reinstall. Windows won't uninstall AMDS. (windows vista) It will unins

  • Apple TV video streaming issue with EA4500

    I am facing issues with my router EA4500 and my apple TV. When I am watching a video from my itunes library at my PC, sometimes stop palying waiting to receive data. Is that a way to conect my apple tv to my router to prioritize this video streaming

  • Check marks when texting

    I've recently noticed that when I send texts on my phone to other numbers that are Verizon there is no longer a check mark to confirm that they have received the text. I have a Samsung intensity 2 and its always done the check mark thing before. I wa