Regarding Excel file generation from xml

Hi all,
I want export my JTable information to an excel when a specified action is occured.
I already completed this task using some third party api.
Some body told me, there is api in j2sdk itself for export data to excel file. but i didnt find that.
Could anybody help me out , if sun java api is providing any api for dealing excel files.

hi
i've found this:
http://jexcelapi.sourceforge.net/
but i had trouble trying to make it works!
pratically my textpad, we�hen i import the package, tell me tha the package doesn't exists!
bye! ;)

Similar Messages

  • Regarding Excel file generation from java

    Hi all,
    I want export my JTable information to an excel when a specified action is occured.
    I already completed this task using some third party api.
    Some body told me, there is api in j2sdk itself for export data to excel file. but i didnt find that.
    Could anybody help me out , if sun java api is providing any api for dealing excel files.

    hi
    i've found this:
    http://jexcelapi.sourceforge.net/
    but i had trouble trying to make it works!
    pratically my textpad, we�hen i import the package, tell me tha the package doesn't exists!
    bye! ;)

  • Excel file generation from ascx page

    Hi,
    I generated excel file using this below code. I am getting left navigation, top navigation (all contents in a page) are coming in the excel file. I want to generate the excel file only with whatever controls I created. Anyone help in this?
    HttpContext.Current.Response.Clear();
    HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
    HttpContext.Current.Response.Charset = "";
    HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
    HttpContext.Current.Response.ContentType = "application/vnd.xls"
    ScriptManager
    .RegisterStartupScript(btnExcel, this.GetType(), "call me", "ExcelPanel()", true);
    function ExcelPanel() {
    var panel = document.getElementById("<%=updatepanelPrint %>");
    var excelWindow = window.open('', '', 'height=1500,width=800', 'scrollbars=yes');
    excelWindow.document.write(
    '<html><head><meta http-equiv=Content-Type content=:' + '"' + "text/html; charset=utf-8" + '"' + '>');
    excelWindow.document.write(
    '</head><body >');
    excelWindow.document.write(panel.innerHTML);
    excelWindow.document.write(
    '</body></html>');
    excelWindow.document.close();
    return false;

    Hi,
    As this question is more relate to Excel Development, I suggest you post it to the corresponding forum, you will get more help and confirmed answers from there.
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=csharpgeneral
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • Regarding excel file download from webdynpro table element

    Hi All,
            I want steps to do excel download from webdynpro table element.
    Thanks in advance.
    Regards,
    Muneesh Gitta.

    Hi Gitta,
    There are 2 ways in doing it, one is using GUI DOWNLOAD FM or using class clwd_runtime_services.
    DATA:
        node_node_alv                       TYPE REF TO if_wd_context_node,
        elem_node_alv                       TYPE REF TO if_wd_context_element,
        stru_node_alv                       TYPE wd_this->element_node_alv,
        itab_node_alv                       TYPE TABLE OF wd_this->element_node_alv..
    navigate from <CONTEXT> to <NODE_ALV> via lead selection
    @TODO handle not set lead selection
      IF ( node_node_alv IS INITIAL ).
      ENDIF.
    get all declared attributes
      node_node_alv->get_static_attributes_table(
        IMPORTING
          table = itab_node_alv ).
      DATA:
        node_file_download                  TYPE REF TO if_wd_context_node,
        elem_file_download                  TYPE REF TO if_wd_context_element,
        stru_file_download                  TYPE wd_this->element_file_download ,
        item_fname                          LIKE stru_file_download-fname.
      navigate from <CONTEXT> to <FILE_DOWNLOAD> via lead selection
      node_file_download = wd_context->get_child_node( name = wd_this->wdctx_file_download ).
      get element via lead selection
      elem_file_download = node_file_download->get_element(  ).
      get single attribute
      elem_file_download->get_attribute(
        EXPORTING
          name =  `FNAME`
        IMPORTING
          value = item_fname ).
      CALL FUNCTION  'GUI_DOWNLOAD'
        EXPORTING
          filename                        = item_fname
        FILETYPE                        = 'ASC'
        TABLES
          data_tab                        = itab_node_alv.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    OR
    check this blog for
    Re: Export to Excel Sheet functionality

  • I cannot Open EXCEL files transferred from my old HP laptop.

    I am unable to open EXCEL files transferred from my HP LapTop. How to resolve?

    The forum for MBP:
    MacBook Pro
    As for Excel, checked microsoft office community?
    Maybe if you try export first....?
    Vista has its own ownership permission flags. Maybe if you modify the file or a copy first, and then copy.

  • I am unable to open attachments (Word Documents, Excel file, Adobe) from my Gmail with Firefox.

    I am unable to open attachments (Word Documents, Excel file, Adobe) from my Gmail with Firefox. My computer freezes when I try to open the (email attachment) file. Task Manager says "not responding".
    You can respond to [email protected]

    You may first want to look into Safari's "Installed Plugins" section within the browser. This is (usually) found under the Safari Help header in the top of a browser. I say usually, because I don't use Safari often and mine is an older version. They handle applications and plugins like most others, to a point.
    I see in Safari Installed Plugins that mine would use
    application/pdf
    Acrobat Portable Document Format
    Acrobat Reader & reader plugin v9.5.5 for web browsers
    (in Safari 5.x, where I looked into this)
    While I use FireFox, SeaMonkey (Mozilla) and others, where I can choose in preferences the helper applications to open from the browser, Safari has different methods; so if you can change this in the preferences or settings of Safari in a later version I am not certain.
    You could see what the defaults are by using Safari help menu to open the Installed plugins, and maybe find out what happend to Adobe reader plugin. Could be it was 'sandboxed' in a later OS X and needs to be installed differently to be accepted as safe.
    It is easier to set how a file type is handled once it is inside the computer and not held in the browser; by file type in general or specific to each single document. I do both, and seldom let an a browser do these things due to security considerations. I download and open them, only then if I feel they are safe.
    Sorry to not have a specific answer for that anomaly.
    Good luck & happy computing!

  • Crystal Reports generation from XML datasource or file.

    How to generate the crystal report(.rpt file) from XML/XSD file as input..?
    I'm trying out this from 'Crystal Reports in Eclipse'.

    Same problem here using CR4J v.2 sp1<BR/>
    This is the complete StackTrace:<BR/>
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Error al cargar el conector de base de datos. No se pudo obtener acceso a la clase 'com.crystaldecisions.reports.queryengine.driverImpl.DriverLoader'.---- Error code:-2147467259 Error code name:failed
         at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
         at com.businessobjects.samples.InformePruebaXML.main(InformePruebaXML.java:64)
    Caused by: com.crystaldecisions.reports.common.QueryEngineException: Error al cargar el conector de base de datos. No se pudo obtener acceso a la clase 'com.crystaldecisions.reports.queryengine.driverImpl.DriverLoader'.
         at com.crystaldecisions.reports.queryengine.Connection.ur(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Connection.uB(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Connection.br(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Connection.bs(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Connection.t1(Unknown Source)
         at com.crystaldecisions.reports.dataengine.dfadapter.DFAdapter.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.dfadapter.DFAdapter.for(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.ReportHelper.a(Unknown Source)
         at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.long(Unknown Source)
         at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.a(Unknown Source)
         at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.int(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(Unknown Source)
         at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
         at com.businessobjects.sdk.erom.jrc.a.a(Unknown Source)
         at com.businessobjects.sdk.erom.jrc.a.execute(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ds.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
         ... 4 more
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         ... 32 more
    Caused by: com.businessobjects.reports.jdbinterface.common.DBException: No se pudo cargar el conector de base de datos 'crdb_xml.dll'.
         at com.crystaldecisions.reports.queryengine.driverImpl.DriverLoader.loadDriver(Unknown Source)
         ... 36 more
    Edited by: Asier Camara Martin on Jun 1, 2009 2:16 PM

  • Comparing an excel file to and xml file and appending data to the xml file

    I have an xml file (mapsource) and an excel file. One of the columns in the excel file matches up with a node in the xml file. I want to be able to loop through both files and add a new node to the xml file where the one of the columns in the excel file matches a node in the xml file.
    I can create a query object out of the excel dosument using the cfspreadsheet tag.
    I'm able to use xmlparse to create a xml document object from the xml file.
    What I would like to do is add col_3 from the excel spreadsheet as a new node when col_2 is equal to gpx.wpt.name.xmltext of the xml object.
    Any help or direction would be very helpful!

    Hi,
    Thank you for your reply. But I have to attach an excel file from a particular path (C:\TEMP\TEST.XLS) and I have to send that excel file to the user inbox.That excel file has multiple sheets with data. Can you please provide me any code is available.
    Thanks and Regards
    venkat.

  • How to upload all excel files data from one folder into internal table.

    Dear All,
    I have one requirement, It is like I want to upload the frontend file data into my internal table, But here my scenario is;
    If I have one folder ( Called : Temp) in my frontend system, in this folder ( Called : Temp)  I have 100 excel files. In each excel file I have some 1000u2019s of entries. All these data of every file I want to take into my internal table.
    If I have one file I can go for, CALL METHOD cl_gui_frontend_services=>file_open_dialog and then upload method to upload. But I want to take all these excel files from that folder at a time, is there any class or any thing is there..? plz help..
    Thanks...
    Edited by: satishsuri on Jan 11, 2011 9:33 AM

    Hi satishsuri ,
    You will have to use 3 methods together :
    CALL METHOD cl_gui_frontend_services=>directory_browse "Browse the Directory
    CALL METHOD cl_gui_frontend_services=>directory_list_files "Get all the files from the directory
    CALL METHOD cl_gui_frontend_services=>gui_upload "Upload each file in a loop
    Example:
    TYPES: BEGIN OF ty_data,
             line TYPE string,
          END OF ty_data.
    DATA: str_file TYPE string,
          str_dir TYPE string,
          it_file_table TYPE STANDARD TABLE OF file_info,
          wa_file_table TYPE file_info,
          v_count TYPE i,
          it_data TYPE STANDARD TABLE OF ty_data,
          wa_data TYPE ty_data.
    CALL METHOD cl_gui_frontend_services=>directory_browse
      CHANGING
        selected_folder = str_dir.
    CALL METHOD cl_gui_frontend_services=>directory_list_files
      EXPORTING
        directory  = str_dir
      CHANGING
        file_table = it_file_table
        count      = v_count.
    LOOP AT it_file_table INTO wa_file_table.
      CONCATENATE str_dir wa_file_table-filename INTO str_file SEPARATED BY '\'.
      CALL METHOD cl_gui_frontend_services=>gui_upload
        EXPORTING
          filename = str_file
          filetype = 'ASC'
        CHANGING
          data_tab = it_data.
      LOOP AT it_data INTO wa_data.
        WRITE : / wa_data-line.
      ENDLOOP.
      ULINE.
    ENDLOOP.
    Regards,
    Jovito

  • Read multi-tabbed excel file attachments from Sender Mail Adapter.

    There is a need to read excel attachments from incoming email to a
    mailbox. We know we can use Sender Mail adapter to easily read .xml, .txt
    or .csv attachments.
    For excel attachments we know from SDN that you have to write
    adapter modules to handle excel. However the excel file we need to read has
    multiple worksheets(tabs) and data may be contained in any of them.
    Is it possible to use SAP XI Mailsender adapter to read such a file as an attachment? What kind of module development would we need for this? I am not much of a Java programmer so examples or links to other documentation would help.
    Thanks,
    Rudra

    Rudra,
    Use Java Mapping.  There is a free java api available called JExcelAPI to achieve this. 
    Shabarish's blog describes about this.  This might be helpful to you
    /people/shabarish.vijayakumar/blog/2009/04/05/excel-files--how-to-handle-them-in-sap-xipi-the-alternatives

  • Excel 2013 (office 365) crashes every time I opened a excel file directly from Browser or zip file.

    Hi guys,
    I got a problem with my Office 365 that every time I open an office file from IE/chrome browser (i.e. click the document link and save the file to local, open it in the browser after download completed) or under a zip file, no matter it is an excel file
    or word document, the Excel/Word crashes. The Excel/Word will ask me to repair the file if I open the file again. The file will be closed automatically after the repair, when I open the file again it will told me the excel/word itself has just successfully
    registered and ask me to close and re-open the excel again in order to enable editing the file. This is extremely inconvenience, I have to open this file 4 times to edit my file. 
    Could anyone here can help me to resolve the problem?
    Many thanks.

    Hi,
    According to your description, Excel seems not crash when you opened a local Excel/Word file directly. Where do you store these file? OneDrive, SharePoint or other?
    If possible, please let me see the screenshot of the error dialog.
    Moreover, please open Event Viewer to check whether there's any error about the Excel/Word crash issue.
    Press Win + R, type "eventvwr" in the blank box, press Enter. In the Event Viewer, browse to Windows Logs -> Application, there may be some errors after the crash.
    To protect your privacy, you may send the error logs to
    [email protected], we will try to find the cause.
    Regards,
    George Zhao
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click "[email protected]"

  • Save alv report as excel file directly from program

    Hello guys,
    I require this in my work.
    I want to save the ALV report tat is to be generated in the filepath that is given in the selection screen (want to save it locally eg: my windows desktop) and in the layout which is also given in the selection screen.
    your comments will be very much appreciated.
    Thanks in Advance,
    Johny

    Hi Johny,
    Actually we have an option to download report output in ALV but it does not download the specified on Selection-screen. For this Create on button for Excell download by setting PF status. and use USER_COMMAND event to trigger when u click on the button and download data to specified path.
    1.
    declare events table like this.
    data :
          i_events  type slis_t_event,
          w_events  like line of i_events.
    2.
    Build events table .
    w_events-name = 'USER_COMMAND' .
    w_events-form = 'USER_COMMAND' .
    append w_events to i_events.
    clear w_events.
    w_events-name = 'PF_STATUS_SET' .
    w_events-form = 'PF_STATUS_SET' .
    append w_events to i_events.
    clear w_events.
    3.
    pass this events table through REUSE_ALV_GRID_DISPLAY.
    4.
    USER_COMMAND and PF_STATUS_SET call back subroutines should be like this in your case. These are nowhere called using PERFORM statement in ur program.
    5.
    PF_STATUS_SET' subroutine should be like this.
    *&      Form  pf_status_set
    form pf_status_set    using extab type slis_t_extab.
    set pf-status 'STATUS1' excluding g_extab.
    "If you write like above Standard status will be gone.
    "For that u have to copy standard status of any ALV program which has standard status.
    "1. goto SE41 tcode. give program SAPLKKBL and status :STANDARD_FULLSCREEN .
    2.Click on the Copy status button below program is ur program and status ur program status.
    3. After that create your own button for Excel downlod.
    endform.                    "pf_status_set
    6.
    USER_COMMAND subroutine should be like this.
    *&      Form  user_command
    form user_command using ucomm like sy-ucomm
                      selfield type slis_selfield.
      case ucomm .
        when 'XLS_DOWN'.
        perform download_to_xls.
      endcase.
    endform.                    "user_command
    Here is the sample program to download data into Excel file with header and Columns..
    Check this program by running.
    *& Report  ZVENKAT_DOWNLOAD_XLS_WITH_HEAD
    REPORT  zvenkat_download_xls_with_head.
    "  Data retrieval related declarations
    TYPES:
         BEGIN OF t_emp_dat,
           pernr TYPE pa0001-pernr,
           persg TYPE pa0001-persg,
           persk TYPE pa0001-persk,
           plans TYPE pa0001-plans,
           stell TYPE pa0001-stell,
         END OF t_emp_dat,
         t_attachment TYPE  solisti1.
    DATA:
         w_emp_data TYPE t_emp_dat,
         w_attachment     TYPE  t_attachment.
    DATA:
         i_emp_data TYPE STANDARD TABLE OF t_emp_dat,
         i_attachment     TYPE STANDARD TABLE OF t_attachment.
    PARAMETERS: p_file TYPE string DEFAULT 'c:\tmp\test.xls'.
    "Start-of-selection.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM build_xls_data_and_download.
      "Form  get_data from PA0001
    FORM get_data.
      SELECT pernr
             persg
             persk
             plans
             stell
       FROM pa0001
       INTO CORRESPONDING FIELDS OF TABLE i_emp_data
       UP TO 4 ROWS.
    ENDFORM.                    " get_data
    "Form  build_xls_data_and_download
    FORM build_xls_data_and_download.
      "If you have Unicode check active in program attributes then
      "you will need to declare constants as follows.
      CLASS cl_abap_char_utilities DEFINITION LOAD.
      CONSTANTS:
          con_tab  TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
          con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
      DATA :l_lines TYPE char10.
      DESCRIBE TABLE i_emp_data LINES l_lines.
      CONCATENATE 'Total no of records:' l_lines
             INTO  w_attachment
    SEPARATED BY  con_tab.
      CONCATENATE con_cret
                  w_attachment
             INTO w_attachment.
      APPEND w_attachment TO i_attachment.
      CLEAR  w_attachment.
      CONCATENATE 'PERNR' 'PERSG' 'PERSK' 'PLANS' 'STELL'
             INTO  w_attachment
    SEPARATED BY  con_tab.
      CONCATENATE con_cret
                  w_attachment
             INTO w_attachment.
      APPEND w_attachment TO i_attachment.
      CLEAR  w_attachment.
      LOOP AT i_emp_data INTO w_emp_data.
        CONCATENATE w_emp_data-pernr
                    w_emp_data-persg
                    w_emp_data-persk
                    w_emp_data-plans
                    w_emp_data-stell
               INTO w_attachment
       SEPARATED BY con_tab.
        CONCATENATE con_cret w_attachment
               INTO w_attachment.
        APPEND w_attachment TO i_attachment.
        CLEAR  w_attachment.
      ENDLOOP.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename              = p_file
          write_field_separator = con_tab
        TABLES
          data_tab              = i_attachment.
      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.                    "build_xls_data_and_download
    I hope that it helps u .
    Regards,
    Venkat.O

  • Issues with format of Excel file created from an Oracle Report

    I'm running Oracle Reports 6i.  My reports run fine but when I covert them to Excel files I lose my column headings (they end of being repeated for each row in their own columns) and the ordering of my other columns. I can't figure out what is determining the column order as it is not the order of the items in Report Builder or in the query. Could someone tell me why this might be happening and how to fix the issue?  Any help would be greatly appreciated as I'm a very new user. Thanks!

    Hi,
    First of all let me clear out generating a report pdf is different from excel.
    The Repeating Frame and boxes,lines etc., used in your reports plays a vital role in excel.
    Because, the fields in the reports are segmented into XL cells and displayed as the output.
    For Better results in excel...Follow the below instructions,
    --Remove Boxes,lines,etc.,
    --Make your repeating frame and main frame visible (don't put 'NO_LINE') for any frames,
    --Don't leave any unnecessary spaces in reports between fields,frames etc.,
    --Then run your report.
    It will work fine,
    Regards,
    Soofi

  • FM to mail a excel file generated by XML

    Hi All,
    I have a requirement to generate fancy excel file as attachment in mail.
    Please help with some FM to send mail with excel as attachment,
    I have used a code like the sample code given below.
    *&amp;----
    **&amp; Report  ZTEST_NP_EXCEL_XML
    **&amp;
    **&amp; Download the formatted excel file using XML
    *&amp;----
    report Z_IXML.
    TABLES USR02.
    TYPES XMLLINE(1024) TYPE C.
    DATA IT_XML TYPE XMLLINE OCCURS 0.
    DATA WA_XML TYPE XMLLINE.
    DATA FNAME(60) TYPE C VALUE '/ft/D02/001/test.xls'.
    \ Build-up of xml in internal table
    \\* Opening tags
    APPEND '<?xml version="1.0"?>' TO IT_XML.
    APPEND '<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"'
    TO IT_XML.
    APPEND 'xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">'
    TO IT_XML.
    APPEND ' <Worksheet ss:Name="Tabelle1">' TO IT_XML.
    APPEND ' <Table>' TO IT_XML.
    \\* The actual data from table USR02
    SELECT * FROM USR02.
    APPEND ' <Row>' TO IT_XML.
    CONCATENATE ' <Cell><Data ss:Type="String">'
    USR02-BNAME '</Data></Cell>' INTO WA_XML.
    APPEND WA_XML TO IT_XML.
    CONCATENATE ' <Cell><Data ss:Type="String">'
    USR02-TRDAT '</Data></Cell>' INTO WA_XML.
    APPEND WA_XML TO IT_XML.
    APPEND ' </Row>' TO IT_XML.
    ENDSELECT.
    \*Closing tags
    APPEND ' </Table>' TO IT_XML.
    APPEND ' </Worksheet>' TO IT_XML.
    APPEND '</Workbook>' TO IT_XML.
      DATA: window_title TYPE string,
            fullpath TYPE string,
            path TYPE string,
            user_action TYPE i,
            default_extension TYPE string,
            default_file_name TYPE string,
            file_filter TYPE  string,
            filename TYPE string,
            initialpath TYPE string.
    File selection
      MOVE '.XLS' TO default_extension.
      MOVE 'XLS files (.XLS)|.XLS' TO file_filter.
      CALL METHOD cl_gui_frontend_services=>file_save_dialog
        EXPORTING
          default_extension = default_extension
          default_file_name = default_file_name
          file_filter       = file_filter
          initial_directory = initialpath
        CHANGING
          filename          = filename
          path              = path
          fullpath          = fullpath
          user_action       = user_action
        EXCEPTIONS
          cntl_error        = 1
          error_no_gui      = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = fullpath
          filetype                = 'ASC'
        TABLES
          data_tab                = it_xml
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          OTHERS                  = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Please help
    I am giving a sample code how

    Hi Supratik,
    Please refer to these two links:
    Send email with 1 excel file and multiple sheet
    How to Convert file to excel and send it via email
    Hope this will resolve your issue.

  • Regarding Excel file creation.

    Hi experts,
    I retrieved the ALV output into an internal Table which is containing Text(1024) as member.
    After getting Data I need to pass this data to Excel file.
    Excel file should contain exact format of ALV.
    Please suggest me..............
    Regards,
    Subash

    hi,
    after getting data into EXCEL File and i need to pass this one as attachment to mail. If i use  GUI_DOWNLOAD is saved into presentation server and i need to pick that file from presentation server  and i will send. But this one won't work in BACK Ground. That is the reason after getting data from ALV report into Text Variable and i need to pass this data to excel file, and that excel file as to go an attachemnt to mail,.Everything in Background only.

Maybe you are looking for

  • How to use open graph tags in muse to show facebook share images

    i am trying to use a facebook share button. i would like to have a preview of the image in the story i want to have shared. i know that it has to do with open graph tags. i am unsure of how and where to add these og tags to my muse program to have th

  • Compler error "integer no too long"  when there is no integer

    My compiler complains that the interger value is too long. i want to generate a 12 digit random pin numbers. i have this code that wont compile. {private void generate()       Long pinNumber=0;       int no=100;       for(int counter=0;counter<no;cou

  • Send e-mail in HTML-format with attachment

    Does function SO_OBJECT_SEND allow to send e-mail with attachment? Does function SO_DOCUMENT_SEND_API1 allow to send e-mail in HTML format?

  • Where is the inventory tab gone?

    Hello, This is something I've noticed for some time now (probably since 7.0 released). No matter where I am in Spiceworks there is no Inventory tab. I can still get to it because I know I can just add /inventory to the end of the URL. In my helpdesk

  • Flattening data structures generated by JAXB

    hello, I was wondering if it is possible to automatically "flatten" objects generated with JAXB for example, if my schema has <xsd:complexType name="Type1" > <xsd:sequence> <xsd:element name="DummyType"> <xsd:complexType> <xsd:sequence> <xsd:element