Sending report output to Excel

Dear buddies
I'm using OLE Object in my report to send its output to excel. I find this way from an example at the same forum. But I feel that this example is for very small sized reports which have to send a few cells to excel because in this method we've to map each boiler plate and data field to excel like this.
function B_DEPTNOFormatTrigger return boolean is
begin
RPT2XLS.put_cell(1, 'DEPTNO', FontColor => 10, FontSize => 8, FontStyle => RPT2XLS.BOLD);
RPT2XLS.new_line;
return (TRUE);
end;
In this way its very hard to map large reports to excel which have more than 50 or 60 data fields and labels. So is there any short way to send its output to excel. Be careful that I also dont wanna use Delimited option coz Delimited file has also to be formatted while importing to Excel. Is there anyway that OLE Object should automatically detect all my Report Labels and fields or some other solution in yours minds???

If you are using 10g reports you can use the latest parameter desformat=spreadsheet
Rajesh Alex

Similar Messages

  • Send Report Output to Excell?

    Hi all,
    can anyone say me, how can I send the output of Report to the Excell Worksheet?
    Regards

    Hi Leonid,
    you can try this:
    In AFTERPARAMETERFORM trigger:
    myfile TEXT_IO.FILE_TYPE;
    begin
    myfile := TEXT_IO.FOPEN(:DESNAME, 'W');
    TEXT_IO.PUT(myfile, 'first column heading');
    TEXT_IO.PUT(myfile, chr(9));
    etc...
    end;
    PROCEDURE write_xls IS -- report program unit
    myfile TEXT_IO.FILE_TYPE;
    begin
    myfile := TEXT_IO.FOPEN(:DESNAME, 'A');
    TEXT_IO.PUT(myfile, :column1);
    TEXT_IO.PUT(myfile, chr(9));
    etc...
    TEXT_IO.FCLOSE(myfile);
    end;
    In the repeating frame trigger:
    write_xls;
    RETURN (TRUE);
    Good luck,
    Monica

  • Sending report output to Excel worksheet- Why all labels R put in one line?

    We need to export data from Oracle database to MS Excel work sheet. We developed a report and put all required things in the report. Set DESFORMAT and DESNAME parameters accordingly. Every thing works fine. But all the labels at the start of report are put in one line when we open output file in Excel worksheet. That is report heading, sub heading and column headings are all put in one line. Rest of the data is fine.
    To make excel worksheet more readable, we need to show these lines as these appear in layout and Line Previewer.
    Pl. help.

    Thanks Siva,
    Yes I am setting destination format to DELIMITED. But I do NOT want to suppress headers. In fact I do want headers in proper manner. The reason is that a no of files are produced by the same report for different columns as per user option in parameter form. So I want to put headers at the top of Excel file so that later on, at the time of using file for graphs in excel, user is able to properly recognize what the file contains. So I do want headers in manner in which they appear in Live Previewer and printed report.
    Waiting for reply from U and support group.
    M. Tariq

  • Send Report output as attachment in excel

    Hi All,
    I am scheduling background Job for Auto mail of standard SAP report. I am able to send the details in html format, please guide me how to send report details in excel format.
    I have already check SCN but unable to find exact solution for same.
    Regards
    Rashid

    Rashid,
    When u Go  SM37 Follow This Step Then U Get The Data In Excel Format.
    Follow step
    Select Spool Option
    Then U got the screen
    Select the type option then u got screen.
    In This Screen U Find the option save in Local File  then get the option.
    When U Select the Spreadsheet Option You can Able to save your data in excel format.
    Hope its help full for you

  • Report output to excel format

    Hi Experts,
    My requriement is I have to send a mail with report output in excel format as an attachment.
    I wrote the below subroutine for building excel sheet but I am getting output in the single row.  I am using version 4.6
    Please  help me regarding this. ASAP
    FORM BUILD_XLS_DATA .
      CONSTANTS: CON_CRET TYPE STRING VALUE '0D', "OK for non Unicode
      CON_TAB TYPE STRING VALUE '09'. "OK for non Unicode
      CONCATENATE 'Vendor' 'Country' 'Name'
      INTO IATTACH SEPARATED BY CON_TAB.
      CONCATENATE CON_CRET IATTACH INTO IATTACH.
      APPEND IATTACH.
      LOOP AT IT_lfa1.
       CONCATENATE IT_lfa1-lifnr IT_lfa1-land1 IT_lfa1-name1      INTO IATTACH
            SEPARATED BY CON_TAB.
        CONCATENATE CON_CRET IATTACH INTO IATTACH.
        APPEND IATTACH.
      ENDLOOP.
    ENDFORM.                    "build_xls_data
    Thanx,
    Sudha

    Hi Sudha,
    I am sending the standard format of sending a mail along with an attachment in .xls format.
    Try this code.
    form sendmail.
      CLEAR GV_DELIMIT.
      GV_DELIMIT = CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
      TEMPREAD = LV_LNCNT1.
      REFRESH OBJTXT.
      CONCATENATE 'The no. of error records are : ' TEMPREAD
      INTO OBJTXT-LINE.
      APPEND OBJTXT.
      CLEAR OBJPACK. REFRESH OBJPACK.
      CONCATENATE   C_CODE     
                    C_CMMT  
                    C_COMMENT1
                    INTO OBJTXT-LINE  SEPARATED BY GV_DELIMIT.
      APPEND OBJTXT.
      LOOP AT IT_DATA INTO WA_DATA.
        CONCATENATE   WA_DATA-ZCODE
                      WA_DATA-ZCOMMENT
                      WA_DATA-ZREASON
                      INTO OBJTXT-LINE  SEPARATED BY GV_DELIMIT.
        APPEND OBJTXT.
      ENDLOOP.
      CLEAR GV_DELIMIT.
      CLEAR OBJPACK. REFRESH OBJPACK.
      CLEAR DOC_CHNG.
      TAB_LINES = 0.
      OBJHEAD = REJFILE. APPEND OBJHEAD.
      DESCRIBE TABLE OBJTXT LINES TAB_LINES.
      READ TABLE OBJTXT INDEX TAB_LINES.
      DOC_CHNG-OBJ_NAME = REJFILE.
      MOVE TEXT-006 TO
      DOC_CHNG-OBJ_DESCR.
      DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
      CLEAR OBJPACK-TRANSF_BIN.
      OBJPACK-HEAD_START = 1.
      OBJPACK-HEAD_NUM = 0.
      OBJPACK-BODY_START = 1.
      OBJPACK-BODY_NUM = 1.   " 3.
      OBJPACK-DOC_TYPE = 'RAW'.
      APPEND OBJPACK.
      FOR ASCII TO BINARY OBJECT FUNCTION
      TOTLINEXFER = 0.
      TOTXFER = 0.
      BINMAXLEN = 255.
      REFRESH OBJBIN.
      LV_CR = CL_ABAP_CHAR_UTILITIES=>CR_LF.
      TGTMAXLEN = BINMAXLEN.
      TGTLEN = 0.
      LOOP AT OBJTXT FROM 2.
        IF NOT OBJTXT-LINE CP 'The no. of records are '." AND
          CONCATENATE OBJTXT-LINE LV_CR INTO BUFFER.
          SRCOBJLEN = STRLEN( BUFFER ).
          SRCOBJPTR = 0.
          WHILE SRCOBJLEN > 0 .
            XFERLEN = TGTMAXLEN - TGTLEN.
            IF XFERLEN > SRCOBJLEN.
              XFERLEN = SRCOBJLEN.
              MOVE BUFFERSRCOBJPTR TO OBJBIN-LINETGTLEN.
              TGTLEN = TGTLEN + SRCOBJLEN.
              SRCOBJLEN = 0.
              CLEAR BUFFER.
            ELSE.
              MOVE BUFFER+SRCOBJPTR(XFERLEN) TO
              OBJBIN-LINE+TGTLEN(XFERLEN).
              APPEND OBJBIN.
              CLEAR OBJBIN-LINE.
              TGTLEN = 0.
              SRCOBJLEN = SRCOBJLEN - XFERLEN.
              SRCOBJPTR = SRCOBJPTR + XFERLEN.
              TOTLINEXFER = TOTLINEXFER + 1.
            ENDIF.
            TOTXFER = TOTXFER + XFERLEN.
          ENDWHILE.
        ENDIF.
      ENDLOOP.
      IF TGTLEN > 0.
        APPEND OBJBIN.
        TOTLINEXFER = TOTLINEXFER + 1.
      ENDIF.
      CLEAR OBJPACK-TRANSF_BIN.
      OBJPACK-TRANSF_BIN = 'X'.
      OBJPACK-HEAD_START = 1.
      OBJPACK-HEAD_NUM = 0.
      OBJPACK-BODY_START = 1.
      OBJPACK-BODY_NUM = TOTLINEXFER.
      OBJPACK-DOC_TYPE = 'XLS'.
      OBJPACK-OBJ_NAME = REJFILE.
      OBJPACK-OBJ_DESCR = 'Rejected Entries File'.
      OBJPACK-DOC_SIZE = TOTXFER.
      APPEND OBJPACK.
      REFRESH RECLIST.
      MAIL1 =   Recepient Mail Id
      RECLIST-RECEIVER = MAIL1.
      RECLIST-REC_TYPE = 'U'.
      APPEND RECLIST.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA = DOC_CHNG
          PUT_IN_OUTBOX = 'X'
          COMMIT_WORK   = 'X'
        TABLES
          PACKING_LIST  = OBJPACK
          OBJECT_HEADER = OBJHEAD
          CONTENTS_BIN  = OBJBIN
          CONTENTS_TXT  = OBJTXT
          RECEIVERS     = RECLIST.
      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.
    Hope this is helpful to you. If you need further information, revert back.
    Reward all the helpful answers.
    Regards
    Nagaraj T

  • How to Generate HTML Report Output in Excel

    Dear Experts,
    How to convert HTML report output in Excel.
    I have reports which output is coming in HTML format & the same I want to use in Excel.
    So tell me how I can covert the same in Excel.
    Thanks
    Sudhir

    hello,
    in your case, you might want to make the following :
    a) use DESFORMAT=HTML
    b) use MIMETYPE=application/vnd.msexcell (or whatever mimetype your excel application is bound to)
    i am nor sure if excel will understeand our HTMLCSS (which is actually HTML4.0 using layers for best possible rendering of the paper page in the browser).
    regards,
    the oracle reports team

  • Xml report output in excel format without using options tab in EBS

    How to get xml publisher report output in excel format without using options tab in EBS?
    I am getting XML Publisher report output in excel format by using options tab while submitting the concurrent request .
    But i want to get excel output automatically.
    Can anyone give idea to get XML publisher Report output in excel without selecting options tab.
    Thanks in advance
    Sandeep V

    Hey Sandeep,
    I am working on a similar format for a report and if possible can you please give me some guidelines. I have initially created reports using XML Publisher, but for those , the output preview format was PDF. So, if I select the preview format as EXCEL will it give me output in Excel and for this to happen, how do I define the rtf template. I believe the working will be same as for PDF, create a rdf report, get output in XML and apply the template to get the data in Excel or there is something different to this.
    Thanks,
    Sunil

  • 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

  • Download alv report output to excel format with out header line

    Hi experts,
    i want to download a alv report output into excel formatt with out the header line but it has to download including field description. as this output will fed into another transaction, the downloaded excel file should be with out header line.
    fro eg:
    Report   : Zabc                      ABAP Development          Page  :     1
    Run Date : 12/14/06                                                     System: UD400 
    Run Time : 08:45:37
    this header details should not be downloaded into the excel file.
    could somebody help me please.
    thanks
    deepu

    hi jayanti,
    thanks for your response.
    i have delclared all the field types as character but still it is not downloading and it 's sy-subrc is 4... the code is as below.
    *field names
      lt_fieldnames-value = 'Material Number'.
      APPEND lt_fieldnames.
      lt_fieldnames-value = 'Plant'.
      APPEND lt_fieldnames.
      lt_fieldnames-value = 'Material Group'.
      APPEND lt_fieldnames.
      lt_fieldnames-value = 'Material Description'.
      APPEND lt_fieldnames.
      lt_fieldnames-value = 'UOM'.
      APPEND lt_fieldnames.
      lt_fieldnames-value = 'Price Unit'.
      APPEND lt_fieldnames.
      lt_fieldnames-value = 'Material Type'.
      APPEND lt_fieldnames.
      lt_fieldnames-value = 'X-Plant Status'.
      APPEND lt_fieldnames.
      lt_fieldnames-value = 'Valuation Class'.
      APPEND lt_fieldnames.
      lt_fieldnames-value = lw_avmng.
      APPEND lt_fieldnames.
      lt_fieldnames-value = lw_avntp.
      APPEND lt_fieldnames.
      lt_fieldnames-value = 'Latest PO Qty'.
      APPEND lt_fieldnames.
      lt_fieldnames-value = 'Latest PO Cost'.
      APPEND lt_fieldnames.
      lt_fieldnames-value = 'PO Creation Date'.
      APPEND lt_fieldnames.
      lt_fieldnames-value = lw_fcaqt.
      APPEND lt_fieldnames.
      lt_fieldnames-value = 'Prev. Yr. Std. Cost'.
      APPEND lt_fieldnames.
      lt_fieldnames-value = lw_stcst.
      APPEND lt_fieldnames.
      CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
        EXPORTING
          file_name                       = 'XLSHEET'
        CREATE_PIVOT                    = 0
        DATA_SHEET_NAME                 = ' '
        PIVOT_SHEET_NAME                = ' '
        PASSWORD                        = ' '
        PASSWORD_OPTION                 = 0
        TABLES
        PIVOT_FIELD_TAB                 =
          data_tab                        = t_output1
          fieldnames                      = lt_fieldnames
        EXCEPTIONS
          file_not_exist                  = 1
          filename_expected               = 2
          communication_error             = 3
          ole_object_method_error         = 4
          ole_object_property_error       = 5
          invalid_pivot_fields            = 6
          download_problem                = 7
          OTHERS                          = 8
      IF sy-subrc <> 0.
        MESSAGE e001 WITH 'Data could not be downloaded'.
      ENDIF.
    ENDFORM.                               " z_dwn_xl
    thanks
    deepu

  • Missing Timecard Report output in Excel

    Hi all,
    Can you help me in extracting the missing timecard report output in excel format. Is it possible to achieve thru' configuration like setting up some profile option?
    I have tried using vieweroptions: Application for text to 11i Excel but it is not returning me the desired output
    Looking forward for your response.
    thanks
    Vinoth

    Try below option in your code
    fnd_request.add_layout ('Appl_Name','template_code','en','US','EXCEL');
    Thanks!!

  • How to convert Oracle Report Output to Excel Spread Sheet..

    Hello Sir,
    How to convert Oracle Report Output to Excel Spread Sheet..
    Thanks..

    Hello,
    Please give us more information what kind of report(s). Sample example etc.,
    Sri

  • Very urjent how to send report output in mail

    hi experts,
    how to send report output in mail which function module should i use wht parameters should i pass.
    thanks in addavnce,
    points to be awarded.

      CALL FUNCTION 'GET_PRINT_PARAMETERS'
           EXPORTING
                destination    = '026c'
                copies         = count
                list_name      = 'VATS_ASBUILT'
                list_text      = v_list
                immediately    = 'X'
                release        = 'X'
                new_list_id    = 'X'
                expiration     = days
                line_size      = 132
                line_count     = 65
                layout         = 'X_65_132'
    *            sap_cover_page = 'X'
    *            cover_page     = 'X'
                receiver       = 'SAP*'
                department     = 'VATS'
                no_dialog      = 'X'
           IMPORTING
                out_parameters = params
                valid          = valid.
      SUBMIT zppr_vats_asbuilt  WITH p_aufnr EQ v_aufnr
                   TO SAP-SPOOL WITHOUT SPOOL DYNPRO
                      SPOOL PARAMETERS params
                         AND RETURN.
      SELECT SINGLE rqident FROM tsp01 INTO l_spoolno
                         WHERE rqtitle = v_list .
    * convert report to PDF format
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = l_spoolno
                no_dialog                = 'X'
           TABLES
                pdf                      = l_ipdf
           EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 5
                user_cancelled           = 6
                err_spoolerror           = 7
                err_temseerror           = 8
                err_btcjob_open_failed   = 9
                err_btcjob_submit_failed = 10
                err_btcjob_close_failed  = 11
                OTHERS                   = 12.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        EXIT .
      ENDIF.
    Now comes the part to send the mail
      try.
    * -------- create persistent send request ------------------------
          send_request = cl_bcs=>create_persistent( ).
          clear document.
    * -------- create and set document with attachment ---------------
    * create document from internal table with text
          document = cl_document_bcs=>create_document(
          i_type = 'RAW'
          i_text = text
          i_length = '12'
          i_subject = '' ).
    *changing the content of the attachment
          binary_content[] = l_iobjbin[].
    *change the name of the PDF attachment
          concatenate 'Build ID' s_buildid_i 'Rev' v_buildid_rev
                              into i_att_sub separated by space.
    * add attachment to document
          call method document->add_attachment
            exporting
              i_attachment_type    = 'PDF'
              i_attachment_subject = i_att_sub
              i_att_content_hex    = binary_content.
    *setting the option to send an e-mail more than 50 characters
          call method send_request->set_message_subject
            exporting
              ip_subject = t_sub.
    * add document to send request
          call method send_request->set_document
            exporting
              i_document = document.
    * --------- set sender -------------------------------------------
    * note: this is necessary only if you want to set the sender
    * different from actual user (SY-UNAME). Otherwise sender is
    * set automatically with actual user.
          sender = cl_sapuser_bcs=>create( 'VATSUPPORT' ).
          call method send_request->set_sender
            exporting
              i_sender = sender.
    *Send the list based on receivers list obtained
          loop at l_ireclist.
            AD_SMTPADR = l_ireclist-receiver.
    * --------- add recipient (e-mail address) -----------------------
    * create recipient - please replace e-mail address !!!
          recipient = cl_cam_address_bcs=>create_internet_address(
          AD_SMTPADR ).
    * add recipient with its respective attributes to send request
          call method send_request->add_recipient
            exporting
              i_recipient = recipient
              i_express   = 'X'.
          ENDLOOP.
          call method send_request->set_status_attributes
            exporting
              i_requested_status = 'E'
              i_status_mail      = 'E'.
    * To send the mail immediately
          call method send_request->set_send_immediately( 'X' ).
    * ---------- send document ---------------------------------------
          call method send_request->send( ).
          commit work.

  • How to export report output into excel.

    Hi all
    how to export report output into excel sheet can any on give me answer step by step please as soon as possible
    kk

    Hi Prashanth,
    If you are executing Query from WAD  ---> Right click on Table (only on Characteristics Data)  --> Enhanced Menu ---> Export as --> CSV file or MS Excel
    assign points if this helps,
    Thanks,
    Sudhakar

  • Oracle reports output in excel format does not display the graphs

    Oracle reports output in excel format does not display the graphs: "linked image cannot be displayed".
    The output file in PDF format the graph is supported.

    Do you have any header and footer on your template?
    If you have any header and footer then try to adjust it as of to display full page.
    Thanks
    Yasar

  • Displaying the report output in excel format

    Please help me in getting the report output in excel format.
    thnks

    I ran into a BIG problem after passing from 6i rep server to 9i rep server.
    On 6i rep server I used to set DESFORMAT='DELIMITED', and that produced reasonable tab-delimited output for reports that did not have group above (all the query groups were from left to right, not a single group having fields displayed above some other group). When deployed on rep server 9i, the same reports produced some unexplainable output: some of the rows were duplicated, but I couldn't figure out any rule.
    So, the best thing to get the reports into something that fits in .xls would be to have the output in .xml, that may be imported in Excel.

