Download to excel in background

Hi
I want to download data to Excel as a background job.
Are there any FM's that can be used for the same.
I can not use GUI_DOWNLOAD in this case.
I am working on a CRM5.0 system.
Any pointers on the same would be really helpful.
Regards
Avinash

Hi Avinash,
If you didn't use a BSP technology (ASP/PHP/JSP) before it will be very complicated to impiment this.
The other way to do it (but I'm not sure I didn't tried it) is to create a file on the server and generate link to this file that user will click on it.
I think it should be much complicated because of the security issue (which user have different security policy) and you need to manage files on the server (how long you gonna keep them there ? is evry user wil create it own file ? etc')
As you can see there is a lot of different issues that you should take care when working on the web
Good Luck
Eli Steklov

Similar Messages

  • Background download to excel

    hi,
    what FM to download to excel via background? i save data in app server using dataset and now want to open dataset for input? can this get the data downloaded to local c drive in background?
    thanks

    Hi,
    Downloading in background in presentation server is not possible.But you can read the data from application server.
    DATA: BEGIN OF T_INPUT OCCURS 0, " Flat file data
           PERNR(9) TYPE C,
           AMOUNT(15) TYPE C,
           W_TYPE(5) TYPE C,
          END OF T_INPUT.
    DATA : G_DATA(1000) TYPE C,
    G_DELIM TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
    OPEN DATASET G_AFILE1 FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF SY-SUBRC = 0.
        DO.
          READ DATASET G_AFILE1 INTO G_DATA.
          IF SY-SUBRC = 0.
            SPLIT G_DATA AT G_DELIM INTO T_INPUT-PERNR T_INPUT-AMOUNT
                                                     T_INPUT-W_TYPE .
            IF SY-SUBRC = 0.
              APPEND T_INPUT.
              CLEAR T_INPUT.
            ELSE.
              error message
            ENDIF.
          ELSE.
            EXIT.                       "After reading last Record
          ENDIF.
        ENDDO.
      ELSE.
                  error message
      ENDIF.

  • Download from alv to excel in background

    Hi All,
    I have developed one alv report which has 100 column(more than 1023 character in header).
    When I download in excel it is not comming properly so I go to LIST-EXPORT-SPREADSHEET then
    it comes in MHTML format then I can open it in to excel so its comes perfect.
    Now what my query is--- when I execute in background then there is no option for MHTML format.
    so in this case the report not come properly in excel. Please give the solution.
    Thanks,
    Rakesh

    Hi,
    Try using File Handling Concept ..Open Dataset (the file will be downloaded in application server)  .. and schedule a background job
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3c8c358411d1829f0000e829fbfe/content.htm
    Regards,
    Rajashiva R

  • Upload and download of  excel file in the application server in background

    Hi all,
    i want to download the excel file from application server into internal table and after processing i have to upload to excel file in the application server in the background mode..
    i mean i'll schedule the program in background.
    im using FM ALSM_EXCEL_TO_INTERNAL_TABLE its working fine in fore ground but not in back ground.
    what method i have to follow ?

    Hi Ankit,
    I think this is not possible to open a Excel-File from the application server because the Excel format before Office 2007 where a binary format (Suffix: .xls). The newer Office file format (Suffix: xlsx) is a zipped XML Format. To read the binary Excel-Format you need an OLE Connection between SAP GUI and Office. But at the application server in background you doesn't have this OLE Connection.
    In my opinion you have two possibilities:
    1. Convert all files in the CSV format. This file format can be read with open dataset.
    2. Upload the files from the presentation server in forground. There are some funktion modules in the standard which can read the xls format. But they have some limits regarding the length of cells content.
    My recommendation is solution no. 1. If you know an VBA expert, he can write an Excel-macro which converts all Excel Files in the CSV-Fomat.
    Regards
    Dirk

  • Urget::How to download in excel format  in Background

    hi,
            i was using GUI_DOWNLOAD  in a program to download into excel format. but now the user wants to run this in background mode .But gui_download doesn't support the background .can u suggest me any other way to download in background mode into excel format.
    it's urgent .please help.
    Thanks in advance .

    Hi Rasmi,
    In background you can only download it to application server and not on your PC.
    If its ok then you can use OPEN DATASET....CLOSE DATASET to do that.
    Once its downloaded to Application server you can download that into your PC.
    Hope This helps you.
    Thanks,
    Arun

  • MB51, download to excel works different for online and background.

    Hi,
    Have a question regarding excel download of MB51 in online mode against background.
    If I run MB51 online, I can download it to an excel sheet that is easy to read and work with. Each column in the report in seperate column in excel.
    If I run it in the background, try to download the spool to excel, I don't get the columns the same way as online report.
    I’ve tried changing the layout, downloading to excel, downloading to text and then dropping to excel, etc.
    Why won’t the download from a batch job work the same as online?
    Any ideas or anyway to fix?

    Hi All,
    I am also facing the same problem. When I download to Powerpoint, its getting downloaded properly and whn I download to excel, I am not able to download properly. I have 2 charts of the same report being displayd sde-by-side and under them I have a pivot table displayed in compound view. When downloaded to excel, the first chart is overlapping on top of the report in the excel.
    Can anyone suggest if we have any options?
    Thanks Shravan

  • Download an excel file in background mode

    Hi All,
    I need to download a file from a ABAP  report to the local workstation in background mode. I tried GUI_DOWNLOAD but it is failing in the background.
    Is there any way to download the excel file in the background. I am thinking of generating the spool.
    Please let me know if anybody has worked on the same requirement. Any help would be highly appreciated.
    Thanks a lot.
    Regards,
    Priti

    You be able to use the function "WS_DONLOAD" ?
    parameters: p_fnam like  rlgrap-filename memory id fnam obligatory.
    data: begin of t_registro occurs 0,
            registro(1000),
          end of t_registro.
          describe table t_registro lines sy-tfill.
          if sy-tfill gt 0.
            l_tam = strlen( p_fnam ).
            call function 'WS_DOWNLOAD'
                 exporting
                      filename                = p_fnam
                 tables
                      data_tab                = t_registro
                 exceptions
                      file_open_error
                      file_write_error
                      invalid_filesize
                      invalid_type
                      no_batch
                      unknown_error
                      invalid_table_width
                      gui_refuse_filetransfer
                      customer_error.
            if sy-subrc <> 0.
              open dataset p_fnam for output in text mode.
              if sy-subrc = 0.
                loop at t_registro.
                  transfer t_registro to p_fnam.
                endloop.
                close dataset p_fnam.
                write:/ 'Se genero el archivo:', p_fnam(l_tam).
              else.
                write:/ 'No se pudo generar el archivo:', p_fnam(l_tam).
              endif.
              close dataset p_fnam.
            else.
              write:/ 'Se genero el archivo:', p_fnam(l_tam).
            endif.
       endif.
    I hope this works for you.
    See ya.
    Ar@

  • Download to Excel In the Background

    Hi,
    Our SAP server is in Windows operating system. Is it possible to download data in Excel file in the background mode?
    Thanks
    Lokman

    1) One way is, using GUI_DOWNLOAD from your program and haedcoding the path to which it should be downloaded.
    2) Check the link below for downloading excel in background... A demo program is also available.
    http://www.sap-img.com/abap/download-in-background-in-excel-format.htm
    Cheers,
    Thomas.
    Please mark points if you got solution.

  • Download to Excel not proper for chart

    Hi all,
    I have a graph and a simple tabular report in Dashboard page.
    When i m trying the option download to excel the chart is not coming proper in excel and it is overwriting the report.
    So its like that report at the background and a chart over it.
    Can i have the option to show the chart below or above the report?
    Please note i m using multiple charts in View Selector and user can select any chart of his choice and also re-arraging the graph option and report in compound layout.
    Regards,
    Rajan

    Hi All,
    I am also facing the same problem. When I download to Powerpoint, its getting downloaded properly and whn I download to excel, I am not able to download properly. I have 2 charts of the same report being displayd sde-by-side and under them I have a pivot table displayed in compound view. When downloaded to excel, the first chart is overlapping on top of the report in the excel.
    Can anyone suggest if we have any options?
    Thanks Shravan

  • Download into excel

    Hi all,
    is there any function module which i can download the excel sheet into internal table.
    I have requirement like this way.
    i have two records in excel file like
    a   b   c   10 100
    a   b   c   20 100
    I have to copy into internal table these values as it is and then I want to do calculations based on 10 & 20.
    I am trying to do it with Field symbols but not able to do so.
       LOOP AT INTERN1.
         IF   KZHEADER = 'X'
          AND INTERN1-ROW = 1.
            CONTINUE.
         ENDIF.
         TIND = INTERN1-COL.
         CONCATENATE 'DATA_TAB-VALUE_' TIND INTO ZWFELD.
         ASSIGN (ZWFELD) TO <fs1>.
         <fs1> = INTERN1-VALUE.
         AT END OF ROW.
           APPEND DATA_TAB.
           CLEAR DATA_TAB.
         ENDAT.
       ENDLOOP.
    Any suggetions are really appreciatable.
    shylesh

    Hi,
    FM : 'SXPG_COMMAND_EXECUTE'
    For full program code check the following link:
    http://www.sap-img.com/abap/download-in-background-in-excel-format.htm
    Regards,
    Bhaskar

  • Warning while downloading an Excel file from WD ABAP

    Hi folks,
    In one of requirements, Client wants to download all the data that is appearing on the screen ( WD ABAP Application ) to an Excel with a layout in different manner.
    We achieved this with Simple Transformations.
    Now the question is while downloading the excel file, the framework/other  is throwing an Warning like
    " The file you are trying to open, 'info.xls', is in a different format than specified by the extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now? "
    Note: All the users of my client are using MS Office 2002 / 2003.
    I am using the following code........!
    *------ Call Transformation for Excel OUTPUT
      CALL TRANSFORMATION ZEXCEL_OUTPUT
          SOURCE
                 t_dates     = t_dates
                 t_info        = t_info
          RESULT XML l_xml_string.
    REPLACE ALL OCCURRENCES OF '<?xml version="1.0" encoding="utf-16"?>'  l_xml_string WITH '<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?>'.
    **-- Call Function Module for converting string data to XSTRING
      CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
        EXPORTING
          text           = l_xml_string
          mimetype = 'application/xml'
        IMPORTING
          buffer      = l_xml_xstring
        EXCEPTIONS
          failed   = 1
          OTHERS   = 2.
      CALL METHOD cl_wd_runtime_services=>attach_file_to_response
        EXPORTING
          i_filename       = 'info.xml'
          i_content        = l_xml_xstring
          i_mime_type   = 'application/vnd.ms-excel'.
    With this code I am generating a file of type XML SPREADSHEET 2003. While opening this file I am getting the above message which the user unwanted......
    Can any one help me on this -
    > How to avoid this warning?
    Thanks and Regards,
    Aneel Danda
    Edited by: danda aneel on Jul 13, 2010 1:43 PM

    Firstly, Thanks for Your quick Response, Thomas.
    Even though what ever may be the file name I am passing either info.xml or Info.xls , In error info.xls is coming.
    Kindly provide me an alternative on this  XML doesn't seem like it would match the 'application/vnd.ms-excel'.
    what is the supported format.?
    Similarly, It is not considering the UTF-8 / UTF-16 for xml.........same result is appearing in the output.
    Edited by: danda aneel on Jul 14, 2010 7:52 AM

  • Doubt on ALV report download to EXCEL

    Hi All,
    i have written a report with ALV_GRID FM, by default we get the option to download the output to excel. But when we click on the download to excel, it displays the output
    in the frist page, but it also opens so many pages like
    format, header, pivot,sub1,sub1....etc.
    Pls. check the SAP standard report BCALV_TEST_FULLSCREEN, does the same thing when we do download to excel.
    How can i avoid opening so many pages in excel?
    Thanks for the help.
    Sekar

    Hi ,
    prabhu here , i think check the FM wheather u r passing all these to FM. for Excel keep export.param: --> i_save only and check.
    regards
    prabhu

  • Help needed: Download to excel without pop-up

    Hi All,
    In a particular scenario, I require to trigger an action once a file have been successfully downloaded to EXCEL from Webdynpro UI. But in case of download functionilty, once the MS window pop-up for download comes up, the control is lost from Webdynpro and its impossible to track whether user have saved, opened or canceled the file.
    Is there any functionality to directly download internal table content to EXCEL, without facing the download popup. Please let me know any function module or functionality for this.
    Thanks in advance to all.
    Regards,
    Mainak

    yes there are many tutorials on SDN regarding this
    u may procced like this :
    get the contents in internal table  and then use the FM 'SCMS_STRING_TO_XSTRING'
    DATA text   TYPE string.
      DATA xtext  TYPE xstring.
    *   get all declared attributes
      lo_nd_sbook->get_static_attributes_table(
        IMPORTING
         table = lt_sbook ).
      LOOP AT lt_sbook INTO ls_sbook.
    CONCATENATE text ls_sbook-carrid
    ls_sbook-connid
    ls_sbook-fldate
    ls_sbook-bookid
    ls_sbook-order_date
    ls_sbook-counter
    ls_sbook-passname
    cl_abap_char_utilities=>newline INTO text SEPARATED BY
    cl_abap_char_utilities=>horizontal_tab.
    ENDLOOP.
        CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
          EXPORTING
            text   = text
          IMPORTING
            buffer = xtext.
        wdr_task=>client_window->client->attach_file_to_response(
    **path to the word file
    i_filename = 'WDP.xls'
    * String Variable
    i_content =  xtext
    * File Type
    i_mime_type = 'EXCEL' ).
    here it_sbook is the inernal table and ls_sbook is the structure type of the attributes declared in the context node sbook
      DATA ls_sbook TYPE wd_this->element_sbook.
    *  data LT_SFLIGHT type WD_THIS->ELEMENTS_SFLIGHT.
      DATA lt_sbook TYPE wd_this->elements_sbook.
    Edited by: amit saini on Oct 14, 2009 1:30 PM

  • Download to Excel is hiding rows in a pivot view

    Hello ,
    When downloading a report to excel from OBIEE Dashboard , certain rows are getting hidden . For instance , I have total 15 rows in my pivot view and when I download that report into excel format , the rows from 8-13 are not showing up . After 7th row I see 14th row .
    But when I download the same report from Answers I can see all rows in the pivot view .
    I tried looking at the formatting options of the pivot view and everything is normal . This is happening only with this particular report , other reports in dashboard download normally .
    Please let me know if anybody has ideas .
    Thank you
    Karthik

    karthik,
    From where ur downloading to excel ...use the download option available at "preview " button ,if you are using the same go with report links download button option
    Last option create a new report (without any filters in case if u have)
    Thanks,
    Saichand.v

  • Download to excel using GUI_DOWNLOAD : Date format

    Hi Gurus,
    I am downloading the data from an internal table to excel file using FM gui_download. The date field in my internal table is in the format MM-DD-YYYY (stored as Char 10 field). But when it downloads to excel, the date format changes to MM/DD/YYYY. I want to keep original format of MM-DD-YYYY in excel.
    Please help, sure points for helpful answers.
    should i use FM gui_download only, or is there some Other useful FM.
    Regards,
    Abhishek

    Hi,
    Check the code below:
    v_date = sy-datum.
    IF v_date CA '/'.
      REPLACE '/' WITH '-' INTO v_date.
    ENDIF.
    Regards
    Kannaiah

Maybe you are looking for