Eliminate page heading in the spool of ALV report

Hi,
We are running the ALV report in the background, and when we view the spool
the page heading and the column heading is displayed for all the pages, Is there some way to
eliminate this.
The download from the on-line exec is fine,but the download from the spool includes the column
headings for each page. Is there some way to check if the ALV report is run in the batch mode
and to disable the heading from Page 2 to N.
Appreciate any input.
Thank you
Lalitha

Hi,
I need to avoid the column headings also, I need the heading in the first page, but not on the subsequent pages.
Is there any setting in the ALV function modules to prevent this ?
So wanted to know if there is some setting to accomplish that.
Thank you
Lalitha

Similar Messages

  • Page breaks appear in the spool output of report when run in the background

    Hi All,
    Report is using fm 'REUSE_ALV_GRID_DISPLAY' to display the report. parameters passed to this fm for display are :it_fieldcat,is_layout,it_events,t_outtab.
    Page breaks appear in the spool output when report is run in the background.These page breaks needs to be removed. When executed in the background, the excel extract should be the same as if pulling directly from the report itself.
    How to remove the page breaks in background?
    Thanks & Regards,
    Abhishek Singh

    Hi
    You can use the below code , which the reprt run in background. If you run the report in background thenyou need to use  'REUSE_ALV_LIST_DISPLAY'
    if sy-batch = ' '.
    call 'REUSE_ALV_GRID_DISPLAY'.
    else.
    call 'REUSE_ALV_LIST_DISPLAY'.
    endif.
    if you are using OO alv then write this code..
    CALL METHOD cl_gui_alv_grid=>offline
    RECEIVING e_offline = off.
    IF off IS INITIAL.
    CREATE OBJECT g_custom_container
    EXPORTING container_name = g_container.
    ENDIF.
    Regards

  • Pages 5.5.1: When opening a document created with Pages '09 (Version 4.0) with Pages 5.5.1 the page header and the page footer are deleted. How can this be prevented? Or is this a bug in Pages 5.5.1?

    Pages 5.5.1: When opening a document created with Pages '09 (Version 4.0) with Pages 5.5.1 the page header and the page footer are deleted. How can this be prevented? Or is this a bug in Pages 5.5.1?

    Same problem here (no graphics in header or footer) and the problem has been reported months ago. It is another bug/feature lost when Apple moves from 09 to the iCloud-compatible versions.  Complain to Apple, you may have better chance than me and they may finally listen to their users....

  • How to get the number of rows written to the header of the spool file.

    Hi
    I need to create a header line for the spool file .
    the header line should include fixed length values .
    The header should include the number of records found in the table with a maximum begin date (begin_date is the column of the table)
    To get the header in the spool file , i wrote a select query has :-
    --SPOOL 'C:\Documents and Settings\abc\Desktop\output.TXT'
    select 'W'||to_char(sysdate,'MM/DD/YYYYMi:HH:SS')||lpad(max(rownum),9,'000000000') ||'R'||max(to_char(school_from_date,'MM/DD/YYYY')) ||
    rpad(' ',76,' ')
    from dad.school
    group by sysdate;
    SPOOL OFF
    which gets me all the rows in the table , but i only want the rows with the latest school_begin_date .
    how can i achieve that ...
    I know that a subquery should be written in the from clause to get the number of rows found with a maximum school_begin_date.
    select 'W'||to_char(sysdate,'MM/DD/YYYYMi:HH:SS')||lpad(max(rownum),9,'000000000') ||'R'||max(to_char(school_from_date,'MM/DD/YYYY')) ||
    rpad(' ',76,' ')
    from dad.school where
    select rownum from dad.school
    where school_begin_date = max(school_begin_date) ;
    the error i get is
    ORA-00934: group function is not allowed here
    I NEED HELP ..IN GETTING THE ROWNUM JUST FOR THE LATEST BEGIN_DATE ?
    PLS HELP ME IN WRITING THE QUERY .
    THANKS IN ADVANCE .

    Try this:
    select 'W'||to_char(sysdate,'MM/DD/YYYYMi:HH:SS')||lpad(max(rownum),9,'000000000')||'R'||max(to_char(school_from_date,'MM/DD/YYYY')) || rpad(' ',76,' ')
      from dad.school
    where school_begin_date = (select max(school_begin_date)
                                  from dad.school);

  • Crystal 6.0 : How to hide the Page footer and Page Header of the Main Report on the Sub report.

    Post Author: pranay
    CA Forum: Crystal Reports
    Hi ,
    I have a Main report and a Sub report .  When a subreport spans across multiple pages , the page header and page footer of the main report gets displayed along with it . I want to hide the Page Footer and Page Header of the main report when a sub report is displayed . Is there any way it could be acheived in Crystal Report 6.0.

    I am assuming you are talking about the JSControl dropdown menu navigation. The easiest way to hide Community pages is to disable the Below Banner View for that navigation scheme, although it also disables the Subcommunties, Related Communities and Go up to Parent Community links. If you still want these in below the banner menu you could not display Community Pages in the "In this Community" tab and only leave the "Community Members and Knowledge Directly" link in there.
    You would think that it would be better to remove the "In this Community" tab althogether but it is tricky to remove it due to the fact that there needs to be a default horizontal menu displayed all the time. Not all Communities will have a Subcommunities or Related Communities tab so these communities would not display any below banner menus at all if there is no "In this Community" tab, which could be confusing.

  • Is it possible to suppress the Page Header of the Main Report based on the Section Name?

    Hi,
    I am fairly new to Crystal Reports XI.  Is it possible to suppress the Page Header of the Main Report based on the Section Name?  Thanks.

    In the section expert you can enter a formula on the suppress function.
    You just need something to check against if it is section name you say
    {section name} ="Suppressme"
    I have used it more in drill level to display headers based on how far you have drilled into a report.
    Hope this helps
    Eric
    Via Christi Health System

  • How to print page numbers like 'Page 2 of 10' on an ALV report

    Hi,
    I've seen a few threads regarding this, but haven't seen any code that actually works. 
    What I'd like to do is print page x of y (i.e. Page 2 of 10) on an ALV report once the report is printed.
    Is this actually possible?  If so, what are the steps and coding required? 
    I greatly appreciate your help experts!
    Mark

    Hi Mark,
    I think there is no better way than calculate it before doing the output. If you do not have extra-new-page, the total number of pages may be calculated as the number of lines displayed divided by lines on one page - this will depend on the lines used for top-of-page and end-of-page. Also filters and subtotals could not be used.
    An other approach could be to read the current page number in end-of-list event and then scan the whole list using READ LIST and MODIFY LIST in each page top accordingly.
    Because it is decades ago I printed a list last time I will never have the chance to try.
    Regards,
    Clemens

  • How to refresh after delete the records in ALV report ?

    Hi Friends,
    How to refresh after delete the records in ALV report.
    I am deleting records in ALV report .
    After successful delete the screen should refresh.
    u201C Deleted records should not appear in the screen u201C.
    Please guide me.
    Regards,
    Subash

    Hi subhash,
    FORM user_command USING r_ucomm LIKE sy-ucomm      rs_selfield TYPE slis_selfield.
    WHEN 'BACK'.
    Refresh the internal table from the ALV grid
          PERFORM update_alv_tab.
    ENDFORM.                    "user_command
    FORM update_alv_tab .
      DATA :  e_grid TYPE REF TO cl_gui_alv_grid.
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          e_grid = e_grid.
      CALL METHOD e_grid->check_changed_data.
      "update_alv_tab
      CALL METHOD e_grid->refresh_table_display.
    ENDFORM.                    " UPDATE_ALV_TAB
    Then see in Debug mode is it updating or not..
    Please confirm .
    And please paste the code if you can.
    Regards.

  • To add/delete the rows in ALV report outpout

    Hi,
    Is there any way by which we can  add/delete the rows in ALV report output.
    Thanks
    Ankul

    Hi,
    Try out this way:
    data: i_modified TYPE STANDARD TABLE OF mara,"For getting modified rows
            w_modified TYPE mara.
    CASE e_ucomm.
          WHEN 'EDIT'.
          perform save_database.
          CALL METHOD ref_GRID->REFRESH_TABLE_DISPLAY.
        ENDCASE.
    FORM SAVE_DATABASE .
    data: i_selected_rows TYPE lvc_t_row,                "Selected Rows
          w_selected_rows TYPE lvc_s_row.
    * Getting the selected rows index
        CALL METHOD ref_grid->get_selected_rows
                    IMPORTING  et_index_rows = i_selected_rows.
    * Through the index capturing the values of selected rows
        LOOP AT i_selected_rows INTO w_selected_rows.
        READ TABLE it_tab INTO wa_it_tab INDEX w_selected_rows-index.
        IF sy-subrc EQ 0.
          MOVE-CORRESPONDING wa_it_tab TO w_modified.
          APPEND w_modified TO i_modified.
        ENDIF.
      ENDLOOP.
      MODIFY mara FROM TABLE i_modified.
    Thanks,
    Krishna

  • How to stop to display the main report page header in the subreport!

    Hello all,
    I have an existed report that display the CR page header on every page of the report. Now I added another subreport into report footer without using link. How do I stop to display the main report page header and display the subreport in the new page with subreport header only? I really appreciate your time to help me out on this issue. Thanks.

    Hi,
    I tried to supress the page header with (onlastrecord and TotalpageCount > 1) condition, but the last page of main report without page header. I still like the page header display on last record, but not on the subreport only. How do I get it? Thanks in advance.

  • To display the date in ALV report

    Hi All,
    In the header part of the ALV report, how to write a particular date by the day,month & year and simultaneously how to get the orders due for the week with displaying the weekend date..by the day, month & year.
    example :
                                        monday, december 16 2007
    orders for the weekend : sunday, december 22 2007.
    **and the orders will be displayed here..**
    How to get it? is there any function module to display as such, <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 21, 2008 10:42 AM

    Hi,
    Please refer to the below code:
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
    Form top-of-page.
    *ALV Header declarations
    data: t_header type slis_t_listheader,
          wa_header type slis_listheader,
          t_line like wa_header-info,
          ld_lines type i,
          ld_linesc(10) type c.
    *Use FM DATE_TO_DAY to get the day, month and year by specifying the date.
    *Date
      wa_header-typ  = 'H'.
      wa_header-info = <variable>.
      append wa_header to t_header.
      clear wa_header.
    * Time
      wa_header-typ  = 'H'.
      wa_header-info = <variable>.
      append wa_header to t_header.
      clear wa_header.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = t_header.
    *            i_logo             = 'Z_LOGO'.
    endform.
    Thanks,
    Sriram Ponna.

  • How to get list header in ECC6.0 of ALV reports ?

    Hello i want to display header in ALV reports this the code what i am using..
    *ALV TOP-OF-PAGE DECLATRACTION
    DATA : W_LISTHEADER TYPE SLIS_LISTHEADER,
           T_LISTHEADER TYPE SLIS_T_LISTHEADER.
    **PUPULATING TOP-OF-PAGE.
      w_LISTHEADER-TYP = 'H'.
      W_LISTHEADER-INFO = 'Report for Sales'.
      APPEND W_LISTHEADER TO T_LISTHEADER.
      CLEAR W_LISTHEADER.
    It is working fine in SAP4.7 version but in ECC6.0 it is not working where i have to do changes..
    Thks

    Hi,
    Try the top-of-page by using events, like
    Data Declaration
    TYPE-POOLS: slis.
    TABLES: mara.
    TYPES: BEGIN OF i_mara,
           matnr LIKE mara-matnr,
           mtart LIKE mara-mtart,
           meins LIKE mara-meins,
           groes LIKE mara-groes,
           volum LIKE mara-volum,
           END OF i_mara.
    DATA: it_mara TYPE STANDARD TABLE OF i_mara INITIAL SIZE 0.
    ALV Data Declaration
    DATA: fldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          i_events TYPE slis_t_event,
          w_events LIKE LINE OF i_events,
          i_repid TYPE sy-repid.
    DATA: i_comment TYPE slis_t_listheader,
          wa_comment TYPE slis_listheader.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM bld_fldcat.
      PERFORM call_events.
      PERFORM display_alv_report.
    *&      Form  CALL_EVENTS
          text
    FORM call_events.
    W_events-name = slis_ev_top_of_page.
    W_events-form = 'TOP-OF-PAGE'.
    append W_events  to i_events.
    clear W_events .
    ENDFORM.                    "CALL_EVENTS
    Build field catalog for ALV
    FORM bld_fldcat.
      fldcat-fieldname = 'MATNR'.
      fldcat-seltext_m = 'MATERIAL NUMBER'.
      fldcat-col_pos = 0.
      APPEND fldcat TO fldcat.
      CLEAR fldcat.
      fldcat-fieldname = 'MTART'.
      fldcat-seltext_m = 'MATERIAL TYPE'.
      fldcat-emphasize = 'C111'.
      APPEND fldcat TO fldcat.
      CLEAR fldcat.
      fldcat-fieldname = 'MEINS'.
      fldcat-seltext_m = 'UNIT OF MEASURE'.
      APPEND fldcat TO fldcat.
      CLEAR fldcat.
      fldcat-fieldname = 'GROES'.
      fldcat-seltext_m = 'SIZE'.
      APPEND fldcat TO fldcat.
      CLEAR fldcat.
      fldcat-fieldname = 'VOLUM'.
      fldcat-seltext_m = 'VOLUME'.
      APPEND fldcat TO fldcat.
      CLEAR fldcat.
    ENDFORM.                    "BLD_FLDCAT
    Display report using ALV List
    FORM display_alv_report.
      i_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
         i_callback_program             = I_REPID
         it_fieldcat                    = fldcat[]
         i_save                         = 'A'
         it_events                      = i_events
        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.                    "DISPLAY_ALV_REPORT
    Retrieve data from MARA table and populate itab IT_MARA
    FORM data_retrieval.
      SELECT matnr mtart meins groes volum
      INTO TABLE it_mara FROM mara UP TO 50 ROWS.
    ENDFORM.                    "DATA_RETRIEVAL
    *&      Form  TOP_OF_PAGE
          text
    FORM TOP-OF-PAGE.
      CLEAR i_comment[].
      wa_comment-typ = 'H'.
      wa_comment-info = 'TOP OF PAGE' .    "SY-PAGNO.
      APPEND wa_comment TO i_comment.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = i_comment.
    ENDFORM.                    "GENERATE_USERCOMMAND_FOOTER
    Regards,
    Chandu

  • Column Heading are not displayed in ALV Report using CL_SALV_DISPLAY?

    Hi,
       I am using CL_SALV_DISPLAY class to display data. I Created an Internal Table Dynamically based fieldcatalog which was prepared based data at run time. When i displayed data using CL_SALC_DISPALY data is display in output but column headings are not displayed.
    can anyone suggest me how to display heading in ALV using CL_SALV_DISPLAY class, My code is
          CLASS lcl_report DEFINITION
    CLASS lcl_report DEFINITION.
      PUBLIC SECTION.
        METHODS:
          display  IMPORTING l_table  TYPE string
                             l_fcat   TYPE string.
    ENDCLASS.                    "lcl_report DEFINITION
          CLASS lcl_report IMPLEMENTATION
    CLASS lcl_report IMPLEMENTATION.
      METHOD display.
        DATA: gr_table   TYPE REF TO cl_salv_table.
        DATA: gr_columns TYPE REF TO cl_salv_columns_table,
              gr_column  TYPE REF TO cl_salv_column_table,
              ls_fcat    TYPE slis_fieldcat_alv.
        DATA: gr_display TYPE REF TO cl_salv_display_settings.
        DATA: l_o_functions TYPE REF TO cl_salv_functions_list,
              l_field    TYPE string.
        FIELD-SYMBOLS : <fs_table>    TYPE STANDARD TABLE,
                        <ft_fcat>     TYPE STANDARD TABLE.
    Get the ALV object refering to the output table
        ASSIGN (l_table) TO <fs_table>.
        ASSIGN (l_fcat)  TO <ft_fcat>.
        TRY.
            cl_salv_table=>factory(
              IMPORTING
                r_salv_table = gr_table
              CHANGING
                t_table      = <fs_table> ).
          CATCH cx_salv_msg.                                "#EC NO_HANDLER
        ENDTRY.
    Add basic default functionality in the ALV report
    Functions
        l_o_functions = gr_table->get_functions( ).
        l_o_functions->set_all( abap_true ).
        gr_columns = gr_table->get_columns( ).
        gr_columns->set_headers_visible( abap_true ).
    Display the list
        gr_table->display( ).
      ENDMETHOD.                    "extract
    ENDCLASS.                    "lcl_report IMPLEMENTATION
    *& start-of-selection declaration
    START-OF-SELECTION.
      PERFORM :
      get store codes
        get_storecodes    USING      p_stfile
                          CHANGING   it_t001w,
      fetching mard data
        read_mard_data,
      preparing fieldcatalog for Final Data
        create_filedcat   USING      it_t001w
                                     it_site
                          CHANGING   it_fieldcat,
      preparing structure & internal table for Final Data
        create_final_table_structure  USING  it_fieldcat,
      prepare output data
        prepare_final_data.
    *& end-of-selection declaration
    END-OF-SELECTION.
      PERFORM :
      display data
        display_data    USING l_table
                              l_fcat.
    *&      Form  get_storecodes
    FORM get_storecodes  USING    p_p_stfile
                         CHANGING p_it_t001w  LIKE it_t001w[].
      DATA  :
    internal table for RAW
      lt_raw    TYPE truxs_t_text_data,
      rs_site   LIKE LINE OF rt_site,
      l_index   LIKE sy-tabix.
      FIELD-SYMBOLS :
    field symbol for it_t001w
      <fs_t001w>   LIKE LINE OF p_it_t001w.
    calling function module to get Stores Data from File
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_line_header        = 'X'
          i_tab_raw_data       = lt_raw
          i_filename           = p_p_stfile
        TABLES
          i_tab_converted_data = p_it_t001w[]
        EXCEPTIONS
          conversion_failed    = 1
          OTHERS               = 2.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      SORT p_it_t001w BY werks.
      CLEAR rs_site.
      rs_site-sign   = 'I'.
      rs_site-option = 'EQ'.
      rs_site-low    = p_dccode.
      APPEND rs_site TO rt_site.
      IF it_t001w[] IS NOT INITIAL.
        LOOP AT p_it_t001w ASSIGNING <fs_t001w>.
          l_index   = sy-tabix.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
            EXPORTING
              input  = <fs_t001w>-werks
            IMPORTING
              output = <fs_t001w>-werks.
          MODIFY p_it_t001w FROM <fs_t001w> INDEX l_index.
          IF <fs_t001w>-werks GE s_site-low AND <fs_t001w>-werks LE s_site-high.
          append site to ranges
            CLEAR rs_site.
            rs_site-sign   = 'I'.
            rs_site-option = 'EQ'.
            rs_site-low    = <fs_t001w>-werks.
            APPEND rs_site TO rt_site.
            CONTINUE.
          ENDIF.
        ENDLOOP.
        SORT p_it_t001w BY werks.
        SORT rt_site.
      ENDIF.
    ENDFORM.                    " get_storecodes
    *&      Form  create_final_table_structure
    FORM create_filedcat   USING    p_it_t001w      LIKE it_t001w[]
                                    p_it_site       LIKE it_site[]
                           CHANGING p_it_fieldcat   LIKE it_fieldcat[].
      FIELD-SYMBOLS :
    field symbol for p_it_t001w
      <fs_t001w>     LIKE LINE OF p_it_t001w,
    field symbol for p_it_site
      <fs_site>      LIKE LINE OF p_it_site.
      DATA :
    fieldname
      l_fieldname    TYPE slis_fieldname,
    workarea for site ranges
      rs_site        LIKE LINE OF rt_site.
      CLEAR : l_fieldname, rs_site.
      l_fieldname    = p_dccode.
      PERFORM
    prepare fieldcatalog
      build_fieldcatalog USING :   'MTART'      'CHAR'        '5'  ,
                                   'MTBEZ'      'CHAR'        '25' ,
                                   'MATKL'      'CHAR'        '6'  ,
                                   'WGBEZ'      'CHAR'        '20' ,
                                   'MATNR'      'CHAR'        '18' ,
                                   'MAKTX'      'CHAR'        '30' ,
                                    l_fieldname 'CHAR'        '17' .
    create header for excel
      PERFORM create_excel_header USING  : 'Division',
                                           'Divsion Description',
                                           'MC Code',
                                           'MC Description',
                                           'Article',
                                           'Article Description',
                                            l_fieldname.
    loop for creating fieldcatalog
      LOOP AT it_site ASSIGNING <fs_site>.
        READ TABLE it_t001w ASSIGNING <fs_t001w> WITH KEY werks = <fs_site>-werks
                                                                  BINARY SEARCH.
        IF sy-subrc = 0           AND <fs_t001w> IS ASSIGNED AND
           <fs_site> IS ASSIGNED  AND <fs_site>-stock GT 0.
          CLEAR : l_fieldname, rs_site.
          l_fieldname    = <fs_site>-werks.
        prepare fieldcatalog
          PERFORM build_fieldcatalog USING : l_fieldname    'CHAR'   '17'.
        create header for excel
          PERFORM create_excel_header USING  l_fieldname  .
          CONTINUE.
        ENDIF.
      ENDLOOP.
      l_fcat  = 'it_fieldcat[]'.
    ENDFORM.                    " create_final_table_structure
    *&      Form  build_fieldcatalog
    FORM build_fieldcatalog  USING    p_fieldname      TYPE slis_fieldname
                                      p_datatype       TYPE datatype_d
                                      p_length         TYPE intlen.
      DATA : ls_fieldcat    LIKE LINE OF it_fieldcat.
      CLEAR  : ls_fieldcat.
      ls_fieldcat-fieldname   = p_fieldname.
      ls_fieldcat-datatype    = p_datatype.
      ls_fieldcat-intlen      = p_length.
      APPEND ls_fieldcat TO it_fieldcat.
    ENDFORM.                    " build_fieldcatalog
    *&      Form  create_final_table_structure
    FORM create_final_table_structure  USING    p_it_fieldcat.
    Create dynamic internal table and assign to FS
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fieldcat
        IMPORTING
          ep_table        = t_table.
      ASSIGN t_table->*  TO <ft_final>.
    ENDFORM.                    " create_final_table_structure
    *&      Form  create_excel_header
    FORM create_excel_header  USING    p_p_fieldname.
      DATA : ls_header  LIKE LINE OF it_header.
      CLEAR ls_header.
      ls_header-col_name  = p_p_fieldname.
      APPEND ls_header TO it_header.
    ENDFORM.                    " create_excel_header
    *&      Form  prepare_final_data
    FORM prepare_final_data .
      DATA          : l_matnr       LIKE g_matnr,
                      l_werks       LIKE g_werks,
                      l_index       LIKE sy-tabix.
      FIELD-SYMBOLS : <fs_mard>     LIKE LINE OF it_mard.
    Getting No. of Lines in IT_MARD internal table
      DESCRIBE TABLE it_mard LINES g_lines.
      LOOP AT it_mard ASSIGNING <fs_mard>.
        l_index    = sy-tabix.
        IF l_matnr IS INITIAL.
          l_matnr  = <fs_mard>-matnr.
          CLEAR : l_werks.
          l_werks    = <fs_mard>-werks.
          UNASSIGN : <fs_value>, <fs_final>.
        Create dynamic work area and assign to FS
          CREATE DATA t_line LIKE LINE OF <ft_final>.
          ASSIGN t_line->*   TO <fs_final>.
          ASSIGN COMPONENT 'MATNR'  OF STRUCTURE <fs_final> TO <fs_value>.
          <fs_value>        = <fs_mard>-matnr.
          ASSIGN COMPONENT l_werks  OF STRUCTURE <fs_final> TO <fs_value>.
          <fs_value>        = <fs_value> + <fs_mard>-labst.
        getting Article Type,MC & its Descriptions
          PERFORM get_other_data    USING     l_matnr
                                              l_werks.
        ELSEIF l_matnr <> <fs_mard>-matnr.
          APPEND <fs_final> TO <ft_final>.
          CLEAR l_matnr.
          l_matnr  = <fs_mard>-matnr.
          CLEAR : l_werks.
          l_werks    = <fs_mard>-werks.
          UNASSIGN : <fs_value>, <fs_final>.
        Create dynamic work area and assign to FS
          CREATE DATA t_line LIKE LINE OF <ft_final>.
          ASSIGN t_line->*   TO <fs_final>.
          ASSIGN COMPONENT 'MATNR'  OF STRUCTURE <fs_final> TO <fs_value>.
          <fs_value>        = <fs_mard>-matnr.
          ASSIGN COMPONENT l_werks  OF STRUCTURE <fs_final> TO <fs_value>.
          <fs_value>        = <fs_value> + <fs_mard>-labst.
        getting Article Type,MC & its Descriptions
          PERFORM get_other_data    USING     l_matnr
                                             l_werks.
        ELSE.
          CLEAR : l_werks.
          l_werks    = <fs_mard>-werks.
          ASSIGN COMPONENT l_werks  OF STRUCTURE <fs_final> TO <fs_value>.
          <fs_value>        = <fs_value> + <fs_mard>-labst.
        ENDIF.
        IF l_index = g_lines.
          APPEND <fs_final> TO <ft_final>.
        ENDIF.
      ENDLOOP.
      l_table  = '<ft_final>[]'.
    ENDFORM.                    " prepare_final_data
    *&      Form  get_other_data
    FORM get_other_data  USING    p_l_matnr
                                  p_l_werks.
      FIELD-SYMBOLS : <fs_mara>     LIKE LINE OF it_mara,
                      <fs_t023t>    LIKE LINE OF it_t023t,
                      <fs_t134t>    LIKE LINE OF it_t134t,
                      <fs_makt>     LIKE LINE OF it_makt.
      READ TABLE it_mara ASSIGNING <fs_mara> WITH KEY matnr = p_l_matnr.   " BINARY SEARCH.
      IF sy-subrc = 0 AND <fs_mara> IS ASSIGNED.
        ASSIGN COMPONENT 'MTART'  OF STRUCTURE <fs_final> TO <fs_value>.
        <fs_value>        = <fs_mara>-mtart.
        ASSIGN COMPONENT 'MATKL'  OF STRUCTURE <fs_final> TO <fs_value>.
        <fs_value>        = <fs_mara>-matkl.
        READ TABLE it_makt  ASSIGNING <fs_makt>  WITH KEY matnr =  <fs_mara>-matnr   BINARY SEARCH.
        IF sy-subrc = 0 AND <fs_makt> IS ASSIGNED.
          ASSIGN COMPONENT 'MAKTX'  OF STRUCTURE <fs_final> TO <fs_value>.
          <fs_value>        = <fs_makt>-maktx.
        ENDIF.
        READ TABLE it_t023t ASSIGNING <fs_t023t> WITH KEY matkl = <fs_mara>-matkl  BINARY SEARCH.
        IF sy-subrc = 0 AND <fs_t023t> IS ASSIGNED.
          ASSIGN COMPONENT 'WGBEZ'  OF STRUCTURE <fs_final> TO <fs_value>.
          <fs_value>      = <fs_t023t>-wgbez.
        ENDIF.
        READ TABLE it_t134t ASSIGNING <fs_t134t> WITH KEY mtart = <fs_mara>-mtart  BINARY SEARCH.
        IF sy-subrc = 0 AND <fs_t134t> IS ASSIGNED.
          ASSIGN COMPONENT 'MTBEZ'  OF STRUCTURE <fs_final> TO <fs_value>.
          <fs_value>      = <fs_t134t>-mtbez.
        ENDIF.
      ENDIF.
    ENDFORM.                    " get_other_data
    *&      Form  display_data
          text
    FORM display_data  USING    p_l_table
                                p_l_fcat.
      DATA:
    Variable for Object Creation
      o_report TYPE REF TO lcl_report.
      CREATE OBJECT o_report.
      o_report->display( EXPORTING l_table = p_l_table
                                   l_fcat  = p_l_fcat ).
    ENDFORM.                    " display_data

    I don't know how to read the code you pasted or I would have checked this myself.
    Do your fields in the internal table reference dictionary objects or elementary types? If not using dictionary types, the column names will be blank by default. If you can't change your fields to be dictionary types, you can try this to change the column names:
    I made a method inside my local class to add the names:
            call method set_colname
              EXPORTING iv_tab = alv_tab
                        iv_colid = 'xxxx'  "fieldname from the table
                        iv_stxt = text-t54
                        iv_mtxt = text-t55
                        iv_ltxt = text-t55.
    METHOD set_colname .
      data:
              alv_cols type REF TO cl_salv_columns_table,
              alv_col type REF TO cl_salv_column.
      TRY .
    *... Change fieldnames
            call METHOD iv_tab->get_columns RECEIVING value = alv_cols.
            call method alv_cols->get_column EXPORTING columnname = iv_colid RECEIVING value = alv_col.
            IF iv_stxt <> ''.
              CALL METHOD alv_col->set_short_text EXPORTING value = iv_stxt.
            ENDIF.
            IF iv_mtxt <> ''.
              CALL METHOD alv_col->set_medium_text EXPORTING value = iv_mtxt.
            ENDIF.
            IF iv_ltxt <> ''.
              CALL METHOD alv_col->set_long_text EXPORTING value = iv_ltxt.
            ENDIF.
       CATCH cx_salv_not_found.
      ENDTRY.
    ENDMETHOD. "set_colname

  • Average of the column in ALV report

    Hi,
      I am working on an ALV report and for one of the column, i am calculating the average with fieldcatalog property do_sum = 'C'.
    I am sorting the output table for 2 fields and whenever I am expanding/compressing the sorted fields the average of the column is changing. Please let me know how do I get this average calculated constant. It should not change when the user collapses/expands on the sorted field.
    Regards
    Rashmi

    The same question has been asked in this thread:
    Compute average of a report column
    I have offered a solution but as I've said it's not great but it may meet your needs.
    Or another forum user may review and be able to suggest a better solution.
    Does the average need to be part of the report?
    Could you calculate it and display it within a page item below the report instead?

  • Display two heading in single column using ALV report

    Hi Experts,
    I got a requirement for displaying 2 rows heading in a single column report. Is it possible that I can perform this task using ALV. How to get this 2 rows in ALV.
    This is a criteria that need to be output in ALV REPORT.
    MATERIAL CODE--MATERIAL NUMBERSTORAGE LOC----SLOC1     SLOC2
    --DATE--DATE1      DATE2
    123445--TEST MATERIAL22--
    3
    As mentioned above storage loc and date will be changing with respect to data dynamically and under this double heading qty will be displayed.
    Just want to know how to get double heading. It is clear that how to display dynamically but unaware of double heading using fieldcatalog.
    Regards,
    Yahya

    Hi Yahya,
    Please pass row position in fieldcatalogue for the respective columns.
    E.g  MOVE '2' to w_fieldcat-row_pos.  " This will display the field in 2nd row.
    Thanks,
    Rupali

Maybe you are looking for