Static text in ALV Report

Hi,
I have a requirement to create an ALV report which has to display some static text on each page. In the format below, the line item texts and sub total texts will be the same for each page. Each page displays data for one company code. The company code should be displayed on the top of page.
Line Items    Sub totals          Amounts
Line item 1                              Amt1
Line item 2                              Amt2
Line item 3                              Amt3
                        Sub total          1-3
Line item 4                              Amt4
Line item 5                              Amt5
                        Sub total        1-5           
                                             Total
1. How to display the same item texts on each page? Can I use text symbols to avoid hard coding?
2. How do I get sub totals?
3. Display company code on top of page according to the viewed page?
any sample code greatly appreciated.
Thanks,
MJ

Hi,
I have a requirement to create an ALV report which has to display some static text on each page. In the format below, the line item texts and sub total texts will be the same for each page. Each page displays data for one company code. The company code should be displayed on the top of page.
Line Items                       Amounts
Line item 1                        Amt1
Line item 2                        Amt2
Line item 3                        Amt3
Sub total                             1-3
Line item 4                         Amt4
Line item 5                         Amt5
Sub total                            1-5           
   Total                               1-5
1. How to display the same item texts on each page? Can I use text symbols to avoid hard coding?
2. How do I get sub totals?
3. Display company code on top of page according to the viewed page?
any sample code greatly appreciated.
Thanks,
MJ

