Download the file

How to download the report output to the specified file
Edited by: Anil Reddy on Dec 19, 2007 9:35 AM

Hi Anil,
There are different ways to do this. There is the ALV option that comes with the ability to download into spreadsheet format, and you can also use OLE to run Excel & create a spreadsheet. Since it is a report you asked about, ALV is the more logical way to go.
OR
standard SAP functionality: (from the menu) System --> List --> Save -->Local File choose excel format.
or you can use the function module - GUI_DOWNLOAD for downloading the file to the presentations server.
Here i am copying a sample code for downloading a file using
GUI_DOWNLOAD.
This code download the data from table kna1 to a text file along the
header data.
TABLES:  KNA1.
PARAMETERS:  STATE LIKE KNA1-REGIO .
TYPES:       BEGIN OF OUTREC,
             KUNNR LIKE KNA1-KUNNR,
             REGIO  LIKE KNA1-REGIO,
             TELF1  LIKE KNA1-TELF1,
          END OF OUTREC.
TYPES:
BEGIN OF ty_output,
name TYPE dbfieldnam,
END OF ty_output.
DATA:
lt_dbfield TYPE STANDARD TABLE OF dbfield WITH HEADER LINE,
lt_output TYPE STANDARD TABLE OF ty_output WITH HEADER LINE.
CALL FUNCTION 'DB_GET_TABLE_FIELDS'
EXPORTING
field_info = 'A'
tabname = 'KNA1'
IMPORTING
SUBRC =
TABLES
dbfields = lt_dbfield.
LOOP AT lt_dbfield.
lt_output-name = lt_dbfield-name.
APPEND lt_output.
ENDLOOP.
DATA:     OUT_ITAB TYPE STANDARD TABLE OF OUTREC
             INITIAL SIZE 10 WITH HEADER LINE,
       IN_ITAB TYPE STANDARD TABLE OF OUTREC
             INITIAL SIZE 10 WITH HEADER LINE.
SELECT * FROM KNA1 WHERE REGIO = STATE.
     MOVE-CORRESPONDING KNA1 TO OUT_ITAB.
     APPEND OUT_ITAB.
ENDSELECT.
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
  BIN_FILESIZE                    =
    FILENAME                        =  'C:\XYZ.TXT'
   FILETYPE                        = 'ASC'
   APPEND                          = 'X'
   WRITE_FIELD_SEPARATOR           = 'X'
   HEADER                          = '00'
  TRUNC_TRAILING_BLANKS           = ' '
  WRITE_LF                        = 'X'
  COL_SELECT                      = ' '
  COL_SELECT_MASK                 = ' '
  DAT_MODE                        = ' '
  CONFIRM_OVERWRITE               = ' '
  NO_AUTH_CHECK                   = ' '
  CODEPAGE                        = ' '
  IGNORE_CERR                     = ABAP_TRUE
  REPLACEMENT                     = '#'
  WRITE_BOM                       = ' '
  TRUNC_TRAILING_BLANKS_EOL       = 'X'
  WK1_N_FORMAT                    = ' '
  WK1_N_SIZE                      = ' '
  WK1_T_FORMAT                    = ' '
  WK1_T_SIZE                      = ' '
IMPORTING
  FILELENGTH                      =
  TABLES
    DATA_TAB                        =  OUT_ITAB
   FIELDNAMES                    =   lt_output
   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 <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Reward points if useful.
Regards
Manoj Kumar

