Hi list should be saved as .xls file on desktop.

hi,
my scenarios is as follows:
In Selection i have some input fields and select options. upon executing the report , the report output(list) should be saved as excel file. the name of the excel file should be what we mention in the selection screen.( option should be provided parameter ,like browse option)
please help me..
Thanks  & regards
Raju Mummidi

Hiii!
  Try out this code
REPORT  z_FILE_DOWNLOAD.
DATA: w_name(90) TYPE c.
DATA:
  BEGIN OF fs_flight,
    carrid   LIKE sflight-carrid,
    connid   LIKE sflight-connid,
    fldate   LIKE sflight-fldate,
    price    LIKE sflight-price,
    currency LIKE sflight-currency,
  END OF fs_flight.
DATA:
  t_flight LIKE
     TABLE OF
           fs_flight.
SELECT-OPTIONS:
  s_carrid FOR fs_flight-carrid.
PARAMETERS: p_name(90) TYPE c DEFAULT 'D:\'.
START-OF-SELECTION.
  SELECT carrid
         connid
         fldate
         price
         currency
    FROM sflight
    INTO TABLE t_flight
   WHERE carrid IN s_carrid.
w_name = p_name.
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
*   BIN_FILESIZE                  =
filename = 'w_name'
   FILETYPE                      = 'ASC'
   WRITE_FIELD_SEPARATOR         = 'X'
  tables
    data_tab                      = t_flight
EXCEPTIONS
   FILE_WRITE_ERROR              = 1
   NO_BATCH                      = 2
   GUI_REFUSE_FILETRANSFER       = 3
   INVALID_TYPE                  = 4
   NO_AUTHORITY                  = 5
   UNKNOWN_ERROR                 = 6
   HEADER_NOT_ALLOWED            = 7
   SEPARATOR_NOT_ALLOWED         = 8
   FILESIZE_NOT_ALLOWED          = 9
   HEADER_TOO_LONG               = 10
   DP_ERROR_CREATE               = 11
   DP_ERROR_SEND                 = 12
   DP_ERROR_WRITE                = 13
   UNKNOWN_DP_ERROR              = 14
   ACCESS_DENIED                 = 15
   DP_OUT_OF_MEMORY              = 16
   DISK_FULL                     = 17
   DP_TIMEOUT                    = 18
   FILE_NOT_FOUND                = 19
   DATAPROVIDER_EXCEPTION        = 20
   CONTROL_FLUSH_ERROR           = 21
   OTHERS                        = 22
IF sy-subrc EQ 0.
  MESSAGE 'Download successful' TYPE 'S'.
ENDIF.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards
Abhijeet Kulshreshtha

