Download excel file template on desktop

Hi all,
I am working on a requirement in which I am creating an excel file template on the user's system on the click of a pushbutton. The path of the file has to be given by user in an input/output field provided.
Now the user can enter this path manually or through F4 help. I want to put a check on this path such that it should exist in the user's system.
I am using MS_EXCEL_OLE_STANDARD_DAT
FM for creating an excel file template.
How to check that?
Regards
Natasha Garg

REPORT ZCREATEEXCEL.
TYPE-POOLS OLE2.
DATA: EXCEL     TYPE OLE2_OBJECT,
      WORKBOOKS TYPE OLE2_OBJECT,
      WORKBOOK  TYPE OLE2_OBJECT.
DATA: FILENAME LIKE RLGRAP-FILENAME.
START THE EXCEL APPLICATION
  CREATE OBJECT EXCEL 'EXCEL.APPLICATION'.
  PERFORM ERR_HDL.
PUT EXCEL IN FRONT
  SET PROPERTY OF EXCEL  'VISIBLE' = 1.
  PERFORM ERR_HDL.
INFORM USER OF THE CURRENT STATUS
  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
       EXPORTING
            PERCENTAGE = 0
            TEXT       = TEXT-I08
       EXCEPTIONS
            OTHERS     = 1.
CREATE AN EXCEL WORKBOOK OBJECT
  CALL METHOD OF EXCEL 'WORKBOOKS' = WORKBOOKS.
  PERFORM ERR_HDL.
  CALL METHOD OF WORKBOOKS 'ADD' = WORKBOOK.
  PERFORM ERR_HDL.
EXCEL FILENAME
  CONCATENATE SY-REPID '_' SY-DATUM6(2) '_' SY-DATUM4(2) '_'
              SY-DATUM(4) '_' SY-UZEIT '.XLS' INTO FILENAME.
  CALL METHOD OF WORKBOOK 'SAVEAS' EXPORTING #1 = FILENAME.
  FORM ERR_HDL.
  IF SY-SUBRC <> 0.
    WRITE: / 'OLE ERROR: RETURN CODE ='(I10), SY-SUBRC.
    STOP.
  ENDIF.
ENDFORM.