Similar Messages

  • I need help. My ipad 2 was stuck in recovery mode. i tried to connect it to itunes and restore but after downloading the file and extracting the software there is a pop up message that says "the device is full" i dont know what to do. Its been 2 days now.

    I need help. My ipad 2 was stuck in recovery mode. i tried to connect it to itunes and restore but after downloading the file and extracting the software there is a pop up message that says "the device is full. Deleting files and emptying your recycle been will help you restore." how am i going to erase files if i can't open my ipad. i dont know what to do. Its been 2 days now. please help. thanks.

    yes i am sure. This are the exact words... "The iPad "iPad" could not be restored. The disk you are attempting to use is full. (Removing files and emptying the recycle bin will free up additional space". i tried some options, hard reset, redsnow, tinyumbrella but still it's stuck.

  • HT1420 my laptop has been stolen. I have bought a new one but I can't download the files (movies, articles,...) that I have in my ipad into my new ipad so I can put some of them in my daughters mini ipad. How can i do it?

    My laptop has been stole. I have bought a new one but I can't download the files (homemovies, articles, presentations) from my ipad to the new laptop so I can share with my daughters in their mini ipads. Any ideas?
    I am working with Windows 8

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • Error While downloading the file A server Error has occurred, please try again later Downloading Yahoo mail Application Attachments  Trying to download My Photos and movie 3 items so i can delete them all

    I have icloud and a new iPhone5 ! They work good , took pictures and a few short movies, plugged in my phone to my iMac transfered Items to iPhoto then inported items to iMovie. when getting to know what i was doing i decided to delete pictures and movies i no longer wanted. when i looked for a few missing items i opend Finder and there some where buyt i had already trashed them and deleted the doubles. Still could not find missing pictures and movies 3 items and today after calling yahoo about a different complant with sending feed back for Yahoo mail Applications login . i opened up Attachments Not the Large Attachments just Attachments and there were the 3 items i had been hunting for to Trash and delete. the mail Attachments file does not have the Option to delet Files and photos and movies. When i tried to Download the 3 items a window shows up that says Error While Downloading the Files, A Server Error has occured, please Try Again later. nothing works how do i remove the Trapped photo and movie Blank Files and trash them?  Onece they get into my downloads i can do something with them as i understand.    That part of it kind of keeps me in Question also because why should i have to down load my own files of Attachments / Pictures and movies if they are comming from my iMac?    How much better is iLife11 then iPhoto08 and iMovie08 .  Thanks Greg

    Hello,
    Thank you for your post.
    This is a quick note to let you know that we are performing research on this issue.
    If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Simon Wu
    TechNet Community Support

  • Download the file to apllication server

    hai all,
    My requirement is i need to download the file in application server and i need to validate the file path that file already exist or not if exist it has to give the error message
    How can i do that.
    Pls send the fn modules are methods which is suitable for my requirement with code.
    I will reward the points,
    Thanks in advance
    Laxmi

    HI,
       report zexternalfile .
    tables : zzpublisher,
             sscrfields.
    data: it_publisher like standard table of zzpublisher,
          wa_publisher like zzpublisher.
    select * from zzpublisher into table it_publisher.
    call function 'GUI_DOWNLOAD'
      exporting
      BIN_FILESIZE                  =
        filename                      = 'C:\externalfiles\kamal.XLS'
      FILETYPE                      = 'ASC'
      APPEND                        = ' '
        write_field_separator         = 'X'
      HEADER                        = '00'
      TRUNC_TRAILING_BLANKS         = ' '
      WRITE_LF                      = 'X'
      COL_SELECT                    = ' '
      COL_SELECT_MASK               = ' '
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
      tables
        data_tab                      = it_publisher
    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 <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    <b>Reward useful points,</b>
    siva

  • Gui_download function to download the file in application server in bdc

    Can we use gui_download function to download the file in application server in bdc?
    Regards,
    pandu.

    for downloading the file on application sever you use the concept of Dataset. GUI_DOWNLOAD is for presentaion server.
    regards
    Abhi

  • One field is missing in downloading the file from report

    Hi Friends,
    I have a problem with downloading the file from SAP.
    Actually the report has to download 6 fields from the list of the report to a .txt file on the presentation server. But it is downloading only 5 fields. The missing field is DEA#. Actually now i have to fix that problem.
    I found that in the download process they have not inlcuded the DEA# field.
    Here in this 1 field is not getting dowloading from the list of the report to the text file.
    I'm giving a portion of the code.
    Like this they r calling the FM:
    FORM DOWNLOAD_FILE.
      CALL FUNCTION 'DOWNLOAD'
           EXPORTING
                FILENAME = P_OUTFIL
           TABLES
                DATA_TAB = I_OUTPUT.
      IF SY-SUBRC <> 0.
        WRITE:/ 'Error downloading file'.
      ENDIF.
    in code we have,
    data: v_output type t_output,
    data: i_output type t_output occurs 0.
    and,
    BEGIN OF T_OUTPUT,
           RECORD(200),
           END OF T_OUTPUT.
    when i debug the program,
    the record field is showing only the 5 fields not the missing 6th filed)DEA#).
    and we have another FORM :
    *&      Form  FORMAT_FILE_WITH_TABS
          Insert tabs between fields so when uploaded in Excel, the
          record will be separated into columns where a tab is found.
    FORM FORMAT_FILE_WITH_TABS.
      LOOP AT I_KNA1 INTO V_KNA1.
        CONCATENATE: V_KNA1-KUNNR
                     V_KNA1-NAME1
                     V_KNA1-NAME2
                     V_KNA1-STRAS
                     V_KNA1-ORT01
                     V_KNA1-REGIO
                     V_KNA1-PSTLZ
           INTO V_OUTPUT SEPARATED BY C_TAB.
        APPEND V_OUTPUT TO I_OUTPUT.
        CLEAR V_OUTPUT.
      ENDLOOP.
    ENDFORM.                               " FORMAT_FILE_WITH_TABS
    If you look into this FM, there is no mention of DEA# field,
    i hve tried to correct it by adding the "v_likp_dea" in the FM. when i did like this it is showing the DEA# field in the downloaded .txt file but only 1 value for all the records.
    My question is for each record i have to show its unique DEA#.
    I guess i could do this by putting it in loop, could anybody tell me how i can i do that, Please
    Thank you very much.
    Raj.

    In the subroutine format_file_with_tabs ,
    You should read  it_likp with the key that uniquely identifies for dea# . This should be done in the loop at i_kna1.
    Suppose kunnr identifies a unique dea# in it_likp internal table , then you should write
    FORM FORMAT_FILE_WITH_TABS.
    LOOP AT I_KNA1 INTO V_KNA1.
    clear v_likp.
    read table it_likp into v_likp
       with key kunnr = v_kna1-kunnr binary search.   (should sort the itab to use binary search with read. )
    CONCATENATE: V_KNA1-KUNNR
    V_KNA1-NAME1
    V_KNA1-NAME2
    V_KNA1-STRAS
    V_KNA1-ORT01
    V_KNA1-REGIO
    V_KNA1-PSTLZ
    v_likp-dea
    INTO V_OUTPUT SEPARATED BY C_TAB.
    APPEND V_OUTPUT TO I_OUTPUT.
    CLEAR V_OUTPUT.
    ENDLOOP.
    ENDFORM. " FORMAT_FILE_WITH_TABS
    Message was edited by: Kalidas Cheroolil

  • I have Adobe Acrobat 7.0 Professional that I want to migrate to my newer laptop running Windows 7. I downloaded the file 22020134.exe to reinstall it on my new computer and I go through the hops and when I put in the Serial Number it tells me its invalid.

    I have Adobe Acrobat 7.0 Professional that I want to migrate to my newer laptop running Windows 7. I downloaded the file 22020134.exe to reinstall it on my new computer and I go through the hops and when I put in the Serial Number it tells me its invalid.

    22020134.exe is the file Adobe say you must download and run to instal Acrobat 7.0 Pro. I went through the  process, the one described in your link, I downloaded the file, ran it, it runs well, except it tells me my serial number is invalid. Now what? Does this mean I now have to discard my Adobe Acrobat 7.0 Professional and start again with a $500 purchase? All I want to do is transfer what I have to another computer.  

  • I can not do the update , what should I do to fix this error ? "There was a problem with downloading the file . For tips on troubleshooting , please go to Customer Support . ( Error code : 204 ) ." thanks

    I can not do the update , what should I do to fix this error ?
    "There was a problem with downloading the file . For tips on troubleshooting , please go to Customer Support . ( Error code : 204 ) ." thanks

    Hi,
    Please refer to the help document below:
    Error downloading, installing, or updating Creative Cloud applications
    Regards,
    Sheena

  • Problem with ipad 2 safari cannot download the file for windows live photo gallery

    on ipad 2 safari cannot download the file for windows live photo gallery

    What you can download via Safari on the iPad is very limited - you can only download apps from the iTunes app store on your computer to sync to the iPad, or from the App Store app directly on the iPad

  • How to download the file in as3.0

    hi
    in as3.0 click the button and download the file in the local path folder.
    how to write the code in as3.0. help me
    thks

    Search Google for a tutorial using terms like "AS3 FileReference download tutorial"
    Here is a link for that search...
    http://www.google.com/search?q=AS3+FileReference+download+tutorial&rls=com.microsoft:en-us &ie=UTF-8&oe=UTF-8&startIndex=&startPage=1&rlz=1I7GGNI_en

  • How to not append '.PART' to the file name of the currently downloading file, and just download the file with its normal filename

    In Windows, when Firefox (I'm currently using 7.0) downloads a file, it appends ''.PART'' to the file name of the currently downloading file and just renames it to its original file name after it finishes downloading.
    I sometimes like to watch a currently downloading video file, so it will be better if Firefox just downloads the file to its actual filename (like what Opera does), so I can easily double click the incompletely downloaded file and watch it with the video player assigned to that file extension, rather than the awkward ''Right click -> Open With -> Choose Default Program'' route with .part files.
    Does anyone know how to set Firefox to do this?

    It is possible that your anti-virus software is corrupting the downloaded files or otherwise interfering with downloading files by Firefox and prevents Firefox from renaming the .part file.
    Try to disable the real-time (live) scanning of files in your anti-virus software temporarily to see if that makes downloading work.
    See "Disable virus scanning in Firefox preferences - Windows"
    * http://kb.mozillazine.org/Unable_to_save_or_download_files

  • Cannot preview filetype please download the file for viewing and garbled text on a downloaded image

    Dear Madam or Sir,
    When I click on a file titled "Subject Access Request Letter re Account Number 12527629 Sort Code 60-10-34 24022015.pdf", which is stored in my Account on Acrobat.com I get the response "Cannot preview filetype please download the file for viewing". This file was created from an OpenOffice .odt document of the same title. Please advise.
    I downloaded an image, which purports to be a .pdf, from the Royal Mail Track & Trace web facility using my Samsung S5. The text that I expect to see might as well be hieroglyphics for all its similarity to text. Please advise.
    Regards,
    Ron Platt
    PS I have tried to attach both files (.pdf) but am advised "That image type is forbidden". Please advise.

    Hi Laura,
    I have found the solution to be:
       1. Not to upload to "Document Cloud" from the .pdf stored on my PC and
       open on screen.
       2. To login to Acrobat.com from the .pdf stored on my PC and open on
       screen, select "Document Cloud" and the sub-folder required and then upload
       the file
    I have a feeling that there is a glitch somewhere, because after I have
    opened a number of .pdf files stored on my PC, and irrespective of whether
    I have closed them prior to opening the next .pdf file or left them open,
    Acrobat Reader will display (Not responding) in the window title bar. The
    "number of files" equates to less than 10. I, then, click on the X at the
    right of the window title bar and I am given the option of "Close the
    program" or "Wait until the program responds" (or words to that effect). If
    i choose the latter, nothing happens and I am back at the unhappy status
    quo. If I choose the former, I am told that Windows is searching for a
    solution, which it never finds. I, then, have to shut down the PC and then
    start it up, again. Clicking "Restart" does not solve the problem.
    I have described the above before and received the usual "it cannot be
    Acrobat, it is perfect" response. I could, I suppose, screenshot/snip every
    sequential screen but why should I have to when I have described the
    sequence as fully as I can. So I have found a "workaround" that does not
    solve the "Not responding" problem but does solve the problem of not being
    able to upload from the open .pdf file to the sub-folder in "Document
    Cloud". I am, on occasion, working through the myriad of .pdf files that
    are in the root folder of "Document Cloud" and putting them in the correct
    sub-folder(s).
    I have today read that Google is starting a cellphone service in the USA in
    which a monthly "access" rental (US$20) is paid plus a GB capacity usage is
    elected for at a rate specified, e.g. US$10.00/GB. If the subscriber  does
    not use the elected GB capacity Google refunds the US$value of the unused
    elected GB capacity.
    Suggestion: Adobe applies that kind of policy to its online software
    package usage rates, e.g. I elect to subscribe to a particular level of
    online software package usage monthly, but, if I do not use all of the
    programs included in that online software usage package, I am credited back
    for not having used the softwares, that I did not use, that were inclusive
    in that online software package offer.
    Regards,
    Ron

  • I'm having problems downloading: the file cascades a bizzillion times on the screen and it appears to be a .part file.

    I'm on a Mac - my hard drive crashed last week (got a new one) so I downloaded the Firefox again. When I download, I can view my downloads under the "Tools" menu, but in my download file in my dock, the files say pdf.part - and when I download, the file cascades a bizzillion times (really annoying) and I have to quit out of Firefox to move forward.

    See [[Firefox keeps opening many tabs or windows]]
    You can have infinite tabs opening if you have selected Firefox as the application to handle a file if you get an Open with download window.<br />
    Firefox should not be selected as the application to handle a file and you have to remove the action that is associated with that file type.
    You can delete [http://kb.mozillazine.org/mimeTypes.rdf mimeTypes.rdf] in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder] to reset all actions or set that action in Tools > Options > Applications to 'Always Ask'.
    See http://kb.mozillazine.org/File_types_and_download_actions ("File handling in Firefox 3 and SeaMonkey 2" and "Reset Download Actions")

  • IB- Downloading the file and send it to the user

    Hello BW gurus,
    I have a question. I have automated the ECC Z table loading process. Like I have a program which will run the ztable update process logic and will update the table and after that it will raise an event in the BW system. Based on the event the process chain will be triggered.
    After the BW data load. I want to add an extract step like run the query and then download the file in excel format and send an email to the user. I know this has to be done by information broadcasting. I haven't looked at the documentation. Maybe you guys can explain to me like how to acheive this in the process chain.
    Thanks in advance for your help.
    Senthil

    Hello Gurus Any solution for the above issue. Thanks

  • Hey i have ios 4.3.5 on my ipad and i wanna update it to ios 5.1.1 and ive downloaded the file made by apple but every time i try to update it to ios 5.1.1 it allways says error 3194. can anyone help?

    hey i have ios 4.3.5 on my ipad and i wanna update it to ios 5.1.1 and ive downloaded the file made by apple but every time i try to update it to ios 5.1.1 it allways says error 3194. can anyone help?

    alanangert1 wrote:
    ... every time i try to update it to ios 5.1.1 it allways says error 3194. ...
    3194  = http://support.apple.com/kb/ts4451
    If the above Support Article does not resolve it... then you have a problem.
    Perhaps a Visit to an Apple Store or AASP (Authorized Apple Service Provider) is required..
    Be sure to make an appointment first...
    Note:
    That error message may be indicative of the Device being Hacked / jailbroken.... If this is the case then you are on your own.
    Unauthorized modification of iOS...
    http://support.apple.com/kb/HT3743

Maybe you are looking for

  • Recording hd video on iphone 4, better in imovie app, or desktop?

    For some reason, my imovie recordedo on my iphone and imported looks worse on the desktop version than on the app. Anyone know what parameters or settings should be used to import the iphone 4 hd videos into the desktop version? I would rather use th

  • How to do join in BMM layer.

    Hi Guys, i am using Argus safety application for analytics. i need some help. here i am explaining my scenario. CASE_MASTER is my main fact table. Dim_Prefferd_Term (1)-------------(M) Map_PrefferedTerm_CaseId (M)----------------- (1) Case_master (1)

  • About LTS

    Hi friends, Can any one tel me 1. How many LTS's we can create in one logical table? 2.Is it possible to create hierarchy for year with out quater level ( directly year to month) if so then how? 3.Where will we find sql query other than default file(

  • Reader Extend to use Web Service?

    Quick question that I can't seem to find an answer for, do you need to Reader Extend a form to be able to use a Web Service in Acrobat Reader through Workspace??? Thanks

  • Active directory response: 00002098: SecErr: DSID-03150A48, problem 4003 (INSUFF_ACCESS_RIGHTS), data 0

    Hi All, I have just added my first 2010 exchange server to our organisation. Upon trying to enter the product key, i get the following: Error: Active Directory operation failed on DC01.myorg.com. This error is not retriable. Additional information: I