Getting files of a directory in app server

Hi,
Is there any FM or method to get all the files of a directory ( in the application server )if its path is given as input.
It should list the file name, creation date and also size.
Thanks,
Nawaz.

Hi,
you can use the follow code:
REPORT  zdirtest.
DATA lv_dir TYPE rsmrgstr-path VALUE '/usr/sap/trans/data'.
DATA: wa_files  TYPE rsfillst,
      it_files  LIKE TABLE OF wa_files.
START-OF-SELECTION.
  CALL FUNCTION 'SUBST_GET_FILE_LIST'
    EXPORTING
      dirname      = lv_dir
      filenm       = '*'
    TABLES
      file_list    = it_files
    EXCEPTIONS
      access_error = 1
      OTHERS       = 2.
  IF  sy-subrc  <>   0.
    WRITE /1 'Error! :-('.
  ELSE.
    LOOP AT it_files INTO wa_files.
      WRITE: /1 wa_files-name,
                wa_files-len.
    ENDLOOP.
  ENDIF.
However the field <b>MTIME</b> from the structure <b>RSFIILST</b> is not filled correctly with the number of seconds since 1970 because the field is defined to small.
So you can't list the correct modification date and time.
If you really need this, you should take a look in the Report <b>RSWATCH0</b> in the form <b>fill_file_list</b>.
This form fills an internal table with the correctly modification date and time.
Regards,
Stefan

