Download(xls) file fm ABAP using background job

Hi,
My request is how to download(xls) file fm ABAP using background job. ( Daily 3 times download )
Pls advise...

Hello Rajesh,
Actually it is not the function module WRITE_DATASET but command OPEN DATASET. Check this link for more info:
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/content.htm
Also for this please contact your ABAP collegues. It is their job and they should have the expertise.
Regards.
Ruchit.

Similar Messages

  • How to get Header in Downloaded .xls file using  GUI_Download function

    How to get Header in Downloaded .xls file using  GUI_Download function ???
    How to use the the Header parameter available in GUI_Download function .

    HI,
    see this sample code..
    data : Begin of t_header occurs 0,
           name(30) type c,
           end of t_header.
    data : Begin of itab occurs 0,
           fld1 type char10,
           fld2 type char10,
           fld3 type char10,
           end   of itab.
    DATA: v_pass_path TYPE string.
    append itab.
    itab-fld1 = 'Hi'.
    itab-fld2 = 'hello'.
    itab-fld3 = 'welcome'.
    append itab.
    append itab.
    append itab.
    append itab.
    append itab.
    t_header-name = 'Field1'.
    append t_header.
    t_header-name = 'Field2'.
    append t_header.
    t_header-name = 'Field3'.
    append t_header.
      CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
        EXPORTING
          default_extension     = 'XLS'
        IMPORTING
          fullpath              = v_pass_path.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                        = v_pass_path
          filetype                        = 'DBF'
        TABLES
          data_tab                        = itab
          FIELDNAMES                      = t_header
    Cheers,
    jose.

  • Issues to use GUI_LOAD to download xls file

    Hi Guru's, we are using the fm GUI_DOWNLOAD for downloading xls files to the physical system.  We are facing  following issues.
    1. File contains the currency fields. When downloaded the file to desktop or any location  after decimal zero's are not printing in currency field.
    how to get zero's after decimals in the currency fields. Please let us know the solution if any.
    2. If we click the open option under file tab on the opened xls file which is downloaded from SAP then one wizard popup is coming and prompting the user to click the 'FINISH' button.
    Please let me know how to avoid this wizard popup.
    Thanks in advance.
    Regards,
    j.p

    Myself

  • How to find process chain using background job in sm37

    How to find process chain using background job in sm37

    Better is to select the job.
    Select (Define) Step (s) or F6.
    Select the line and Menu Goto>Variant.
    The variant contains the name of the CHAIN and its VARIANT.
    Success
    We faced an old job and via job monitoring we were informed about a cancelled job every 'interval'.
    We noticed that the related chain was deleted but still the job was scheduled each interval again and was cancelled because an event was missing
    We could not find the scheduled job via SM37.
    Via view V_OP, view over tbtco abd tbtcp, we find the related entry.
    We delete these entries via function BP_JOB_DELETE....
    Edited by: Jack Otten on Jul 9, 2010 2:50 PM

  • File path problem in background job spool

    Hello ,
    i have probelm in file path of the background job in spool.
    i have selection screen
    Radiobutton : p_local
    parameter: path1.
    Radibutton: p_applicatioserver
    parameter: path2.
    if i keep program in background job, it will alwas take second option.
    Now user selected first option and executed job in abckground. File stored in the spplication server with corect file  path name. (path2)
    But when i go to sm37 entered job name and checked the spool, it gives me the file path name path1. but i need the file path1 in the background spool. my question whether i need to change the file path name in program or whether i have to change the setting
    Regards,
    zub

    First of all, local is not an option in background job; you can only save to the apps server, and your program should take that into consideration by checking for sy-batch = 'X', for example.  You should be checking in your at selection-screen to be sure the user has not chosen local path and file and background job.

  • Can ABAP proxy to consume WSDL file be run as background job for every10min

    Hi all,
    I have a requirement where I need to build an interface which gatheru2019s the purchase order details and send to external third party software in their required format (as an XML file).
    So I should be the first point of contact and should trigger the interface each time a purchase order is generated.
    So I am thinking that I should develop a background job for every 10 minutes which will look for new purchase orders and gathers the information of the purchase orders and send them to external third party software in their required format.
    I have gone through all the SAP forums and e-Learning but still I have confusion in regards to how is it possible technically? Can some one guide me with some information on the same.
    I have a little bit of confusion and want to know few things.
    1)     Should I create a web service or should I consume a web service?
    2)     If I need to consume a web service, then can I write an ABAP proxy to be run in background fro evry 10 minutes? I mean can we run ABAP proxy as a batch job in the background?
    3)     Is there a difference between consuming an XML file and WSDL File?
    Any Help will be highly appreciated.
    Regards,
    Jessica.

    There are two options (as I know) to generate XML file.
    1. Use XML TRANSFORMATION to get the XML string based your TRANSFORMATION. You can input your data and get back the XML string. Download this string to a file
    Test XML generation program is:
    types: begin of ty_data,
           num   type i,
           end   of ty_data.
    DATA: itab TYPE standard table of ty_Data,
          la_data like line of itab,
          xmlstr TYPE string.
    DO 3 TIMES.
      la_data-num = sy-index.
      APPEND la_data TO itab.
    ENDDO.
    CALL TRANSFORMATION ztest_np1
      SOURCE table = itab
      RESULT XML xmlstr.
    CALL FUNCTION 'DISPLAY_XML_STRING'
      EXPORTING xml_string = xmlstr.
    My ZTEST_NP1 transformation. To create a transformation, click on the transformation in the "CALL TRANSFORMATION ztest_np1" statement. Select Simple transformation type.
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="table"/>
      <tt:template>
        <table>
          <tt:loop ref=".table">
            <item>
              <tt:value ref="NUM"/>
            </item>
          </tt:loop>
        </table>
      </tt:template>
    </tt:transform>
    XML string is like:
      <?xml version="1.0" encoding="utf-8" ?>
      <table>
      <item>1</item>
      <item>2</item>
      <item>3</item>
      </table>
    To use this option, you have to create a transformation and than use it to generate the XML string.
    Check this SAP Help
    http://help.sap.com/saphelp_nw04s/helpdata/en/e3/7d4719ca581441b6841f1054ff1326/frameset.htm
    2. You can concatenate and create an XML string and download that string into a file.
    Regards,
    Naimesh Patel

  • Download .XLS-File in Background

    Hallo
    I should download data from an internal table into a real .XLS-file. It should run as a job in background (without upcoming pop-ups). At the end a real .xls-file should be saved on my harddisk and/or on a Windows NT-server.
    Excel and file don't need to be openend during runtime of job.
    I'm trying with FM 'MS_EXCEL_OLE_STANDARD_DAT' , but I have following problems (code of testreport is below):
    1. Doesn't run in the background.
    2. .xls-file stays open, when running in the foreground.
    3. Strange formatted fields in .xls-file.
    I have nearly no knowledges object-oriented development. System is R/3 Release 4.6C.
    Can anybody help me?
    Thanks, Martin.
    Code:
    REPORT yr_0001_test .
    TYPES: BEGIN OF t_excel,
           fld1(20) TYPE c,
           fld2(20) TYPE c,
           fld3(20) TYPE c,
           END OF t_excel.
    DATA: it001 TYPE TABLE OF t001.
    DATA: xt001 TYPE t001.
    DATA: iexcel TYPE TABLE OF t_excel.
    DATA: flditab TYPE TABLE OF t_excel.
    DATA: xexcel TYPE t_excel.
    xexcel-fld1 = 1000.
    xexcel-fld2 = 'testtext1'.
    xexcel-fld3 = 'testplace1'.
    APPEND xexcel TO iexcel.
    xexcel-fld1 = 2000.
    xexcel-fld2 = 'testtext2'.
    xexcel-fld3 = 'testplace2'.
    APPEND xexcel TO iexcel.
    xexcel-fld1 = 'BUKRS'.
    APPEND xexcel TO flditab.
    xexcel-fld1 = 'BUTXT'.
    APPEND xexcel TO flditab.
    xexcel-fld1 = 'ORT'.
    APPEND xexcel TO flditab.
    CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
      EXPORTING
        file_name                       = 'C:TEMPSAPWORKDIRTEST'
    *   CREATE_PIVOT                    = 0
        data_sheet_name                 = 'SHEET1'
    *   PIVOT_SHEET_NAME                = ' '
    *   PASSWORD                        = ' '
    *   PASSWORD_OPTION                 = 0
      TABLES
    *   PIVOT_FIELD_TAB                 =
        data_tab                        = iexcel
        fieldnames                      = flditab
      EXCEPTIONS
        FILE_NOT_EXIST                  = 1
        FILENAME_EXPECTED               = 2
        COMMUNICATION_ERROR             = 3
        OLE_OBJECT_METHOD_ERROR         = 4
        OLE_OBJECT_PROPERTY_ERROR       = 5
        INVALID_FILENAME                = 6
        INVALID_PIVOT_FIELDS            = 7
        DOWNLOAD_PROBLEM                = 8
        OTHERS                          = 9
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CLEAR: iexcel,flditab.
    REFRESH: iexcel,flditab.

    If you are downloading a true xls file, then you cannot avoid the pop-ups and you will not be able to create it in the background as the EXCEL interface is not available to the backend. Your only option is to download it as tab or comma delimited.
    Imagine it this way, excel is a user driven application that runs on the user's desktop and requires inputs from the user. The current mechanism of creating an excel file from SAP works on the same principle of user interaction. In the background, since there is no user interaction, it will not be possible.

  • Download excel file to PC in background

    Hi All,
    I need to write a report to local PC as an excel file. The program is working fine in foreground using cl_gui_frontend_services=>gui_download. However since the report data is very large, when the user runs the program in foreground, it always gets timeout. So it has to be run in background. I did a lot of research and tried the example posted here as well: http://abapblog.com/articles/tricks/33-create-xlsx-mhtml-file-from-internal-table-in-background
    But I am still not successful. I am getting ""control_flush_error". Does anybody have any ideas?
    Thanks,
    Meiying

    Hi ,
    cl_gui_frontend_services=>gui_download is for front end if you use this for background job scheduling it will throw dump !!
    so the solution is write a program to download the file to application  server using
    'OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE'
    and from there you can get the file.
    there is no way that you can schedule a program in background and store it on local PC.

  • Saving spool request  in PDF format  using background job

    Hi,
    We have some important jobs which create spool requests. My requirement is to save those spool requests either on front end  or on application server in pdf format. I tried with  program RSTXPDF4 but i can save those files only when pdf conversion is done online and I want it to run in background  as some of the spool request have more then 3000 pages and also i'm not looking for ABAP development.
    It is fine with me to save it in text format but some of the spool request have around 3000 pages and  i cannot save the whole request in one shot using option system->list->save->local file
    It is appreciated if someone has any alternative for the above one.
    Regards,
    Chaitanya

    Hi,
    Just check Is it solve your purpose... When you are creating background jobs mention your email / user id as spool list recipient...
    I think you will recv. the spool output in the mailbox in pdf
    Edited by: Mrinal Das on Jan 3, 2011 2:37 PM

  • "Unable to read file" error in Excel 2010 when downloading .xls file from IE11

    We have lots of reports that have links for our users to be able to download report results in Excel format. We accomplish this by using the Excel mime type in our .asp pages. Sporadically, we are seeing "Unable to read file" errors in Excel 2010
    after choosing Open from the IE11 save dialog. Choosing Save/Save As and the file will open just fine.
    Also, we can sometimes cause the error to occur more frequently by switching windows during the time when the file is downloading.
    If the file is opened directly from /Temporary Internet Files then it opens just fine.
    Window 7 64-bit
    Thanks in advance!

    Hi,
    I found you replied in a similar thread, did you try the workaround (Reset the IE) that provided there? Did you change a browser to test?
    Then, I suggest we use Process Monitor to do further troubleshooting. Please collect all the actions of IE.exe and Excel.exe, and check the if there are some
    error message/code during you open XLS file from IE 11.
    Hope it's helpful.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Need to Add Field Name to the Downloaded XLS file

    Im using the function SAP_CONVERT_TO_TXT_FORMAT
    and downloading the contents by sending them as attachements in email.
    I need to add field names(column name) to excel fields.
    So that when fields are displayed in excel file they are displayed by their column names..
    How do I do this.? Any ideas.
    Answers will be rewarded with points..

    Hi
    You can manually insert the column names as the first row in your internal table to have them in .xls file as headers.
    Regards,
    Raj

  • Downloading xls file

    i want to download the .xls file into the application server they give me
    this path  :- /USER/REPORTS/MM
    i  hv used  "ws_download " function.
    but the errot  is that " Error in Downloading the file "
    plz this prob argently ?

    Hi,
    for that you have to use dataset.
      Refer this code.
    *-- Concatenate the file path retrived from the  function module
      with additonal directory 'mm/ptpi006/in/' and pass it to a
      variable.
      CONCATENATE lv_fname c_const INTO pv_input_file.
      CONCATENATE lv_fname c_const pv_flext INTO lv_file.
      lv_dsn = lv_file.
    *-- Open Dataset
      OPEN DATASET lv_dsn FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc NE 0.
    File not found
        MESSAGE e503.
      ELSE.
      Read each line from the dataset and append to an internal table.
        DO.
          IF sy-subrc NE 0.
    No records found in the file.
            MESSAGE e504.
          ENDIF.
    *-- Read dataset and pass it to an internal table.
          READ DATASET lv_dsn INTO lv_line.
          CLEAR wa_eord.
          wa_eord-matnr = lv_line+0(18).
          wa_eord-werks = lv_line+18(4).
          wa_eord-vdatu = lv_line+22(8).
          wa_eord-bdatu = lv_line+30(8).
          wa_eord-lifnr = lv_line+38(10).
          wa_eord-ekorg = lv_line+48(4).
          wa_eord-meins = lv_line+52(3).
          wa_eord-autet = lv_line+55(1).
          wa_eord-feskz = lv_line+56(1).
          IF NOT wa_eord IS INITIAL.
            APPEND wa_eord TO pr_eord.
          ENDIF.
        ENDDO.
    *-- Close Dataset .
        CLOSE DATASET lv_dsn.
      ENDIF.
    Regards,
    Prashant

  • Setting up archive delete functionalities using background job

    Hi,
    Through SARA transaction there we can set up a archive delete job by selecting the files, job timing details. Instead of this, we want to set up this functionality using a background job as per the variant and timing requirements.
    Is there any option to set up a background job of archive delete functionality by selecting the files through a program or function moduel. Please suggest me if anyone has done this in previous.
    Thanks,
    Siva

    Hello,
    Take a look at OSS note 205585 which describes how to schedule archive delete jobs indirectly using program RSARCHD.
    Hope this helps.
    Best Regards,
    Karin Tillotson

  • Trying to download xls file with IE7 but browser tries to download as htm

    Hi!
    I have got a problem with downloading files using a hyperlink.
    I've got a hyperlink and i did set the url property to: /resources/file.xls
    when using IE7 and clicking Save As... the save as dialog appears and suggests file.htm as the filename and the file typ is shown as: HTML Document
    Firefox works fine, it suggests file.xls and the type as: Microsoft Office Excel 97-2003 Worksheet
    Next i typed in the url of the resource folder: http://localhost:29080/myProject/resources/
    The file was shown as file.xls in the directoy listing, but when i tried to download the file from here, both browsers behaved the same way as before.
    gif-files and others worked fine in both browsers.
    Does anyone have an idea?
    greets,
    Remi

    I'd first try downloading an installer from the Apple website using a different web browser:
    http://www.apple.com/itunes/download/
    If you use Firefox instead of IE for the download (or vice versa), do you get a working installer?

  • Issue in downloading the file to application server (background)

    i am downloading the PIR records to the application server.
    the program is running fine .
    i m using background coz i m downloading large no of records (>5000)
    my actually target is 28000 records.  we are spliting it up into atleast 7000 records at a time.
    for 1000 records  , it is taking     217 secs        (this is fine)
    for 2000 records  , it is taking    1647 secs        (not satisfactory)
    for 5130 records  , it is crossed more than 10647 secs   still running  (not acceptabe)
    why is it increasing in expotenial of time for increase in the records
    why not ~1000 sec for 5130 records...??
    somebody help me , the hav check the extended check and fine tuned the code.
    it is a modification of standard program RM06IBIE for download of PIR records.
    regards
    venkat.

    Hi,
    It is definitely because of the poor performace in the code only.
    Try using, FOR ALL ENTRIES, SORT BY key fields, DELETE ADJACENT DUPLICATES from the internal table COMPARING key fields, etc.
    If you have already used all the possible ones, then check the table from which it is picking the data.
    Whether they are using the primary key fields in the where condition, if they are using some other fields, then go for an option of secondary index if required.
    Regards,
    Santhosh.

