Report header on Excel Sheet

Hi to all there,
I am generatating my report output in excel format,
I am getting the records but my report header is not coming on Excel.
I have developed this report using reports6i.
can anybody help me.
Thanks in advance
Manvar

its not the "layout model" which defines the XML structure but it is the "Data Model", if you include your parameters / variables in one query in data model, you can find the information in the output XML ..
Hope this helps..

Similar Messages

  • Download the ALV Report output into excel sheet or notepad

    Hi,
    how to downlaod the alv report out into excel sheet or notepad in a proper manner. program contain large number records....
    Thanks in advance!!!!
    Regards,
    kranthi.

    Hi
    Download a report to excel with format (border, color cell, etc) 
    Try this program...it may help you to change the font ..etc.
    Code:
    REPORT ZSIRI NO STANDARD PAGE HEADING.
    this report demonstrates how to send some ABAP data to an
    EXCEL sheet using OLE automation.
    INCLUDE OLE2INCL.
    handles for OLE objects
    DATA: H_EXCEL TYPE OLE2_OBJECT,        " Excel object
          H_MAPL TYPE OLE2_OBJECT,         " list of workbooks
          H_MAP TYPE OLE2_OBJECT,          " workbook
          H_ZL TYPE OLE2_OBJECT,           " cell
          H_F TYPE OLE2_OBJECT.            " font
    TABLES: SPFLI.
    DATA  H TYPE I.
    table of flights
    DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
    *&   Event START-OF-SELECTION
    START-OF-SELECTION.
    read flights
      SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
    display header
      ULINE (61).
      WRITE: /     SY-VLINE NO-GAP,
              (3)  'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (4)  'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (8)  'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
      ULINE /(61).
    display flights
      LOOP AT IT_SPFLI.
      WRITE: / SY-VLINE NO-GAP,
               IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
      ENDLOOP.
      ULINE /(61).
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-007
           EXCEPTIONS
                OTHERS     = 1.
    start Excel
      CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
    PERFORM ERR_HDL.
      SET PROPERTY OF H_EXCEL  'Visible' = 1.
    CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls'
    PERFORM ERR_HDL.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-008
           EXCEPTIONS
                OTHERS     = 1.
    get list of workbooks, initially empty
      CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      PERFORM ERR_HDL.
    add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP.
      PERFORM ERR_HDL.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-009
           EXCEPTIONS
                OTHERS     = 1.
    output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
      PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
      PERFORM FILL_CELL USING 1 3 1 'Von'(003).
      PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
      PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
      LOOP AT IT_SPFLI.
    copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
        PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
        PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
        PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
        PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
      ENDLOOP.
    changes by Kishore  - start
    CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #1 = 2.
      PERFORM ERR_HDL.
    add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP  EXPORTING #1 = 2.
      PERFORM ERR_HDL.
    tell user what is going on
      SET PROPERTY OF H_MAP 'NAME' = 'COPY'.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-009
           EXCEPTIONS
                OTHERS     = 1.
    output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
      PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
      PERFORM FILL_CELL USING 1 3 1 'Von'(003).
      PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
      PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
      LOOP AT IT_SPFLI.
    copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
        PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
        PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
        PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
        PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
      ENDLOOP.
    changes by Kishore  - end
    disconnect from Excel
         CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING  #1 = 'C:\SKV.XLS'.
      FREE OBJECT H_EXCEL.
      PERFORM ERR_HDL.
          FORM FILL_CELL                                                *
          sets cell at coordinates i,j to value val boldtype bold       *
    FORM FILL_CELL USING I J BOLD VAL.
      CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_ZL 'Value' = VAL .
      PERFORM ERR_HDL.
      GET PROPERTY OF H_ZL 'Font' = H_F.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_F 'Bold' = BOLD .
      PERFORM ERR_HDL.
    ENDFORM.
    *&      Form  ERR_HDL
          outputs OLE error if any                                       *
    -->  p1        text
    <--  p2        text
    FORM ERR_HDL.
    IF SY-SUBRC <> 0.
      WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
      STOP.
    ENDIF.
    ENDFORM.                    " ERR_HDL
    Please note that this example maybe slow at filling the excel table
    (perhaps four fields per second on a 900 MHz machine - almost 30 seconds
    for a short example).
    To get the data on properties and methods - there is a bit of smoke and mirrors
    going on here; they are EXCEL properties and methods, not sap ones - so you need
    to look at excel help to determine how a particular function is structured. then
    build the block in sap, as shown in the example.
    If you only want to transfer the data to Excel like when you transfer the data from
    ALV to Excel simply use the Function Modules:
    XXL_SIMPLE_API
    If you want more modifications when you transfer it to Excel use:
    XXL_FULL_API

  • Need to send ALV Report as an Excel sheet via Email

    Well , I need to Email an ALV Report as an Excel Sheet using my program. What do I need to do and how?
    Answers will be rewarded with points.
    Thanks

    Hi Manu,
    You can copy and paste the following codes and try to execute..
    Hope this will help you..
    note: dont forget to change 'SAPUSER' to your SAP user id.
    REPORT  yhn_test8                               .
    TYPE-POOLS: slis, slist, truxs.
    DATA t5         LIKE t005t OCCURS 0 WITH HEADER LINE.
    DATA fcat       TYPE slis_t_fieldcat_alv.
    DATA listobject LIKE abaplist OCCURS 0 WITH HEADER LINE.
    DATA stack      TYPE slist_listlevel_stack WITH HEADER LINE.
    DATA ttxt       LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    PARAMETER p_alv   RADIOBUTTON GROUP a.
    PARAMETER p_excel RADIOBUTTON GROUP a.
    START-OF-SELECTION.
      SELECT * INTO TABLE t5
               FROM t005t
              WHERE spras = sy-langu.
      CLEAR : fcat, fcat[].
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'T005T'
        CHANGING
          ct_fieldcat            = fcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      IF p_alv = 'X'.
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
            it_fieldcat   = fcat
          TABLES
            t_outtab      = t5
          EXCEPTIONS
            program_error = 1
            OTHERS        = 2.
        IF sy-subrc <> 0.
        ENDIF.
      ELSEIF p_excel = 'X'.
        CALL FUNCTION 'LIST_FREE_MEMORY'.
        SUBMIT yhn_test8 EXPORTING LIST TO MEMORY AND RETURN.
        CALL FUNCTION 'LIST_FROM_MEMORY'
          TABLES
            listobject = listobject
          EXCEPTIONS
            not_found  = 1
            OTHERS     = 2.
        IF sy-subrc = 0.
        Generate LIST for excel file
          CALL FUNCTION 'LIST_TO_TXT'
            TABLES
              listtxt            = ttxt
              listobject         = listobject
            EXCEPTIONS
              empty_list         = 1
              list_index_invalid = 2
              OTHERS             = 3.
          IF sy-subrc = 0.
            LOOP AT ttxt.
              REPLACE ALL OCCURRENCES OF '|' IN ttxt-line
                      WITH cl_abap_char_utilities=>horizontal_tab.
              MODIFY ttxt.
            ENDLOOP.
            PERFORM send_email.
          ENDIF.
        ENDIF.
      ENDIF.
    *&      Form  send_email
    FORM send_email .
      DATA docs LIKE docs OCCURS 0 WITH HEADER LINE.
      DATA excelsize TYPE i.
      DATA excel LIKE solisti1   OCCURS 0 WITH HEADER LINE.
      DATA doc LIKE sodocchgi1.
      DATA excelln TYPE i.
      DATA int_objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
      DATA int_objhead LIKE solisti1   OCCURS 2 WITH HEADER LINE.
      DATA int_objtext LIKE solisti1   OCCURS 0 WITH HEADER LINE.
      DATA int_reclist LIKE somlreci1  OCCURS 1 WITH HEADER LINE.
      DATA bodyln LIKE sy-tabix.
      DATA output_data TYPE ssfcrescl.
      excel[] = ttxt[].
    excel table sizes
      DESCRIBE TABLE excel LINES excelln.
    Body Email
      int_objtext-line = 'Test Body'.
      APPEND int_objtext.
      DESCRIBE TABLE int_objtext LINES bodyln.
      READ     TABLE int_objtext INDEX bodyln.
      CLEAR doc.
      doc-doc_size   = ( bodyln - 1 ) * 255 + STRLEN( int_objtext ).
      doc-obj_name   = ' '.
      doc-sensitivty = 'P'.
      doc-proc_syst  = sy-sysid.
      doc-proc_clint = sy-mandt.
      CLEAR: int_objpack, int_objpack[].
      int_objpack-transf_bin = ' '.
      int_objpack-head_start = 1.
      int_objpack-head_num   = 0.
      int_objpack-body_start = 1.
      int_objpack-body_num   = bodyln.
      int_objpack-doc_type   = 'RAW'.
      int_objpack-obj_descr  = 'Test'.
      APPEND int_objpack.
      CLEAR: int_objhead, int_objhead[].
      int_objhead            = 'Attachment'.
      APPEND int_objhead.
      int_objpack-transf_bin = 'X'.
      int_objpack-head_start = 1.
      int_objpack-head_num   = 0.
      int_objpack-body_start = 1.
      int_objpack-body_num   = excelln.
      int_objpack-doc_size   = excelsize.
      int_objpack-doc_type   = 'XLS'.
      int_objpack-obj_name   = 'excel'.
      int_objpack-obj_descr  = 'test.xls'. "File name
      APPEND int_objpack.
      Set Receiver
      int_reclist-receiver   = 'SAPUSER'.
      int_reclist-rec_type   = 'B'.
      int_reclist-notif_del  = 'X'.
      int_reclist-notif_read = 'X'.
      int_reclist-notif_ndel = 'X'.
      int_reclist-express    = 'X'.
      APPEND int_reclist.
      doc-obj_descr = 'Report in Excel'.
      Sending Email
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = doc
          put_in_outbox              = 'X'
          commit_work                = 'X'
        TABLES
          packing_list               = int_objpack
          object_header              = int_objhead
          contents_bin               = excel
          contents_txt               = int_objtext   "Body
          receivers                  = int_reclist
        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.
    ENDFORM.                    " send_email

  • Problem when dowloading the ALV report output to Excel Sheet.

    Hi ,
    I am dowloading the ALV report output to Excel Sheet.
    There is field Condition Unit(KOMP-KMEIN) in the output of the ALV, this has values PC and CSE , but when I download to Excel Sheet, CSE is appearing as CSE ,but PC is appearing as ******.
    Can you please help me in knowing the reson for this.
    Regards,
    Madhu.

    hi
    refer to following link
    http://www.****************/Tutorials/ALV/ColorSALV/Demo.htm
    http://www.sap-img.com/abap/download-to-excel-with-format-border-color-cell-etc.htm
    Cheers
    Snehi
    Edited by: snehi chouhan on Jul 11, 2008 12:42 PM

  • Problem while exporting ALV column header to excel sheet.

    Hi,
    I am able to export an ALV grid details to an excel sheet. But the ALV column headers when exported to excel sheet are getting truncated.
    For eg: if my column header in ALV grid is displayed as 'Material' then the column header in excel sheet is 'Mater' only. Remaining portion is getting truncated.
    How can I view the entire column header text?
    Kindly assist.
    Thanks.

    I have the same problem with you, when user export to excel. I fixed it by using
    w_layo-colwidth_optimize = 'X'. <<<<<<<<<<<<This
    perform generate_fcat_reftab
        using 'PRUEFLOS' 'T_INPUT' '' '' 'Inspection Lot' 0.
    form generate_fcat_reftab  using    p_fieldname
                                        p_tabname
                                        p_ref_tabname
                                        p_ref_fieldname
                                        p_output_text
                                        p_output_lenght.
      clear w_fcat.
      w_fcat-fieldname = p_fieldname.
      w_fcat-tabname   = p_tabname.
      w_fcat-ref_fieldname = p_ref_fieldname.
      w_fcat-ref_tabname = p_ref_tabname.
      w_fcat-seltext_s = p_output_text.
      w_fcat-seltext_m = p_output_text.
      w_fcat-seltext_l = p_output_text.
      w_fcat-outputlen = p_output_lenght.
      w_fcat-ddictxt = 'L'. <<<<<<<<<<<<<<<<<<This
      append w_fcat to t_fcat.
    endform.

  • How to save each section report into different excel sheet?

    Hi all
    How to save each section report into different excel sheet?
    I have a report in which there are 4 sections north south west east now i need to save north in excel sheet 1 , south in sheet2, west in sheet3, and east in sheet4. under each section there is list report.
    Please let me know is it possible are not if possible let me no the procedure to be followed.
    Thank you

    If you're running XI 3.1 you might be able to solve this as follows.
    1. Create four users: east, west, north, south
    2. Create a profile that filters on the variable you used for the section/break
    3. Publish the report
    3.1 Set users created above to be the enterprise recipients
    3.2 Add personalization (the profile created above)
    3.3 Check the Deliver objects to each user in Destinations
    (3.4 You could use %SI_OWNER% to get a nice suffix to the report name)
    This should cause four reports to be created, each with its own "personalized" contents.

  • Report output in excel sheet

    hi friends,
    how can i display output of a report in excell sheet.
    regards,
    malleswari.

    Hi
    You would be able to download the report to an Excel Sheet.
    If you are using standard ABAP List then all you have to do is List->Save->File->Choose Spreadsheet as option
    If for ALV
    Please check this link
    https://forums.sdn.sap.com/click.jspa?searchID=255077&messageID=2410067

  • Again: Using Crystal Report to export excel sheet.

    Morning every one, first Iu2019d like to apologize for my last question see Using Crystal Report to export excel sheet. Itu2019s pretty hard to understand and wastes your precious time. Now here is a new one hopefully it will do myself a lot of help:)
    First, we have a table called HOURLY_PORTUTIL in the Database:
    Column Name...........Data Type  
    STARTTIME ................DATE
    CIRCLE.......................VARCHAR2
    SERVICENAME...........VARCHAR2
    PORTUTIL....................NUMBER
    The data in this table looks like:
    9/25/2008 00:00:00 AM...AP...(456)...0.01
    9/25/2008 01:00:00 AM...AP...(456)...0.04
    9/25/2008 02:00:00 AM...AP...(456)...5.04
    9/25/2008 12:00:00 PM...AP...(456)...0.02
    9/25/2008 00:00:00 AM...AP...AL-MOD...0.01
    9/25/2008 01:00:00 AM...AP...AL-MOD...0.04
    9/25/2008 02:00:00 AM...AP...AL-MOD...0.04
    9/25/2008 12:00:00 PM...AP...AL-MOD...0.02
    9/26/2008 00:00:00 AM...AP...(456)...1.01
    9/26/2008 01:00:00 AM...AP...(456)...0.34
    9/26/2008 02:00:00 AM...AP...(456)...5.24
    9/26/2008 12:00:00 PM...AP...(456)...7.72
    9/26/2008 00:00:00 AM...AP...AL-MOD...12.0
    9/26/2008 01:00:00 AM...AP...AL-MOD...0.23
    9/26/2008 02:00:00 AM...AP...AL-MOD...0.44
    9/26/2008 12:00:00 PM...AP...AL-MOD...8.11
    9/25/2008 00:00:00 AM...Delhi...(456)...1.01
    9/25/2008 01:00:00 AM...Delhi...(456)...2.04
    9/25/2008 02:00:00 AM...Delhi...(456)...6.04
    9/25/2008 12:00:00 PM...Delhi...(456)...7.02
    Then we have a Cross-Table:
    Columns:
    .............HOURLY_PORTUTIL.SERVICENAME
    Rows:
    ............HOURLY_PORTUTIL.CIRCLE
    ............HOURLY_PORTUTIL.STARTTIME
    ............@hourly
    Summarized Fields:
    ..............................Sum HOURLY_PORTUTIL.PORTUTIL
    The Formula @hourly converts, say, '9/25/2008 01:00:00 AM' to '01:00-02:00'.
    The above all is the information of our Cross-Table configuration, but the outcome is not what we want. I find that this forum doesn't want the user to post image, so I post the actually outcome and the outcome we want in my Picasa.
    Actually outcome:
    [http://picasaweb.google.com/enel.guo/ForWork#5288743968250408770]
    What we want:
    [http://picasaweb.google.com/enel.guo/ForWork#5288743974292750610]
    I know that the outcome looks good enough, but our customers don't think so. They want export the report to Excel sheet and have every row with exact CIRCLE and STARTTIME.
    Thanks again guys:)

    Hi  Ashwini Yadav,
    Thanks for your reply:)
    I'm afraid that your answer is not perfectly right. Again I'm sorry for my vague description. The suggestion you gave us is already adopted. The total and grand total part disappeared but we still can't get what we want.
    Please have a look at the new image link below, Hopefully it will give you a clear picture of what's going on:)
    Cross-table:
    [http://picasaweb.google.com/enel.guo/ForWork#5289122850514299506]
    Cross-Table configuration:
    [http://picasaweb.google.com/enel.guo/ForWork#5289123604007267826]
    Cross-Table configuration::
    [http://picasaweb.google.com/enel.guo/ForWork#5289122854967734466]
    The original output:
    [http://picasaweb.google.com/enel.guo/ForWork#5289120017105336914]
    The output we want:
    [http://picasaweb.google.com/enel.guo/ForWork#5289120018508824882]
    Edited by: Yu-Lin Liang on Jan 9, 2009 3:51 AM

  • Can we generate output of a report in an Excel Sheet?

    Hi All,
      Can anyone tell me how to generate output of a report in an Excel Sheet format?
    Thanks in advance,
    Jasmine.

    hi,
    try this sample...
    data: begin of itab occurs 0,
          vbeln like vbak-vbeln,
          posnr like vbap-posnr,
          end of itab.
    select vbeln
           posnr
           from vbap
           up to 20 rows
           into table itab.
    * EXCEL sheet using OLE automation.
    INCLUDE OLE2INCL.
    * handles for OLE objects
    DATA: H_EXCEL TYPE OLE2_OBJECT,        " Excel object
          H_WORK  TYPE OLE2_OBJECT,
          H_SHEET TYPE OLE2_OBJECT,
          H_CELL  TYPE OLE2_OBJECT,
          V_COL   LIKE SY-TABIX.     " column number of the cell
    DATA:
      V_STEP(30),
      V_FILE LIKE RLGRAP-FILENAME.
    * tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
    *           PERCENTAGE = 0
               TEXT       = 'Creating Excel...'
           EXCEPTIONS
                OTHERS     = 1.
    * start Excel
      V_STEP = 'Starting Excel'.
      CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_EXCEL  'Visible' = 1.
      CALL METHOD OF H_EXCEL 'APPEND'
        EXPORTING  #1 = 'D:SappdfABAP Trainingsheettr.xls'.
    *  PERFORM ERR_HDL.
    * tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
    *           PERCENTAGE = 0
               TEXT       = 'Adding Data to Excel...'
           EXCEPTIONS
                OTHERS     = 1.
    * Get the list of workbooks
      V_STEP = 'Preaparing Excel'.
      CALL METHOD OF H_EXCEL 'WORKBOOKS' = H_WORK.
      PERFORM ERR_HDL.
    ** Add new workbook (create a file)
      CALL METHOD OF H_WORK 'ADD'.
      PERFORM ERR_HDL.
    * Get the created worksheet
    ************************Sheet Number
      CALL METHOD OF H_EXCEL 'WORKSHEETS' = H_SHEET EXPORTING #1 = 3.
    ************************Sheet Number
      PERFORM ERR_HDL.
    * Activate (select) the first sheet
      CALL METHOD OF H_SHEET 'ACTIVATE'.
      PERFORM ERR_HDL.
    * tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
    *           PERCENTAGE = 0
               TEXT       = 'Adding Data to Excel...'
           EXCEPTIONS
                OTHERS     = 1.
    * output column headings to active Excel sheet
      V_STEP = 'Adding data to Excel'.
      LOOP AT ITAB.
        V_COL = SY-TABIX.
        PERFORM FILL_CELL USING 1 V_COL ITAB-vbeln.
        PERFORM FILL_CELL USING 2 V_COL ITAB-posnr.
      ENDLOOP.
      V_STEP = 'Releasing Excel'.
      FREE OBJECT H_EXCEL.
      PERFORM ERR_HDL.
      H_EXCEL-HANDLE = -1.
    *&      Form  ERR_HDL
    *       text
    *  -->  p1        text
    FORM ERR_HDL.
      IF SY-SUBRC <> 0.
        WRITE: / 'Error in processing Excel File:', V_STEP.
        STOP.
      ENDIF.
    ENDFORM.                    " ERR_HDL
    *&      Form  FILL_CELL
    *       text
    *      -->P_1      text
    *      -->P_1      text
    *      -->P_1      text
    FORM FILL_CELL USING  ROW COL VAL.
      CALL METHOD OF H_EXCEL 'Cells' = H_CELL
                     EXPORTING #1 = ROW #2 = COL.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_CELL 'Value' = VAL .
      PERFORM ERR_HDL.
    ENDFORM.                    " FILL_CELL
    regards
    satesh

  • Error while downloading Report as an Excel Sheet

    Hi All,
    I have a issue regarding enabling download of report as a excel sheet. Here is the summary of the issue I am facing.
    I have enabled report links in the Dashboard and saved the Dashboard. The download link is visible and when I click on the link
    it gives the option of excel and pop up window starts showing that the download has started. But midway it says the application URL is unavailable.
    My query is are there any server settings which we need to enable or add to allow the download of reports are excel sheets.
    The download to excel works fine in Firefox.
    The problem is with MIME type which is .mhtml in IE browser.
    Our Instance is SSO wired.
    If we remove the SSO, download to excel works fine in both IE and Firefox.
    Any inputs on this?
    Regards
    (S.Prashant)
    Edited by: user783550 on Sep 15, 2009 11:11 PM

    this issue is related to the web server hosting sso. i had posted the same question on this forum, hope it will help you as well - Download to excel issue

  • Formatting problem when downloading classical report output to excel sheet.

    Dear Experts,
    My classical report o/p looks like:
    SI    Name   ID
    1      xyz     11
    2      abc     22
    3      eet      33
    4      jnc      44
    When I download the same to a excel sheet from List->Save->file->Spreadsheet and save it.
    The formatting looks like this:
    SI   Name   ID
    1     xyz               11
    2     abc               22
    3     eet                33
    4     inc                44
    That is the heading and column entries are in different columns.
    There is no GUI_Download used.
    Kindly help what may be the issue.

    Hi,
    In the report output the formatting looks fine. It is exactly below the heading. But only when I save it to excel, this alignment issue is coming. Even the columns after this column are are properly aligned and there is no issue at all. Only this column in the middle has issue.

  • Header in EXCEL Sheet

    Hi all,
    I'm trying to download the file into excel sheet getting data into excel but header is missing in SAP4.7 version , when i check my code in ECC6.0 then the header is coming. Below is my code.
    TYPES: BEGIN OF it_int,
            sales(3) TYPE n,
            name(30) TYPE c,
           END OF it_int.
    DATA: t_int TYPE STANDARD TABLE OF it_int,
          fs_int TYPE it_int.
    DATA:
      BEGIN OF t_header  OCCURS 0,
        header(50) TYPE c,
      END OF t_header.
    fs_int-sales = 001.
    fs_int-name = 'Urea'.
    APPEND fs_int TO t_int.
    CLEAR fs_int.
    fs_int-sales = 002.
    fs_int-name = 'Ammonia'.
    APPEND fs_int TO t_int.
    CLEAR fs_int.
    t_header-header = 'Sales'.
    APPEND t_header.
    t_header-header = 'ItemName'.
    APPEND t_header.
    CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      filename  =
      'C:\SAELS.xls'
         filetype= 'ASC'
         append  = 'X'
         write_field_separator = 'X'
        TABLES
          data_tab   = t_int
          fieldnames = t_header.
    What needs to be done to get header in SAP4.7 version ?
    Thanks in Advance.
    Regards
    VENk@

    Hi Venkat reddy,
    <li>Try this way .I tried to change your program. it works
    REPORT ztest.
    TYPES: BEGIN OF it_int,
            sales(3) TYPE n,
            name(30) TYPE c,
           END OF it_int.
    DATA: t_int TYPE STANDARD TABLE OF it_int,
          fs_int TYPE it_int.
    DATA:BEGIN OF t_header OCCURS 0,
            field1(50) TYPE c,
            field2(50) TYPE c,
         END OF t_header.
    fs_int-sales = 001.
    fs_int-name = 'Urea'.
    APPEND fs_int TO t_int.
    CLEAR fs_int.
    fs_int-sales = 002.
    fs_int-name = 'Ammonia'.
    APPEND fs_int TO t_int.
    CLEAR fs_int.
    t_header-field1 = 'Sales'.
    t_header-field2 = 'ItemName'.
    APPEND t_header.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename              = 'C:\SAELS.xls'
        filetype              = 'ASC'
    *    append                = 'X'
        write_field_separator = 'X'
      TABLES
        data_tab              = t_header.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename              = 'C:\SAELS.xls'
        filetype              = 'ASC'
        append                = 'X'
        write_field_separator = 'X'
      TABLES
        data_tab              = t_int.
    Thanks
    Venkat.O

  • Convert the matrix report output to excel sheet

    Hi,
    I am using reports 6i and database Oracle Database 10g Enterprise Edition Release 10.2.0.1.0.
    I have to convert the output of matrix report into Excel sheet.
    Is it possible.
    Is there any other way to populate the matrix data to the excel sheet.
    Thanks and regards,
    Ansaf.

    You can generate excel file by setting SYSTEM PARAMETER values as below
    DESFORMAT - DELIMITED
    DESTYPE -FILE
    DESNAME -File Name.XLS
    Although this is not a pure Excel file (Its only a tab delimited file) but you can open this with MSExcel or Open office Calc.
    Regards
    Ahamed Rafeeque Cherkala.

  • Std Oracle Report output to Excel Sheet

    I'm supposed to make changes to Standard Oracle Report such that the changes of Oracle Standard Report should be Excel output. One of the ways of doing this is to develop the whole report again in Discoverer as it has the feature of outputing into Excel Sheet. I would appreciate if someone can suggest me other ways of achieving it.
    Thanks
    Bobby

    Hi,
    even i am trying to do the same with my reports. Though it is possible to convert the reports to excel using the DESFORMAT attribute on the reports service, I am not able to preserver all the format in the excel sheet.
    I do not want to use rep2excel but want to implement the same idea on my reports service. Is it possible
    thanks

  • Heading for excel sheet

    Hi everyone,
                     I am downloading an internal table into an excel sheet using function module using GUI_DOWNLOAD . Now i need to have a heading line in the excel sheet. How should i do this? I kindly request you to help me in this issue. Thanks in advance.

    hiii
    yes you right..that is the only problem you are having..without using FIELDNAMES you can get header like following program..just check follwoing program it will solve your problem...as that parameter is not used in FM gui_download
    TABLES:
      mara.
    *                        T Y P E S                                     *
    TYPES:
      BEGIN OF type_a090,
        kschl TYPE a090-kschl,             " Condition type
        vbeln TYPE a090-vbeln,             " Sales document number
        posnr TYPE a090-posnr,             " Item number
        matnr TYPE a090-matnr,             " Material number
        datbi TYPE a090-datbi,             " Valid from
        datab TYPE a090-datab,             " Valid to
      END OF type_a090.
    TYPES:
      BEGIN OF type_mara,
        matkl TYPE mara-matkl,             " Material group
        matnr TYPE mara-matnr,             " Material number
      END OF type_mara.
    TYPES:
      BEGIN OF type_makt,
        maktx TYPE makt-maktx,             " Material description
        matnr TYPE makt-matnr,             " Material number
      END OF type_makt.
    TYPES:
      BEGIN OF type_output,
        kschl TYPE a090-kschl,             " Condition type
        vbeln TYPE a090-vbeln,             " Sales document number
        posnr TYPE a090-posnr,             " Item number
        matnr TYPE a090-matnr,             " Material number
        datbi(10) TYPE c,                  " Valid from
        datab(10) TYPE c,                  " Valid to
        matkl TYPE mara-matkl,             " Material group
        maktx TYPE makt-maktx,             " Material description
      END OF type_output.
    TYPES:
      BEGIN OF type_final,
        string TYPE string,
      END OF type_final.
    *                            D A T A                                   *
    DATA:wa_a090 TYPE type_a090,
         i_a090  TYPE STANDARD TABLE OF type_a090,
         wa_mara TYPE type_mara,
         i_mara  TYPE STANDARD TABLE OF type_mara,
         wa_makt TYPE type_makt,
         i_makt  TYPE STANDARD TABLE OF type_makt,
         wa_output TYPE type_output,
         i_output  TYPE TABLE OF type_output,
         wa_final TYPE type_final,
         i_final  TYPE STANDARD TABLE OF type_final.            "#EC NEEDED
    *                 S E L E C T I O N     S C R E E N                    *
    SELECTION-SCREEN BEGIN OF BLOCK sel1 WITH FRAME TITLE text-se1.
    SELECT-OPTIONS:
      s_matnr          FOR mara-matnr,     " Material Number
      s_mtart          FOR mara-mtart.     " Material Type
    PARAMETERS p_kschl TYPE konp-kschl  DEFAULT text-000.
    " Condition Type
    SELECTION-SCREEN END   OF BLOCK sel1.
    SELECTION-SCREEN BEGIN OF BLOCK sel2 WITH FRAME TITLE text-se2.
    SELECTION-SCREEN BEGIN OF BLOCK sel3 WITH FRAME TITLE text-se3.
    PARAMETERS:
      p_app_a          RADIOBUTTON GROUP file,
      p_filea          type rlgrap-filename,
                                           " Local file for upload/download
      p_app_p          RADIOBUTTON GROUP file,
      p_filep          type rlgrap-filename.
    " Local file for upload/download
    SELECTION-SCREEN END   OF BLOCK sel3.
    SELECTION-SCREEN BEGIN OF BLOCK sel4 WITH FRAME TITLE text-se4.
    PARAMETERS:
      p_price          type rlgrap-filename OBLIGATORY
        DEFAULT text-001.
    SELECTION-SCREEN END   OF BLOCK sel4.
    SELECTION-SCREEN END   OF BLOCK sel2.
    * Selection screen processing
    AT SELECTION-SCREEN ON p_filea.
      IF NOT p_app_a IS INITIAL.
        IF p_filea IS INITIAL.
          MESSAGE e398
            WITH text-002 '' '' ''.
        ENDIF.                             " IF p_filea IS INITIAL
      ENDIF.                               " IF NOT p_app_a IS INITIAL
    AT SELECTION-SCREEN ON p_filep.
      IF NOT p_app_p IS INITIAL.
        IF p_filep IS INITIAL.
          MESSAGE e398
            WITH text-003 '' '' ''.
        ENDIF.                             " IF p_filep IS INITIAL
      ENDIF.                               " IF NOT p_app_p
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM output_data.
      PERFORM header.
    *&      Form  get_data                                                 *
    * Fetching data from the tables.
    *  There are no interface parameters to be passed.                     *
    FORM get_data .
      SELECT   kschl                       " Condition type
               vbeln                       " Sales document number
               posnr                       " Item number
               matnr                       " Material number
               datbi                       " Valid from
               datab                       " Valid to
               FROM a090
               INTO TABLE i_a090
               WHERE matnr IN  s_matnr AND
               kschl EQ p_kschl
               AND datab LE syst-datum
               AND datbi GE syst-datum.
      IF sy-subrc EQ 0.
        SELECT matkl                         " Material group
               matnr                         " Material number
               FROM mara
               INTO TABLE i_mara
               FOR ALL ENTRIES IN i_a090
               WHERE matnr = i_a090-matnr.
      ENDIF.
      IF sy-subrc EQ 0.
        SELECT maktx                         " Material description
               matnr                         " Material number
               FROM makt
               INTO TABLE i_makt
               FOR ALL ENTRIES IN i_mara
               WHERE matnr = i_mara-matnr
               AND spras = 'EN'.
      ENDIF.
    ENDFORM.                               " get_data
    *&      Form  output_data                                              *
    *  Populating the final output table.
    * There are no interface parameters to be passed.                      *
    FORM output_data .
      DATA:
        w_date2(10) TYPE c,                " For date formate
        w_date1(10) TYPE c.                " For date formate
      LOOP AT i_a090 INTO wa_a090.
        CONCATENATE wa_a090-datbi+6(2) wa_a090-datbi+4(2) wa_a090-datbi+0(4)
        INTO w_date1 SEPARATED BY '/'.
        CONCATENATE wa_a090-datab+6(2) wa_a090-datab+4(2) wa_a090-datab+0(4)
        INTO w_date2 SEPARATED BY '/'.
        wa_output-kschl = wa_a090-kschl.
        wa_output-vbeln = wa_a090-vbeln.
        wa_output-posnr = wa_a090-posnr.
        wa_output-matnr = wa_a090-matnr.
        wa_output-datbi = w_date1.
        wa_output-datab = w_date2.
        READ TABLE i_mara INTO wa_mara WITH KEY matnr = wa_a090-matnr.
        IF sy-subrc EQ 0.
          wa_output-matkl = wa_mara-matkl.
        ENDIF.
        READ TABLE i_makt INTO wa_makt WITH KEY matnr = wa_a090-matnr.
        IF sy-subrc EQ 0.
          wa_output-maktx = wa_makt-maktx.
        ENDIF.
        APPEND wa_output TO i_output.
        CLEAR wa_output.
      ENDLOOP.                             " LOOP AT i_a090
      DELETE ADJACENT DUPLICATES FROM i_output COMPARING ALL FIELDS.
      LOOP AT i_output INTO wa_output.
        CONCATENATE wa_output-kschl
                    wa_output-vbeln
                    wa_output-posnr
                    wa_output-matnr
                    wa_output-datbi
                    wa_output-datab
                    wa_output-matkl
                    wa_output-maktx
               INTO wa_final-string
               SEPARATED BY ','.
        APPEND wa_final TO i_final.
      ENDLOOP.                             " LOOP AT i_output...
    ENDFORM.                               " output_data
    *&      Form  header                                                   *
    *  Formating the header.                                               *
    *  There are no interface parameters to be passed.                     *
    FORM header .
      CONCATENATE text-004
                  text-005
                  text-006
                  text-007
                  text-008
                  text-009
                  text-010
                  text-011
             INTO wa_final-string
             SEPARATED BY ','.
      INSERT wa_final
      INTO i_final INDEX 1.
      PERFORM f901_output.
    ENDFORM.                               " header
    *&      Form  f901_output                                              *
    *  Downloading the final output table to the presentation server or    *
    *  application server.                                                 *
    *      -->P_I_OUTPUT  text                                             *
    *      -->P_P_PRICE  text                                              *
    FORM f901_output .
      IF p_app_p = 'X'.
        PERFORM f903_file_to_presentation
          USING p_price.
      ELSE.
        PERFORM f904_file_to_application
          USING p_price.
      ENDIF.                               " IF p_app_p
    ENDFORM.                               " f901_output
    *&      Form  f903_file_to_presentation                                *
    *  Dowload the file to the presentation server.                        *
    *      -->P_P_PRICE  text                                              *
    FORM f903_file_to_presentation  USING    p_p_price.
      DATA:
        lwa_file            TYPE string.  "#EC NEEDED     "rlgrap-filename.
      CONCATENATE p_filep p_p_price INTO lwa_file.
    *      Download the file
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
    *   BIN_FILESIZE                    = BIN_FILESIZE
          filename                        = lwa_file
          filetype                        = 'ASC'
    *   APPEND                          = ' '
    *   WRITE_FIELD_SEPARATOR           = ' '
    *   HEADER                          = '00'
    *   TRUNC_TRAILING_BLANKS           = ' '
    *   WRITE_LF                        = 'X'
    *   COL_SELECT                      = ' '
    *   COL_SELECT_MASK                 = ' '
    *   DAT_MODE                        = ' '
    *   CONFIRM_OVERWRITE               = ' '
    *   NO_AUTH_CHECK                   = ' '
    *   CODEPAGE                        = ' '
    *   IGNORE_CERR                     = ABAP_TRUE
    *   REPLACEMENT                     = '#'
    *   WRITE_BOM                       = ' '
    *   TRUNC_TRAILING_BLANKS_EOL       = 'X'
    *   WK1_N_FORMAT                    = ' '
    *   WK1_N_SIZE                      = ' '
    *   WK1_T_FORMAT                    = ' '
    *   WK1_T_SIZE                      = ' '
    * IMPORTING
    *   FILELENGTH                      = FILELENGTH
        TABLES
          data_tab                        = i_final
    *   FIELDNAMES                      = FIELDNAMES
        EXCEPTIONS
          file_write_error                = 1
          no_batch                        = 2
          gui_refuse_filetransfer         = 3
          invalid_type                    = 4
          no_authority                    = 5
          unknown_error                   = 6
          header_not_allowed              = 7
          separator_not_allowed           = 8
          filesize_not_allowed            = 9
          header_too_long                 = 10
          dp_error_create                 = 11
          dp_error_send                   = 12
          dp_error_write                  = 13
          unknown_dp_error                = 14
          access_denied                   = 15
          dp_out_of_memory                = 16
          disk_full                       = 17
          dp_timeout                      = 18
          file_not_found                  = 19
          dataprovider_exception          = 20
          control_flush_error             = 21
      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.                               " f903_file_to_presentation
    regards
    twinkal

Maybe you are looking for

  • Missing atrribute from ERp system

    Dear gurus! I am installing the business content (BC) for catalog 0MMIC_CHA01 (MMIC: Characteristics ). However I get a dump when I install becuase the attribute 0CCMB0PR_BASE_UNIT_ATTR does not exist in the ERP system. Also note that other finance B

  • High school computer lab: turning off iSight, disabling Photobooth

    We purchased new iMacs for our computer labs, and the iSight camera plus Photo Booth have been nothing but needless distractions since the school year began. I think that it is UNACCEPTABLE that Apple did not foresee the need to turn these cameras of

  • Investigate an element on a site

    Hi all. <br /> In advance I apologize for my not really good English. The problem such is - on one site is a popup window which when aiming at it the mouse pointer jumps out. At once this window became constantly active. <br /> If to investigate this

  • What is the current link for NI's LabView Wish List?

    never easy

  • Help Plzzzzzzzzzzzzzzzzzzzzzzzz

    Plz tell me how to run jsp in tomcat? http://localhost:8080 is working fine. examples in Tomcat are working.But my .jsp is not working Is it necessary to create web-inf/web.xml and also classes folder for running .jsp file..