How to Display Heading for TREE Structure (report)

hi,
     tell me how display the heading for the TREE Report.
With Regards,
Shakthi Raj N.

Hi,
If you are using object oriented approach for developing the Tree report, then you can use below shown example for creating header for the report.
  first create tree control
  CREATE OBJECT TREE1
    EXPORTING
        PARENT              = G_CONTAINER_OBJECT
        NODE_SELECTION_MODE = CL_GUI_COLUMN_TREE=>NODE_SEL_MODE_SINGLE
        ITEM_SELECTION      = ''
        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.
  CLEAR GT_HEADER.
  GT_HEADER-TYP = 'H'.
  GT_HEADER-INFO = 'Output'.
  APPEND GT_HEADER.
  CLEAR GT_HEADER.
  GT_HEADER-TYP = 'S'.
  GT_HEADER-KEY = 'Display'.
  GT_HEADER-INFO = 'Report'.
  APPEND GT_HEADER.
then create empty tree-control
  CALL METHOD TREE1->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
               IS_HIERARCHY_HEADER  = G_HIERARCHY_HEADER
               I_BACKGROUND_ID      = 'ALV_BACKGROUND'
               IT_LIST_COMMENTARY   = GT_HEADER[]
          CHANGING
               IT_OUTTAB            = GT_SPFLI[]    "empty table
               IT_FIELDCATALOG      = GT_FIELDCAT_LVC[].
In this way header can be given for Tree report.
Hope this answers your query.
Regards,
Brajvir

