Code  to dowload excel  .xslx  format

Hi  gourou,
We  use  some  function to dowload in xls  format  but  didn't  work  in .xlsx  format   (convert error).
Can you provide me a function or method  we  can  use it to download excel  in .xslx   format.
Thanks a lot
Soufiene

hi
Use this code it will helps u.........
*DOWNLOAD THE ITAB DATA
    if not it is initial.
      data:   l_filename type string,
              l_path type string,
              l_fullpath type string,
              l_result type i.
Display save dialog window
      call method cl_gui_frontend_services=>file_save_dialog
        exporting
          window_title      = 'FILE PATH'
          default_extension = 'XLS'
          default_file_name = 'CREDIT LIMIT DATA'
     INITIAL_DIRECTORY = 'c:\temp\'
        changing
          filename          = l_filename
          path              = l_path
          fullpath          = l_fullpath
          user_action       = l_result.
Check user did not cancel request
      check l_result eq '0'.
      call function 'GUI_DOWNLOAD'
        exporting
  BIN_FILESIZE                    =
          filename                        = l_fullpath
         filetype                        = 'ASC'
         write_field_separator           = 'X'
        tables
          data_tab                        = it_crdt_limit
    endif.
  endif.
<begging removed by moderator>
Thanks
Gupta
Edited by: Thomas Zloch on Nov 24, 2011 4:07 PM

