How i access file which stored at application server .? Is there any fm ?

How i access file which stored at application server . Is there any function module which provide same funtinality.
Gurprit Bhatia

Hi ,
        U need to use datasets for reading data from application server.Do a f1 on dataset,u will get to know rest of the things.
  IF sy-subrc = 0.
      READ DATASET file INTO <wa_data> MAXIMUM LENGTH 200.
           move the data in to internal table
    close dataset
Edited by: A kumar on Aug 21, 2008 1:37 PM

Similar Messages

  • Files are stored in application server,

    Files are stored in application server, I am using Open dataset to write to a file in unix box.would like to convert my itab into tab delimted and download. Please let know
    is there any function?

    You should do a search to get the right ascii value (you can get an
    ascii chart, you can google a bit, you can visit the group's page and
    search for tab delimited... ) and replace 09 by the right value. And
    that's it.. The technique (which is what it matters) is right.
    Another tip:: you could download in two steps: first you use
    gui_download or ws_download to create a tab delimited file in your pc or
    in a network. Then you upload this file (using gui_upload or ws_upload
    into an internal table and the final step is to use open dataset -
    transfer - close dataset to write down this last itab to your app

  • Reading the data from excel file which is in application server.

    Iam trying to read the data from excel file which is in application server.
    I tried using the function module ALSM_EXCEL_TO_INTERNAL_TABLE. But it didn't work.
    I tried just reading using open data set and read data set it is giving junk characters.
    Please suggest me if you have any solution.
    Best Regards,
    Brahma Reddy

    Hi Narendra,
    Please see the below code I have written
    OPEN DATASET pa_sfile for INPUT in text mode ENCODING  DEFAULT MESSAGE wf_mess.
    CHECK sy-subrc = 0.
    READ DATASET pa_sfile INTO wf_string.
    IF sy-subrc <> 0.
    split wf_string at wl_# into wf_field1 wf_field2 wa_upload-field3
    wa_upload-field4 wa_upload-field5 wa_upload-field6 wa_upload-field7 wa_upload-field8
    wa_upload-field9 wa_upload-field10 wa_upload-field11 wa_upload-field12 wa_upload-field13
    wa_upload-field14 wa_upload-field15 wa_upload-field16 wa_upload-field17 wa_upload-field18
    wa_upload-field19 wa_upload-field20 wa_upload-field21 wa_upload-field22 wa_upload-field23
    wa_upload-field24 wa_upload-field25 wa_upload-field26 wa_upload-field27 wa_upload-field28
    wa_upload-field29 wa_upload-field30 wa_upload-field31 wa_upload-field32 wa_upload-field33
    wa_upload-field34 wa_upload-field35 wa_upload-field36 .
    wa_upload-field1 = wf_field1.
    wa_upload-field2 = wf_field2.
    append wa_upload to int_upload.
    clear wa_upload.
    CLOSE DATASET pa_sfile.
    Please note Iam using ECC5.0 and it is not allowing me to declare wl_# as x as in your code.
    Also if Iam using text mode I should use extension encoding etc.( Where as not in your case).
    Please suggest me any other way.
    Thanks for your help,
    Brahma Reddy

  • Viewing a file which is in Application Server [al11]

    Hi All
    I have a file which is residing in Application Server [al11 tcode], how i can display the file using LinkToURL UI Element,
    what is the path which i need give in the REFERENCE parameter of the UI Element.
    Thanks in Advance

    Just becuase the file is in the filesystem of the application server, doesn't necessarily mean that it is exposed to the network at all. This really depends upon your OS and if you have a file share or external web server connected to the OS of your application server.
    However if you want to temporarily create a URL via the ABAP application server for a file in the filesystem you can do so by placing the content into the ICM cache.
    So you would read the file from the filesystem using the normal ABAP dataset commands.
    Here is a small example where I am doing this with different image formats:
    ****Create the cached response object that we will insert our content into
      data: cached_response type ref to if_http_response.
      create object cached_response
          add_c_msg        = 1.
    *  cached_response->set_compression( options = cached_response->IF_HTTP_ENTITY~CO_COMPRESS_IN_ALL_CASES ).
    try. " ignore, if compression can not be switched on
          call method cached_response->set_compression
              options = cached_response->co_compress_based_on_mime_type
              others  = 1.
        catch cx_root.
    ****set the data and the headers
      data: l_app_type type string.
      data: l_xstring type xstring.
      case i_format.
        when 'BMP'.
          cached_response->set_data( me->gx_content ).
          l_app_type = 'image/x-ms-bmp'.
        when 'GIF'.
              i_format  = i_format
              e_xstream = l_xstring ).
          cached_response->set_data( l_xstring ).
          l_app_type = 'image/gif'.
        when 'JPG'.
              i_format  = i_format
              e_xstream = l_xstring ).
          cached_response->set_data( l_xstring ).
          l_app_type = 'image/jpeg'.
        when 'TIF'.
              i_format  = i_format
              e_xstream = l_xstring ).
          cached_response->set_data( l_xstring ).
          l_app_type = 'image/tiff'.
        when 'PNG'.
              i_format  = i_format
              e_xstream = l_xstring ).
          cached_response->set_data( l_xstring ).
          l_app_type = 'image/png'.
        when others.
          raise exception type zcx_abap_bitmap.
      cached_response->set_header_field( name  = if_http_header_fields=>content_type
                                         value = l_app_type ).
    ******Set the filename into the response header
    *  cached_response->set_header_field( name  = 'Content-Encoding'
    *                                     value = 'compress' ).
    ****Set the Response Status
      cached_response->set_status( code = 200 reason = 'OK' ).
    ****Set the Cache Timeout - 60 seconds - we only need this in the cache
    ****long enough to build the page and allow the IFrame on the Client to request it.
      cached_response->server_cache_expire_rel( expires_rel = i_cache_timeout ).
    ****Create a unique URL for the object
      data: guid type guid_32.
      call function 'GUID_CREATE'
          ev_guid_32 = guid.
      concatenate i_path '/' guid '.' i_format into r_url.
    ****Cache the URL
      cl_http_server=>server_cache_upload( url      = r_url
                                           response = cached_response ).
    Another option would be to create a custom ICF handler class.  In this class you could pass the file name as URL parameters, read the content using ABAP DATASET commands and return the content in the response object. 
    Handler classes have to implement the IF_HTTP_EXTENSION Interface.  You implent the method HANDLE_REQUEST.
    Here is an example implementation of the HANDLE_REQUEST:
    * Inform ICF to "keep" (reuse) this handler, and that we answered the HTTP request
      if_http_extension~lifetime_rc = if_http_extension=>co_lifetime_keep.
      if_http_extension~flow_rc     = if_http_extension=>co_flow_ok.
    * Determine image name from URL ~script_name/~path_info (= image_name)
      data: name type string.
      name = server->request->get_header_field( name = if_http_header_fields_sap=>path_info ).
      translate name to upper case.
      if strlen( name ) >= 1 and name(1) = '/'.
        shift name left.
    * Application logic
      data: content type xstring.
      content = me->load( name ).
      if xstrlen( content ) is initial.
        raise exception type cx_http_ext_exception exporting msg = 'Invalid URL!'.
    * Set up HTTP response
      server->response->set_status( code = 200 reason = 'OK' ).
      server->response->set_header_field( name = if_http_header_fields=>content_type   value = 'image/png' ).
      server->response->server_cache_expire_rel( expires_rel = 86000 ).
      server->response->set_header_field( name = if_http_header_fields=>cache_control value = 'max-age=86000' ).
      server->response->set_data( content ).
    3rd option would be to create an ICM File Handler. I detailed this functionality in the SAP Press book Advanced BSP Programming.  It is covered in Chapter 16.2.  Here is an exerpt:
    The Internet Communication Manager (ICM) allows just such access to any file
    system accessible to the underlying operating system. You can map operating file
    system directories into ICM URL paths using the profile parameter icm/HTTP/
    If you have never maintained one of the system-profile parameters, now is good
    time to make friends with your Basis administrator. With the following additions
    to our instance profile and a quick restart of the ICM, we are now able to access
    file system directories via HTTP.
    icm/HTTP/file_access_0 =
    icm/HTTP/file_access_1 =
    In the first entry, we are just going to map to the local directory usr. We are able
    to control the useru2019s options to browser a directory via the additional parameter
    BROWSEDIR. The possible values are: 0 u2013 no browsing allowed, 1 u2013 only file names
    are displayed, and 2 u2013 file names along with their size and last change date are displayed.
    The second entry really shows off the power of this profile parameter. We are able
    to expose a directory on a remote server via UNC paths. Of course the security on
    that directory would have to be open to allow read-and-browse access. There is
    also no real mechanism to apply security to the ICM URL for this file access node,
    so you will want to be careful what you expose through it.


    Hi ,
    I want to move files between folders on application servers and also on presentation server.
    Is any ABAP code available for it.
    Can anybody help me out in this.
    Waiting for reply.
    Thanks & regards,

    I am also interested in this post. The FB  ARCHIVFILE_SERVER_TO_SERVER workes fine for copying the file, however I also need to remove the file from its original location.
    Does anybody have a sugestion on how I can do that (in coding).

  • How to change the excel file name which is in Application server...

    hi friends,
    my requirement is getting failed, when i'm trying to change the file name which is in Application server using the FM: SXPG_COMMAND_EXECUTE.
    when i execute above FM, i can see all my required details in SM69 like:
    OS: Windows NT
    TYPE: Customer 
    OS COMMAND: cmd rename Y:\OBRZ.PDF OBRZ38582.PDF
    once the above FM is executed, i'm getting SY-SUBRC = 2 (exception: COMMAND_NOT_FOUND).
    so, can any one guide me how to resolve this issue or is there any other way to rename the file which is in AS?
    thanks in advance...

    Hi ,
    First you can tranfer the AS server file to a new application server file.
    Then you delete the original file .
    To do that you can write code as follows --
    DATA : w_file(8) TYPE c VALUE 'FILE_NAM', " your present AS file name
           w_new(8) TYPE c VALUE 'NEW_FILE',
           fs_itab(255) TYPE c,
           t_itab LIKE TABLE OF fs_itab.
      READ DATASET w_file INTO fs_itab. " Reading value from the AS file to field string
      IF sy-subrc NE 0.
        APPEND fs_itab TO t_itab. " Populating internal table form the file value
    OPEN DATASET w_new FOR INPUT IN BINARY MODE. " creating a new file if that does not exist
    LOOP AT t_itab INTO fs_itab.
      TRANSFER fs_itab TO  w_new. " Transfering to file
    CLOSE DATASET w_file..
    DELETE DATASET w_file. " Dleting the old file
    CLOSE DATASET w_new.  " Closing the final file

  • Create a Document with an original file stored on application server

    I start with document managment system : i am able to create new document (CV01N) manually, add a local file and check-in this file.
    Now we need to store file which are stored on the SAP Application Server.
    Firstly, in the GUI of transaction CV01N, i don't know how to browse file on application server. All files i can't attach as original, are files i can access from my computer.
    Is it possible to access also on application server files ?
    Moreover, i have to define function module which have to
    - Create a document (DMS)
    - Attach an orginial file which is stored on application server
    - Check-in the file
    This function module will be called from a web application
    I define this kind of function and run it correctly with a local file (stored on my computer) : i call BAPI "BAPI_DOCUMENT_CREATE2" and "BAPI_DOCUMENT_CHECKIN2"
    But i don't how to do with a file stored on application server. I see also note 504692 and try a program like ZZUZTEST_TEST_CHECKIN which use FM CVAPI_DOC_CHECKIN but it return an error Error uploading  E:\usr\sap\TD1\DVEBMGS00\data\FACTURE.txt" (this path and file exist on application server and is really the file i want to checkin)
    Please could you confirm what i search, is possible or not.
    If possible, could help me with some explanations and guidelines and perhaps a sample ?
    Thank you very much.
    The function used
    Checkin the first original of a document info record *
    from the application server and/or in the background *
      data   : w_host like BAPI_DOC_AUX-HOSTNAME.
      data: lf_line(255).
      data: ls_draw like DRAW,
            ls_message_cvapi like messages,
            lt_files_cvapi type standard table of CVAPI_DOC_FILE,
            lt_files_cvapi_header like CVAPI_DOC_FILE.
      data: lt_originals LIKE cvapi_doc_file OCCURS 0 WITH HEADER LINE,
            vo_originals LIKE cvapi_doc_file OCCURS 0 WITH HEADER LINE.
      ls_draw-dokar = 'ZFT'.
      ls_Draw-doknr = '0000000000000004500000032'.
      ls_Draw-dokvr = '00'.
      ls_Draw-doktl = '000'.
    Read Originals contained in the document info record
          pf_batchmode    = 'X'
          pf_hostname     = ' '
          pf_dokar        = ls_draw-dokar
          pf_doknr        = ls_draw-doknr
          pf_dokvr        = ls_draw-dokvr
          pf_doktl        = ls_draw-doktl
          pf_active_files = 'X'
          psx_draw        = ls_draw
          pt_files        = vo_originals
          not_found       = 1
          no_auth         = 2
          error           = 3
          OTHERS          = 4.
      IF sy-subrc <> 0.
        WRITE 'Error returned by CVAPI_DOC_GETDETAIL'.          "#EC NOTEXT
    Check if we can really access the file from the application server
      read table vo_originals index 1.
      open dataset vo_originals-filename for input in text mode ENCODING DEFAULT.
      if not sy-subrc is initial.
        message e500(26) with vo_originals-filename 'not found'.
      read dataset vo_originals-filename into lf_line.
      if not sy-subrc is initial.
        message e500(26) with vo_originals-filename 'read error'.
      lt_originals             = vo_originals.
      lt_originals-STORAGE_CAT = 'SAP-SYSTEM'.
      append lt_originals.
      w_host = sy-host.
      PF_DOKAR = ls_draw-dokar
      PF_DOKNR = ls_draw-doknr
      PF_DOKVR = ls_draw-dokvr
      PF_DOKTL = ls_draw-doktl
    *PF_HOSTNAME =  w_host
    PF_REPLACE = ' '
      PSX_MESSAGE = ls_message_cvapi
      PT_FILES_X = lt_originals
    PT_COMP_X =
      IF ls_message_cvapi-msg_type CA 'EA'.
        MESSAGE ID '26' TYPE 'I' NUMBER '000'
        WITH ls_message_cvapi-msg_txt.
        COMMIT WORK and wait.

    This is a bit tricky. I spent lots of hours about this .
    You have to set PF_HOSTNAME with your name of your AS and gives the path to the file on the server.
    You wrote
    *PF_HOSTNAME = w_host
    But beware: if you have more thän one AS you have to fix one AS for upload or you have to find the servers name of the file. A better way can be to share one folder by each AS.
    You also have to decide between HTTP or FTP.
    You wrote:
    You must define only one ! Then you have to check your settings in SM59 about working right.
    Pls rate, if this was helpful.

  • How to have a live feed from application server log file (realtime viewr )

    how to have a live feed from application server log file (realtime viewr for apps log files)
    hi , thank you for reading my post.
    is there any way to have a live feed of Application server log ?
    for example is there any application that can watch the log file and show the changes as new log items come in ?
    can some one with more experience help ?

    Your question would be more suited to the Developer Forums
    but anyway...
    My goal is to develop a web application that is able to run on iPhone too, to capture the audio and video content from its camera and mic.
    Web Apps running in Safari don't have access to the camera or mic hardware.
    Or I should built a native application distributed through Apple store?
    That is your only option, although such a system already exists:

  • How to retrieve data from an Excel file which is located on server

    hi everybody,
                    I am using SAP NWDS 2004s .     
                I have done an application on how to export the table data into an Excel .
    Now i want to get the data from an Excel file which is located in server and display that data which is in excel in a View for example a Sample view in Webdynpro  .
    In Sample view i took a uielement textview to display the data ....   
    can any one help how to procced further
    Thanks in advance

    Options to read Excel data to WebDynpro context
    Reading Excel Sheet from Java without using any Framework
    Reading Multiple Sheets of Excel Sheet from Java
    Few Threads
    How to Display the content of Excel file into Webdynpro Table
    Is it possible to upload data from excel file(.xls)
    Re: How to export the data as integer into excel sheet?

  • How I COULD CHECK files are storing in DMS server or DNS server.

    Hi, all,
    I am storing DMS files ie originals in DMS_C1_ST through Kpro,
    Because we have DNS server and DMS server.
    Now I m working in Production server,
    How I can check the DMS files is storing in DMS server or in DNS server.
    The DMS configuration is working fine but I donu2019t know how I could check whether the files or storing in DMS server or in DNS server. Or any other configuration is required.

    If u r using DMS_C1_ST  storage category, then ur original are checking in to SAP data base, because, this category is created using SAP database.If ur using separate content server for storing originals, then create content repository in ur content server and storage category in content repository.
    Now while checking in, system will ask u to choose storage category, instead of selecting DMS_C1_ST , select which u have created in ur content server, then ur originals will store in DMS content server.

  • HT4910 sold my ipad today. the concern is how to access all info stored in cloud and if possible eventualy merge data into new andriod tablet. Thanks all of you who respond.

    sold my ipad today. the concern is how to access all info stored in cloud and if possible eventualy merge data into new andriod tablet. Thanks all of you who respond.

    <IfModule mod_weblogic.c>
    MatchExpression /app1
    <Location /weblogic>
    SetHandler weblogic-handler
    DebugConfigInfo ON
    PathTrim /weblogic
    <IfModule mod_weblogic.c>
    MatchExpression /app2
    <Location /weblogic>
    SetHandler weblogic-handler
    DebugConfigInfo ON
    PathTrim /weblogic
    This configuration is weird little bit. There is MatchExpression /app1 and MatchExpression /app2 and at the same time two <Location /weblogic> sections. Are you sure you understand what that configuration stands for?
    Try something like this ...
    <Location /app1>
    SetHandler weblogic-handler
    DebugConfigInfo ON
    <Location /app2>
    SetHandler weblogic-handler
    DebugConfigInfo ON
    where /app1 and /app2 are contexts of your weblogic applications.

  • How to move PDF file from Spool to Application Server?

    How to move PDF file from Spool to Application Server?
    Cannot use RSTXPDFT4 because that converts OTF to PDF and the file is already PDF.
    RSTXPDFT5 doesn't work. It picks the file up and assigns it a 'text' type and outputs a 1 line txt (1kb in size) on the server with the spool number in it!
    The program which outputs the file to the spool, in the first place, uses adobe forms and outputs to a printer of type PDF.

    Hi Gemini ,
    Please refer the below links.
    Edited by: Prasath Arivazhagan on Apr 13, 2010 4:48 PM

  • How To Access HTTPS Web Service  in Application Module

    I need to know how to access HTTPS web service in application module.
    If you can provide the tutorial or guidance to achieve this really appreciate.

    Use the Web Service Proxy wizard in JDeveloper to create a class that calls your Web service, and then call this class from code in your AM.

  • How to access file from AIX server to windows

    HI all,
    My question is how to represent file folder name of that server
    my file folder in AIX server and i want to access that file in window s machine.
    * is this the right way to represent the data folder in physical schema declaration
    file:///<aix server IP>/usr/oracledi/oracldi/data

    No, it is not. Filename magic alone will not do the job.
    AIX supports NFS (network file system) or you can use samba (implementation of the Microsoft SMB protocol to share resources in Un*x) .

  • How to access file from AIX server

    Hi ,
    I am facing a problem with Aix Machine .
    I want to access the file from AIX server machine .I am in Windows machine.

    HI all,
    My question is how to represent file folder name of that server
    my file folder in AIX server and i want to access that file in window s machine.
    * is this the right way to represent the data folder in physical schema declaration
    file:///<aix server IP>/usr/oracledi/oracldi/data
    Message was edited by:

