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.

Similar Messages

  • Background download in excel format

    Hi all,
    We have a requirement to download a dataset in excel format. The users have access to a folder on the server where the program will dump the files. Then the users should be able to open the files using excel. Any suggestions?
    Regds
    Thiru

    hi,
    if your requirement still exists then here is a way of doing it...
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2
    Regards,
    Samson Rodrigues.

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

  • Background download

    hi,
    as cannot directly download file via background, i must save in app server b4 download to presentation server. may i know in the same program run via background can do both together? meaning upload to app server and download to presentation server as user want to run the report in background to download file in excel.
    can use dataset for input and output in the single program to run in background?
    please advise with example.
    thx

    hi,
    thanks. i read the post before i post mine.
    i do not want to do setting as i am not allowed. the setting same as the one in the post? if not, you can email to me at [email protected] just for knowledge.
    i would like to ask if i use DATASET, can both INPUT and OUTPUT be done in a single report that run in background? or in short can use dataset to download to excel file in the same report that run in background?
    thanks

  • 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

  • BSP-MVC download to excel

    Hello experts,
    I know there are many threads on this topic in the forum. I tried using method cl_bsp_utility=>download
    but nothing happens. Here is the scenario -
    1. I have BSP
    2. From Do_handle_event in controller class I am calling model method which handles downloading to excel.
    Please help as this is real showstopper for the application, I am developing.
    Thanks, in advance.
    Trupti

    Hi Gopal,
    Thanks for your reply.
    Tried the code you sent me. As I am using BSP-MVC, I am building method in controller class and with event handling calling the method that handles download to excel. But it is not doing anything at all.
    Thank you.
    Trupti

Maybe you are looking for

  • Connecting tv to mac

    Connecting my macbook to tv. I have no picture only sound.Using scart lead from tv to converter supplied with computer, plus audeo connection. Used system preferences find detect displays etc any ideas?

  • How to put the SQL-statement returned value into the field (as a default)

    Hi, I am using Developer/2000 (Forms Designer) under windows 98. Please tell me how to put the SQL-statement value (as a default value) into the field before enter-query mode. Noted that I have tried the following ways but still some problems:- 1) Pl

  • Bex Analyzer 7.0, Filter on Hierarchy Node (Text Group)

    Hi gurus, I would be glad if anyone of you could help me with this issue. I made an application with Bex Analyzer 7.0 which does following -> create certain combinations and copy it directly into PowerPoint as a picture. This works great, I can send

  • Re: Lenovo A7 A3300GV LATEST UPDATE PROBLEM

    Multiple members of the forum have have reported multitouch issues on the A3300GV after OTA update A3300GV_A442_01_44_140924_ROW. My team has investigated these reports and is escalating them to next level support.  I will post an update in this disc

  • Transferring files to SD card

    Hey there, I have inserted a 32gb SD-Card and my Xperia Z2 seems to only transfer pictures, movies and music files to it. I would like to transfer apps to it aswell but I can't transfer them manually like I could on my Xperia S. Has that been turned