List of files in a AL11 directory

Requirement: To get the file list in an internal table in a specific directory
Current Scenario: We are using the FM 'SUBST_GET_FILE_LIST' to get the file list.
But the file names in the return table are being truncated after 75 characters but we are having long file names(100 chars)
Could anybody sugest an alternate FM or the table from where we can retrieve the file list?
Thanks in advance !!

PARAMETER p_path(50) TYPE c DEFAULT '/TMP' LOWER CASE.
PARAMETER p_file(50) TYPE c DEFAULT '*.* '  LOWER CASE.
dpath = p_path.
pfile = p_file.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
     EXPORTING
          dir_name               = dpath
*          FILE_MASK              = PFILE
     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.

Similar Messages

  • Getting a list of files from a shared directory

    Hi All,
    I need to get a list of files from a shared directory on another server and put them in a HTMLB TableView element with links to the files.
    I was not successful with CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES. This method works in test mode, but gives me a gui_not_supported exception in BSP. I guess BSPs are not allowed to use this.
    Is there any other alternative?
    I need to be able to upload the files as well.
    Thanks,
    Roman
    Message was edited by: Roman Dubov

    Hi again,
    Not sure about the shared directory files list...
    In my opinion, this cannot be done using BSP.
    But, you can try using VBScript to access the file system with object of that sort :
    CreateObject("Scripting.FileSystemObject")
    it is only a thought and you can be sure to cross security problems by accessing files through a Web application...
    Best regards,
    Guillaume

  • How to get list of file names from a directory?

    How to get list of file names from a directory?
    Please help

    In addition, this:
    String filename = files;Should be this:
    String filename = files;
    That's just because he didn't use the "code" tags, so [ i ] made everything following it become italicized.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to create Dynamic Selection List containg file names of a directory?

    Hi,
    I need a Selection List with a Dynamic List of Values containing all file names of a particular directory (can change through the time).
    Basically, I need an Iterator over all file names in a directory, which could be used for Selection List in a JSF form.
    This iterator has nothing to do with a database, but should get the names directly from the file system (java.io.File).
    Can anybody tell me how to create such an iterator/selection list?
    I am working with JDeveloper 10.1.3.2, JSF and Business Services.
    Thank you,
    Igor

    Create a class like this:
    package list;
    import java.io.File;
    public class fileList {
        public fileList() {
        public String[] listFiles(){
        File dir = new File("c:/temp");
        String[] files = dir.list();
        for (int i = 0; i < files.length; i++)  {
                System.out.println(files);
    return files;
    Right click to create a data control from it.
    Then you can drag the return value of the listFiles method to a page and drop as a table for example.
    Also note that the Content Repository data control in 10.1.3.2 has the file system as a possible data source.

  • List all file names in a directory

    Hello everybody,
    I need to write a script in PL/SQL (oracle 10g) that lists all filenames in a specific directory on a client machine and import the files into the database (xml files). After the file is imported they have to be removed.
    I was searching for a solution for this because I have never come accross a challenge like this.
    What I found was that I could use the procedure dbms_backup_restore.searchfiles of the SYS schema.
    Now I need to know how this procedure works. There is very little documentation available.
    Can I give the procedure a folder name on my client computer that has the xml files and let the procedure list these files?
    Can someone please help me with this. I haven't got a clue.
    Thanks in advance.
    regards,
    Mariane

    Hello Justin,
    Thank you for your reply.
    You have just confirmed what I already was thinking: that the server cannot read files from the client.
    I haven't got a client application running to do this. My customer wants me to write a script in PL/SQL that enables users to run an import of xml files in the database by giving in a directory name on the client.
    I told my customer that they have to put the xml files on a server directory. Should that always be the server where the database resides on?
    Is there another way to solve this request?
    Thanks in advance.
    regards,
    Mariane

  • How to list all files in a given directory?

    How to list all the files in a given directory?

    A possible recursive algorithm for printing all the files in a directory and its subdirectories is:
    Print the name of the directory
    for each file in the directory:
    if the file is a directory:
    Print its contents recursively
    else
    Print the name of the file.
    Directory "games"
    blackbox
    Directory "CardGames"
    cribbage
    euchre
    tetris
    The Solution
    This program lists the contents of a directory specified by
    the user. The contents of subdirectories are also listed,
    up to any level of nesting. Indentation is used to show
    the level of nesting.
    The user is asked to type in a directory name.
    If the name entered by the user is not a directory, a
    message is printed and the program ends.
    import java.io.*;
    public class RecursiveDirectoryList {
    public static void main(String[] args) {
    String directoryName; // Directory name entered by the user.
    File directory; // File object referring to the directory.
    TextIO.put("Enter a directory name: ");
    directoryName = TextIO.getln().trim();
    directory = new File(directoryName);
    if (directory.isDirectory() == false) {
    // Program needs a directory name. Print an error message.
    if (directory.exists() == false)
    TextIO.putln("There is no such directory!");
    else
    TextIO.putln("That file is not a directory.");
    else {
    // List the contents of directory, with no indentation
    // at the top level.
    listContents( directory, "" );
    } // end main()
    static void listContents(File dir, String indent) {
    // A recursive subroutine that lists the contents of
    // the directory dir, including the contents of its
    // subdirectories to any level of nesting. It is assumed
    // that dir is in fact a directory. The indent parameter
    // is a string of blanks that is prepended to each item in
    // the listing. It grows in length with each increase in
    // the level of directory nesting.
    String[] files; // List of names of files in the directory.
    TextIO.putln(indent + "Directory \"" + dir.getName() + "\":");
    indent += " "; // Increase the indentation for listing the contents.
    files = dir.list();
    for (int i = 0; i < files.length; i++) {
    // If the file is a directory, list its contents
    // recursively. Otherwise, just print its name.
    File f = new File(dir, files);
    if (f.isDirectory())
    listContents(f, indent);
    else
    TextIO.putln(indent + files[i]);
    } // end listContents()
    } // end class RecursiveDirectoryList
    Cheers,
    Kosh!

  • File generated in AL11 directory

    Hi Experts,
    I have created a logical file path and assigned it to physical path in FILE transaction.
    I have also created logical file name and mapped it to Physical File name.
    The physical file name is "stock<YYYY><MM><DD>.csv" . But when I execute APD and the file is generated, it gets generated at different directory and the file name appears as "stock201".
    I dont know where it is getting wrong, but I think it is getting replaced with exact no. of characters in <FILENAME> parameter.
    The output file "stock201" is exactly 8 characters long as the the no. of characters in parameter <FILENAME>.
    Any suggestions to resolve the above problem.
    Regards,
    Hardik

    Hello Hardik,
    Can you please check that you have the coding correction applied from the SAP notes 1318160 and 1416830 if they are relevant for your release?  Although the note symptoms don't exactly describe your problem they are relevant for the issue.
    Kind Regards,
    Des

  • List opened file of a specific directory

    Hi, i would like to list all opened file of a specific duirectory. Maybe I could try to open all files in exclusive mode and catch the exception if the file already open. But i don't know how to open a file in exclusive mode. If you know a better way to do that you are welcome.
    Don't forget that no matter what program already open the file... it could be word, notepad... I'm working on windows, sorry :) !!!
    Thanks
    Zoop

    I also need to make the items in the list click'able so that I can press the display_name and then get the item displayed.
    I have now tried to make a procedure in the portal schema:
    as
        v_tal   number := 0;
        CURSOR tidCursor1 IS
            select DISPLAY_NAME, DESCRIPTION, TO_DATE(PUBLISH_DATE,'DD-MM-YYYY') DATO from portal.wwsbr_all_items WHERE CAID=53 and CATEGORY_ID=8992 order by ID desc;
        begin
            htp.p('<table border=0 width=100%>');
            FOR tidRec IN tidCursor1
            LOOP
                htp.p('<tr><td><b><font face="Arial" size="2" color="#014353">' || tidRec.DISPLAY_NAME || '</font></b><br><font face="Arial" size="1" color="#859CA6"> Skrásett tann ' || TO_CHAR(tidRec.DATO,'D. Mon ´YY') || '</font></td></tr><tr><td><font face="Arial" size="1" color="#014353">' || tidRec.DESCRIPTION || '</font></td></tr><tr><td> </td></tr>');
                v_tal := v_tal + 1;
                EXIT WHEN v_tal >= tal;
            END LOOP;
            htp.p('</table>');
    exception
    when others then
        null;
    end;But now I'm in doubt of how to insert a link to the item itself.
    I'm running portal 10.1.4, so it has path-names that go like this:
    htto://host.domain:port/portal/page/portal/myPageGroupName/PageName/SubPageName etc.
    How can I get an url to these items, that I can be sure will work. What table can I use for that?
    Thanks,
    Botzy
    Message was edited by:
    Botzy

  • Problem with getting a list of files in a directory

    I'm trying to get a list of files in a particular directory. The problem is I'm also getting a listing of all the sub-directories too. Here is my code:
    File directory = new File(dir);
    File[] filelist;
    filelist = directory.listFiles();
    for(int i=0;i<filelist.length;i++)
    System.out.println("FileName = " + filelist.getName());
    What am I doing wrong?
    Thanks
    Brad

    You are not doing anything wrong. You just have to test whether a given file is a subdirectory:
    File directory = new File(dir);
    File[] filelist;
    filelist = directory.listFiles();
    for(int n = 0; n < filelist.length; n++) {
      if (!filelist[n].isDirectory())
        System.out.println("FileName = " + filelist[n].getName());
    }S&oslash;ren Bak

  • List of files in directory

    I need to access a list of files in a directory. The files are .js scripts that I want to dynamically insert into a page with JSP. The problem is that at my company these .js scripts will often be added/removed and it would simplify the process to just look at what's in the directory and pick out the appropriate .js that are available.
    My directory structure is arranged something like this:
    ./src/jsp for the jsp pages
    and
    ./conf/somescripts for the .js scripts.
    I tried accessing it with getClass().getResource() to get the URL, and I also tried File(relativePathToSomescripts) but without much success - tends to get nulls in return. I'm not too experienced with JSP, but I'm guessing the relative paths change once Tomcat compiles them. So what would be a reliable way to access the list of files in the script directory?

    The File constructor only accepts absolute URI's. You can get the absolute URI for the relative URI using ServletContext#getRealPath().
    String absolutePath = servletContext.getRealPath(relativePath);

  • Problem in output file generation in AL11 tcode

    Hi experts,
                     I am doing one proxy to file scenario.file to be generated as a fixed length format .when i run the scenario, i am getting all the values in output payload correctly in Sxmb_moni and file is also created.But when i scroll upto last to the file generated in ALL11 directory. I am not getting whole values that generated in output payload.In my case my last value is generating in output payload but i am getting trimmed value in file generated in al11 directory.when i save this text file also in local system , i am again only getting trimmed values as seen in All11 directory.when i tried with changing any field length value before that last field with small length(size)value.I am able to see the whole output payload value in file also while scrolling in the file generated in al11 directory

    >
    deepak jaiswal wrote:
    > Hi,
    >
    > I summed the fixed length of all fields and it's sum comes 515. But it displays me upto length 514 values in file generated in al11 only.
    >
    > Please help me to reslove this issue.
    >
    > Deepak jaiswal
    Since in AL11 you can have only 256 char in a row, so I hope you will be getting 3 rows in your case. Correct??
    First row 256
    2nd   row 256
    3rd   row   1
    Total     513
    So out will be 513 which is correct because from first 2 rows it has truncated 1 char from both rows. Please check your output length again to confirm.
    So it is not a problem neither your's nor AL11's. When you write your file at legacy system then it will show the correct data or use FTP adapter and write the file on your local machine to see all the char.
    I hope this solves your problem.

  • TO READ FILES IN A PARTICULAR DIRECTORY FROM APPLICATION SERVER

    Hi all,
    Is there any function module which gives the list of files in a specific directory ??
    for eg ;i want to fetch all files in a particular directory say */interf/sy-mandt/reports....*
    I need a function module which will give all filenames in an internal table ,if i give the directory name as input.
    Thanks in advance,
    Aakash.
    Edited by: Aakash Neelaperumal on Apr 25, 2008 11:06 PM

    Hi,
    You can use WS_FILENAME_GET but understand it is obsolete. Search for a FM in function group SFES. I saw quite a few and one of them should meet your requirement.
    Cheers !

  • List of files in subdirectories

    I am trying to create an array of strings to contain a list of files in a particular directory. The only problem is that I am having trouble getting down to the subdirectories. I think I am going in the right direction here is some of my code:
    public void readDir()
              String dir = "F:\\APPS\\SPCII\\DATA\\";
              File directory = new File(dir);
              String[] M = directory.list();
              for (int index = 0; index < M.length; index++)
                   System.out.println (M[index]);
              for(int i = 0; i < M.length; i++)
                   File directory1 = new File(M);
                   String[] P = directory1.list();
              for (int index = 0; index < P.length; index++)
                   System.out.println (P[index]);
         }//readDir
    I can get all the files in the parent directory but when I go into the subdirectories such as files Array P is holding and try to print them out I get an error that it cannot resolve the symbol P. Any help is appricieated.

    Doesn't anybody read the fine instructions any more? Just above where you posted this unformatted code it says "You can format the text of your message by using a number of special tokens". If you had read that you would have been able to format your code like this:public void readDir()
      String dir = "F:\\APPS\\SPCII\\DATA";
      File directory = new File(dir);
      String[] MACHINE = directory.list();
      for (int index = 0; index < MACHINE.length; index++)
        System.out.println (MACHINE[index]);
      for(int i = 0; i < MACHINE.length; i++)
        File directory1 = new File(MACHINE);
    String[] P = directory1.list(); // here you declare P
    } // this is the end of the block where P is declared, P is not known outside this block
    // you probably want this } to go after the next for loop
    for (int index = 0; index < P.length; index++) // so you can't use P inside this block
    System.out.println (P[index]);
    }//readDir

  • AL11 Directory length

    Dear all,
    Let say I have a work area with 6 fileds and each is of CHAR100 type. so if I completely populate the work area then, it will contain 600 characters.
    Now, when I create a file in the AL11 Directory with the contents of the work area, it is showing only 512 characters in the AL11 directory. However, if we open the same file through Unix system and display it, it displays all the characters.
    There is no truncation of data. But my requirement is to increase the limit from 512 characters to say 1024 or something like that, so that I can see all the characters in AL11 also.
    Is that possible? if so how can I do that?
    Thanks and Regards,
    S.Dakshna Nagaratnam.

    evem the display is not there also,once you download the files you will have all the data..
    if particlulary you want to increase the size viewable in AL11 then contact the BASIS..

  • Get the File information(data) from Directory AL11.

    Hi Friends,
    I want to get the file data from the given particular directory(which maintained in AL11) in the selection screen.
    for listing the files from the directory, i used FM 'RZL_READ_DIR_LOCAL'. it displaying only files what ever in the given directory.
    But my requirement is to display the complete data in the file ( log file contents).
    please suggest me with relevant Function module or logic.
    Thank you.
    Regards
    Ramesh M

    HI,
    Try using function module:
    PARAMETERS:     p_fname    LIKE rlgrap-filename               .
    data l_path       TYPE dxlpath       .
    DATA: l_true       TYPE btch0000-char1.
    *-- F4 functionality for filename on Application Server
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
        EXPORTING
          directory        = '/usr/sap/input'
          filemask         = ''
        IMPORTING
          serverfile       = l_path
        EXCEPTIONS
          canceled_by_user = 1
          OTHERS           = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        p_fname = l_path.  ""Here p_fname is the parameter for the user to select the file from the application server
      ENDIF.
    PFL_CHECK_OS_FILE_EXISTENCE
      DATA: l_file       TYPE tpfht-pffile.
      CLEAR l_file.
      l_file = p_fname.    "Here p_fname is the parameter for the user to select the file from the application server
      CALL FUNCTION 'PFL_CHECK_OS_FILE_EXISTENCE'
        EXPORTING
          fully_qualified_filename = l_file
        IMPORTING
          file_exists              = l_true.
      IF l_true = space.
        MESSAGE e001(zmsg).
      ENDIF.
    Hope it helps
    Regards
    Mansi

Maybe you are looking for

  • I have 2 icloud accounts how can i see them both on my macbook and iphone

    I have 2 icloud accounts how can I see them both on my macbook and iphone?

  • Convert from 9.0 to 8.5

    Can anyone convert this file from LabView 9.0 to 8.5? Solved! Go to Solution. Attachments: FFT z pliku i mikrofonu2mod (1).vi ‏307 KB

  • Problems with running a scipt in SuSE Linux

    Hiya, Need some help please. I'm writing an application in SuSE linux and I'm having trouble porting it over from my SuSE 9.1 Pro desktop - to my SuSE 9.2 laptop. I'll try and keep it as brief and simple as possible so here goes; Firstly, everything

  • Using Decode in where clause in free hand sql

    Hi,     I want to use decode in free hand sql. for eg : this is a where condition Outlet_Lookup.City  =  @variable('Enter City') Requirement : if we put the user prompt as "Enter City and % for all cities" and the user enters % then the data display

  • Aperture to iPad

    I am awaiting my iPad, and thinking about how to keep Aperture photos on it. I have Aperture set to shared previews. What is the best preview size and quality settings for optimized viewing on an iPad? The iPad specs say, "TV and video Support for 10