Maybe you are looking for

  • How can I transfer all my files from iphone 3g to iphone 4s?

    I have my iphone 3g with all the apps , contacts, emails, etc. (all the files). Then now I bought the iphone 4s and I want to transfer all my files and apps from iphone 3g to iphone 4s. Is there an easy way to transfer them?

  • How can I get my google homepage back after it was replaced somehow by ibox?

    When I clicked on Firefox, instead of my Google homepage coming up, an IBOX logo appeared and I cannot recover my homepage. It had stock quotes, weather, the Drudge Report, etc. etc. I hope I don't have to create another homepage. Thanks for any help

  • ALE Partner type ( Parnter profiles)

    Can I select vendor and customer as partner type while creating partner profile in ALE configuration. If 'YES',please let me know, where to maintain the mapping between vendor(sending system part type) and customer(receiving system partner type). Tha

  • CSS or What?

    Can someone assist as I don't know how to accomplish this tasks. I would like for all the squares areas to stay the same as I will be placing pictures and linking them with videos. Basically, I would like for the first row to look like the 2nd and 3r

  • Launch iview in new window: howto rename browser window name?

    Hi all, When I open an iview in a new window, I would like to set the visible window name to the name of the iview, instead of just "SAP Enterprise Portal 6.0". Any suggestions? I am working with a SAP Transaction iView (windows gui). Cheers, faB