Alv Excel download

Hi,
I written a ALV Grid report and i want to download the the report to Excel.
When I click on the excel button on the menu, Excel opens and the report is downloaded . BUT all the data with decimals are not downloaded it shows blank ,
Can any one help me on this  .
But when I use export to excel it works properly but my customer want to click on the excel and download
Thanking you,
Raju S

hi raju,
please try this,
Open Excel -> Tools -> Options -> Security -> Macro Security -> Make it low.
Now on the same path open tab -> Trusted Publishers and Check the checkbox for Trust Access to VB Project.
Use the FM - ALV_XXL_CALL. here is the sample -
REPORT ZSKC_ALV_XXL.
TYPE-POOLS : KKBLO.
DATA : ITAB LIKE T100 OCCURS 0,
T_FCAT_LVC TYPE LVC_S_FCAT OCCURS 0 WITH HEADER LINE,
T_FCAT_KKB TYPE KKBLO_T_FIELDCAT.
START-OF-SELECTION.
Get data.
SELECT * UP TO 20 ROWS
FROM T100
INTO TABLE ITAB
WHERE SPRSL = SY-LANGU.
CHECK SY-SUBRC EQ 0.
Create the field catalog.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = 'T100'
CHANGING
CT_FIELDCAT = T_FCAT_LVC[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
CHECK SY-SUBRC EQ 0.
make sure you pass the correct internal table name in the field catalog.
t_fcat_lvC-tabname = 'ITAB'.
MODIFY T_FCAT_LVC TRANSPORTING TABNAME WHERE TABNAME NE SPACE.
Transfer to KKBLO format.
CALL FUNCTION 'LVC_TRANSFER_TO_KKBLO'
EXPORTING
IT_FIELDCAT_LVC = T_FCAT_LVC[]
IMPORTING
ET_FIELDCAT_KKBLO = T_FCAT_KKB
EXCEPTIONS
IT_DATA_MISSING = 1
IT_FIELDCAT_LVC_MISSING = 2
OTHERS = 3.
CHECK SY-SUBRC EQ 0.
Call XXL.
CALL FUNCTION 'ALV_XXL_CALL'
EXPORTING
I_TABNAME = 'ITAB'
IT_FIELDCAT = T_FCAT_KKB
TABLES
IT_OUTTAB = ITAB[]
EXCEPTIONS
FATAL_ERROR = 1
NO_DISPLAY_POSSIBLE = 2
OTHERS = 3.
IF SY-SUBRC 0.
ENDIF.
Dont forget to reward,
Thanks & Regards,
Kalyan.

Similar Messages

  • ALV Excel download problem

    Hi,
    I am trying to download ALV report to excel but the columns in the o/p is appearing in two rows.
    THe ALV report has 82 columns in o/p.Is there any restriction on the no of columns that can be downloaded in excel.Please help.
    Thanks,
    Sutapa.

    Hi Sutapa,
    Kindly go through this link below for ALV Excel Download:
    Re: how to view alv grid output in excel format(not downloading to pc)
    Hope it helps
    Regrds
    Mansi

  • ALV Excel Download problem ( Special Character)

    Hi,
    I am unable to download completely in XLS format from ALV grid. When i tried in couple of ways there is a special character( " ) in one of the filed. Due to the same Excel download has some problem. I tested by removing those and it worked fine, 
    Please suggest me to solve the issue.
    Thanks,
    Bhanu Gattu,

    Data strings with special characters can not be downloaded into XLS format from ALV grid. In my case, I replaced the special character " with space and I could download the data into excel.

  • Max. no of columns in ALV Excel download

    I've a problem regarding the download of data from alv report's that have more than 99 columns.
    I have searched the forum but couldn't find a right answer.
    It is being done by standard option and not by custom functionality is there any way where we can increase this limitation.

    I don't know if there is a way it for more columns using that function.     But I suggest you to use excel inplace tool. With excel inplace users directly display and maintain values in SAP screen and they can save final document without any limits I think. Just go to change layout-> view and choose microsoft excel. To be able to display excel using this option macro security in installed MS Excel should be in low and VB script execution must be on.

  • ALV - Excel download Date field sits in the last Column

    Hi,
    I have custom ALV grid report using OOp . From the report i am exporting the results to an EXCEL, but the date columns in the report sits as last column the exported excel.
    Any idea ?
    Thanks
    aRs

    That is the default functionality of the ALV grid, it collects all the similar data types together and then donwloads the data.
    If you don't want that, you will have write code yourself and download the data
    Regards,
    Ravi
    Note - Please mark all the helpful answers

  • Blocked ALV Excel Download Issue

    Hi Experts,
    My customers requirement is to download the output of Quotation Comparison Report with exact alignments as how it displays on Screen.
    When I tried to download from Standard SAP Save options, like List->save.... Export.. Spreadsheet........, I am not getting the same format into the Excel Sheet.
    I went into the program to check and found that it is a Blocked ALV.
    I have 3 Blocks in the Outputs.
    I am missing the alignment of Second Block having "Quoted" "Negotiated" to left side.
    Kindly help me in downloading this as it is.
    Regards,
    G.V.S Praveen Kumar

    Hi Sumeet,
    DATA: lv_exit   TYPE char1,                               "#EC NEEDED
             lwa_exit  TYPE slis_exit_by_user,                   "#EC NEEDED
             lt_excl   TYPE slis_t_extab,
             lwa_event TYPE slis_alv_event.
       DATA: lwa_layout1 TYPE slis_layout_alv,
             lwa_layout2 TYPE slis_layout_alv,
             lwa_layout3 TYPE slis_layout_alv,
             lt_events   TYPE slis_t_event.
    FIELD-SYMBOLS: <t_block1> TYPE STANDARD TABLE,
                    <t_block2> TYPE STANDARD TABLE,
                    <t_block3> TYPE STANDARD TABLE,
                    <w_block>  TYPE any.
    * Initializing the Block List
       CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
         EXPORTING
           i_callback_program       = sy-repid
           i_callback_pf_status_set = 'PF_STATUS'
           i_callback_user_command  = 'USER_COMMAND'
           it_excluding             = lt_excl.
    CONSTANTS:slis_ev_top_of_list TYPE slis_formname VALUE 'TOP_OF_LIST'.
       lwa_event-name = slis_ev_top_of_list.
       lwa_event-form = 'HEADER_TOP_OF_LIST'.
       APPEND lwa_event TO lt_events.
       CLEAR  lwa_event.
       lwa_layout1-no_colhead = 'X'.
       lwa_layout1-zebra = 'X'.
    * Appending the block data for header to the list
       CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
         EXPORTING
           is_layout                  = lwa_layout1
           it_fieldcat                = t_fld1
           i_tabname                  = '<T_BLOCK1>'
           it_events                  = lt_events
         TABLES
           t_outtab                   = <t_block1>
         EXCEPTIONS
           program_error              = 1
           maximum_of_appends_reached = 2
           OTHERS                     = 3.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
       REFRESH lt_events.
       lwa_event-name = slis_ev_top_of_list.
       lwa_event-form = 'ITEM_TOP_OF_LIST'.
       APPEND lwa_event TO lt_events.
       CLEAR  lwa_event.
       lwa_layout2-no_colhead = 'X'.
       lwa_layout2-zebra = 'X'.
    * Appending the block data for item to the list
       CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
         EXPORTING
           is_layout                  = lwa_layout2
           it_fieldcat                = t_fld2
           i_tabname                  = '<T_BLOCK2>'
           it_events                  = lt_events
         TABLES
           t_outtab                   = <t_block2>
         EXCEPTIONS
           program_error              = 1
           maximum_of_appends_reached = 2
           OTHERS                     = 3.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
       lwa_layout3-no_colhead = 'X'.
       lwa_layout3-zebra = 'X'.
       REFRESH lt_events.
    * Appending the block data for item to the list
       CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
         EXPORTING
           is_layout                  = lwa_layout3
           it_fieldcat                = t_fld3
           i_tabname                  = '<T_BLOCK3>'
           it_events                  = lt_events
         TABLES
           t_outtab                   = <t_block3>
         EXCEPTIONS
           program_error              = 1
           maximum_of_appends_reached = 2
           OTHERS                     = 3.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    * Displaying the block list
       CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
         EXPORTING
           i_screen_start_column   = 0
           i_screen_start_line     = 0
           i_screen_end_column     = 0
           i_screen_end_line       = 0
         IMPORTING
           e_exit_caused_by_caller = lv_exit
           es_exit_caused_by_user  = lwa_exit
         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.

  • ALV -Excel download -header & data comming in Different columns

    Hi,
    I have an ALV report with FM.When I download it to excel through LIST/EXPORT/LOCALFILE some columns are getting messed up (ex: header is in one column and data is comming in different column).
    When i do with LIST/EXPORT/SPREADSHEET option it is working fine.
    but users want to use the first option only.
    I am use FM's in this report.
    Regards
    Praveen

    Hi
    What is the statement you used to dowload data .Check the field catalog that u are passing to downloaad function module.
    or check in the debuging mode..
    change these options in excel sheet and checkout if it can help u
    1. Go to Tools -> Macro -> Security in Excel
    2. Select the ‘Trusted Sources’ tab and ensure that the checkbox titled ‘Trust access to Visual Basic Project’ is ticked.
    3. With the feature switched on, the data is passed to Excel.
    check this sample one
    TABLES : MAST , "Material to BOM Link
    STKO , "BOM Header
    MARA . "General Material Data
    * Types Begin with TY_ *
    TYPES : BEGIN OF TY_MASTER ,
    MATNR TYPE MAST-MATNR , "Material Number
    WERKS TYPE MAST-WERKS , "Plant
    STLAN TYPE MAST-STLAN , "BOM Usage
    STLNR TYPE MAST-STLNR , "Bill of material
    STLAL TYPE MAST-STLAL , "Alternative BOM
    ANDAT TYPE MAST-ANDAT , "Date record created on
    AEDAT TYPE MAST-AEDAT , "Date of Last Change
    AENAM TYPE MAST-AENAM , "Name of Person Who Changed Object
    STLST TYPE STKO-STLST , "BOM status
    ZPLP1 TYPE MBEW-ZPLP1 , "Future Planned Price 1
    DWERK TYPE MVKE-DWERK , "Delivering Plant (Own or External)
    END OF TY_MASTER .
    TYPES : MY_TYPE(20) TYPE C.
    * Constants Begin with C_ *
    * Internal tables Begin with IT_ *
    DATA : IT_MASTER TYPE STANDARD TABLE OF TY_MASTER,
    WA_MASTER TYPE TY_MASTER .
    DATA : IT_HEADER TYPE TABLE OF MY_TYPE.
    * Data Begin with W_ *
    DATA : W_PTH TYPE RLGRAP-FILENAME.
    DATA : W_FILE TYPE RLGRAP-FILENAME.
    * Field Symbols Begin with FS_ *
    * Select Options Begin with SO_ *
    * Parameter Begin with PR_ *
    * I N I T I A L I Z A T I O N *
    *--- Add Header Fields to Header Table ---
    APPEND 'Material Number' TO IT_HEADER .
    APPEND 'Plant' TO IT_HEADER .
    APPEND 'BOM Usage' TO IT_HEADER .
    APPEND 'Bill Code' TO IT_HEADER .
    APPEND 'Alternative BOM' TO IT_HEADER .
    APPEND 'Created On' TO IT_HEADER .
    APPEND 'Changed On' TO IT_HEADER .
    APPEND 'Changed By' TO IT_HEADER .
    APPEND 'BOM Status' TO IT_HEADER .
    APPEND 'Planned Price' TO IT_HEADER .
    APPEND 'Delivery Plant' TO IT_HEADER .
    IF SY-MANDT = '700'.
    W_PTH = '\lkdb01ISDISSoftware DevelopmentsDevelopmentsData FilesSAP DumpsBOM_Available'.
    ELSE.
    W_PTH = 'C:'.
    ENDIF.
    * A T S E L E C T I O N S C R E E N *
    * s t a r t o f s e l e c t i o n
    START-OF-SELECTION.
    *--- Load Data to Internal Table ---
    * SELECT MAST~MATNR MAST~WERKS MAST~STLAN MAST~STLNR MAST~STLAL MAST~ANDAT MAST~AEDAT MAST~AENAM STKO~STLST
    * INTO TABLE IT_MASTER
    * FROM MAST
    * INNER JOIN STKO ON STKO~STLNR EQ MAST~STLNR
    * AND STKO~STLAL EQ MAST~STLAL
    * INNER JOIN MARA ON MARA~MATNR EQ MAST~MATNR
    * WHERE MARA~MTART LIKE 'ZFG%'
    * AND STKO~LKENZ NE 'X'
    * AND STKO~LOEKZ NE 'X'
    * AND STKO~STLST EQ '1'.
    SELECT MAST~MATNR MAST~WERKS MAST~STLAN MAST~STLNR MAST~STLAL MAST~ANDAT MAST~AEDAT MAST~AENAM STKO~STLST MBEW~ZPLP1 MVKE~DWERK
    INTO TABLE IT_MASTER
    FROM MAST
    INNER JOIN STKO ON STKO~STLNR EQ MAST~STLNR
    AND STKO~STLAL EQ MAST~STLAL
    INNER JOIN MARA ON MARA~MATNR EQ MAST~MATNR
    INNER JOIN MBEW ON MBEW~MATNR EQ MAST~MATNR
    AND MBEW~BWKEY EQ MAST~WERKS
    INNER JOIN MVKE ON MVKE~MATNR EQ MAST~MATNR
    WHERE MARA~MTART LIKE 'ZFG%'
    AND STKO~LKENZ NE 'X'
    AND STKO~LOEKZ NE 'X'
    AND STKO~STLST EQ '1'.
    IF SY-SUBRC <> 0.
    MESSAGE I014(ZLOAD).
    ENDIF.
    *--- Set Path to Function Module ---
    CONCATENATE W_PTH SY-DATUM ' - ' 'BOM_AVAILABLE_PLANT.XLS' INTO W_FILE.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    FILENAME = W_FILE
    FILETYPE = 'DAT'
    TABLES
    DATA_TAB = IT_MASTER
    FIELDNAMES = IT_HEADER
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_WRITE_ERROR = 2
    INVALID_FILESIZE = 3
    INVALID_TYPE = 4
    NO_BATCH = 5
    UNKNOWN_ERROR = 6
    INVALID_TABLE_EIDTH = 7
    GUI_REFUSE_FILETRANSFER = 8
    CUSTOMER_ERROR = 9
    OTHERS = 10.
    IF SY-SUBRC = 0.
    SUBMIT ZI005_MARA_DUMP_SOLIDEAL_N.
    MESSAGE I023(ZLOAD) WITH text-001.
    ELSE.
    MESSAGE I022(ZLOAD) WITH W_FILE. "Errors while downloading.
    ENDIF.
    END-OF-SELECTION.
    SUBMIT ZI005_MARA_DUMP_SOLIDEAL_N.
    Reward all helpfull answers
    Regards
    Pavan
    Message was edited by:
            Pavan praveen

  • Trigger event of Excel download in ALV

    From my menu bar on the screen can i trigger the alv
    excel download feature.

    Hi Kaushik,
    Check out the function module ALV_XXL_CALL.
    Srinivas

  • Problem in ALV to Excel Download

    Good Morning Experts,
      I am facing one issue related ALV to excel Download.
    I Developed one custom report the output is correct displaying.
    the output is like for example i am taking 3 columns (plant, material, amt).
    plant material amt
    1001  aaa     1000
    1001  bbb     2000
    while downloading to excel
    it displaying like
    plant
    material
    amt
    1001
    aaa
    1000
    1001
    bbb
    2000
    I dont know why its coming like that.
    this is my code
    DEFINE field_cat.
    wa_field-row_pos = &1.
    wa_field-fieldname = &2.
    wa_field-tabname = &3.
    wa_field-seltext_m = &4.
    wa_field-outputlen = &5.
    wa_field-currency = &6.
    wa_field-ref_fieldname = &7.
    wa_field-ref_tabname = &8.
    APPEND wa_field to it_field.
    clear wa_field.
    END-OF-DEFINITION.
    field_cat '1' 'BUKRS' 'IT_FINAL' 'Company Code' '6' '' '' ''.
    field_cat '2' 'BUTXT' 'IT_FINAL' 'Comp Descrip' '25' '' '' ''.
    field_cat '3' 'LIFNR' 'IT_FINAL' 'Vendor No' '10' '' '' ''.
    field_cat '4' 'NAME1' 'IT_FINAL' 'Vendor Name' '35' '' '' ''.
    field_cat '5' 'STRAS' 'IT_FINAL' 'Vendor Addres' '35' '' '' ''.
    field_cat '6' 'FDGRV' 'IT_FINAL' 'Nature Of Work' '30' '' '' ''.
    field_cat '7' 'DMBTR' 'IT_FINAL' 'Net Amount' '16' 'X' 'WAERS' 'IT_FINAL'.
    field_cat '8' 'QBSHB' 'IT_FINAL' 'TDS Amount' '16' 'X' 'WAERS' 'IT_FINAL'.
    field_cat '9' 'TOTAL' 'IT_FINAL' 'Total Amount' '16' 'X' 'WAERS' 'IT_FINAL'.
    it_layout-zebra = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = sy-repid
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
       IS_LAYOUT                         = it_layout
       IT_FIELDCAT                       = it_field
       I_SAVE                            = 'X'
      TABLES
        t_outtab                          = it_final
    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
    FORM TOP_OF_PAGE.
    REFRESH it_head. CLEAR it_head.
    wa_head-typ = 'H'.
    wa_head-info = 'Vendorwise Expense Details'.
    APPEND wa_head to it_head.
    wa_head-typ = 'S'.
    IF NOT s_MONAT-high is INITIAL.
      CONCATENATE 'Period : ' p_gjahr '.' s_MONAT-low ' to ' p_gjahr '.' s_MONAT-high INTO wa_head-info.
    ELSE.
      CONCATENATE 'Period : ' p_gjahr '.' s_MONAT-low INTO wa_head-info.
    ENDIF.
    APPEND wa_head to it_head.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        it_list_commentary       = it_head.
    ENDFORM.
    Regards,
    Dhina..

    Hi,
    You can also try in this way
    in the output screen
      click List (in app tool bar) -> Export -> Spreadsheet
    and save at your desired location.
    (It will be save in .mhtml format , just rightclick on it and you can open it with excel )
    Then you will be able to view in your required format.
    Regards,
    koolspy.

  • Using download button in ALV to download to excel

    Hi,
    Please provide me the solution on using download button in Hierarchial List ALV to download to excel.I need to download the Header and Item details in a single line (in one line)in the Excel sheet.
    Please suggest the solution and sample code ASAP.
    Thanks and Regards,
    Latha.

    Hi Rames,
    my mail id : [email protected]
    Thanks and Regards,
    Vidyullatha.

  • Excel download from ALV grid, for characters more than 1020

    Hi,
    When i am trying to download the report which is having character more than 1020, it is coming in two rows. I want all fields in one row. Please give solutions.
    I am using below field catalog.
    Car Eligibility
      CLEAR lw_fieldcat.
      lw_fieldcat-fieldname = text-001.
      lw_fieldcat-reptext_ddic = text-011.
      lw_fieldcat-tabname = text-021
      APPEND lw_fieldcat TO gt_fieldcat.
    I am using below FM.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          is_layout          = gt_layout
          it_fieldcat        = gt_fieldcat[]
          it_sort            = gt_sort[]
          it_events          = gt_events[]
        TABLES
          t_outtab           = gt_data
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    Thanks in Advance,
    Ravi Kumar

    ravi,
    its not about how you have used your field catalog or how you called ALV FM. its excel download functionality,
    what you need to do is:
    set pf-status '<<some value>>' -> you can find where to pass in ALV FM call.
    then add a application toolbar button though this pf status.
    then at  use_command event, check sy-ucomm and if its the same as your new icons fcode then use the method to download it in excel.

  • ALV Tree download to Excel (CL_GUI_LIST_TREE )

    Hi All,
         I have created a report for displaying the ALV tree. The flow of the code is sth like this:
    Report -> Calls Screen 9000 -> Initialize container type CL_GUI_CUSTOM_CONTAINER -> Tree Class CL_GUI_LIST_TREE displays the ALV tree.
    Now what I want is a way to download the ALV Tree to Excel format. Can you please help me on this.
    Thanks,
    Anuj

    Anuj,
    check these threads
    ALV tree control report to excel
    reg:alv tree Excel Download
    http://www.sapfans.com/forums/viewtopic.php?f=12&t=138177
    Thanks
    Bala Duvvuri

  • Material Number Truncated in ALV to Excel Download

    Hi Guru,
    I have a ALV program report. It has about 18 columns, but for some strange reason, when we download this report to an ALV the 3rd column which host the material number as the last digit missing/truncated.
    For example if we have a material number in SAP ALV Grid as 1234567, when we download this the excel, what we get in excel is 123456. with the last number missing.
    What is the best solution to fix this issue.
    Thanks for you help in advance.

    Hi Keshav,
    Previously I faced the same situation, like in ALV grid I was displaying the material nos with output length as 15. Since in the Grid display you can readjust the columns, So after displaying we just expanded in the grid and try to download the same in excel. But at that time the ALV was downloading with material number field length as 15 ( What I set in my field catalog). Even when I saw the print priview I saw only the length it is showing as 15.  After changing the output length as 18 in field cat  I got the correct download.
    (Here I am assuming that the question is raised for  ALV grid display since no where it is mentioned the type of ALV).
    Sorry it was mentioned in the question itself
    Regards
    Shiba
    Edited by: Shiba Prasad Dutta on Feb 22, 2010 2:41 PM

  • Excel download from ALV not working inproduction

    Hi all,
    I am using "set_table_for_first_display" for alv display. the excel download from alv is woking fine in development and quality stystem but in production only first 3-4 rows are getting downloaded. Other rows donot appear in excel.
    Any Idea !!!
    Thanks
    Madhu

    Hi Experts,
    I have noticed that same problem is occuring in development system also with same set of data . The ascii file created has some missing rows. I guess its due to some special characters though i am not able to see any special character . Any solution for this.
    Regs
    madhu

  • Repetition of header in ALV output once excel download is selected

    Hi Experts,
    I have alv report where I use FM as below
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program     = w_repid
          i_callback_top_of_page = 'TOP-OF-PAGE'  "see FORM
          is_layout              = l_layout
          it_fieldcat            = lt_fieldcat
          it_sort                = l_sort
          i_save                 = 'X'
        TABLES
          t_outtab               = itab
        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.
    and top of page as below
    FORM top-of-page.
    * Title
      w_header-typ  = 'H'.
      w_header-info = text-033.
      APPEND w_header TO t_header.
      CLEAR w_header.
    * Report Name
      w_header-typ  = 'S'.
      w_header-key = text-034.
      w_header-info =  sy-repid.
      APPEND w_header TO t_header.
      CLEAR w_header.
    * Date
      w_header-typ  = 'S'.
      w_header-key = text-035.
      CONCATENATE  sy-datum6(2) '.'+
                   sy-datum4(2) '.'+
                   sy-datum(4) INTO w_header-info.
      APPEND w_header TO t_header.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_header.
    ENDFORM.                    "top-of-page
    Its displaying well in output, but when I select excel download, the header is getting printed 4 times in the alv output and in the excel download it is printing twice. Please advise how to keep the header once. Note : I am not using any paging concept, simple header at the top.
    Please advise.
    Regards,
    Kiran.

    Hi kiran,
    While creating top-of-page,
    You have to refresh your header internal table before populating it with data i.e,
    FORM TOP.
    Refresh IT_HEADER                   -->with this the header text will not get repeatedly printed
    WA_HEADER-TYP = 'S'.
    WA_HEADER-KEY = TEXT-001.
    WA_HEADER-INFO = SY-REPID.
    APPEND WA_HEADER TO IT_HEADER.
    CLEAR WA_HEADER.
    WA_HEADER-TYP = 'S'.
    WA_HEADER-KEY = TEXT-002.
    WA_HEADER-INFO = SY-UNAME.
    APPEND WA_HEADER TO IT_HEADER.
    CLEAR WA_HEADER.
    WA_HEADER-TYP = 'S'.
    WA_HEADER-KEY = TEXT-003.
    WA_HEADER-INFO = SY-DATUM.
    APPEND WA_HEADER TO IT_HEADER.
    CLEAR WA_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        it_list_commentary       = IT_HEADER
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.
    Hope it helps you
    Regards
    Mansi

Maybe you are looking for

  • Saving a PDF File to the Desktop from an Internet Application

    When downloading a PDF attachment that contains a password I cannot save the file to my desktop. The display message indicates that the document is protected and that I need another password to unlock the file. However when downloading the same file

  • Error in ALE

    Scenarion : The IDOC should generate while saving the purchse order in ALE distribution. 1. Creating a TRFC port with RFC destination 2. Creating a partner profile for the vendor (LI). Vendor Name, Partner function, Orders & Ordchg message type, Assi

  • Subution problem in workflow

    hi , if user is on leave, and he is not maintained the substitution. then wokitem go to in his inbox. for this problem how can i solve . i heard that workflow adminstrator can put subtitute for any user, how? if workitem already went to user inbox, h

  • Can I package and call a java object in the swf? (on the client)

    Hello, Can I package and call/execute a java object within the swf/adobe flash player? I want to embed a java object in my swf, and then whne the swf executes have it call the java object...... E.

  • HT3939 Let me know , please if my iPhone 5 unlocked or no with model A1428 Part No MD644LL/A

    Let me know , please if my iPhone 5 unlocked or no with model A1428 Part No MD644LL/A