Similar Messages

  • How to display Header for table in Script

    Dear All,
    In script i am displaying the data in tabular format, by using the
    function module write_form_lines. For this i have called multiple
    windows for each column. I am able to display the data,however
    don't know how to name this column, i.e the header for each column.
    (Sr_No,,Vendor Name,,Account Number,,Reference Code,,Amount ).
    Any help is appreciated.
    Thanks & Regards,
    Manju

    Hi Manju,
    Create a widow to display the header details(hard code the name of the columns). You have to  use main window for displaying the table data.Loop the internal table in driver program, inside the loop call the function write_form for printing the table contents.
    Thanks,
    Prabhakaran

  • How to display header for secondrary alv list

    HI ALL,
    WHEN I RAN THIS REPORT HEADER IS COMING FOR FIRST ALV.WHEN I DOUBLE CLICK ON SALES ORDER NUMBER IT SHOWS SECONDARY LIST. FOR THIS SECONDARY LIST HEADER IS NOT COMING.ANY BODY CAN SUGGEST HOW TO FIXZ THIS PROBLEM
    REPORT ZMAHI1 LINE-SIZE 30.
    TYPE-POOLS : SLIS.
    *TYPES : BEGIN OF I_VBAK,
           VBELN TYPE VBAK-VBELN,
           ERDAT TYPE VBAK-ERDAT,
           ERNAM TYPE VBAK-ERNAM,
           ERZET TYPE VBAK-ERZET,
           VTWEG TYPE VBAK-VTWEG,
           VKORG TYPE VBAK-VKORG,
          END OF I_VBAK.
    DATA : BEGIN OF IT_VBAK OCCURS 0,
            VBELN TYPE VBAK-VBELN,
            ERDAT TYPE VBAK-ERDAT,
            ERNAM TYPE VBAK-ERNAM,
            ERZET TYPE VBAK-ERZET,
            VTWEG TYPE VBAK-VTWEG,
            VKORG TYPE VBAK-VKORG,
           END OF IT_VBAK.
    *DATA : IT_VBAK TYPE STANDARD TABLE OF I_VBAK INITIAL SIZE 0,
          WA_VBAK TYPE I_VBAK.
    *TYPES : BEGIN OF I_VBAP,
           VBELN TYPE VBAP-VBELN,
           MATNR TYPE VBAP-MATNR,
           ERZET TYPE VBAP-ERZET,
           POSNR TYPE VBAP-POSNR,
          END OF I_VBAP.
    DATA : BEGIN OF IT_VBAP OCCURS 0,
            VBELN TYPE VBAP-VBELN,
            MATNR TYPE VBAP-MATNR,
            ERZET TYPE VBAP-ERZET,
            POSNR TYPE VBAP-POSNR,
           LINE_COLOR(4) TYPE C,     "Used to store row color attributes
          END OF IT_VBAP.
    *DATA : IT_VBAP TYPE STANDARD TABLE OF I_VBAP INITIAL SIZE 0,
          WA_VBAP TYPE I_VBAP.
    DATA : EVENTCAT TYPE SLIS_T_EVENT.
    DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
          GD_LAYOUT    TYPE SLIS_LAYOUT_ALV,
          GD_REPID     LIKE SY-REPID.
    DATA:  I_TITLE_VBAK TYPE LVC_TITLE VALUE 'ALV LIST FIRST'.
    DATA:  I_TITLE_VBAP TYPE LVC_TITLE VALUE 'ALV LIST SECOND'.
    DATA: V_REPID LIKE SY-REPID .
    DATA :    HEADING TYPE  SLIS_T_LISTHEADER.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-T01.
    PARAMETERS : P_VBELN TYPE VBAK-VBELN.
    SELECTION-SCREEN END OF BLOCK B1.
    INITIALIZATION.
      V_REPID = SY-REPID.
    START-OF-SELECTION.
      PERFORM GET_DATA.
      PERFORM BUILT_FIELDCATALOG.
      PERFORM E03_EVENTTAB_BUILD USING EVENTCAT[].
      PERFORM COMMENT_BUILD USING HEADING[].
      PERFORM GRID_DISPLAY.
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DATA.
      SELECT VBELN
             ERDAT
             ERNAM
             ERZET
             VTWEG
             VKORG
         FROM VBAK
         INTO TABLE IT_VBAK
      WHERE VBELN EQ P_VBELN.
    ENDFORM.                    " GET_DATA
    *&      Form  BUILT_FIELDCATALOG
          text
    -->  p1        text
    <--  p2        text
    FORM BUILT_FIELDCATALOG.
      CLEAR I_FIELDCAT.
      REFRESH : I_FIELDCAT[].
      WA_FIELDCAT-TABNAME = 'IT_VBAK'.
      WA_FIELDCAT-FIELDNAME = 'VBELN'.
      WA_FIELDCAT-SELTEXT_M = 'SALES DOC NO'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAK'.
      WA_FIELDCAT-FIELDNAME = 'ERDAT'.
      WA_FIELDCAT-SELTEXT_M = 'Creation Date'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAK'.
      WA_FIELDCAT-FIELDNAME = 'ERNAM'.
      WA_FIELDCAT-SELTEXT_M = 'NAME'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAK'.
      WA_FIELDCAT-FIELDNAME = 'ERZET'.
      WA_FIELDCAT-SELTEXT_M = 'TIME'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAK'.
      WA_FIELDCAT-FIELDNAME = 'VTWEG'.
      WA_FIELDCAT-SELTEXT_M = 'DIS CHANNEL'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAK'.
      WA_FIELDCAT-FIELDNAME = 'VKORG'.
      WA_FIELDCAT-SELTEXT_M = 'SALES ORG'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    " BUILT_FIELDCATALOG
    *&      Form  GRID_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM GRID_DISPLAY.
      V_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM      = V_REPID
                I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
                I_CALLBACK_TOP_OF_PAGE  = 'TOP-OF-PAGE'
                IT_FIELDCAT             = I_FIELDCAT[]
                I_SAVE                  = 'A'
                IT_EVENTS               = EVENTCAT[]
           TABLES
                T_OUTTAB                = IT_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.
    ENDFORM.                    " GRID_DISPLAY
    for header
    *&      Form  HEADER
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                IT_LIST_COMMENTARY = HEADING.
    ENDFORM.                    " HEADER
    *&      Form  E03_EVENTTAB_BUILD
    FORM E03_EVENTTAB_BUILD USING    E03_LT_EVENTS TYPE  SLIS_T_EVENT.
      DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                I_LIST_TYPE = 3
           IMPORTING
                ET_EVENTS   = E03_LT_EVENTS.
      READ TABLE E03_LT_EVENTS
      WITH KEY NAME = SLIS_EV_TOP_OF_PAGE INTO LS_EVENT.
      IF SY-SUBRC = 0.
        MOVE 'TOP_OF_PAGE' TO LS_EVENT-FORM.
        APPEND LS_EVENT TO E03_LT_EVENTS.
      ENDIF.
      DELETE E03_LT_EVENTS WHERE FORM IS INITIAL.
    ENDFORM.                    " E03_EVENTTAB_BUILD
    *&      Form  COMMENT_BUILD
    FORM COMMENT_BUILD USING LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
      DATA: W_HEADING TYPE SLIS_LISTHEADER.
      DATA: W_HEADING1 TYPE SLIS_LISTHEADER.
      CLEAR   : W_HEADING, LT_TOP_OF_PAGE.
      REFRESH : LT_TOP_OF_PAGE.
      W_HEADING-INFO = 'Synopsys World' .
      W_HEADING-TYP = 'H'.
      APPEND  W_HEADING  TO LT_TOP_OF_PAGE .
      CLEAR  W_HEADING  .
    ENDFORM.                    " COMMENT_BUILD
    end of header portion.
    *&      Form  USER_COMMAND
          text
         -->R_UCOMM    text
         -->,          text
         -->RS_SLEFIELDtext
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'.
          IF RS_SELFIELD-FIELDNAME = 'VBELN'.
            PERFORM GETDATA_FROM_VBAP.
            PERFORM BUILD_FIELDCATLOG_IT_VBAP.
            PERFORM BUILD_LAYOUT.
            PERFORM E03_EVENTTAB_BUILD USING EVENTCAT[].
            PERFORM COMMENT_BUILD USING HEADING[].
            PERFORM GRID_DISPLAY1.
          ENDIF.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  GETDATA_FROM_VBAP
          text
    -->  p1        text
    <--  p2        text
    FORM GETDATA_FROM_VBAP.
      DATA: LD_COLOR(1) TYPE C.
      SELECT VBELN
             MATNR
             ERZET
             POSNR
         FROM VBAP
         INTO TABLE IT_VBAP
         FOR ALL ENTRIES IN IT_VBAK
      WHERE VBELN = IT_VBAK-VBELN.
      LOOP AT IT_VBAP .
        LD_COLOR = LD_COLOR + 1.
        IF LD_COLOR = 8.
          LD_COLOR = 1.
        ENDIF.
        CONCATENATE 'C' LD_COLOR '10' INTO IT_VBAP-LINE_COLOR.
        MODIFY IT_VBAP  TRANSPORTING LINE_COLOR.
      ENDLOOP.
    ENDFORM.                    " GETDATA_FROM_VBAP
    *&      Form  BUILD_FIELDCATLOG_IT_VBAP
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_FIELDCATLOG_IT_VBAP.
      CLEAR FIELDCATALOG.
      REFRESH : FIELDCATALOG[].
      FIELDCATALOG-FIELDNAME   = 'VBELN'.
      FIELDCATALOG-SELTEXT_M   = 'SALES DOC NO'.
      FIELDCATALOG-COL_POS     = 0.
      FIELDCATALOG-OUTPUTLEN   = 10.
      FIELDCATALOG-EMPHASIZE   = 'X'.
      FIELDCATALOG-KEY         = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'POSNR'.
      FIELDCATALOG-SELTEXT_M   = 'PO Item'.
      FIELDCATALOG-COL_POS     = 1.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'MATNR'.
      FIELDCATALOG-SELTEXT_M   = 'MAT NO'.
      FIELDCATALOG-COL_POS     = 2.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'ERZET'.
      FIELDCATALOG-SELTEXT_M   = 'TIME'.
      FIELDCATALOG-COL_POS     = 3.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
    ENDFORM.                    " BUILD_FIELDCATLOG_IT_VBAP
    *&      Form  GRID_DISPLAY1
          text
    -->  p1        text
    <--  p2        text
    FORM GRID_DISPLAY1.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM     = GD_REPID
                I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
                IS_LAYOUT              = GD_LAYOUT
                IT_FIELDCAT            = FIELDCATALOG[]
                I_SAVE                 = 'A'
                IT_EVENTS              = EVENTCAT[]
           TABLES
                T_OUTTAB               = IT_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.                    " GRID_DISPLAY1
    *&      Form  BUILD_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_LAYOUT.
      GD_LAYOUT-NO_INPUT          = 'X'.
      GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
      GD_LAYOUT-TOTALS_TEXT       = 'Totals'(201).
      GD_LAYOUT-INFO_FIELDNAME =      'LINE_COLOR'.
    ENDFORM.                    " BUILD_LAYOUT

    In ur report,
    in the rountine <b>GRID_DISPLAY1</b>.
    <b> GD_REPID = SY-REPID.</b>
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM     = GD_REPID
                I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
                IS_LAYOUT              = GD_LAYOUT
                IT_FIELDCAT            = FIELDCATALOG[]
                I_SAVE                 = 'A'
                IT_EVENTS              = EVENTCAT[]
           TABLES
                T_OUTTAB               = IT_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.

  • How to set different header for different Standard report page

    How to set different header for different Standard report page

    Hi,
    A easy answer would be use the 'set report header text.vi' but maybe you are talking about something else ?

  • How to disable cache for a particular Report in obiee 10g?

    HI
    My name is Rani .Learning obiee10g ifaced 1 interview in that they asked me like how u disable cache for a particular report?

    In the advanced tab of the report, under prefix you need to mention:
    SET VARIABLE DISABLE_CACHE_HIT=1;
    Refer below link
    http://tipsonobiee.blogspot.com/2009/06/step-by-step-to-bypass-all-caches.html
    Thanks

  • How to display a variable in the report?

    hi all
    i want to use one complex sql statement which will return only one value and i need to display it in report. i'm new to OBIEE. i thought of creating a repository variable to hold that value. but im not sure of how to display the variable in the report.
    Any idea?
    Your help is appreciated

    Hi where do you want to show that value in answers i mean in which part of answers, you want to show that?
    see this
    http://bischool.wordpress.com/2009/05/05/presentation-variable-values-in-report-titles-or-using-presentation-variable-in-dashboard-text-object-and-narrative-view-directly/
    also see this to where and how to use variables in answers
    http://shivabizint.wordpress.com/2008/10/02/oracle-bi-ee-variables-overview/

  • How to display duplicate key in web report?

    Hi Experts,
    Can anybody tell me how to display duplicate key in web report?
    I know in the Bex analyzer, we can allow the duplicate key to be dispalyed via the 'query property' by right click, and in the 'display option' tab, there is an option which named 'forbid duplicate key', if we don't select this option, the duplicate key will be dispalyed in the report result in BEx analyzer.
    But how can I do this in Web report? Thanks in advance.
    Eileen

    Hi,
    <b>I know in the Bex analyzer, we can allow the duplicate key to be dispalyed via the 'query property' by right click, and in the 'display option' tab, there is an option which named 'forbid duplicate key', if we don't select this option, the duplicate key will be dispalyed in the report result in BEx analyzer.</b>
    Do the same and execute report in web.You can able to see the same.
    Cheers
    Karthik

  • How to set optional for table structure in functiona module

    hi experts,
    as i have small doubt regarding
    while publishing web service by using rfc where i am unable to set optional for table structure i am able to put optional for import parameters may i know how to set optional for table structure ....
    reagrds prabhanjan

    Ignoring the TABLES/CHANGING/EXPORTING argument...
    while publishing web service by using rfc where i am unable to set optional for table structure i am able to put optional for import parameters may i know how to set optional for table structure
    Why not?  There's no issue with marking a TABLES interface parameter with 'Optional' and publishing the function module or function group as a web service...

  • Issue in displaying header details in ALV report

    Hi,
    I have used slis_t_listheader and REUSE_ALV_COMMENTARY_WRITE to display the header details in ALV report.I want the details to be displayed as below.
    Requester : ----------------------                                                                               Page: 1
    Program: -----------------------                                                                                Date:---------
                                                                     Title of Report
    But when I use the structure slis_t_listheader to display the header details,all the fields are coming one below the other.
    How can I get the fields as shown in the above format
    Edited by: Abaper12345 on Jun 25, 2009 7:54 AM

    Hi,
    Go through following code... its showing the data exactly the way you want....
    REPORT  TEST3.
    TYPE-POOLS:slis.
    TABLES:MARA.
    *Type Declaration
    TYPES:BEGIN OF t_mara,
          matnr TYPE mara-matnr,
          ersda TYPE mara-ersda,
          ernam TYPE mara-ernam,
          END OF t_mara.
    *Internal Table
    data:it_mara type standard table of t_mara.
    *Work Area
    data:wa_mara type t_mara.
    DATA:i_repid TYPE sy-repid .
    i_repid = sy-repid.
    *Declaration for field catalog
    DATA : fcat TYPE slis_t_fieldcat_alv,
           wa_fcat TYPE slis_fieldcat_alv.
    *Declaration for Layout
    data : WA_LAYOUT type SLIS_LAYOUT_ALV.
    *Initializing ColumnWidth_Optimize For Layout
      WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    START-OF-SELECTION
    START-OF-SELECTION.
    *Fetching data into internal tables
      PERFORM get_data.
    *Buil Fieldcatalog
      PERFORM build_fcat.
    *Display ALV Report
      PERFORM alv_display.
    *Build Fieldcat
    FORM build_fcat .
      wa_fcat-tabname = 'IT_MARA'.
      wa_fcat-fieldname = 'MATNR'.
      wa_fcat-inttype = 'C'.
      wa_fcat-seltext_m = 'Material Number'.
      wa_fcat-outputlen = 25.
      wa_fcat-col_pos = 1.
      APPEND wa_fcat TO fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'IT_MARA'.
      wa_fcat-fieldname = 'ERSDA'.
      wa_fcat-inttype = 'C'.
      wa_fcat-seltext_m = 'Date'.
      wa_fcat-outputlen = 25.
      wa_fcat-col_pos = 1.
      APPEND wa_fcat TO fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'IT_MARA'.
      wa_fcat-fieldname = 'ERNAM'.
      wa_fcat-inttype = 'C'.
      wa_fcat-seltext_m = 'User'.
      wa_fcat-outputlen = 25.
      wa_fcat-col_pos = 1.
      APPEND wa_fcat TO fcat.
      CLEAR wa_fcat.
      endform.
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    form GET_DATA .
    select matnr ersda ernam from mara into table it_mara.
    endform.                    " GET_DATA
    *&      Form  ALV_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    form ALV_DISPLAY .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = i_repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
       I_CALLBACK_HTML_TOP_OF_PAGE       = '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                       = fcat
      TABLES
        t_outtab                          = it_mara
    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.                    " ALV_DISPLAY
    *&      Form  html_top_of_page " I_CALLBACK_HTML_TOP_OF_PAGE  "
    FORM html_top_of_page USING document TYPE REF TO cl_dd_document.
    CALL METHOD document->add_text
      EXPORTING
        text          = 'Program'
        sap_color     = document->list_group
        sap_fontstyle = document->standard
       sap_emphasis  = document->strong.
    CALL METHOD document->new_line
      EXPORTING
        repeat = 1
    CALL METHOD document->add_text
      EXPORTING
        text          = 'Requester'
        sap_color     = document->list_group
        sap_fontstyle = document->standard
       sap_emphasis  = document->strong.
    CALL METHOD document->new_line
      EXPORTING
        repeat = 1
    CALL METHOD document->add_gap
      EXPORTING
         width      = 125
    CALL METHOD document->add_text
      EXPORTING
        text          = 'This Is Test Data'
        sap_color     = document->list_group
       sap_fontsize  = document->LARGE
       sap_fontstyle = document->standard
       sap_emphasis  = document->strong.
    ENDFORM.                    "HTML_TOP_OF_PAGE
    Thanks & Regards
    Ashu SIngh

  • Tree structured Report programming

    Hi,
    I have a requirement of a Report which has to have a Tree structure similar to SE09 Transaction. When we give the User id in the SE09 and hit on Display button the next screen lists all the Transport requests under the user in a Tree structure which can be exploded or collapsed.
    I want to know how complicated is this to code, is there any Function module that can help acheive this. Also let me if there is a sample program.
    Appreciate your help on this.
    Thanks and Regards,
    Saleem.

    Hi Saleem,
    Check this sample code,
    REPORT  Z_AZAZ_TEST_TREE_1                      .
    TYPE-POOLS : FIBS,STREE.
    DATA : T_NODE TYPE SNODETEXT.
    DATA : NODE_TAB LIKE T_NODE OCCURS 0 WITH HEADER LINE.
    CLEAR : NODE_TAB, NODE_TAB[].
    NODE_TAB-TYPE = 'T'.
    NODE_TAB-NAME = 'Earth'.
    NODE_TAB-TLEVEL = '01'.
    NODE_TAB-NLENGTH = '5'.
    NODE_TAB-COLOR = '4'.
    NODE_TAB-TEXT = 'Hello'.
    NODE_TAB-TLENGTH ='5'.
    NODE_TAB-TCOLOR = 3.
    APPEND NODE_TAB.
    CLEAR NODE_TAB.
    NODE_TAB-TYPE = 'P'.
    NODE_TAB-NAME = 'Europe'.
    NODE_TAB-TLEVEL = '02'.
    NODE_TAB-NLENGTH = '6'.
    NODE_TAB-COLOR = '1'.
    NODE_TAB-TEXT = 'Hello'.
    NODE_TAB-TLENGTH ='5'.
    NODE_TAB-TCOLOR = 4.
    APPEND NODE_TAB.
    CLEAR NODE_TAB.
    NODE_TAB-TYPE = 'P'.
    NODE_TAB-NAME = 'Germany'.
    NODE_TAB-TLEVEL = '03'.
    NODE_TAB-NLENGTH = '7'.
    NODE_TAB-COLOR = '4'.
    NODE_TAB-TEXT = 'Hello'.
    NODE_TAB-TLENGTH ='5'.
    NODE_TAB-TCOLOR = 4.
    APPEND NODE_TAB.
    CLEAR NODE_TAB.
    NODE_TAB-TYPE = 'P'.
    NODE_TAB-NAME = 'Berlin'.
    NODE_TAB-TLEVEL = '04'.
    NODE_TAB-NLENGTH = '6'.
    NODE_TAB-COLOR = '4'.
    NODE_TAB-TEXT = 'Hello'.
    NODE_TAB-TLENGTH ='5'.
    NODE_TAB-TCOLOR = 3.
    APPEND NODE_TAB.
    CLEAR NODE_TAB.
    NODE_TAB-TYPE = 'P'.
    NODE_TAB-NAME = 'Asia'.
    NODE_TAB-TLEVEL = '02'.
    NODE_TAB-NLENGTH = '4'.
    NODE_TAB-COLOR = '1'.
    NODE_TAB-TEXT = 'Hello'.
    NODE_TAB-TLENGTH ='5'.
    NODE_TAB-TCOLOR = 3.
    APPEND NODE_TAB.
    CLEAR NODE_TAB.
    NODE_TAB-TYPE = 'P'.
    NODE_TAB-NAME = 'India'.
    NODE_TAB-TLEVEL = '03-'.
    NODE_TAB-NLENGTH = '5'.
    NODE_TAB-COLOR = '1'.
    NODE_TAB-TEXT = 'Hello'.
    NODE_TAB-TLENGTH ='5'.
    NODE_TAB-TCOLOR = 3.
    APPEND NODE_TAB.
    CLEAR NODE_TAB.
    NODE_TAB-TYPE = 'P'.
    NODE_TAB-NAME = 'Bombay'.
    NODE_TAB-TLEVEL = '04-'.
    NODE_TAB-NLENGTH = '6'.
    NODE_TAB-COLOR = '1'.
    NODE_TAB-TEXT = 'Hello'.
    NODE_TAB-TLENGTH ='5'.
    NODE_TAB-TCOLOR = 3.
    APPEND NODE_TAB.
    CLEAR NODE_TAB.
    CALL FUNCTION 'RS_TREE_CONSTRUCT'
    EXPORTING
      INSERT_ID                = '000000'
      RELATIONSHIP             = ' '
      LOG                      =
      TABLES
        NODETAB                  = NODE_TAB
    EXCEPTIONS
      TREE_FAILURE             = 1
      ID_NOT_FOUND             = 2
      WRONG_RELATIONSHIP       = 3
      OTHERS                   = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      DATA: TYPE_MAPPING TYPE STREE_CTL_TYPE_MAPPING_TAB.
      DATA: WA_TYPE TYPE STREE_CTL_TYPE_MAPPING.
      CLEAR: TYPE_MAPPING[].
        WA_TYPE-TYPE = 'A'.
        WA_TYPE-ICON = '@BL@'.
        APPEND WA_TYPE TO TYPE_MAPPING.
    *CALL FUNCTION 'RS_TREE_CONTROL_PREPARE'
    EXPORTING
      CONTROL_PATTERN             = STREE_CTL_GENERIC
       CONTROL_PATTERN             = 'PH'
      HIERARCHY_HEADER            =
      INITIAL_HEADER_WIDTH        =
      LIST_ITEM_HEADER            =
      MULTIPLE_SELECTION          = 'X'
      ITEM_SELECTION              = STREE_FALSE
      SUPPRESS_NODE_ICON          = STREE_FALSE
      SUPPRESS_FOLDER_ICON        = STREE_FALSE
      CALLBACK_PROGRAM            =
      CALLBACK_ITEM_DISPLAY       =
      COLOR_MAPPING               =
        TYPE_MAPPING                = type_mapping
    IMPORTING
      SUBSCREEN_PROGRAM           =
      SUBSCREEN_DYNNR             =
    EXCEPTIONS
      NOT_AVAILABLE               = 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.
    *CALL FUNCTION 'RS_TREE_SET_CURRENT_LAYOUT'
    EXPORTING
      CURSOR_COLUMN             = 3
      CURSOR_LINE               = 2
      FIRST_NODE                = 1
      FIRST_NODE_TYPE           = ' '
      LIST_COLUMN               = 1
      LIST_LINE                 = 1
      LAYOUT_MODE               = STREE_LAYOUT_NORMAL
    IMPORTING
      INCONSISTENT_LAYOUT       =
    TABLES
      LAYOUT                    =
    CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
    EXPORTING
      CALLBACK_PROGRAM                =
      CALLBACK_USER_COMMAND           =
      CALLBACK_TEXT_DISPLAY           =
      CALLBACK_MOREINFO_DISPLAY       =
      CALLBACK_COLOR_DISPLAY          =
      CALLBACK_TOP_OF_PAGE            =
      CALLBACK_GUI_STATUS             =
      CALLBACK_CONTEXT_MENU           =
      STATUS                          = 'IMPLICIT'
      CHECK_DUPLICATE_NAME            = '1'
      COLOR_OF_NODE                   = '4'
      COLOR_OF_MARK                   = '3'
      COLOR_OF_LINK                   = '1'
      COLOR_OF_MATCH                  = '5'
      LOWER_CASE_SENSITIVE            = ' '
      MODIFICATION_LOG                = ' '
      NODE_LENGTH                     = 30
      TEXT_LENGTH                     = 75
      TEXT_LENGTH1                    = 0
      TEXT_LENGTH2                    = 0
      RETURN_MARKED_SUBTREE           = ' '
      SCREEN_START_COLUMN             = 0
      SCREEN_START_LINE               = 0
      SCREEN_END_COLUMN               = 0
      SCREEN_END_LINE                 = 0
      SUPPRESS_NODE_OUTPUT            = ' '
      LAYOUT_MODE                     = ' '
      USE_CONTROL                     = STREE_USE_LIST
       USE_CONTROL                     = 'L'.
    IMPORTING
      F15                             =
    Regards,
    Azaz Ali.

  • Header for text in report

    Hi All,
    I have a Infoobject A , which is displayed inside a report. I have set the display as Key and Text. I need a column header for the TEXT.
    i.e
    Material Category(Key)   Material category (text)
    001                              Saw machine
    002                              Grinding tool
    Here the Material Category(Key) will be pulled from the Small description and the Material category (text)
    will be blank. I need to give a header text for it.
    I heard that there is a possibility using Macros for workbook.But I want to do it in Query level.
    Please let me know if this is possible .
    Thanks,
    Chakravarthy

    Hi,
    You can do this
    1) Add Material Category text as an attribute of Material category Info Object.
    2) Create transfer rules/transformations to fill the Material category text (check how the material category texts are currently filled)
    3) Pull in the Material category text as an attribute of material category in your report....
    Hope this helps..
    Sita.

  • How to display grouped tracks tree-like?

    I imported lots of classical CDs and I grouped some works using the 'Grouping' field of the song information dialog. The grouping I added appears in the column 'Grouping' , but however, I'd like to have the groupings displayed in a tree-like structure. I know iTunes can do that, because I have seen it in the music store (on some classical CDs).
    Unfortunately, the help files and FAQs don't tell a lot about grouping.
    How can I enable the tree-like display of groupings in my library?
    FYI: I am using iTunes 6.0.1 on Mac OS X 10.0.3
    Thanks for any help
    Michael

    I'd like to have the groupings displayed in a tree-like structure. I know iTunes can do that, because I have seen it in the music store (on some classical CDs).
    Ohh! That would be Folder Structure then. A useful feature in other circumstances of running tracks together while in Party Shuffle or Shuffling a list. iTMS can obviously do it, but apparently not iTunes.
    Suggest you log a request at http://www.apple.com/feedback/itunes.html
    Grouping seems another way of making a regular or smart playlist, but would not affect how those songs get displayed in viewing the library. The word "grouping" gives the impression of doing somethiing more I think.

  • Event Handling for tree structure using "CL_GUI_ALV_TREE_SIMPLE"

    Hi,
    I have created a tree structure using class CL_GUI_ALV_TREE_SIMPLE.
    Now I wanted to insert a check and give message when the user opens the last node in my structure.
    I checked the events available in the class , but there in none which gets trigered when we try to open a node.
    Please guide me with this scenario.
    Thanks & Regards,
    Omkar M.

    Hello Omkar
    The solution is somewhat odd but apparently works. As sample report please check BCALV_TREE_SIMPLE_DEMO.
    Copy this report and make the following changes:
    class lcl_tree_event_receiver definition.
      public section.
        methods:
        on_expand_no_children " new event handler method
          for event expand_no_children of cl_gui_column_tree
            importing NODE_KEY,  " class = CL_GUI_COLUMN_TREE !!!
        on_add_hierarchy_node
                  for event on_add_hierarchy_node of cl_gui_alv_tree_simple
                        importing grouplevel
                                  index_outtab.
    endclass.
    CLASS lcl_tree_event_receiver IMPLEMENTATION.
      METHOD on_expand_no_children.
        BREAK-POINT.
      ENDMETHOD.                    "on_expand_no_children
    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_expand_no_children.
      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.  " CL_GUI_ALV_TREE_SIMPLE
      SET HANDLER l_event_receiver->on_expand_no_children
                                              FOR ALL INSTANCES. " CL_GUI_COLUMN_TREE !!!
    ENDFORM.                               " register_events
    As soon as you open a node in the ALV tree the report will stop at the break-point.
    Now you need to check if there are still children nodes to be displayed.
    If not then trigger your special coding.
    Regards
      Uwe

  • How to display Header data

    Hi All,
    How can i display header data in a simple report(its not an ALV report).
    i am planning to use event TOP-OF-PAGE for this.is this correct?
    Can anyone explain me through a piece of code.
    Thanks,
    Rupesh

    Hi,
    Top-of-page is an event which will produce a static header that is even you scroll the list the header will be displayed. But when you not use the top-of-page event You will notget the static header.
    say for example,
    data : itab like mara occurs 0 with header line.
    select * from mara into table itab upto 100 rows.
    loop at itab.
    write : /1 itab-matnr.
    endloop.
    top-of-page.
    write : /1 'header'.
    also use the code,
    data : itab like mara occurs 0 with header line.
    select * from mara into table itab upto 100 rows.
    write : /1 'header'.
    loop at itab.
    write : /1 itab-matnr.
    endloop.
    see the difference in the header.
    Regards,
    Sanki.

  • How to set printersettings for the crystal report viewer in SAP BI dynamically

    Hello
    I have set the URL method for my crystal report and with parameter passing as shown below, it was displaying the crystal report viewer by connecting to the SAP BI 4.0 server with this method.
    http://cr:port/businessobjects/enterprise115/desktoplaunch/opendoc/openDocument.jsp?sDocName=CRLabelParam&sType=rpt&lsSnPrinted=0&lsSsTestProjectNr=1
    This URL will be called from Web application by different users, i would like to set the printer settings differently for different users for this crystal report viewer how shall i need to set the printer options?
    shall i need to set the printer settings programatically for each user. Please advise me how do i need to proceed.
    Thanks & Regards,
    Rajeswari.

    There are no BI / CR APIs that would do this for you. The way I see it, you'll have to have your own print button and populate it with the correct printer information for each user as they request the report. Of course, alternatively, use the viewer printer button and get the users to choose the correct printer.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

Maybe you are looking for