Similar Messages

  • URL Link on downloaded Excel File

    Hi,
    I have got a requirement.
    For study and analysis purpose user download data on excel file from OCOD. Struture(Contents) of downloaded excel file is same as screen.
    But the problem is when user click on 'DETAIL' (which has URL link) he/she is directed to Live OCOD and asked for log in with ID and Password, even if
    user is logged in OCOD.
    What i want to do is.
    1) Download Excel file without any URL link.
    2) If 1) is not possible then do not want to have 'DETAIL' option of downloded file.
    3) Method for avoiding relog into OCOD.
    Thanks in Advance
    Yuj

    Yuj, within the application click on the Training and Support link in the upper right, then click on Add-On Applications, then click on Reports and Analysis for Excel Template. In order to take the webinar click on Browse Training, then click on Training Resources by Job, then click on All Users, then click on Using Mail Merge for Word and Reports and Analysis for Excel with Oracle CRM On Demand.

  • Can't open Excel files saved to desktop, get popup "There was a problem sending command to the program".

    Whenever I save an MS Excel file to my desktop, it creates an icon on the screen. But when I try to open it, I get a popup that says "There was a problem sending the command to the program."
    This happens with all Excel files - but MS Word and other files work fine.
    Thanks for your help.

    Yes, I saw that earlier but it seems to be a temporary fix. I had the same issue return 2 weeks ago, then again yesterday. Each time, I've tried this solution which works but only to see it return at some time in the near future.
    Coincidently, I have a similar issue occur on my iPhone 4S w/ iOS 6. There, my keyboard shortcuts won't work in forms unless I tick off Data and Documents iCloud setting, power down the phone, then turn it back on. But like this, it only seems to work for a temporary time and the problem resurfaces in a few days.

  • In SAP Webdynpro using ABAP,how to colour the downloaded excel file?

    Hi all Experts'
    I have downloaded the data from the webdynpro application into an excel file in the presentation server using a custom button in a layout of a view in the webdynpro component.
    Now the requirement is to colour the column heading names and the downloaded excel file should show the full column length.
    Could anybody help me on this how to do this two things.
    Thanks in advance.

    Hi,
    You can use this function GUI_EXEC.
    Let say you want to use winzip to zip the file then what you should do like this:
    use this command --> ' -min -a D:\WALCOTT.ZIP D:\MBARANG.TXT'
    D:\MBARANG.TXT --> path to the file you want to Zip
    D:\WALCOTT.ZIP --> result zip file
    The command above is depends on the software you use to zip.
    then
      DATA: cmdguiexec(150).
      cmdguiexec = cmd.
      CALL FUNCTION 'GUI_EXEC'
        EXPORTING
          command          = cmdguiexec.
    Hope this help you.
    Best Regards,
    Victor.

  • Download Excel file from  from a second server

    Hi,
    In our Java based web application (jsp pages) users need to download Excel files stored on a different server (business tier) than the first application server server that hosts only the presentation tier.
    For security reasons users don't access the second application server. From a technical point of view what's the best solution to answer this requirement ? The logic should be the following: the user clicks on a report name that is displayed on this browser, the request is sent to the first application server that will retrieve the report stored on a second server and will return it to the user.
    Thanks a lot.

    it's been a while since i've done ejb stuff, but i believe you can configure an ejb to "runas" a different user. so, you would configure an ejb on the accessible server to "runas" a user who has access to the secondary server.

  • Filename of downloaded Excel file

    I frequently download Excel files from a website that seems for the most part windows centric. These excel files have an extension of .xls, I can double click them to open, but when opened they just have the file name of WORKSHEET. If I rename the file in the finder the same thing happens. If I try to open the file in numbers I get something like
    <table border="1">
    <!-- <tr><td colspan = "15" valign="middle" align="center">Date: 8/1/2008</td></tr>-->
    <!-- <tr><td colspan = "15" valign="middle" align="center">Investor's Business Daily Æ</td></tr> -->
    <tr><td colspan = "15" valign="middle" align="center">Investor's Business Daily 100</td></tr>
    <tr><td colspan = "15" valign="middle" align="center">Data as of 8/1/2008 market close</td></tr>
    Any idea? Now I have to open the file in excel, then do a save as, type in the file name (if I don't want WORKBOOK), then delete (or write over) the original file. What can I tell the website people?

    Hello ,
    In my procedure i am passing id and with the help of that id , ia am fetching values from the database.
    i have declared on clob type variable say v_insert where i am storing table structure(like worksheet) which i need on excel
    example
    v_insert := v_insert||'<tr>';
            v_insert := v_insert||'<td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td><b>Column1_Value</b></td> <td>abc</td>';
        v_insert := v_insert||'</tr>';then i am converting that clob into blob and storing the content into BLOB type variable say v_blob
    below is the code used for downloding the blob content.
    wpg_docload.download_file(v_blob);Thanks,
    Jitendra

  • I have random excel files on my desktop that cannot be deleted. What are these and how can I trash them?

    I have random excel files on my desktop that cannot be deleted. What are these and how can I trash them?

    They appear as mounted DMG files.If you right click on them mdo they have an Eject entry?
    Have you set the OS to Show All Files with a terminal command? If so take that off for now.
    Look in your Home folder (Users/UserName) and then the Desktop subfolder under it. Do you see all these files/folders/drives?

  • Where are the Download Excel Files going?

    Safari 6 seems to download Excel files as requested from a web site but they do not appear anywhere in the Download Folder I have specified. The site successfully downloaded the files before I upgraded to Safari 6. I now have to switch to Firefox to download these files.  Where are they going?

    Erik Lommers (guest) wrote:
    : What happened to the files? Yesterday I tried to download the
    : different trunks of the ora805 file and suddenly everything
    : stops.
    : The ftp-server is there, but the whole linux directory is gone!
    : Does anyone have an explanation?
    : When will the files be available again?
    Point your browser to:
    http://www.oracle.com/products/trial/html/trial.html#oracle8
    null

  • Dump - While downloading Excel file in Back Ground job.

    Hi Friends,
    I am running a report program in BackGround mode and Downloading an Excel file.
    Getting the following dump report. (Working in 4.6C)
    ABAP/4 processor: RAISE_EXCEPTION
    Job cancelled
    Help me to resolve this.
    000380       CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
    000390         EXPORTING
    000400           DIRECTORY                   = FILE
    000410           FILTER                      = ''
    000420           FILES_ONLY                  = 'X'
    000430   *    DIRECTORIES_ONLY            = 'X'
    000440         CHANGING
    000450           FILE_TABLE                  = filetab
    000460           COUNT                       = count
    000470         EXCEPTIONS
    000480           CNTL_ERROR                  = 1
    000490           DIRECTORY_LIST_FILES_FAILED = 2
    000500           WRONG_PARAMETER             = 3
    000510           ERROR_NO_GUI                = 4
    000520           others                      = 5.
    000530
    000540       IF SY-SUBRC <> 0.
         >         RAISE CNTL_ERROR.
    000560       ENDIF.
    I am calling the methods as shown below.
    CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          filename                = l_file
          write_field_separator   = 'X'
        CHANGING
          data_tab                = i_header
        EXCEPTIONS
          OTHERS                  = 22.
      IF SY-SUBRC NE 0.
       MESSAGE S208(05) WITH 'File download is failed'.
      else.
       MESSAGE S208(05) WITH 'File downloaded to specified path'.
      ENDIF.
      CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          filename                = l_file
          append                  = 'X'
          write_field_separator   = 'X'
        CHANGING
          data_tab                = i_output
        EXCEPTIONS
          OTHERS                  = 22.
      IF SY-SUBRC NE 0.
       MESSAGE S208(05) WITH 'File download is failed'.
      else.
       MESSAGE S208(05) WITH 'File downloaded to specified path'.
      ENDIF.
    Regards,
    Viji

    HI Vijayalakshmi,
    you are using cl_gui_frontendsevices...class in background...
    Is it possible to use this class in the background??
    Plz check once...
    Regards,
    Vamshi

  • How to download Excel file in JSP Page

    Actually I have a page
    Where I am uploading the files to server and it is listing the files which are all uploaded to the server.
    If I try to click the file which is uploaded it has to download to the local system.
    DOC, TXT, PDF, PPT. These file formats are try to download to local. But Excel file, opening the file content only not downloading to local.
    Any solution

    Hi Bangalore:
    As my experience,there may be some symbol such as "\r\n" was added in the content of the Excel file you want to download. this is no porblems to text format file, but to binary format file, such file can not be open. So I suggest you check-up the content of the file befor it was writed to the client, remove unwanted symbol, it should be word!
    I'm a newer to the here , and my english is poor. I thirst for intercommunion, I'm sorry for the syntax error in my reply.

  • Download Excel file through Web dynpro with no windows open?

    Can we have a web dynpro application that just returns an Excel file in the response with no open windows? Similar to a java servlet that is used to download a Excel file?
    This basically means that I cannot use wdComponentAPI.getWindowManager().createNonModalExternalWindow()
    Java Servlet Code
    HttpSession session = request.getSession();      // get a handle on the session id
    response.setContentType("application/download");
    response.setHeader("Content-Disposition", "filename=RTIS_Report.xls");
    PrintWriter out = null;
    out = response.getWriter();
    String report = request.getParameter("REPORT");
    JCO.Table lines = download(request, session, report);
    for (int i = 0; i < lines.getNumRows(); i++) {
         lines.setRow(i);
         String content = lines.getString("LINES") + "\n";
         out.write(content);
         out.flush();
    out.flush();
    out.close();

    Hi,
    I think you can use IWD Cached Web Resource to achieve this..
    See the below code FYI..
    public void downloadToExcel( )
        String fileName = "Customer" + ".xls";
         IWDCachedWebResource cachedExcelResource = null;
         try
              File f = new File("Customer.xls");
              WritableWorkbook workbook =   Workbook.createWorkbook(f);
              WritableFont black = new WritableFont(WritableFont.createFont("Trebuchet MS"),WritableFont.DEFAULT_POINT_SIZE,WritableFont.BOLD,false,UnderlineStyle.SINGLE,Colour.BLACK);
              WritableCellFormat blackFormat = new WritableCellFormat(black);
              WritableFont blue = new WritableFont(WritableFont.createFont("Trebuchet MS"),WritableFont.DEFAULT_POINT_SIZE,WritableFont.NO_BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLUE);
              WritableCellFormat blueFormat = new WritableCellFormat(blue);
              WritableSheet sheet = workbook.createSheet("Customer", 0);
                   Label label;
                   String[] header={"Corporate Code","Batch ID"};
                   for (int i=0;i<2;i++)
                        label = new Label(i,0,header<i>.toString(),blackFormat);
                        sheet.addCell(label);
                   WritableCellFormat integerFormat = new WritableCellFormat(NumberFormats.INTEGER);
                   jxl.write.Number number;
                   // Reading the contents
                   for(int i=0;i<wdContext.nodeVn_DownloadToExcel().size();i++)
                        String strCorpName = wdContext.currentContextElement().getVa_CorpCode();
                        String strBatchID =     wdContext.nodeVn_DownloadToExcel().getVn_DownloadToExcelElementAt(i).getVa_BatchID();
                        label = new Label(0,i+1,strCorpName,blueFormat);
                        sheet.addCell(label);
                        label = new Label(1,i+1,strBatchID,blueFormat);
                        sheet.addCell(label);
                   workbook.setColourRGB(Colour.LIME, 0xff, 0, 0);
                   workbook.write();
                   FileInputStream excelCSVFile = new FileInputStream(f);
                   IWDCachedWebResource cachedWebResource = null;
                   if (excelCSVFile!= null)
                        cachedWebResource = WDWebResource.getWebResource(excelCSVFile, WDWebResourceType.getWebResourceType("xls","application/ms-excel"));
                   cachedWebResource.setResourceName(fileName);
              cachedExcelResource = cachedWebResource;
              wdContext.currentContextElement().setVa_DownloadToExcel(cachedExcelResource.getURL());
              workbook.close();
         catch (Exception ex)
              wdComponentAPI.getMessageManager().reportException("Error in Excel Download"+ex.getMessage(),false);
    Regards,
    Vijay

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

  • Strange: When download excel file from Apex, it ask XDB username/password.

    Hi
    I'm using Apex 4.0.1 on Oracle 10.2.0.3, I have a application where end user can upload some file(excel/PDF/Word) as an attachment and later on they will download. Everything is fine but one thing:
    When User press the download button, a popup window asking you whether you want to open it or save it. when it's PDF/Word file, all works fine no matter what you choose; but when it's an Excel file, if we try to open it(press the open), it will popup a window saying 'XDB need a username and password'. But if you ingore it, it did open the file without any issue; If user press Save button, no issue at all.
    So the app still work but it's kind of annoying..
    Any one seen this before? Any idea?
    Thanks
    Mike
    Edited by: mike on Feb 24, 2011 1:47 PM

    You should open the excel file in binary mode, in that case, no errors will occur.
    Also, there is a very good package located on
    http://stareyes.homeip.net:8888/. It's free. The only thing is the server open
    for a certain hours during the weekday. 11:00amp to 7:00pm New York time zone.

  • Problem in downloading excel file

    Hi,
    I am downloading output of SQ01 into excel file using BDC, but windows system stores the whole data in one cell of sheet instead of all other cells.
      Please anybody tell me solution.
    Thanks & Regards,
    Umesh

    Hi,
    Check the followinf code:
      IF sy-ucomm = 'DOWNLOAD' AND sy-lsind = 1.
        DATA: fullpath      TYPE string,
            filename      TYPE string,
            path          TYPE string,
            user_action   TYPE i,
            encoding      TYPE abap_encoding.
        CALL METHOD cl_gui_frontend_services=>file_save_dialog
          EXPORTING
            window_title         = 'Gui_Download Demo'
            with_encoding        = 'X'
            initial_directory    = 'C:\'
          CHANGING
            filename             = filename
            path                 = path
            fullpath             = fullpath
            user_action          = user_action
            file_encoding        = encoding
          EXCEPTIONS
            cntl_error           = 1
            error_no_gui         = 2
            not_supported_by_gui = 3
            OTHERS               = 4.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        IF user_action <> cl_gui_frontend_services=>action_ok.
          EXIT.
        ENDIF.
    Ascii download
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                        = fullpath
       FILETYPE                        = 'DAT'
      tables
        data_tab                        = itab.
      ENDIF.
    Hope it will help you.
    Regards
    Rajesh Kumar

  • Download excel file to pc from sap

    Hi Experts,
    My requirement is After running the load program, if there are any errors with any of the records in Excel file, create an error file in Excel format and download to the selected file location.  Give an information message to the user if the load was successful or any error file was generated. A output of the report should show how many records were created and a kick out list of those with error.
    Thanks in Advance.
    Moderator message : Spec dumping is not allowed, search for available information. Thread locked.
    Edited by: Vinod Kumar on Sep 19, 2011 9:25 AM

    Hi,
    get error records into an internal table and pass that internal table to function module
    CALL FUNCTION 'GUI_DOWNLOAD'

Maybe you are looking for

  • Purpose of having central adapter engine

    What is the purpose of having Centeral Adapter Engine when any WAS 6.40 has an adapter engine that can communicate de-centrally with the IS? Regards chandrakanth.K

  • Install Error 1714

    I currently have Adobe Acrobat 6.0 Standard on my PC running Windows XP.  I want to upgrade and have downloaded the trial version of Adobe Acrobat 9.0 Pro.  During the install I received "Error 1714" "The older version of Adobe Acrobat 9 Pro cannot b

  • Pre-fill the OLAP cache for a query on Data change event  of infoprovider

    Hi Gurus, I have to pre-fill the OLAP cache for a query,which has bad performance. I read a doc 'Periodic Jobs and Tasks in SAP BW' which suggested sum steps to do this i hav created the setting for Bex broadcasting for scheduling job Execution with

  • Dbconsole won't start in FC7

    Hi there, I am running oracle 11g on FC7 x86. Fresh install with all updates installed. I can get the listener up and running. That was not running, as it had the wrong FQDN. so I: $ vi /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora a

  • Linking FM 9 "At Insertion Point" graphics to an RH 8 project

    Using Technical Communication Suite 2, I have built a structured FM 9 book in order to generate a RH 8 help system. This is a software user guide and I cannot avoid using inline graphics in some body elements. The book only has regular .fm documents