Similar Messages

  • I received an email containing a spreadsheet created using Mac Office 2004 on my new MacBook Air equipped with Mac Office 2011.  When I saved the document, my Finder lists the document without the .xls file extension. Why?

    I received an email containing a spreadsheet created using Mac Office 2004 on my new MacBook Air equipped with Mac Office 2011.  When I saved the document, my Finder lists the document without the .xls file extension. Why?
    All other .xls documents created by Mac Office 2004 retained the .xls file extention when I migrated them over to the new MacBook Air.

    I know what happened.  When I saved the document I somehow hit the Hide File Extension box.  Sorry to trouble this group. I simply resaved it w/o activating the Hide File Extension feature.

  • Excel files are saved as HTML files

    Hi All,
    I am saving the output files into a shared location in excel or csv format. However when i ask the users/business to have a look into it then they say that the files are opening as html web page and not able to load properly.
    I checked it myself and found it true, all the xls and csv files are saved with .xls and .csv format only but when i try to open it and do as 'save as' then it by default tries to save it as a webpage. Is there any way i can correct this so the file is actually saved as xls only.
    Please suggest
    Thanks
    Ronny

    Hi Gareth,
    I am using BI Publiser to ftp my report to the shared location. This is what it involves
    [1] build the report in BIP
    [2] while scheduling the report in BIP use sftp option to save the output file to the shared location
    this is simple process to export the files to the desired location. Now while doing that ...i choose the output format ( template format) as excel and give the extension of the file as .xls.
    The files does get saved as xls file but then when i try to save that agian to another location by opening it than it, by default , tries to save it as web page ....similarly when i ask business to have a look at the output files and when they open it than it opens as a web page .....wheareas it should be an excel file ..
    Please revert if you require more elaborate explanation
    Thanks
    Ronny

  • Unable to access my .xls file in iPhone or iPad using Icould drive. Request help.

    I installed iCloud drive in my mac and saved a .xls file to be viewed and used with my iPad and iPhone. Though these devices are upgraded to IOs8 and Icloud drive is 'on' in these devices, I am unable to access this particular file in iPad or iPhone. Request help on how to open, view and amend files thru iPhone or Ipad.

    Do you have Excel installed on your iPad and iPhone? https://itunes.apple.com/us/app/microsoft-excel/id586683407?mt=8

  • SPD "The server could not complete your request" while "Saving the XOML file"

    Greetz!
    I'm trying to resolve an issue where a SharePoint Designer Approval workflow on a list fails while "Saving the XOML file". The workflow has been reduced to a single step for tests and it still fails.The more details dialog is empty.
    The Event Viewer does not record the event and no unexpected events show up in the logs.
    Any ideas on what might be causing this?
    Thanks!
    Love them all...regardless. - Buddha

    Hello Kansas,
      Did you ever get a solution for your publishing issue. I have been seeing the same problem and I am reading blogs that is pointing to a Feburary 2011 CU as the possible solution. http://support.microsoft.com/kb/2557533

  • Dreamweaver: files on desktop

    I am extremely new to Dreamweaver. I have been creating my first site. In all of the tutorials that I have watched, they all show for you to have your Dreamweaver files saved on your desktop. I was beginning to have a cluttered desktop so I decided to create a folder specifically for the Dreamweaver files and dragged and dropped them in. I went to preview my sight in the browser and my pictures show an X meaning that the link has been broken. I concluded that it must be because I moved the files into the new folder that I had created on my desktop. What I did next was to create a 'dummy' new site, using another new folder that I created on my desktop to store the new files in. I went to preview the 'dummy' site in the browser and it showed the X again where the image should be. My question is: is there another way to have your Dreamweaver files on your desktop, besides having them all individually spread out across? I want to keep things as organized as possible, so does Dreamweaver not recognize the files if you have them in a specifically created folder on the desktop for those files?
    Thank you. Any feedback would be much appreciated.

    I try not to save files to desktop.
    I think the tutorials were saving the tutorial files to desktop. I never save my Dreamweaver site files to desktop. I would create a folder in MY Documents, where the site files are.  Put your photos in the 'images' folder.

  • In file-save as there is a list of previously saved pages, how do I delete this list

    When I save a webpage or pdf document in Firefox there is an arrow in the file name box that gives a history list of recently saved items. How can I clear this list or delete items?

    hello, please install the search reset addon - it will revert the most common customizations those adware programs do in firefox back to the default: https://addons.mozilla.org/firefox/addon/searchreset/

  • I get a dialogue box asking "What should Firefox do with this file" Options open with or save file. My wife selected save file and now it only opens note pad and displays the text of the file to be saved. OK in windows Internet Explorer.

    I get a dialogue box asking "What should Firefox do with this file" Options open with or save file. My wife selected save file and now it only opens note pad and displays the text of the file to be saved. OK in windows Internet Explorer.

    P.S. Site is http://www.coldwatercreek.com

  • Unable to save xls file from website in the "Microsoft Office Excel 97-2003 Worksheet" format. The browser is saving in unrecognized "File" Type

    The version I am using is 3.6.11
    The file is stored in the server in the format "Microsoft Office Excel 97-2003 Worksheet"
    But when I download it, it gets saved in the unrecognized format type "File"
    The servlet code written to download the file sets the content type to "application/vnd.ms-excel"
    I am able to save the file in Microsoft Office Excel 97-2003 Worksheet format using Internet Explorer Browser without any issues.
    But it does not work with the Mozilla Firefox. Any plug-in needed to make it work?

    Did you try to add the .xls file extension yourself to those files?

  • Like many others, I`m a business man and in many ocasions I need to access xls files (Excel) but being able to change using macros like in simulators. I think apple should provide this in the iphone or maybe have some sort of app which we can use?

    I am a business man, and in many times a need a very important tool which I think an iphone should have which is some sort of app which will allow you to make changes to any xls file(Excel file).
    I find apps that allow me to see and open these files but do not allow changing numbers on files with Macros.
    A example is when you have a xls file using macros like in a simulator.
    You have to change the values according to different client and it just doesn`t allow you.
    I think iphone is a very decent phone but I just think that apple should povide this option to all users which would definately be alot happier.
    I work at a finance company and need to use finance simulators with Macros.
    Can you have an app that allows me to do this?

    Since Excel is a microsoft product, they would have to make the app.
    "So why does apple even open these files when they belong to Microsoft?"
    You prefer, since Apple does not make excel, that they not make it possible to even view an excel file?
    Odd take.  All or nothing?

  • Unable to open up pdf xls file on my computer ? what should I do ?

    UNABLE TO OPEN UP
    PDF XLZ DOWNLOAD ON MY COMPUTER
    . i CURRERTLY HAVE ADOBE READER. WHAT SHOULD
    i DO.

    It is an XLS FILE.Where do I find Exel ?
    F.H.O
    In a message dated 8/3/2010 6:30:42 P.M. Eastern Daylight Time, 
    [email protected] writes:
    Which is  it? A PDF or an XLS?
    Reader opens PDF's. Excel opens  XLS's.

  • Saving Query as xls file (I have searched and havent found this problem)

    I am trying to save a query as a xls file. The user can
    currently save the file to there desktop but excel warns them upon
    opening it that the file is associated with a different type of
    file do you want to continue. if you choose to continue then it
    will open up fine. so it kind of works. How can i get around this?
    i can't output it as a csv because there is comma's in some of the
    data i am outputting, and if i do a tab delimited then it is
    associated with notepad by default. here is my code:
    thanks, Drew

    Try:
    <cfcontent type="application/vnd.ms-excel">
    instead of
    <cfcontent type="application/msexcel">
    Also, for future reference, you CAN create a CSV file whose
    elements contain commas if you qualify the offending fields with
    quotation marks:
    Field 1, Field 2, "Field 3, and a comma", Field 4
    Excel will be able to open those up just fine.

  • Opening an .xls file and writing data to it....

    Hi ,
    I have written the following simple routine... which is supposed to open a .xls file and some data are written...:
    DECLARE
    application ole2.obj_type;
    workbooks ole2.obj_type;
    workbook ole2.obj_type;
    worksheet ole2.obj_type;
    worksheets ole2.obj_type;
    cell ole2.obj_type;
    --Declare handles to OLE argument lists
    args ole2.list_type;
    BEGIN
    application:=OLE2.CREATE_OBJ('Excel.Application');
    OLE2.Set_Property(application,'Visible', 'True');
    workbooks := ole2.get_obj_property(application, 'Workbooks');
    workbook:=OLE2.INVOKE_OBJ(workbooks,'Add');
    args:= ole2.create_arglist;
    ole2.add_arg(args, 'c:\example.XLS');
    workbook := ole2.invoke_obj(workbook, 'Open', args);
    ole2.destroy_arglist(args);
    args:=OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args, 1); 
    OLE2.ADD_ARG(args, 1);
    cell:=OLE2.Invoke_Obj(workbooks, 'Cells', args); 
    OLE2.DESTROY_ARGLIST(args);
    OLE2.Set_Property(cell, 'Value', 'Excel');
    args := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args, 0);
    OLE2.INVOKE(workbook, 'Close', args);
    OLE2.DESTROY_ARGLIST(args);
    OLE2.RELEASE_OBJ(cell);
    OLE2.RELEASE_OBJ(workbook);
    OLE2.RELEASE_OBJ(workbooks);
    OLE2.RELEASE_OBJ(application);
    OLE2.INVOKE(application,'Quit');
    END; but it does nothing.... it simply opens the Excel application..... How should I modify the routine in order to open the example.xls file and write some data to it .....???????
    Many thanks,
    Simon

    OK... I SOLVED THE PROBLEM.....
    Regards,
    Simon

  • Compare Server Names in Excel sheet from column1 with column 2 and exact matched server names should be saved in column 3 in same Excel sheet

    Hi Guys,
    First of all thanks in advance any help much appriciated.
    I am new in scripting and excel, i am looking for below solution as my job requires daily work of this kind and i came to know by automating this work lots of time can be saved.
    Compare Server Names in Excel sheet from column1  with column 2 and exact matched server names should be saved in column 3 in same Excel sheet.
    Looking solutions first using excel i.e.vlookup itself so that it will not require any approval in my job else using powersell ,vbscript.
    Once again Thanks for you guys.
    /Regards
    Nitesh24in

    Hi Edward,
    Thanks once again
    I have only changed excel file path and after that this is saved as below , i am not sure which three lines should be together in one line. Please advise.
    $excel = New-Object -ComObject Excel.Application
    $Workbook = $excel.Workbooks.Add("F:\NewDocsToReadNitesh26-May2013\Excel\test.xls")
    $WorkSheet = $Workbook.Worksheets.Item(1)
    $WorkSheet.Activate() | Out-Null
    For ($i=1;$i -le $worksheet.UsedRange.Rows.Count;$i++) {
       If ($worksheet.cells.item($i,1).value2 -eq $worksheet.cells.item($i,2).value2) {
          $worksheet.cells.item($i,3).value2 = $worksheet.cells.item($i,1).value2
    }$Workbook.Save()$excel.Quit()[System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$excel) | Out-Null
    Thanks and Regards
    Nitesh24in

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

Maybe you are looking for