Similar Messages

  • SSIS 2008 R2 Excel Destination Error, "An OLE DB error has occurred. Error code: 0x80040E21.", cannot export to the new Excel (.xlsx) format

    Hello.
    I've been attempting to do a very simple task that just isn't working.  For a Data Flow Task action in SSIS, I am trying to export data from a single SQL Server (2008 R2) database table to an Excel spreadsheet (.xlsx).  No matter what I do, it
    just keeps failing.  The columns in the table match the column header names (in the first row) in the tab I select.  Here is the output I get.
    SSIS package "Package.dtsx" starting.
    Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
    Warning: 0x80049304 at Data Flow Task, SSIS.Pipeline: Warning: Could not open global shared memory to communicate with performance DLL; data flow performance counters are not available.  To resolve, run this package as an administrator, or on the system's
    console.
    Information: 0x40043006 at Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
    Information: 0x40043007 at Data Flow Task, SSIS.Pipeline: Pre-Execute phase is beginning.
    Error: 0xC0202009 at Data Flow Task, Excel Destination [52]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E21.
    Error: 0xC0202025 at Data Flow Task, Excel Destination [52]: Cannot create an OLE DB accessor. Verify that the column metadata is valid.
    Error: 0xC004701A at Data Flow Task, SSIS.Pipeline: component "Excel Destination" (52) failed the pre-execute phase and returned error code 0xC0202025.
    Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
    Information: 0x4004300B at Data Flow Task, SSIS.Pipeline: "component "Excel Destination" (52)" wrote 0 rows.
    Information: 0x40043009 at Data Flow Task, SSIS.Pipeline: Cleanup phase is beginning.
    Task failed: Data Flow Task
    SSIS package "Package.dtsx" finished: Success.
    I kick-off the action and sometimes is hangs for a few seconds (20+ seconds) and sometimes it doesn't, but either way it fails.  I tried this on a 32-bit machine, 64-bit machine, and still it fails.  I tried an OLE DB connection to Excel and
    that doesn't work either.  I made sure that the connection string for the Excel spreadsheet is Provider=Microsoft.ACE.OLEDB.12.0;Data Source=[filepath\excelfile].xlsx;Extended Properties="EXCEL 12.0 XML;HDR=YES"; and still it doesn't work.  
    Now, when I switch it over to export to an Excel 2003 spreadsheet (.xls) it works!  But I don't want it to go to the old Excel spreadsheet format, my requirement is to export the data to the new format.  Is there a bug in the Access 2010 Database
    Engine that won't allow me to export to the new Excel format?  Otherwise, what can I be doing wrong?  I set the Run64BitRuntime property to False and it still doesn't work.  
    My solution (so far) is to export it to Excel 2003 and then via the Script Task action use the Excel COM API (Microsoft.Office.Interop.Excel.dll) for 2010, open the file and save it in the new format (.xlsx) and that works great!  However, the client
    doesn't want to install Excel on the database server!  So what can I do when the Excel Destination or OLE DB Destination (to connect to Excel) actions don't work!?  Please help!!!
    Like I mentioned, if this is a bug, that would be great to know so I can stop wasting my time.  Thanks again.

    Alright, so you mean to say is that the driver is not installed.  Isn't version 12 the 2010 Access Database Engine Driver?  I did install that, and I also tried the 2007 Access DB Engine driver, and both don't work.  What driver am I missing? 
    The connection string is correctly formatted, yes?
    Also, when setting up the OLE DB Destination action and I have it point to the Excel spreadsheet, and I specify as the provider "Microsoft Office 12.0 Access Database Engine OLE DB Provider" and click on Test Connection, the connection is
    successful.  Wouldn't that mean the 12.0 version driver is installed?
    Thanks in advance.

  • Problem with Excel output format

    Hi Guys,
    I am creating a report in XML Publisher (not standalone). I am facing some problems could anyone please help me to figure out the issues.
    Is it possible to have all three output format (PDF, HTML & EXCEL) exact (same aligned) only by creating a single RTF Template? I am facing the problem with Excel output format the output format of excel is taking excels cell formatting.
    Example Numeric fields --> Right Aligned, text fields --> Left Aligned
    One more issue with excel is -ve(negative) values are getting displayed in red and in brackets like ($13) (with red color).
    Our client want excel output on priority.
    Is there any limitation for excel output format of reports?
    It is very urgent for us please help.
    Any help would be highly appreciated.
    Thanks,
    Pragati
    Edited by: user11237443 on Aug 27, 2009 1:22 AM

    Hi Mahi,
    Thanks for your response. But i could not understand how can we write wrapper program could you please give some light on this or provide some link it would be helpful for me:-)
    I have read that blog for excel limitations but i have more question?
    1) What about the negative values?
    if any field is displaying negative amount then excel not displaying right value for that:(
    2)How can we align header or data?
    Do XMLP with EBS provide any solution for formatting in excel?
    3) If for the alignment of numeric value we concatenate them with any special character then how can we perform calculation that field?
    Here are so many formatting issues do we need to write any code in xml for that?
    Please help.
    Many Thanks,
    Pragati

  • Extracting a Report from SAP Spool into a Useful Excel 2010 Format

    Hi All,
    Extracting a Report from SAP Spool into a Useful Excel 2010 Format.  I'm currently running the following report in SAP  and would like the
    ability to set this report up as a recurring report running weekly and
    subsequently access this report in a useable Excel 2010 format without
    much data manipulation.  Can you please assist me.  Below, I've tried to
    provide an example of what I'm encountering.   Thanks, beforehand for
    your assistance.
    Here goes:
    Step one: Run 62 Report in SAP S_P99_41000062- Material List Price and
    Inventory
    Step 2. Select stored Variant "Weekly KPI", ok. Enter the enter  the
    desired company code and period I want thre report to run for and update
    the currency, if necessary. Having input my desired criteria, I believe
    I can either execute immediately, run in the background, preset to run
    at date in the future. For this example let's just execute, immediately.
    This is where the difference originates. Given, I run this report
    immediately, I'm able to simply extract the result to Excel via the list
    selection noted in the tool bar below.  The result is a data friendly
    excel 2007  report is automatically generated.
    Export to Excel via list:
    Select save and Excel 2007 opens automatically:
    That said, the method outlined above works perfectly fine if you want
    the report immediately.  Now let go back and run the exact same report
    with exceptoin of running it in the background and having to retrieve it
    from the Spool (SP01) uisng my user ID.  Given the report generated in
    the background,  I would now access the report via the spool and make
    the following selections:
    SP01 + execute to see my report
    I would hit the sunglasses to see the actual report, then want to
    extract this report to Excel by selecting the export option.
    I would at this point select spreadsheet and be given an option to save
    the spreadsheet to local file. However, upon trying to open the
    spreadsheet I will receive an error messageindicating that the format is
    different than that which the file I am currently trying to open it
    with.  I'm currently running Excel 2010 on my computer.  The currency
    format and other issues arrise with this extract.  Please help. 
    Thanks,
    Chowadary.

    Update to Latest GUI.
    Use   List -> Export -> Spreadsheet  to get the output to excel.
    I remember in ALV max length allowed is 1023 characters and the max no of columns supported is 90. Issue occurs when row size of exported data gets more than 1023 character. (This includes if Long/Medium Header Text used ) If it exceed 1023 character the columns splits and moves to next row.
    Check your fieldcatog for header lengths.
    -Satya

  • Output report data to excel file format or csv format

    Is there any way to save softcopy of report output to excel file format or csv format.

    Hi,
    Regarding csv file format, i have no issues. The file is generating without any issues in using oracle reports without using any PL/SQL code.
    My requirement is to design oracle reports to generate excel (.xls) file with multiple worksheets. Each sheets are having many data and graphs(chart).
    Using oracle reports alone, how to achieve this.
    In oracle reports 10g 1.2.0 version, I tried by creating .rdf file but, it is generating single worksheet only.
    In oracle reports 10g 1.2.0 ver, I tried by creating .jsp file. For this first i am creating excel template about how my ouput column headings all that going to be with one sample hard coded data and save the excel file as web page.
    Eg employee.html.
    Next open the html file in oracle reports builder and double click the websource now, you will see the jsp tags, html and xml tags. Now include the contentType="application/vnd.ms-excel " and charset also.
    Next, include the <rw:foreach id="G_EMPNO_1" src="G_EMPNO">
    here insert the fieldl for each column by removing the hard coded values.
    close the tag
    </rw:foreach>
    Save the file as .jsp and deploy it in oc4 enabled folder (say, devsuite_home/reports/j2ee/reports_ids/web
    Start the oc4J server
    Run it in the browser http://server:port/reports/emp.jsp?useride=uid/pwd@db
    It is invoking the Microsoft excel with 3 sheets default and my emp table output in the first page.
    We can save this output file as .xls file by clicking file -> save as.
    1) The question is, it is working fine with Microsoft excel 97-2003 version. But for excel 2007, i am not able to create single html file like how 2003 save web page option.
    2) I found this in oracle getting started demo
    http://www.oracle.com/technology/products/reports/htdocs/getstart/demonstrations/index.html
    Which is more useful. This is what i am looking for.
    I done that in excel 2003 as per demo. But excel 2007 with reports 10g issues.
    Is there any demo for 10g with excel 2007
    3) For most of excel issues working fine with excel 2003 and 10g. But excel 2007 with 10g reports are issues.
    I want the excel output from oracle reports with multiple worksheet similar to the above demo.
    Thank you.

  • Excel data formatting

    Hi all,
    following the tutorial "Exporting context data into Excel using the WD binary cache" I've added an export function to my wd app for a table's contents.
    In the Excel document I'd like to treat all as text, avoiding e.g. the null values written, the ...E+17, deletion of leading zeroes and so on.
    Can you help me please?
    Thanks.
    Angelo

    Angelo,
    If your client's Excel application supports XML format (starting from Office XP, AFAIK) you may produce output in Excel XML rather then CSV(comma separated values) while former allows formatting.
    You may get details about MS Office specific XML schemas here http://www.microsoft.com/office/xml/default.mspx .
    Next, if this format is useful for you, you may use code posted here (Re: converting context-tree to xml?) to convert context node data to XML. You may either supply XSL template to transform generic XML into Excel-specific XML (better option) or modify original code to produce Excel XML directly.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • Selection Screen Excel File Format

    Hi,
    I developed a BDC report to upload data. Data is uploaded Perfactly.
    parametrs: p_file TYPE rlgrap-filename.
    and Excel file format is Storage Location Matnr Stock_Qty
                                         1000    Mat_00001    50
    but i want to give eaxel file screen shot with sample data
    is it possible to give excel format screen shot on selection screen
    before   parametrs: p_file TYPE rlgrap-filename.

    Hi,
    I was telling if  its only  to tell user we can print like comment at the end .I have pasted the code for you .
    it will look at at the bottom of your screen.
    After you declare your slection screen parameters then paste the  code and first text you create text element which has- MS EXCEL format types
    Second textelemnt-Give column1 - "so and so ......
    was i clear this time...
    It not poss to give scrreen shot thriugh above way but throuh your text elemnt message you convery what is colum 1,2 .... to user
    Thank You
    Poornima
    Edited by: Pendyala_poornima on Oct 7, 2011 3:01 PM
    Edited by: Pendyala_poornima on Oct 7, 2011 3:01 PM
    Edited by: Pendyala_poornima on Oct 7, 2011 3:03 PM

  • Tranfer table content in to excel file format

    HI
    I have Created one table .and I want to download this table in to excel file format.how can i do this.

    Hi Vijay
    1) Type the t-code SE16
    2) Type the table name, for example USR02
    3) Press F7 to view the table contents
    4) If you need filter the data in the next screen you could do it.
    5) Press F8 or press the execute bottom.
    In the next screen you will find the result.
    In the menu, follow the options:
    System->List->Save->Local File->Spreadsheet
    Type the excel name, and click generate
    Hope it helps, and please reward points if helpful
    Regards

  • PL/SQL + XML with Excel report format?

    Dear all,
    I am a new beginner in XML Publisher. For the EBS11i, I can use PL/SQL with http scripts to generate excel report format.
    The following code will include in store procedure:
    >
    begin
    owa_util.mime_header(ccontent_type => 'application/vnd.ms-excel');
         htp.htmlopen;
         htp.headopen;
         htp.print( '<STYLE>' );
    htp.print( '<!--'||
              '.xl24' ||
              '{mso-style-parent:style0;' ||
                     'mso-number-format:"\@";}' ||
    '.xl41' ||
         '{mso-style-parent:style0;' ||
                   'mso-NUMBER-format:"\#\,\#\#0\.000";}' ||
    '.xl42' ||
         '{mso-style-parent:style0;' ||
                   'mso-NUMBER-format:"\#\,\#\#0\.00";}' ||
    '.xl45' ||
         '{mso-style-parent:style0;' ||
                    'mso-NUMBER-format:"\#\,\#\#0";}' ||
    '-->' );
         htp.print( '</STYLE>' );     
         htp.headclose;
         htp.bodyopen;
         htp.para;
         htp.strong( '<U>' || 'Sample Report Name'|| '</U>');
         htp.para;
    htp.tablerowopen;
         htp.tabledata('<DIV align="left">' || rec_main2.vendor_name || '</DIV>',cattributes => ' class="xl24" width="190"');
    htp.tablerowclose
    >
    How can I do that in R12?
    Please advice.

    We currently do not support SQL aliasing of directories. This
    is causing your errors.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    Frank Hubeny (guest) wrote:
    : I think I got past this point by first creating a directory
    : under sys and then granting read privileges to owner of the
    : domsample procedure (in my case the this user is called "xml").
    : create directory xml as 'e:\web\xml';
    : grant read on directory xml to xml;
    : Then the call becomes (I think)
    : exec domsample ('XML','family.xml','test.err')
    : However, I am getting the following error:
    : ERROR at line 1:
    : ORA-20100: Error occurred while parsing: XML/err.log
    : ORA-06512: at "XML.XMLPARSER", line 43
    : ORA-06512: at "XML.XMLPARSER", line 120
    : ORA-06512: at "XML.DOMSAMPLE", line 80
    : ORA-06512: at line 1
    : The readme says "It is necessary for the user running
    : this sample to have been granted the appropriate security
    : priveleges to read and write from a file on the file
    : system." I am not sure what the "write" grant would be.
    : And so I also set utl_file_dir so that it pointed to
    : the directory. But somehow I don't think that utl_file is
    : needed in this context. In any case, it appears I cannot write
    : to the err.log file or find it.
    : Brad Douglass (guest) wrote:
    : : I'm receiving the following error when I use the domsample
    : : procedure supplied with the PL/SQL XML parser:
    : : SQL> exec domsample('e:\web\xml','test.xml','test.err');
    : : begin domsample('e:\web\xml','test.xml','test.err'); end;
    : : ERROR at line 1:
    : : ORA-20101: Error occurred while accessing a file or URL:
    : unknown
    : : protocol: file
    : : ORA-06512: at "XML.XMLPARSER", line 46
    : : ORA-06512: at "XML.XMLPARSER", line 164
    : : ORA-06512: at "XML.DOMSAMPLE", line 77
    : : ORA-06512: at line 1
    : : UTL_FILE doesn't have any problems with the file.
    : : Any ideas?
    null

  • Export to excel with formatting was autowrapping text in a cell

    Export to excel with formatting was autowrapping text in a cell without having to check the can grow option.  When the can grow option is checked it does wrap the text however it spans multiple rows, which causes complications when trying to sort. 
    It worked in:
    ProductVersion=10.0.0.533
    ProductName=Crystal Enterprise 10 Embedded
    Doesnt work in:
    Crystal Reports 10.0 Service Pack 6
    After the upgrade the reports did not autowrap, b/c the "can grow" option was not checked.  I believe this was fixed by "ADAPT00305137 Patch ID: 36479914
    Description:
    When users export to Excel 97-2000 with the page-based format, text fields are wrapped, even when the "can grow" feature in the
    Designer is turned off." .   After we turn the option to grow on it does wrap however it spans across multiple rows.  So I guess my question is there a way for it not to span multiple rows when wrapping text?
    Edited by: dforde on Jan 27, 2010 11:12 PM

    I could be wrong, but I believe the export to excel option exports the database values, and the export to HTML exports the values seen in the sheets. If the database values are stored as seconds, the Excel will see them as seconds, and the data will have to be formatted properly in Excel.
    I haven't toyed around with Excel exports that much, but it might be possible to set up a template or macro in excel that would have the proper formatting, and use it when opening the Disco export.

  • Excel 2007 and Excel 2003 format

    Hi all,
    we have some problems with Excel file format on BPC 7.5NW SP06:
    1- We save input schedules or reports woth Excel 2007 file format. Then when we try to open these report they are corrupted (we click on "Open" and nothing happens). We can download the report from UJFS. The xltx file is corrupted. We can change th file extension to xls. Then we can open the report again.
    2- Is it possible to define the default extension when we save input schedules and reports? By default xltx is selected. We want to have xlt selected by default.
    thanks for your help,
    Romuald

    Hello,
    First you can try checking if you have configured your apset to work with xltx.
    1. Open BPC web admin and select AppSet Parameters
    2. Check ALLOW_EXTENSIONS and DEFAULT_EXTENSIONS if you have xltx there
    3. If not, add and click on update
    If this continues to happen, check note  "1579344 - Office 2007 extensions not loading in BPC 7.5 SP6 for NW". This can be a program error, but note that it only happens for some templates.
    Hope it helps
    Debora

  • How to download alv grid output(with field catalog) into excel file format

    Hi all,
    How to download alv grid output(with field catalogs) into excel file format and same file has to download to application server.
    Please help.
    Regards,
    Satya.

    Hi,
    On list where alv is displayed, select export icon( green color -> ),select spread sheet.
    This will display records in Excel sheet.

  • How to  send ALV output data into Excel sheet format via Mail to the user?

    Hi friends,
    I have a doubt ie,
    How to  send ALV output data into Excel sheet format via Mail to the user?
    regards
    Moosa

    Hi,
    Provide the output internal table to the objbin in the below FM
    Send Message
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           EXPORTING
                document_data              = i_docdata
                put_in_outbox              = c_x
           TABLES
                packing_list               = i_objpack
                object_header              = i_objhead
                contents_bin               = i_objbin
                contents_txt               = i_objtxt
                receivers                  = i_reclist
    and specify the document type
      i_objpack-doc_type   = 'XLS'.
    and try.
    Regards,
    Nandha

  • Excel auto formats cell in CSV flat file.

    Hi,
    I am using an etext template to generate a CSV file (comma separated) and that piece works fine. But as soon as you open the generated file in Excel, it changes the format of one of the columns to a date! And once you have opened it in Excel, saving it changes the column value, so now I have wrong data!
    The field value is : 8050-09-7 (Alpha)
    When opened in Excel, it becomes: 9/7/8050 (Excel auto formats it)
    If I save the file as a .xls file and not a .csv file, it works, but now when I open it, the entire row shows up in one line in Excel and each field is not in each cell.
    The user wants to see the output first, verify the data and save it as a CSV file and export it to a vendor software.
    Any ideas?
    Thanks,
    Shaf

    Hi Steven,
    I think I understand what you are trying to say.
    My data is getting generated initially as XML; I merge it with my eText template to get the final output. If I save the output as .txt, its fine. But users have a hard time reading comma delimited lines, though it will work fine for the customers.
    <G_COMPONENTS>
    <ID>12215</ID>
    <PRODUCT_ID>379-9006-00</PRODUCT_ID>
    *<CAS_NUMBER>8050-09-7</CAS_NUMBER>*
    <CHEMICAL_NAME>GUM ROSIN</CHEMICAL_NAME>
    <SUPPLIER>Name</SUPPLIER>
    <PERCENT_WEIGHT>0</PERCENT_WEIGHT>
    <PERCENT_VOLUME>0</PERCENT_VOLUME>
    </G_COMPONENTS>
    Thanks,
    Shaf

  • Bursting with Excel Template Format

    Greetings!
    Does anyone have a working example of a bursting solution with an EXCEL Template Format? The documentation doesn't list Excel as a supported format; my hope is that this is out of date. I'm on version 10.1.3.4.
    Thanks,
    Mac

    Here's the error message I'm getting when I try to run this report. Perhaps it's something different than I expect:
    History ID 584
    Status Failed
    Start Processing Time 8/13/10 1:58 PM
    End Processing Time 8/13/10 1:58 PM
    Time Elapsed 2.03 sec
    System Message oracle.apps.xdo.servlet.scheduler.ProcessingException: java.sql.SQLException: ORA-01722: invalid number
         at oracle.apps.xdo.servlet.scheduler.XDOJob.runBurstingReport(XDOJob.java:2153)
         at oracle.apps.xdo.servlet.scheduler.XDOJob.execute(XDOJob.java:372)
         at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
    Caused by: java.sql.SQLException: ORA-01722: invalid number
         at oracle.apps.xdo.servlet.ReportException.fillInStackTrace(ReportException.java:124)
         at oracle.apps.xdo.servlet.data.DataException.fillInStackTrace(DataException.java:127)
         at java.lang.Throwable.<init>(Throwable.java:181)
         at java.lang.Exception.<init>(Exception.java:29)
         at oracle.apps.xdo.servlet.ReportException.<init>(ReportException.java:40)
         at oracle.apps.xdo.servlet.data.DataException.<init>(DataException.java:44)
         at oracle.apps.xdo.servlet.data.bind.AdvancedQueryBoundValue11.getXML(AdvancedQueryBoundValue11.java:547)
         at oracle.apps.xdo.servlet.ReportContextImplV11.getReportXMLData(ReportContextImplV11.java:408)
         at oracle.apps.xdo.servlet.CoreProcessor.process(CoreProcessor.java:225)
         at oracle.apps.xdo.servlet.CoreProcessor.generateDocument(CoreProcessor.java:76)
         at oracle.apps.xdo.servlet.ReportImpl.renderReportXML(ReportImpl.java:284)
         at oracle.apps.xdo.servlet.scheduler.XDOJob.runBurstingReport(XDOJob.java:1915)
         ... 3 more

Maybe you are looking for