How to download a file from application server to presentation server

Hi experts,
I want to download a file from application server to presentaion server, file contaims three fields customer name, customer email id and status..
help me out i m new into sap.

Dear Aditya,
Please check below thread
http://scn.sap.com/thread/1010164
it will help you.
BR
Atul

Similar Messages

  • How to download a file from Application Sever to Client Workstation?

    Hi All,
    I know how to move a file from client workstation to Application server.
    How to download that uploaded file from Application file (AL11)  directory to local desktop?
    Regards,
    Arun.M.D

    Hi Arun,
    Goto AL11 - > click on the directory path and select your file  -open the file - > click on menu item List - >save/send -> file
    -> select the type of file.
    Or you can write a small abap code using DATASETS. If you require I will post the code.
    Hope it helps you.
    Regards,
    Rajani.

  • How to download a file from application server in webdynpro

    Hi Experts,
                       I am trying to download a file through Web Dynpro file download UI element..The file is stored in application server in binary format ..in my code i am reading the file in binary mode,converting Binary File into Xstring(Using FM SCMS_BINARY_TO_XSTRING) ..getting its Mime type and binding the UI element properties (data with XString, Mime type and file name) with respective context attributes..But the problem is file is getting opened but Junk data is getting displayed on it..Not sure where i am making the mistake.

    Hi Lukas,thanks for the reply..please find the code
    here '/tmp/accenturedocs'  is the folder name on application server,and zdocs_list_tab is the table that contains file URL.File upload is on the BSP page (custom logic to upload the file ) where they are storing local file path in ztable.Same i am extracting in my code to get File URL.
    DATA: i_file TYPE rlgrap-filename .
      DATA:v_path TYPE zlist.
      DATA:i_datatab TYPE STANDARD TABLE OF tbl1024,
           wa_datatab TYPE   tbl1024.
      DATA  file TYPE  string.
      DATA dot_offset TYPE i.
      DATA extension TYPE mimetypes-extension.
      DATA mimetype TYPE mimetypes-type.
      SELECT SINGLE description
        FROM  zdocs_list_tab
        INTO v_path.
      CONCATENATE '/tmp/accenturedocs' v_path INTO i_file.
      FIELD-SYMBOLS <hex_container> TYPE x.
      OPEN DATASET i_file FOR INPUT IN LEGACY BINARY MODE.
      IF sy-subrc NE 0.
        MESSAGE e999(00) WITH 'Error opening file' .
      ENDIF.
      ASSIGN  wa_datatab TO <hex_container> CASTING.
      DO.
        READ DATASET i_file INTO <hex_container>.
        IF sy-subrc = 0.
          APPEND wa_datatab TO i_datatab.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET i_file.
      DATA:l_count TYPE i,
            l_len TYPE i.
      DESCRIBE TABLE i_datatab LINES l_count.
      READ TABLE i_datatab INTO wa_datatab INDEX l_count.
      l_len = XSTRLEN( wa_datatab-line ).
      l_len = l_len + ( l_count - 1 ) * 1022.
    DATA: v_xstring TYPE xstring.
      CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
        EXPORTING
          input_length = l_len
        IMPORTING
          buffer       = v_xstring
        TABLES
          binary_tab   = i_datatab
        EXCEPTIONS
          failed       = 1
          OTHERS       = 2.
      IF sy-subrc <> 0.
      ENDIF.
    file = i_file.
      " Find out file name extension
      FIND FIRST OCCURRENCE OF REGEX '\.[^\.]+$' IN file MATCH OFFSET
      dot_offset.
      ADD 1 TO dot_offset.
      extension = file+dot_offset.
      " Get mime type
      CALL FUNCTION 'SDOK_MIMETYPE_GET'
        EXPORTING
          extension = extension
        IMPORTING
          mimetype  = mimetype.
    DATA lv_file_content TYPE wd_this->element_context-file_content.
    get element via lead selection
      lo_el_context = wd_context->get_element( ).
    set single attribute
      lo_el_context->set_attribute(
        name =  `FILE_CONTENT`
        value =  v_xstring ).
    same way i am assigning file name and file mime type to context attributes.
    please suggest where is the mistake.

  • How to upload XML file from Application server.

    Hi,
    How to upload XML file from Application server.Please tell me as early as possible.
    Regards,
    Sagar.

    Hi,
    parameters : p_file type ibipparms-path obligatory.
    ***DOWNLOAD---->SAP INTO EXCEL
    filename1 = p_file.
    call function 'GUI_DOWNLOAD'
      exporting
      BIN_FILESIZE                    =
        filename                        = filename1
        filetype                        = 'ASC'
      APPEND                          = ' '
      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                        = it_stock
      FIELDNAMES                      =
    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.
    Regards,
    Deepthi.

  • Download text file from application server to client server.

    Hi all,
    I am facing a format issue while downloading text file from application server to the client machine.
    The issue is that, say I have 6 to 10 lines in my text file in application server. but when i store it on the hard drive,
    it shoes all the data in a single line. Where as i need to download data in same format as in application server.
    Awaiting for your responses.
    Regards,
    Jose

    Hi,
    If we want to upload file data from the application server to the internal table, there is no function module or class static method which we can use, we must wirte the code by ourselves.
    1. For the file data which has no seperator between field columns.
    PARAMETERS p_file  TYPE dxfile-filename.
    START-OF-SELECTION.
    OPEN DATASET p_file IN TEXT MODE ENCODING DEFAULT FOR INPUT.
      DO.
        READ DATASET p_file INTO gds_data.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        APPEND gds_data TO gdt_data.
      ENDDO.
    CLOSE DATASET p_file.2. For the file data which has tab separator between field columns.
    DATA: gds_field_split type gts_data.
    FIELD-SYMBOLS: <fs_field> TYPE gts_data.
    PARAMETERS p_file  TYPE dxfile-filename.
    START-OF-SELECTION.
    OPEN DATASET prf_file IN TEXT MODE ENCODING DEFAULT FOR INPUT.
      DO.
        READ DATASET p_file INTO gds_field.
        SPLIT gds_field  AT cl_abap_char_utilities=>horizontal_tab
             INTO TABLE gdt_field_split.
       LOOP AT gdt_field_split  into gds_field_split.
           gdf_index = gdf_index + 1.
           ASSIGN COMPONENT gdf_index OF STRUCTURE
                 gds_data to <fs_field>.
          IF sy-subrc = 0.
              <fs_field> = gds_field_split.
          ENDIF.
       ENDLOOP.
        APPEND gds_data TO gdt_data.
      ENDDO.
    CLOSE DATASET p_file.
    Thanks & regards,
    ShreeMohan

  • How to download a file from Path specifed

    Hi Frndz..
    How to download a file from a specified path like  , i have a file on server in the path like "C://temp/Sap.pdf"
    I want to download this to user desktop..
    Thanks in Advance
    regards
    Rajesh

    Hi,
    For file down load u have to use a UI element as "File download".
    u just create context attribute as setdownload_res and file data.
    setdownload_res as of type "com.sap.ide.webdynpro.uielementdefinitions.Resource" then bound it to the ui element "resource".
    file data as of type "com.sap.tc.webdynpro.progmodel.api.IWDInputStream"
    and set calcuclated as true and read only as true.
    then in doinit method u just write this code
    IWDAttributePointer attr = wdContext.currentContextElement().getAttributePointer("fileData");
    IWDResource res = WDResourceFactory.createResource(attr,null,WDWebResourceType.UNKNOWN);
    wdContext.currentContextElement().setDownload_res(res);
    wdComponentAPI.getMessageManager().reportSuccess(""+c);
    after this in the getter method u write this code
    IWDInputStream stream = null;
    try
    stream = WDResourceFactory.createInputStream(new FileInputStream(new File("<pathof the file to be download>")));
    catch(Exception e)
    e.printStackTrace();
    return stream;
    also look at this thread  How to DownLoad any type of File from the server(PDF,XLS,Word)
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/202a850a-58e0-2910-eeb3-bfc3e081257f
    PradeeP

  • How to download a file from the internet using terminal

    how to download a file from the internet using terminal
    does any one know how to download afile from the internet using the Terminal application?

    Use curl. Something like this:
    curl -O http://www.example.com/filename.zip
    For more info, type +man curl+.

  • How to download .doc file from ms sql

    Hi guys.,,,!
    I have a problem in file uploading and downloading. The problem is i upload my .doc file in ms sql server successfully completed. After that i would like to download the file from the database.can anybody tell that how to download the file from the database.

    mani_miit wrote:
    I have a problem in file uploading and downloading.OK.
    The problem is i upload my .doc file in ms sql server successfully completed. Sorry, I don't see a problem here? You said that it is successfully completed. Please elaborate the problem.
    After that i would like to download the file from the database.can anybody tell that how to download the file from the database.Just get an inputstream of the file from the database using ResultSet#getBinaryStream() and write it to the output of whatever UI technology you're using.

  • How to download a file from the net and save it into .txt format in a datab

    Can some one show me a tutorial on how to download a file from the net and save it into .txt format in a database?
    Thank you,

    http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html

  • How to download a file from AL11 inot Excel format without collapse the col

    Hi,
    Please suggest how to download a file from AL11 to Excel sheet.currenlty all field are merging into single column.I writing this file via using DATASET.
    Regards
    Ricky

    Hi,
       Try this code,
    ==============================================
    TYPES : BEGIN OF ty_emp,
              empno(2) TYPE c,
              empid(10) TYPE c,
              empname(3) TYPE c,
            END OF ty_emp.
    DATA : it_emp TYPE TABLE OF ty_emp,
            wa_emp TYPE ty_emp.
    DATA : pbk TYPE string.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_file TYPE rlgrap-filename.
    PARAMETERS : p_asfile TYPE rlgrap-filename.
    SELECTION-SCREEN END OF BLOCK b1.
    pbk = p_file.
    OPEN DATASET p_asfile FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      DO.
        READ DATASET p_asfile INTO wa_emp.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        APPEND wa_emp TO it_emp.
      ENDDO.
    CLOSE DATASET p_asfile.
    Filling the already created file with download PS radiobutton
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      BIN_FILESIZE                  =
          filename                      = pbk
      FILETYPE                      = 'ASC'
         append                        = 'X'
         write_field_separator         = ' '
      HEADER                        = '00'
      TRUNC_TRAILING_BLANKS         = ' '
      WRITE_LF                      = 'X'
      COL_SELECT                    = ' '
      COL_SELECT_MASK               = ' '
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
        TABLES
          data_tab                      = it_emp
    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.
    ==============================================
    Regards,
    Krrishna

  • HT6154 how to download the files from mail like gmail or yahoo or hotmail to my iphone 5s.I have not seen the option in my iphone 5s

    how to download the files from mail like gmail or yahoo or hotmail to my iphone 5s.I have not seen the option in my iphone 5s

    Download what files?
    What is the actual problem that is occurring?

  • How to display a file from Application server without downloading it to local drive

    I want to dispaly a file from Application server without downloading it to my local system.
    i tried the below method but it didn't work.
         CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
          EXPORTING
            APPLICATION            = L_FILE
            DEFAULT_DIRECTORY      = L_DIR

    Hi,
    Use open dataset to read file from application server.
    try like this sample code:
    data : p_file like ibipparms-path.
    data : rec(350) type c.
    data:  g_delimiter(1) type c value ','.
    maintain the file path in p_file. then
    open dataset p_file for input in text mode encoding default.
       IF SY-SUBRC = 0.
    do n times.
    READ dataset p_file into rec.
    split rec at g_delimiter into your internal table fields like it-id it-name it-age.
    append it.
    clear it.
    enddo.
    close dataset p_file.
    Now you have the data in internal table it.

  • How to download a file from server machine to client machine using jsp

    Hi,
    In my application, I have an excel file stored on my server machine. How can I download that excel file on to my client machine using jsp. Is there any other way I can open that file from my machine and save it in my machine using jsp/java?
    Its an emergency for me to do this.
    Can anyone provide me the full code to download a file from server machine as I don't have
    time to browse through various sites.
    thanks in advance,
    Tiijnar

    Please post your code using code tags (click on CODE above the text area, when posting)
    response.setContentType("application/octet-stream");Why octet-stream? Set the correct mime-type.
    String disHeader = "Attachment; Filename=\"filename\"";The filename should just be the file's name. Not the complete path to the file! This will tell anyone where the file is located on the server. It's also inconvenient because by default,the browser will suggest it as the name for the download.
    Your way of writing to the output stream is just plain wrong. See this snippet (picked from [http://balusc.blogspot.com/2007/07/fileservlet.html])
            BufferedInputStream input = null;
            BufferedOutputStream output = null;
            try {
                // Open streams.
                input = new BufferedInputStream(new FileInputStream(file), DEFAULT_BUFFER_SIZE);
                output = new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE);
                // Write file contents to response.
                byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
                int length;
                while ((length = input.read(buffer)) > 0) {
                    output.write(buffer, 0, length);
                // Finalize task.
                output.flush();
            } finally {
                // Gently close streams.
                close(output);
                close(input);
            }

  • How to download a file from server?

    Hi everyone,
    I need to download a file from my server to client machine. I got a sample code from ur forum and I modified it slightly.
    //Snippet of code:
    public void doGet(HttpServletRequest req, HttpServletResponse res)throws
         ServletException, IOException{
    int bytesRead=0;
         int count=0;
         byte[] b1=new byte[1];
         //OutputStream out=res.getOutputStream();
         res.setContentType("application/html");
         //Create an input stream from file URL.
         String fileURL="http://localhost:8080/webapps/upload/upload.html";
         BufferedInputStream bis=null;
         BufferedOutputStream bos=null;
         boolean download=false;
         res.setHeader("Content-disposition", "attachment; filename=upload.html " );
         try{
         URL url=new URL(fileURL);
         URLConnection connection=url.openConnection();
         InputStream in=connection.getInputStream();
         bis=new BufferedInputStream(in);
         FileOutputStream fileout=new FileOutputStream("upload.html");
         bos=new BufferedOutputStream(fileout);
         while(-1 != (bytesRead = bis.read())){
         try{
         bos.write(bytesRead);
         bos.flush();
         }//end of try forwhile loop
         catch(SocketException e){
         setError(e);
         break;
    The code is getting compiled, when I run the appln using the URL,
    http://localhost:8080/upload/servlet/DownloadFile
    it opens a pop up dialog box, asking whether to "open", "save" or "cancel" buttons. When I try to open a file, I'm getting a blank page.
    I'm not getting the contents of the file.
    So pls can anyone tel me wht's wrong in the code or do i need to add few more lines in my code?
    Also pls let me know, how can I download any files of type .doc, html, .txt, .zip, or any type, without mentioning the file type?
    Thanks in advance

    Do not use a FileOutputStream (that will save it locally to the server). Call HttpServletResponse.getOutputStream(), which will send it back to the browser. Also remember to call close() on the stream at the end.
    - Saish

  • Applet question, how to download resource files from server

    hi,
    i am new at applet world.
    i have an applet that reads some resource, data and configuration files. so i need to download these files from server to client. i did some resarch and could not find how to download files from server in an applet application.
    how can i do this task?
    thank you for your answers.

    You may want to distinguish between 'resources' and data/configuration files.
    'Resources' are non-class files that are part of your application, i.e without them the application would simply not work, just like class files.
    Those are typically images, sounds or resource bundles (GUI elements translated to different languages) that nobody except you, the developer, would touch (when releasing an upgrade or a patch).
    Those should just go into the applet jar or additional jars named in the applet tag.
    Data/configuration files, that may be changed by others than the developers, should be made available through HTTP, just like the applet jar itself. The applet will have (read) access to them using java.net.URLConnection.

Maybe you are looking for

  • Funky radio buttons... help?

    Hey - I'm having some trouble with my radio button components. The problem is that the text lables for the buttons are displaying wrong (clipped at bottom and/or right side) until you mouse over them. After that, they correct themselves and they are

  • Open Query issue in SQL server 2005

    I am running following query in SQL Server 2005, remote connection is Oracle. Query runs perfect in oracle. Any help would be greatly appreciated. Error is:   OLE DB provider "MSDAORA" for linked server "ORACLEROSTER" returned message "ORA-00911: inv

  • Reset variable screen

    Hello Experts, How to re-set the variable screen to default in a WAD. I tried using option reset variables to default in WAD but its still not returning the variable screen to default. For ex: I have couple of variables to select on the variable scre

  • Business use Linux, then Linux needs a update for ...

    We needs a update for the same version windows and mac!! the skype 4.1 for linux is a garbage, very bad!! I was a pay user but i cancel my account because it, in business we needs a good softwere!

  • Scheduling service

    I am trying design a system that allows users to schedule a sequence of services to be performed in the future via the web. The interface to these services may be in CORBA or JCA or RMI. I am wondering if J2EE is a good solution for this. Any example