Maybe you are looking for

  • Out of Order Coverflow

    Ok, so on my 8g ipod nano(3g), some albums in coverflow appear at the very end of all the albums. Like Bob Dylan appears behind Wolfmother. But its only certain albums, and its the same ones every time. Help? P.S. I've posted this on other forums (cn

  • Can't sync between moble me calendar and outlook calendar

    I downloaded the newest version of iTunes, checked my preferences. i hit "sync" and it seems to go ok, no error message, but nothing is in my outlook calendar. any advice??

  • RemoteFX: Guest OS Driver Unknown

    Installed a Sapphire AMD FirePro V5900 GPU in a HyperVisor server with a Xeon E5504 and running Windows Server 2008 R2 Standard, so the HyperVisor is working and Hyper-V manager recognizes and attaches the RemoteFX 3D Video adapter to the guest VM co

  • Need to access R3 using IConnectorServiceGateway from portal service.

    Hi everyone, I need to access R3 using IConnectorServiceGateway from portal service but unable to access so as I don't get the IPortalComponentRequest. Can anyone help me out on how should i do the connection ? Please let me know as soon as possible.

  • Capture Problems URGENT...

    I have rented a Panasonic AJ-SD93 vtr to capture footage in dvcpro format. When I attempt to capture, the error reads: "Capture encountered a problem reading the data on your source tape. This could be due to a problem with the tape. Capture has been