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

Similar Messages

  • 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

  • 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.

  • 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

  • ALV Report output in Excel format

    Hi ,
    I am facing a different behaviour in two computers , while trying to take an Excel format of an ALV report output. After generating the ALV output ,in one , when I click on the Excel Format button - the Excel spreadsheet opens with the output data. In the second computed , under the same action , a blank Excel sheet opens .
    Could someone tell me a solution . What aspect is responsible for this ?
    Regards ,
    Sujata

    Reduce the MACRO security settings in the Excel to Medium.
    Open an execl sheet, Chose from menu Tootls->Macro->Security.
    Chose the radio-buton medium. Close the file and all excel applications.Then try downloading again.
    Regards,
    Ravi

  • Report output in excel format.

    Dear Friends,
    I have created a report in character mode and I want to store the output of that report into an excel file. So that data of each column with heading will be stored in seperate coulmns(with each row of output in each row in excel file).
    Output as follows:-
    EMPNO ENAME DEPT
    0099 JOHN ART
    0011 SMITH ENGG
    and so on...
    I hope I will get the solution quickly.
    Thanks in advance.
    Sanjeev Bhattacharya

    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

  • Converting oracle reports output  to excel format

    i am using Report Builder 9.0.2.0.3, and want to view the results of the report in excel format. I have gone through many discussion forums and don't wish to use the rep2excel software,as suggested in those forums. I wish to know, at the earliest in what way can this be achieved.

    Hello,
    Since Reports 9.0.2 , it is possible to execute a Reports as a JSP
    Go to :
    http://www.oracle.com/technology/products/reports/htdocs/getstart/demonstrations/index.html
    Click on the link "Output to Excel with Oracle9i Report"
    (This slideshow steps you through creating Excel output from Oracle9i Reports.)
    Regards
    Message was edited by:
    dsegard

  • Unable to save report output in excel format.

    Hi all,
    I am facing a problem on 10gR2 Application Server, When I try to run a report from portal, Report shows o/p in the excel but when I try to save the O/P by using File -> save as , it shows only 4 types of files like htm, html, txt.
    I have used desformat=delimiteddata and minetype=application/excel.
    When I run same report using simple url it allows me to save in excel.
    Plz suggests some way to save the o/p in excel.
    Regards
    Amit.

    If you have the Financial Report open there are two options:
    - in the bottom right hand corner of the report click the link: "Export In Query ready Mode"
    (this opens the report so you can use it as an Excel retrieve)
    - from the Hyperion menu, select File>Export>Excel
    (this exports the headers as objects and the data grid, so you can manipulate in Excel).
    Cheers, Iain

  • XML Publisher report default output in Excel format.

    Hi,
    We have defined one concurrent program whose output format is text, this concurrent program executable is PL/SQL and in this PL/SQL program we are generating XML data and displaying XML using below fnd_request.
    l_conc_id := FND_REQUEST.SUBMIT_REQUEST('GMP','GMPPDROP','', '',FALSE,
         p_sequence_num,chr(0),'','','','','','','','','','','',
    We have also defined template for this.
    Using below fnd_request we are choosing template and data is getting generated in PDF format. Now our requirement is to display the output by default in Excel format.
    FND_REQUEST.SUBMIT_REQUEST('XDO','XDOREPPB','', '',FALSE,'',
    l_conc_id,554,G_comb_pdr_temp,
    G_comb_pdr_locale,'Y','RTF','',scale_report,'','','','','',
    When i saw XML Report Publisher concurrent program, there is one parameter for Output Format and i tried passing 'Excel'/EXCEL/excel to this parameter but output is still coming in PDF format.
    FND_REQUEST.SUBMIT_REQUEST('XDO','XDOREPPB','', '',FALSE,'',
    l_conc_id,554,G_comb_pdr_temp,
    G_comb_pdr_locale,'Y','RTF','Excel',scale_report,'','','','','',
    I have also tried giving Default Output to EXCEL in template definition but this is also not working.
    Your valuable suggestions highly appreciated.
    Thanks
    Vijay

    Hi;
    What is EBS version? Please see below which could be helpful for your issue:
    Changing Output Format to RTF or Excel in XML Publisher Request Does Not Display Output Correctly [ID 404512.1]
    Cannot View BI Publisher (formerly XML Publisher) Report Output In Excel Format or XHTML [ID 359875.1
    How is Default Output Type Determined for Reports Submitted Using XML [ID 888972.1]
    Also see:
    XML PUBLISHER report in Excel out put problem
    XML PUBLISHER report in Excel out put problem
    Regard
    Helios

  • 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 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

  • Report output in Excel

    Hi,
    I am stuck in an issue and need some guidance.
    I have developed a paper report in 10g. I modified the web source and added a frame to display the report in web browser.
    I updated the web source as below to display the output in excel format.
    <%@ page contentType="application/vnd.ms-excel;charset=ISO-8859-1" %>.
    I tried to set
    desformat = SPREADSHEET and delimited both.
    I can see the report in web browser; however I am not able to display it as EXCEL format.
    Please guide me.
    Regards
    Satya

    Hello Satya,
    application/vnd.ms-excel is the MIME type for a binary (proprietary) format that MS uses as default up to version Excel 2000. desformat = SPREADSHEET does not create a binary file, but a representation of the data in a tabular format.
    I am not able to display it as EXCEL formatOracle Reports cannot generate any format defined by Microsoft. For options how to generate "Excel" files see {message:id=9360007}.
    Regards
    Marcus

  • How to get Report Output in csv format

    Hi,
    How can i get report Output in csv format, can any one tell me the word used for output type to get output in csv format.
    i have used XLS output type but it opens in excel format.
    conc.addLayout(appCode,concReqCode,"en-US","US",XLS);
    Thanks
    Babu

    Hi Babu,
    Till now in xmlpublisher there is no method to create file in csv format ,you have to create Excel file and then save it in .csv format.Unless and until ur using BI Publisher in which some work around are possible.
    Thanks

  • 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

Maybe you are looking for

  • User exit IPRM0002 for preventive maintenance

    user exit IPRM0002 for preventive maintenance has anyone used this user exit? or BADI: BAdI: IPRM_MCP_SCHE_CHANGE  ? I seem to have some difficulty in knowing how to use these.... I need to basically be able to influence a calling date for next PMord

  • CS4 crashes on launch as of today

    Friday I upgraded to 10.6.4 (after making a clone of my stable 10.6.3 system). Today I booted PS CS4 (11.0.2) for the first time and it crashed, with the attached (also sent to Adobe) crash report. I restored my 10.6.3 system with no change; then rei

  • Why only 24 hrs fot to know where is my ipod touch

    My Ipod touch was stolen lest week... then I can find due to one mail where told me you ipod was  finded, but the mail was send to the spam 30 hrs I fin it in the spam, the cuestion is could you know                         if after 24 hrs I can know

  • How to connect MySQL in JSP?

    I applied a JSP web hosting, but cannot connect the MySQL server. Error message is: java.sql.SQLException: Server configuration denies access to data source My code is correct, because I have used the similar code to connect some other MySQL server.

  • Questions before I SWITCH to Mac...

    Few questions before I switch to Mac (hoepfully when Leopard comes out).... Currently I have a Dell XPS Media Center PC and a Vista laptop. 1. TV/DVR CAPABILITIES: I love using my PC as a tv tuner & DVR. Does mac have this capability? If I run Vista