Maybe you are looking for

  • 11g Custom.CSS Style Sheet issue...is it a bug?

    I've created a custom style sheet that we're using to change the graphical elements of our dashboard. I've got everything working and I'm really pleased about how it's looking. Today, I started working on changing the default field attributes. I didn

  • Do I have to have icloud to use itunes?

    Do I have to have icloud to download and use itunes?

  • Digital Cable Advisor Missing From W7 Ultimate x64 After Full Install

    I recently installed a new hard drive, and I did a fresh install of Windows 7 Ultimate x64, and when I go to Windows Media Center, the digital cable advisor is not located in Extras.  I previously did the "upgrade in place" from Vista Ultimate x64 to

  • Nokia X6 16gb firmware update

    Hi, When viewing the latest firmware version for my nokia X6 phone, it says 32.0.002. I have installed on my phone version 30.2.003. When checking for updates, using PC or phone, I receive "No updates available". Can anyone help me to update the fir

  • PS Elements 4.0 - Fotodatenbank sichern?

    Kann mir bitte jemand sagen, ob und wie ich die Datenbank des Browsers beim PSE 4 sichern kann? Sollte ich irgendwann mein System neu installieren, so möchte ich ja nicht noch mal von vorne meine Fotos mit Tags etc. versehen. Danke für eure Hilfe!