Similar Messages

  • Display a Long Text in ALV report

    Hi,
    I want to display the PO header long text in ALV Report that is 255 character width.
    Please help me out how to do this.
    please it is very urgent
    Thanks and regards
    Krishna

    Use READ_TEXT and concatenate the first lines of the text.
          CALL FUNCTION 'READ_TEXT'
               EXPORTING
                    id       = 'F01'
                    language = sy-langu
                    name     = lv_name " purchase order with leading zeroes
                    object   = 'EKKO'
               TABLES
                    lines    = t_lines
               EXCEPTIONS
                    OTHERS   = 8.
    Regards

  • Totals text for ALV report

    In my ALV report I need to add descriptions for totals
                Col1        Col2          Col3
    Sum1       #Value      #Value      #Value
    Sum2       #Value      #Value      #Value
    Sum3       #Value      #Value      #Value
    How to add text Sum1, Sum2, Sum3 to the report?
    I tried to use subtotals_text and totals_text in slis_layout_alv for REUSE_ALV_GRID_DISPLAY but that did not work out. I also tried to look for methods using CL_SALV_TABLE class and have not been able to find a solution yet.
    Edited by: Megan Flores on Feb 25, 2008 8:28 PM

    it's a package in the systems above 6.4 with new ALV. There are nice examples. Main package is SALV.
    /wg

  • Problem in display of text in ALV report

    Dear experts,
    I am working on a MM Report in which I need to display Material Basic data text maintained in MM01,02 Tcodes through ALV report.
    I have declared a string type variable for the Basic data text in the Final Internal Table.
    For reading the Standard text I am using Read_Text FM, from which I am looping the Text internal table and concatenating it into
    String variable.
    What I notice is all the content beyond 255 chars is not getting displayed, Even when the ALV report is downloaded to Excel file.
    Can you suggest some approach to over come this issue.
    Regards,
    Murthy

    Hi,
    Use the below code
    Data : lt_content  TYPE TABLE OF tline,
              lw_content   TYPE tline.
    Data : lt_text Type Table of solisti1,
              lw_text TYPE solisti1.
    CALL FUNCTION 'READ_TEXT'
        EXPORTING
          client                  = sy-mandt
          id                        = lv_id
          language            = tdspras
          name                  = lv_name
          object                 = lv_object
          archive_handle  = 0
          local_cat            = ' '
        TABLES
          lines                   = lt_content
        EXCEPTIONS
          id                      = 1
          language          = 2
          name                = 3
          not_found        = 4
          object               = 5
          reference_check = 6
          wrong_access_to_archive = 7
          OTHERS                  = 8.
    loop at lt_content into lw_content.
      lw_text-line = lw_content-tdline.
      APPEND lw_text TO lt_text.
      CLEAR: lw_content, lw_text.
    endloop.
    Now your whole text is in "lt_text".
    Regards,
    Avish Mittal

  • Standard Purchase Order Long Text In ALV Report

    Hi Gurus,
    I am able to get the charecter space for long text in the ALV report but i could not able to get the text in that space out put.
    I have used ekko and ekpo tables.
    Please provide me the code are solution to display the Text in that particular space.
    Thanks,
    SR

    Hi all,
    I am able to see the PO text, But when i moved it to production system  i find
    1) it is taking too much time to execute. 2) I find the first  PO text in the purchase document is getting repeated for all other purchase documents in the run where their is no Po text .
    Please help me how to restrict the repeated Text.
    And also to improve the performance
    regards,
    dileep

  • Displaying Header Text in ALV report.

    HI Gurus,
    I have one sales order which has header Text.
    I am displaying that Header Text in my ALV report.
    But while displaying in the ALV grid, the text is not coming full.
    I have taken the datatype of the column of the ALV grid is string, Still the Header text is not come full.
    Please help me.
    Thanks in advance.

    Hi,
        If the header text is morethan 60 characters, you can't print with REUSE_ALV_COMMENTARY_WRITE. To overcome above limit we can use dynamic document, which can be implemented through the class CL_DD_DOCUMENT. As dynamic documents use HTML viewer control so instead of triggering the TOP_OF_PAGE event we should trigger event of HTML TOP_OF_PAGE.
    First create a subroutine for top of page in HTML format and send that name in I_CALLBACK_HTML_TOP_OF_PAGE parameter of ALV function module. The input parameter for this subroutine will be a variable of class CL_DD_DOCUMENT.
    *       FORM html_top_of_page                                     *
    FORM html_top_of_page USING top TYPE REF TO cl_dd_document.
      data: l_text(255) type c.
    l_text = '*******************************Hellooooooooooooooooooo************************'.
      CALL METHOD top->add_text EXPORTING text = 'Hello world '
                                          sap_style = 'heading' .
      CALL METHOD top->add_gap EXPORTING width = 200.
      CALL METHOD top->add_picture EXPORTING picture_id = 'ENJOYSAP_LOGO'.
      CALL METHOD top->NEW_LINE( ).
      CALL METHOD top->add_text EXPORTING
      text = l_text.
    ENDFORM.
    * Display ALV grid
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
              i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'     " Use this event
              i_callback_program          = g_repid
              i_structure_name            = 'STRUCTURE'
         TABLES
              t_outtab                    = gt_outtab.
    Regards
    Bala Krishna

  • To add additonal rows(text)  in ALV report

    Hi there,
    I want to add additional ROWS at the bottom of each grouping.
    Right now I am getting customer wise total comission amount but the requirement is on commsion amt ,i need to calculate 10 % tax and 2% tax and these taxes should get genrated below the commsion amt column as like below:
    Company code Customer Commsion Amt
    2000 101 1000
    2000 101 2000
    Total Comsion 3000
    10% Service Tax 300
    2% Edn Tax 6
    Total 3306
    2000 102 1230
    2000 102 678
    The output should be like this in ALV report .Could anyone plz help me out on this.
    I will really appreciate your help.
    Thanks,

    Hi Archana,
    You can have the subtotal displayed for each company code and commision in the alv.
    At end of each  comp code and customer , pass the total of the whole amount into a line and you can display a line of this total. 
    Your alv gets displayed like this .
    2000 101 1000
    2000 101 2000
    Total Comsion 3000
    10% Service Tax 300
    2% Edn Tax 6
                            3306
    Thanks,
    Guru

  • Sub total text in ALV report

    Hi,
    I need to do subtotalling in my program using ALV. I am getting the subtotal value in ALV list display , but not getting the text for subtotalling.
    matnr               werks                       stock
    154                  1001                         1589
    158                  1001                         1651
    Subtotal for plant 1001                               3240
    155                  1002                         465
    Subtotal for plant 1002                       465

    hi,
    how did u declared ur internal table?
    Declare a dummy field in your internal table to trigger subtotal text event.
    TYPES: BEGIN OF ty_ekpo,
              lifnr TYPE ekko-lifnr,    "vendor number
              ebeln TYPE ekko-ebeln,    "purchase document number
              ebelp TYPE ekpo-ebelp,    "Item Number of Purchasing Document
              matnr TYPE ekpo-matnr,    "Material Number
              bukrs TYPE ekpo-bukrs,    "Company Code
              werks TYPE ekpo-werks,    "Plant
              d,                        "Dummy field to fire the Subtotal text event
          END OF ty_ekpo.
    Prepare field catalog for that dummyfield also and set attributes like below
    wa_fcat-col_pos = 7.
      wa_fcat-fieldname = 'D'.
      wa_fcat-tabname = 'IT_EKPO'.
      wa_fcat-ref_fieldname = 'NETPR'.
      wa_fcat-ref_tabname = 'EKPO'.
      wa_fcat-no_out = 'X'.
      APPEND wa_fcat TO it_fcat.
    Fill sortinfo table as follows
    wa_sort-spos = 1.
      wa_sort-fieldname = 'LIFNR'.
      wa_sort-tabname = 'IT_EKPO'.
      wa_sort-up = 'X'.
      wa_sort-group = 'UL'.
      APPEND wa_sort TO it_sort.
      CLEAR wa_sort.
      wa_sort-spos = 2.
      wa_sort-fieldname = 'D'.
      wa_sort-tabname = 'IT_EKPO'.
      wa_sort-up = 'X'.
      wa_sort-group = 'UL'.
      wa_sort-subtot = 'X'.
      APPEND wa_sort TO it_sort.
    fill the event table
    wa_event-name = 'SUBTOTAL_TEXT'.  "--> this event is used to trigger subtotal text
      wa_event-form = 'SUBTOTAL'.
      APPEND wa_event TO it_event.
    *&      Form  subtotal
    FORM subtotal USING i_listhead STRUCTURE wa_ekpo  i_subtotal TYPE slis_subtot_text.
      READ TABLE it_sort INTO wa_sort WITH KEY fieldname = 'D'.
      IF sy-subrc = 0.
        IF i_subtotal-criteria = 'D'.
          i_subtotal-display_text_for_subtotal = 'Sub total'.
        ENDIF.
      ENDIF.
    ENDFORM.                    "subtotal
    Thanks & REgards

  • How to display subtotal text in alv report for particular group of values

    Hi,
    if material number falls 1 to 10 then i considered be calculate and display subtotal qty amount with subtotal text " Total of the mat1" and if material number falls 11 to 20 then again i need to be claculate and display subtotal qty amount with subtotal text "total of the mat2". if material number falls 21 to 30 then i don't want to display any subtotal and At last grand total also is not required.
    Please help me asap

    just check the thread...
    Can we modify a sub-total in ALV

  • Displaying text more than 256 in ALV report

    Hi experts,
                     I have problem while displaying text field in ALV report which has more than 256 characters.
    I'm using CL_SALV_TABLE for displaying alv.while concatenating my internal table holding all the text.but at the time of displying the report it's only displaying 256 characters.
               Can anyone guide me how to display more than 256 characters in ALV output using CL_SALV_TABLE.

    Hi,
    Please find the below code.
    TRY.
          gr_column ?= gr_columns->get_column( columnname = 'MATNR' ).
          gr_column->set_output_length( '300' ).
        CATCH cx_salv_not_found.
        Message : Column definition problem
          MESSAGE e075().
      ENDTRY.
    Edited by: Archana.T on Jun 16, 2010 1:24 PM

  • Tool Tip Text for field values in ALV report

    Hi,
    How to get the tool tip text for the field values in ALV report.
    Thanks & Regards,
    Pallavi.

    Hi,
    In fieldcatalog specify the TOOLTIP.
    <b>
    LVC_S_FCAT-TOOLTIP
    </b>
    In this speicfyteh tooltip you want.
    Then append this to the fieldcatalog.
    Hope this solves ur problem.

  • Text  display in ALV Report

    Hi All,
    I have developed an ALV Report, where i am displaying few lines of Texts proir to the ALV Layout. Its working fine.
    Now there is a requirement to display few more lines of Text at the bottom of the screen.
    i.e     Text1
             Text2
             ALV Layout
             Text3
             Text4.
    How to make the Text3 and text4 lines to display at the bottome of the ALV Layout....?????
    Regards
    Pavan

    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE' 
                i_callback_html_end_of_list = 'END_OF_LIST_HTML'
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
    *&      Form  end_of_list_html
    *       output at the end of the list - not in printed output       *
    FORM end_of_list_html USING end TYPE REF TO cl_dd_document.
      DATA: ls_text TYPE sdydo_text_element,
            l_grid     TYPE REF TO cl_gui_alv_grid,
            f(14) TYPE c VALUE 'SET_ROW_HEIGHT'.
      ls_text = 'Footer title'.
    * adds and icon (red triangle)
      CALL METHOD end->add_icon
        EXPORTING
          sap_icon = 'ICON_MESSAGE_ERROR_SMALL'.
    * adds test (via variable)
      CALL METHOD end->add_text
        EXPORTING
          text         = ls_text
          sap_emphasis = 'strong'.
    * adds new line (start new line)
      CALL METHOD end->new_line.
    * display text(bold)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Bold text'
          sap_emphasis = 'strong'.
    * adds new line (start new line)
      CALL METHOD end->new_line.
    * display text(normal)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Normal text'.
    * adds new line (start new line)
      CALL METHOD end->new_line.
    * display text(bold)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Yellow triangle'
          sap_emphasis = 'strong'.
    * adds and icon (yellow triangle)
      CALL METHOD end->add_icon
        EXPORTING
          sap_icon = 'ICON_LED_YELLOW'.
    * display text(normal)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'More text'.
    *set height of this section
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          e_grid = l_grid.
      CALL METHOD l_grid->parent->parent->(f)
        EXPORTING
          id     = 3
          height = 14.
    ENDFORM. "end_of_list_html.

  • Need to have static text on every page of a MS Excel report exported from SSRS

    I need to place an object with a brief static text message in a report using SQL Server Reporting Services 2008 R2.
    When that report is exported to MS Excel from Report Manager and viewed, this static text object must appear "once" at the bottom of every page without using "print preview."
    Furthermore, it must appear only "once" on every page regardless of both the number of groups as well as the number of records in each group.
    Thanks in advance.
    Sincerely,
    Mike

    Hi Mike,
    By default, Excel does not have a concept of a "page" in "Normal" view. So when we export the report to excel and open the file, Excel automatically hides the footers as they are displayed in "Normal" view. Since this issue is relevant to Excel, if we want
    to see the page footer in Excel, we can try to switch to "Page Layout" view in the View Tab. Just as you said, they also shown up while printing.
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Problem to send text file to mail from ALV report

    Hi Friends,
    I have a problem in my ALV report with text file.  As per the requirment, when we execute the program then text attachment should go to the particual email.
    When i am using file type as XLS i am getting attachment with all 4 recoreds( input for 4 records) in mail. But all 4 records are coming in SAME ROW. It should come 4 records in 4 rows. when I use file type as TXT and separated by pipe symble in code, it is showing only one recored for same above input.
    When i use file type as XLS and click the attachment in email, it will triggire one popul with three options like SAVE, OPEN, CANCEL.
    But when i click on text file attachment, it is directly showing ony one recored.
    Please correct me on this.
    my code is
    PERFORM send_file_as_email_attachment
                                   tables i_message
                                          i_attach
                                    using v_email
                                          'User last log on details'
                                          'XLS'
                                          'User log on list'
                                 changing v_error
                                          v_reciever.
    FORM send_file_as_email_attachment tables pi_message
                                              pi_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: l_error    TYPE sy-subrc,
              l_reciever TYPE sy-subrc,
              l_mtitle LIKE sodocchgi1-obj_descr,
              l_email LIKE  somlreci1-receiver,
              l_format TYPE  so_obj_tp ,
              l_attdescription TYPE  so_obj_nam ,
              l_attfilename TYPE  so_obj_des ,
              l_sender_address LIKE  soextreci1-receiver,
              l_sender_address_type LIKE  soextreci1-adr_typ,
              l_receiver LIKE  sy-subrc.
      l_email   = p_email.
      l_mtitle = p_mtitle.
      l_format              = p_format.
      l_attdescription      = p_attdescription.
      l_attfilename         = p_filename.
      l_sender_address      = p_sender_address.
      l_sender_address_type = p_sender_addres_type.
    Fill the document data.
      v_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      v_doc_data-obj_langu = sy-langu.
      v_doc_data-obj_name  = 'SAPRPT'.
      v_doc_data-obj_descr = l_mtitle .
      v_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR v_doc_data.
      READ TABLE i_attach INDEX v_cnt.
      v_doc_data-doc_size =
         ( v_cnt - 1 ) * 255 + STRLEN( i_attach ).
      v_doc_data-obj_langu  = sy-langu.
      v_doc_data-obj_name   = 'SAPRPT'.
      v_doc_data-obj_descr  = l_mtitle.
      v_doc_data-sensitivty = 'F'.
      CLEAR i_attachment.
      REFRESH i_attachment.
      i_attachment[] = pi_attach[].
    Describe the body of the message
      CLEAR i_packing_list.
      REFRESH i_packing_list.
      i_packing_list-transf_bin = space.
      i_packing_list-head_start = 1.
      i_packing_list-head_num = 0.
      i_packing_list-body_start = 1.
      DESCRIBE TABLE i_message LINES i_packing_list-body_num.
      i_packing_list-doc_type = 'RAW'.
      APPEND i_packing_list.
    Create attachment notification
      i_packing_list-transf_bin = 'X'.
      i_packing_list-head_start = 1.
      i_packing_list-head_num   = 1.
      i_packing_list-body_start = 1.
      DESCRIBE TABLE i_attachment LINES i_packing_list-body_num.
      i_packing_list-doc_type   =  l_format.
      i_packing_list-obj_descr  =  l_attdescription.
      i_packing_list-obj_name   =  l_attfilename.
      i_packing_list-doc_size   =  i_packing_list-body_num * 255.
      APPEND i_packing_list.
    Add the recipients email address
      CLEAR i_receivers.
      REFRESH i_receivers.
      i_receivers-receiver = l_email.
      i_receivers-rec_type = 'U'.
      i_receivers-com_type = 'INT'.
      i_receivers-notif_del = 'X'.
      i_receivers-notif_ndel = 'X'.
      APPEND i_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = v_doc_data
                put_in_outbox              = 'X'
                sender_address             = l_sender_address
                sender_address_type        = l_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = v_sent_all
           TABLES
                packing_list               = i_packing_list
                contents_bin               = i_attachment[]
                contents_txt               = i_message
                receivers                  = i_receivers
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.
    Populate zerror return code
      l_error = sy-subrc.

    Hi,
    declare the following constant in u r program and concatenate at the end of each and every record in your internal table.
    CONSTANTS : LV_CRLF TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.
    for eg.
    if u internal table has values like
    row1
    row2
    row3
    concatenate the 1st record lv_crlf into first record.
    conactenate second record lv_crlf into second record.
    concatenate third record lv_crlf into third record.
    now attach  the internal table to the FM which u use for sending email. Each and every row will come in new line. The LV_CRLF will hold nothing but a line feed character (#).
    Hope it will solve u r problem
    Regards,
    Rose.

  • After ALV Report i need to display the text below that

    Hi Experts,
    I need a help.
    I want to display a write statment after alv report is generated.pls help me.
    Please Urgent.

    here is an example
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE' 
                i_callback_html_end_of_list = 'END_OF_LIST_HTML'
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
    *&      Form  end_of_list_html
          output at the end of the list - not in printed output       *
    FORM end_of_list_html USING end TYPE REF TO cl_dd_document.
      DATA: ls_text TYPE sdydo_text_element,
            l_grid     TYPE REF TO cl_gui_alv_grid,
            f(14) TYPE c VALUE 'SET_ROW_HEIGHT'.
      ls_text = 'Footer title'.
    adds and icon (red triangle)
      CALL METHOD end->add_icon
        EXPORTING
          sap_icon = 'ICON_MESSAGE_ERROR_SMALL'.
    adds test (via variable)
      CALL METHOD end->add_text
        EXPORTING
          text         = ls_text
          sap_emphasis = 'strong'.
    adds new line (start new line)
      CALL METHOD end->new_line.
    display text(bold)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Bold text'
          sap_emphasis = 'strong'.
    adds new line (start new line)
      CALL METHOD end->new_line.
    display text(normal)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Normal text'.
    adds new line (start new line)
      CALL METHOD end->new_line.
    display text(bold)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Yellow triangle'
          sap_emphasis = 'strong'.
    adds and icon (yellow triangle)
      CALL METHOD end->add_icon
        EXPORTING
          sap_icon = 'ICON_LED_YELLOW'.
    display text(normal)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'More text'.
    *set height of this section
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          e_grid = l_grid.
      CALL METHOD l_grid->parent->parent->(f)
        EXPORTING
          id     = 3
          height = 14.
    ENDFORM. "end_of_list_html.

Maybe you are looking for