Similar Messages

  • List of files in a directory of app server

    Hi,
    I was trying to get the list of all files in a directory using fm "EPS2_GET_DIRECTORY_LISTING". But the date column is empty in the output table. I also tried fm's
    SUBST_GET_FILE_LIST
    EPS_GET_FILE_ATTRIBUTES
    none of the above is giving date.
    Can anyone tell me a fm which gives date along with other attributes?
    Thanks in Advance.
    Satish

    try get something from the transaction AL11 source code: RSWATCH0 form -> fill_file_list
    Regards,
    Vincent

  • List all files in a directory on a server that hosts the applet

    Hei :)
    I have a problem. I want to list all files in a directory on my server. ( http://www.foo.bar/tw )
    The applet is in the root folder ( http://www.foo.bar ).
    So i tried it like this
    File fi = new URL(getCodeBase() + "/all/").getFile();But when I try to list the files, I get a SecurityException.
    Can anyone help me out?
    Peace!
    LoCal

    http://search.java.sun.com/search/java/index.jsp?col=javaforums&qp=&qt=%2Blist+%2Bfile+%2Bserver

  • How to upload the files of a directory to a server at one time?

    in a jsp page ,the user choose a directory ,then I want to upload the files of the directory to a server at one time.How to do this?Thanks!

    You create multiple file input fields and you have them select each file they want.
    Or tell the user to zip the directory and upload the zip file.
    Or use a signed applet to get all the files and send them.
    There's no way for the browser to select a directory.

  • Creating directory in App.server

    Hi Experts,
    How can we create a directory in App.server?
    is it possible programatically with open data set statement?

    Hi Ravi,
    If your application server is based on UNIX,
    try the following command in an ABAP program
    CALL 'SYSTEM' ID 'COMMAND' FIELD fp_command_line
                  ID 'TAB'     FIELD lt_output.
    The command line fp_command_line should have the UNIX command to create directories(MKDIR...). The lt_output table will have return values from the command(Its a table with a single column of 1000 chars).
    I have tried the CALL 'SYSTEM' command for various other purposes, but did not create a directory till now. Try it out.
    Thanks,
    Vinay

  • Getting file not found exception in managed server

    Hi,
    Working on jdev 11.1.1.3.0, ADF BC with Rich faces.
    I am downloading file from network file system, i am successfully download file in integrated weblogic server, the same application when i am trying to run with my managed server(DEV Server), i am getting error like
    ####<Aug 10, 2010 5:39:02 PM EDT> <Notice> <Stdout> <sunt2000-10.wfs.com> <wld1_ms1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <21291a4e37aed913:-38a2f9a1:12a5d38d756:-8000-0000000000000275> <1281476342286> <BEA-000000> <downloadLetters file name*://bwi-wfp-v01/Apps/SCII/TEST/LOG/Cards/ONDEMAND/Xyz.doc*>
    ####<Aug 10, 2010 5:39:02 PM EDT> <Notice> <Stdout> <sunt2000-10.wfs.com> <wld1_ms1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <21291a4e37aed913:-38a2f9a1:12a5d38d756:-8000-0000000000000276> <1281476342313> <BEA-000000> <<Aug 10, 2010 5:39:02 PM EDT> <Warning> <org.apache.myfaces.trinidadinternal.taglib.listener.FileDownloadActionListener> <BEA-000000> <
    javax.el.ELException: java.io.FileNotFoundException: */bwi-wfp-v01/Apps/SCII/TEST/LOG/Cards/ONDEMAND/Xyz.doc* (No such file or directory)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:161)
    my file location is://bwi-wfp-v01/Apps/SCII/TEST/LOG/Cards/ONDEMAND/Xyz.doc, i am getting the correct file location while reading in the managed bean, but the error is showing as /bwi-wfp-v01/Apps/SCII/TEST/LOG/Cards/ONDEMAND/Xyz.doc one / is missing, why it was happening in managed server.
    Can any one help me, what is the issue here.

    Thanks for your reply, Timo, and John, the same file downloading is working fine with my Integrated weblogic server, but the same application when i deployed in my DEV server i am getting the error.
    Code which i am trying to download file is
    public void downloadCardInserts(FacesContext facesContext,
    OutputStream outputStream) throws FileNotFoundException,
    IOException {
    // Add event code here...
    UploadedFile filename=(UploadedFile)browseFile.getValue();
    String fname=filename.getFilename();
    String fname1="//bwi-wfp-v01/Apps/SCII/TEST/LOG/Cards/RENEWAL/"+fname;
    System.out.println("file name11111:"+fname1);
    FileInputStream in = new FileInputStream(new File(fname1));
    byte[] buffer = new byte[1024];
    int bytes = in.read(buffer);
    while (bytes >= 0) {
    outputStream.write(buffer, 0, bytes);
    bytes = in.read(buffer);
    }

  • How to displays the standard open file dialog box in Oracle Apps Server

    Hi,
    I am having a form, where i am opening a file and putting that file content in a text box.
    This is my code written in WHEN-BUTTON-PRESSED trigger:
    declare
    in_file Text_IO.File_Type;
    linebuf VARCHAR2(8000);
    filename VARCHAR2(30);
    BEGIN
    filename:=GET_FILE_NAME('d:\Rajesh\Practice', File_Filter=>'Text Files (*.txt)|*.txt|',select_file=>false);
    in_file := Text_IO.Fopen(filename, 'r');
    LOOP
    Text_IO.Get_Line(in_file, linebuf);
    :text_item5:=substr(:text_item5||linebuf||chr(10),1,5000);
    END LOOP;
    EXCEPTION
    WHEN no_data_found THEN
    Text_IO.Put_Line('Closing the file...');
    Text_IO.Fclose(in_file);
    END;
    I have posted this in ORacle Apps Server.Where i was not able to get the Open Dialoq Box.It is giving an error as
    "FRM-40735:WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-302000.".
    I think the GET_FILE_NAME function is not supported in the Apps Server.
    Is there any alternative solution for getting the OPEN DIALOG WINDOW in Oracle Apps Server?
    Pls let me know.

    Hi!
    waldemar.hersacher wrote:
    "It seems that the VIs called by the clients are running in the user interface thread.
    A call to the file dialog box will call a modal system dialog. So LV can't go on executing VIs in the user interface thread."
    Are you sure? I think, that File Dialog, called by LabVIEW File Dialog from Advanced File Functions Palette doesn't blocking any cycles in subVI, which running in UI Thread. Look in my old example (that was prepared for other topic, but may be good for this topic too).
    2 linus:
    I think, you must a little bit reorganize you application for to do this. You must put your File Dialog into separated cycle. This cycle, of course, will be blocked when File Dialog appear on the screen. But other cy
    cle, which responsible for visualization will run continuosly at the same time...
    Attachments:
    no_block_with_file_open_dialog.zip ‏42 KB

  • How to see directory in app server

    how can i see the directory in application server if al11 is not accessible( i have no authorization to see al11 in testing server).
    my problem is i have a zip file in the pplication server,
    in development, i am unzipping the fle using the function module SXPG_CALL_SYSTEM.
    it is returning sy-subrc = 0. and it is working fine in development sever.
    iam downloading the same zip file and uploading the same zip file into testing server.
    while uploading iam getting success message. this means the file is created.
    but again when i run the same function module in testing server to unzip,
    iam getting error code 2. (error in external program suffix...).
    but i donno where it is going wrong. to check the directory, i dont have access to al11. any solution?

    Hi
    Run AL11 and goto Tcode SU53 check the authorization there whether u have it or not.
    Regards
    shiva

  • Get file list from directory(t.code: AL11).

    Hi Frnds,
    i need to get the list of file for particular directory from t.code AL11,
    is there any Function Module to display the list of File from  the directory in executable program,
    i have directory like '/home/im3/hrintf/processed/..... ' and now i need to get the list of file from that directory,
    the list is available in t.code AL11( standard program :RSWATCH0 ).
    pls suggest me with relevant FM or relevant logic.
    Thank you.
    Regards
    Ramesh M

    Hi 
       use this code i have checked its working fine
    Data:
          w_itab type table of  EPSFILI,
          w_dirnam type  EPSF-EPSDIRNAM.
          w_dirnam = 'C:\usr\sap\E6S\DVEBMGS00\work'.
    CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
      EXPORTING
        dir_name                     = w_dirnam
    *   FILE_MASK                    = ' '
    * IMPORTING
    *   DIR_NAME                     =
    *   FILE_COUNTER                 =
    *   ERROR_COUNTER                =
      tables
        dir_list                     = w_itab
    * EXCEPTIONS
    *   INVALID_EPS_SUBDIR           = 1
    *   SAPGPARAM_FAILED             = 2
    *   BUILD_DIRECTORY_FAILED       = 3
    *   NO_AUTHORIZATION             = 4
    *   READ_DIRECTORY_FAILED        = 5
    *   TOO_MANY_READ_ERRORS         = 6
    *   EMPTY_DIRECTORY_LIST         = 7
    *   OTHERS                       = 8
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write: 'test'.
    Thanks
    Viquar Iqbal

  • How do you create a directory on Apps Server

    Hi
    Is there any way to create a directory on the apps server at runtime using any of the forms built-ins or WebUtil?

    Use the HOST command, since HOST works on the App Server. WebUtil works on the client PC.

  • Need to get file name and directory back from file adapter - WRITE

    I am using the file adapter to write a file. I want to log the file name of the file we just created. Since we use a precise timestamp in the file name, I can't accurately guess.
    I have an invoke in my BPEL process to the file adapter. My first try was to assign the jca.file.FileName property to a variable, but it never comes back. I looked around and saw plenty of ways to SET the file name for a write and GET the file name for a read, but no GET file name for WRITE.
    Anyone have a solution?
    Thanks in advance!

    I think I got your point... You can tell FileAdapter the filename to write, but if you don't then FileAdapter can not tell you the filename that it wrote... I think it is pretty possible Oracle didn't implement the latter, as the write operation is probably asynchronous and the filename is calculated later on...
    If what you want is just log, you may achieve your requirement by increasing verbosity on Adapter logs... Have a look at the link bellow...
    http://docs.oracle.com/cd/E15586_01/integration.1111/e10226/ad_mon.htm#CJHHBBID
    Otherwise, the solution for you will be to calculate filename yourself, and that will be a little bit of reinventing the wheel... But at least you will know the filename...
    Cheers,
    Vlad

  • Getting file types in directory structure.

    I have a directory with 5000 files in it in 1000 folders. I
    need to parse through all these files and construct a list of file
    types (.jpg, .doc, .pdf etc) These types will be entered into a
    database table so we have a distinct list of file types that we
    have. I'm just wondering what everyone's opinion on the easiest way
    to accomplish this is. Obviously CFDIRECTORY comes to mind doing
    some crazy loops, but I started and was just thinking there might
    be a better/easier way to do this.
    Any suggestions?
    THANKS

    Yeah I got that part as far as parsing out the file type from
    the name that cfdirectory spits out. It's the recursion of the
    dierctories that I'm having problems with. If it was just one
    directory full of files this would be a snap but there are
    directories 3-4 levels deep. Just trying to figure out the best way
    to loop through the files in a directory but also loop through
    files in sub directories.

  • Get File Names & Creation Time of the files of a directory in App. Server

    Dear all,
                  My requirement is to fetch all the file names of a paritucular direcory in the application server. After going through SDN i got some FM's like
        1. EPS_GET_DIRECTORY_LISTING
        2. EPS_GET_FILE_ATTRIBUTES
        3. SUBST_GET_FILE_LIST
        Here EPS_GET_DIRECTORY_LISTING looks perfect for my requirement. But while I tried to test the FM from SE37 its giving exception READ_DIRECTORY_FAILED for the required Directory. But the same FM is returning file names for the root directory.
    Please look a above 2 scenario...
    ie. if I give Export parameter as
         DIR_NAME                         = '/'
         FILE_MASK                       = '*'
         The FM works fine.
    But . if I give Export parameter as
         DIR_NAME                         = '/XYZ'                      
         FILE_MASK                       = '*'
        The FM returns exception READ_DIRECTORY_FAILED .
    But the directory  /XYZ exists and there are files in it..Am I missing something with respect to the path am specifying.
    Regards,
    Antony

    Hi, see if this peace of code helps you.
    CONSTANTS DAYS1980 TYPE I VALUE 3652.
    DATA: DLIST LIKE EPSFILI OCCURS 0 WITH HEADER LINE, DPATH LIKE EPSF-EPSDIRNAM, MDATE LIKE SY-DATUM, MTIME LIKE SY-UZEIT, POINT_IN_TIME TYPE I.
    DATA: BEGIN OF FATTR OCCURS 0, FILE_NAME LIKE EPSF-EPSFILNAM, FILE_SIZE LIKE EPSF-EPSFILSIZ, FILE_OWNER LIKE EPSF-EPSFILOWN, FILE_MODE LIKE EPSF-EPSFILMOD, FILE_TYPE LIKE EPSF-EPSFILTYP, FILE_MTIME(12), END OF FATTR.
    PARAMETER P_PATH(50) TYPE C DEFAULT '/TMP' LOWER CASE.
    DPATH = P_PATH.
    CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
    EXPORTING
      DIR_NAME = DPATH
    TABLES
      DIR_LIST = DLIST
    EXCEPTIONS
      INVALID_EPS_SUBDIR = 1
      SAPGPARAM_FAILED = 2
      BUILD_DIRECTORY_FAILED = 3
      NO_AUTHORIZATION = 4
      READ_DIRECTORY_FAILED = 5
      TOO_MANY_READ_ERRORS = 6
      EMPTY_DIRECTORY_LIST = 7
      OTHERS = 8.
      IF SY-SUBRC EQ 0.
      LOOP AT DLIST.
    CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
    EXPORTING
      FILE_NAME = DLIST-NAME
      DIR_NAME = DPATH IMPORTING
      FILE_SIZE = FATTR-FILE_SIZE
      FILE_OWNER = FATTR-FILE_OWNER
      FILE_MODE = FATTR-FILE_MODE
      FILE_TYPE = FATTR-FILE_TYPE
      FILE_MTIME = FATTR-FILE_MTIME.
      FATTR-FILE_NAME = DLIST-NAME.
      APPEND FATTR.
        ENDLOOP.
      ENDIF.
      SORT FATTR BY FILE_NAME.
      LOOP AT FATTR.
      POINT_IN_TIME = FATTR-FILE_MTIME.
      CALL FUNCTION 'POINT_IN_TIME_CONVERT'
      EXPORTING
      POINT_IN_TIME = POINT_IN_TIME
      IMPORTING
      DATE = MDATE
      TIME = MTIME
      EXCEPTIONS OTHERS = 1.
      SUBTRACT DAYS1980 FROM MDATE.
      WRITE: / FATTR-FILE_NAME, FATTR-FILE_SIZE, MDATE, MTIME.
      ENDLOOP.

  • How to check whether a file is present in the UNIX directory of app. server

    Hi,
            I am creating files in the UNIX directory in the application server using :
                       CONCATENATE '/sapmnt/RD1/interfaces/client670/'
                       p_fname '.CSV' INTO w_filename.
               OPEN DATASET w_filename FOR OUTPUT IN TEXT MODE.
              LOOP AT t_output1.
                      TRANSFER t_output1 TO w_filename.
              ENDLOOP.
             CLOSE DATASET w_filename.
    I am unable to check whether a file with the same name exists or not. How to check the duplicate state of the file.

    You can use the following fm
    RZL_READ_FILE
    or
    use OPEN DATASET FOR INPUT.

  • How to get studio 2 to work with app server 8.1 ??

    I'm about giving up.
    I have tried to redeploye, to export to war
    to recreate the domain (pe-start.bat -reset )
    and nothing helps ... appserver at 24848 is not to be started from within
    studio 2?. so run/debug is imposible.
    I seems confused bout address ( which is not blocked)
    or spaces in path ( what ??? it is a ";" delimited list !!)
    or it simply does not know about the projects in the studio
    (domain xml does not reference any of the projectes (?).)
    Is creator2 usable at all ?
    Worst of all ... the redo of the domain also killed of the project that was running --- outside of studio2.
    the apps disappeared from within domain.xml and cannot be recreated
    ( F***).
    And deploying the war to appserver 8.1 through the admin console is ....
    not working .
    That is days work out the window.
    ERik.

    1: windows xp pro
    2: f:\sun\creator ....
    c:\documents and ....First questions:
    Did you install Creator as the same user as which you're trying to run it?
    Did you try to install it into multiple places? And possibly trying to use the old user directory (C:\Documents and Settings\<user>\.Creator\2_0 - where Creator keeps it's state)?
    3 a: no modification
    b: manually inserted project "descriptors"
    c: redo : pe-startup.bat -reset
    d: deploying projects through admin console
    (export war-file)There you're missing the WEB-INF/sun-web.xml. That's the reason for all the server.log entries related to JNDI names beeing null.
    : inspection shows :
    1: path warning - tried to insert single pings
    |2006-04-24T22:56:13.375+0200|WARNING|sun-appserver-pe
    8.1_02|javax.enterprise.tools.launcher|_ThreadID=10;|L
    AUNCHER005:Spaces in your PATH have been detected.
    The PATH must be consistently formated (e.g.
    C:\Program Files\Java\jdk1.5.0\bin; ) or the
    Appserver may not be able to start and/or stop.
    Mixed quoted spaces in your PATH can cause problems,
    so the launcher will remove all double quotes before
    invoking the process. The most reliable solution
    would be to remove all spaces from your path before
    starting the Appservers components. |#]
    That's a misleading message of the application server:-( Most of the time there is nothing wrong:-(
    2: jndi missing name
    2006-04-24T23:26:41.203+0200|INFO|sun-appserver-pe8.1_
    02|javax.enterprise.system.container.web|_ThreadID=10;
    |WEB0100: Loading web module [logoplus1] in virtual
    server [server] at [logoplus1]|#]
    [#|2006-04-24T23:26:41.203+0200|SEVERE|sun-appserver-p
    e8.1_02|javax.enterprise.system.container.web|_ThreadI
    D=10;|WEB0123: WebModule [logoplus1] failed to deploy
    and has been disabled:
    [javax.naming.InvalidNameException: Real JNDI name
    cannot be empty for jdbc/LogoFlex].|#]
    [#|2006-04-24T23:26:41.203+0200|INFO|sun-appserver-pe8
    .1_02|javax.enterprise.system.container.web|_ThreadID=
    10;|WEB0100: Loading web module [Insort] in virtual
    server [server] at [Insort]|#]
    [#|2006-04-24T23:26:41.218+0200|SEVERE|sun-appserver-p
    e8.1_02|javax.enterprise.system.container.web|_ThreadI
    D=10;|WEB0123: WebModule [Insort] failed to deploy
    and has been disabled:
    [javax.naming.InvalidNameException: Real JNDI name
    cannot be empty for jdbc/LogoFlex].|#]Were those related to your Export War -> deployment attempts? You would have to create the JDBC resources/connection pools by hand and add a WEB-INF/sun-web.xml with the right information to be successful in that case. See http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/appserverdeploy.html for more.
    >
    5: yes and there seems to be NO solution
    I also noticed that the studio2 do not try to
    shutdown the running appserver. and seems to beYes, Creator does not shut down the application server (or DB) when the user stops it.
    baffled seing it started (?) Normally Creator connects just fine to a running PE?? What kind of problems do you see?
    Thanks,
    -- Marco
    >
    ERik

Maybe you are looking for

  • External Drives vs. Network Attached Storage (NAS)

    I'm a part time photograher using a PB G4 1.5GHZ machine with external display for most of my image editing, sorting, etc. I need to by more external storage for my images and have planning on external storage with a two drive configuration in RAID 1

  • Form fields covering lines

    We are adding fillable fields to a form and they are covering the lines on the form up.  Is there a way to make the fields not cover the lines, other than setting them above the lines. Thanks for the help!

  • How do I create hidden folders in iweb

    I switched to Mac from PC which means I lost FrontPage.  I have 6 small websites for my books and I need to rebuild these.  I don't have time to learn Dreamweaver at this time.  How do I create the essential hidden folders I need in iWeb to place the

  • What is a good book to help learn new iNumbers 3.0.1

    Is  there an instruction book out yet for iNumbers 3.0.1???? I need help with iNumbers. Senior citizen who keeps a strick budget in Numbers1 I will be 75 years young on Xmas day. Yeap some Dimension...so Help! Thanks Dennis

  • PO to xml in a specified format in B1iSN

    Hi All, I have scenario where I want to generate  xml from PO in a specified format in B1iSN, The default xsl seems from the package that I have made  u201Cbiu.Z.bp.Z.POtoXML.xslu201D. Now where can I add my own xsl transform template in this and how