Fm to read a directory

Hi Experts,
Is there any FM in ABAP to read a directory from local server.?If so Can any body give me with an example.
SSure of reward points.

hi Ravi,
Check out this hope it works..
REPORT zsritest3.
TABLES: file_table.
DATA: lt_file_names TYPE FILETABLE,
      lwa_file_name TYPE FILE_TABLE,
      lv_subrc TYPE i.
SELECT-OPTIONS: so_file FOR file_table NO INTERVALS.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_file-low.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
  EXPORTING
*    WINDOW_TITLE            =
*    DEFAULT_EXTENSION       =
*    DEFAULT_FILENAME        =
*    FILE_FILTER             =
    INITIAL_DIRECTORY       = 'C:Temp'
    MULTISELECTION          = 'X'
  CHANGING
    file_table              = lt_file_names[]
    rc                      = lv_subrc
*    USER_ACTION             =
  EXCEPTIONS
    FILE_OPEN_DIALOG_FAILED = 1
    CNTL_ERROR              = 2
    ERROR_NO_GUI            = 3
    others                  = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
so_file-sign = 'I'.
so_file-option = 'EQ'.
LOOP AT lt_file_names INTO lwa_file_name.
  so_file-low = lwa_file_name.
  APPEND so_file.
ENDLOOP.
START-OF-SELECTION.
  LOOP AT so_file.
    WRITE: / so_file-low.
  ENDLOOP.

Similar Messages

  • Read a directory structure?

    Hallo every body,
    How can I read the directory structure of a system(any tutorial or hint).
    Thanks in advance

    The File object has all the methods you need to do this manually. What problem are you trying to solve?

  • Nullpointer when reading a directory

    I have a web application (WAR) and a directory called testdir under the WEB-INF\classes directory. I want to loop thru all the properties files inside this directory and for each one, I want to read each one and process it.
    Inside my Java program, I have the following code to read the directory but it gave me back nullpointer
    File bpelDir = new File("testdir ");
    Here's the directory structure. The java program resides in the com\abc directory
    WEB-INF\classes\testdir\
    WEB-INF\classes\com\abc\
    Thanks,

    You're probably better off asking the classloader for the properties files as streams anyway. See the javadocs for Classloader.getResourceAsStream for further info.

  • I/O error while reading domain directory

    I have created a server under admin server. Actually i was trying to integrate weblogic server with obiee.. as i am very new to weblogic i cudn't find the reason for the error.
    while i am starting the server which i created i am getting this error
    error details i will give below.. Thanks for any help and i will highly appreciate it.
    Description: Starting OBIEE server ...
    Status: FAILED
    Begin Time: 5/12/11 10:14:36 AM IST
    End Time: 5/12/11 10:14:37 AM IST
    Exception: I/O error while reading domain directory
    Thank you.

    While starting node manager iam getting this error
    SEVERE: Fatal error in node manager server
    java.net.BindException: Address already in use: JVM_Bind
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
    at java.net.ServerSocket.bind(ServerSocket.java:328)
    at javax.net.ssl.impl.SSLServerSocketImpl.bind(Unknown Source)
    at java.net.ServerSocket.<init>(ServerSocket.java:194)
    at java.net.ServerSocket.<init>(ServerSocket.java:150)
    at javax.net.ssl.SSLServerSocket.<init>(SSLServerSocket.java:84)
    at javax.net.ssl.impl.SSLServerSocketImpl.<init>(Unknown Source)
    at javax.net.ssl.impl.SSLServerSocketFactoryImpl.createServerSocket(Unkn
    own Source)
    at weblogic.nodemanager.server.SSLListener.init(SSLListener.java:76)
    at weblogic.nodemanager.server.NMServer.start(NMServer.java:206)
    at weblogic.nodemanager.server.NMServer.main(NMServer.java:377)

  • Lion Server not reading Active Directory Groups reliably

    I am trying to upgrade one of our XServes from Snow Leopard Server to Lion Server and am running into a strange issue with our Active Directory based users and Groups.
    The current Snow Leopard Server serving files from a XSan volume is running fine, though we find a very long Lag time for Windows users to connect. Once a few users have connected the lag seems to go away, but it is still not nearly as fast as Mac users connecting or Windows connecting to a PC server.
    So I have connected a second Xserve to the SAN and performed a clean install of Lion Server. Initially while it would find my Active Directory Groups it would not import any of the users, so obvioulsly no one could connect. In a last ditch effort I installed the beta of 10.7.4, which seemed to resolve the issue for a small group of test users. However as I expanded the test I found that some users would get a message that the were no resources available to them, or they didn't have the correct permissions. This is very strange as everyone is in the same group so should have the same permissions. As a test I took one of the user accounts and created a new share and gave him R/W permission to that share and suddenly all of the shares that he should have had permission to in the first place popped up.
    The only thing that I can think of is that we have such a large Active Directory structure that the authentication is timing out or reaching some user limit and stops looking. (we have over 50,000 users and thousands of groups spread through multiple OUs in the AD structure)
    The new Server.app in Lion looks nice, but it does not seem to have nearly the robustness of the previous Server Admin tools. For instance, I never needed or wanted to setup a "Golden Triangle" but with Lion it is required. Perviously I could search for AD users or groups and drag them from the search window to the share to assign permission, now even though I've imported the groups and users it needs to search the entire directory when assigning permissions - why can't it see the groups that are already there? Why can I run a dscl search and find a user or group instantly, but the Server.app hangs for 5 minutes and shows 0 results?
    Has anyone found a way to make Lion Server work in an enterprise environment?

    Yesterday morning I bound a 10.7.4 server to our AD, and in the afternoon I eventually saw all the AD users, groups, etc show in Workgroup Manager. Now, with dscl, I can see all the AD user and group records, and with Workgroup Manager, I can search the groups, users, and computers, but with the Server.app, when trying to create new group of the type "Imported group from another directory", the searches returned nothing. Directory Utility can show all the AD information also. Our AD has thousands of user record, and so it is reasonable that it may take some time for the Mac server to get all the info. But from the add users or groups interface, I just could not get any search results. What could be wrong then? 

  • Regds : Read archive Directory

    I want to read the archive directory name in sender file adapter at runtime in the message mapping?
    Please suggest how can i achive this?

    Want to read the archive directory name in sender file adapter at runtime in the message mapping?
    Why?
    For a given sender file channel, the Archive Directory is constant. One sender file channel can be used only in one Sender Agreement. That means for given combination Communication Component, Interface, Namespace there is only one Communication Channel (Archive Directory). These three variable can be accessed in UDF using
    map = container.getTransformationParameters();
    headerField = (String) map.get(StreamTransformationConstants.INTERFACE_NAMESPACE);
    /* similarly Communication Component, Interface */
    http://help.sap.com/saphelp_nw04/helpdata/EN/43/09b16006526e72e10000000a422035/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/EN/78/b4ea10263c404599ec6edabf59aa6c/content.htm
    i.e. if this combination of Communication Component, Interface, Namespace then this is Archive Directory, if this combination of Communication Component, Interface, Namespace then this is Archive Directory.
    Now we have 2 option:-
    1. Hard code in UDF for this combination this is Archive Directory.
    2. Store these values in a database (this combination this is Archive Directory) and access it in message mapping by database lookup.
    There is other option, write a Adapter module, which populate the Archive Directory in SOAP header of messages in Adapter Engine. And access Archive Directory in UDF, similar to this http://help.sap.com/saphelp_nw04/helpdata/EN/78/b4ea10263c404599ec6edabf59aa6c/content.htm
    . But, this option is not recommended as it is performance overhead, and as for a Communication Channel, Archive Directory will not change (we have to do manual edit), At least very less in production (we don't change it very day ).

  • Read a directory on the clients box

    All,
    I have written some code that when you make a pick in the web browser I want it to give you a list of files in a directory on your computer.
    File current_dir = new File("e:\\pro_work\\.proi");
    String file_list[] = current_dir.list();
    This is a piece of the code I use and it seems to work fine when I am testing the application on my own box. When I go over to another persons machine and try it . I get the directory listing of my computer. I am using Netbeans as the server until I get it finished and deploy it. Any help on how Ithe client would see the list of iles on there machine would be appreciated. Thanks

    No, you can't access the client computer with java code.
    Java runs on the server. Thats why they call it Java Server Pages.
    You would need an applet/activex control to access the client computer's file system.

  • How to read Active Directory?

    Hello,
    I am experienced in the Oracle database, but not in the Application Server or any of its components. We have a Forms application which maintains its users in it proprietary Oracle database tables. I need to link them to our employees in the HR database which is an Active Directory.
    What's the easiest way to do that?
    What do I need to install and learn?
    Where do I start reading the documentation?
    Thanks,
    Gabor

    Gabor,
    This is a project in itself. Please follow the below metalink note.
    1) 261914.1
    Also if you have further questions or issues during the project, please create the thread in "Identity Management" forum. That is a special place for Active Directory integration with Oracle Applications
    -Srinivas

  • Having trouble reading a directory

    I'm trying to read all the filenames of a specific web directory for an online photogallery. The reading is done using a custom jsp tag, which creates a js variable with a list of all the picture names. My code works fine when reading from my own PC. For example reading all the names from "C:\Program Files" works perfect. The problem is that I get an error when I try to read from a web directory. Even "http://localhost:8080/test" gives me an error (since I thought it might have something to do with trying to access a directory outside of my domain.) Can anyone help me with the proper way to read a web directory? My code is below:
    if(name != null) {
                   StringTokenizer toker;
                   File f1 = new File(name);
                   File[] list = f1.listFiles(); //Get all files in the directory "name"
                   String files = "", fname;
                   for(int i=0;i<list.length;i++){
                        fname=list.toString(); //Turn filename into a string
                        toker = new StringTokenizer(fname,"\\"); //parse out the path before the filename
                        while(toker.hasMoreTokens())
                             fname=toker.nextToken();
                        files = files + "\"" + fname.substring(0, fname.length()-4) + "\","; //parse out the extension ".jpg"
                   files = files.substring(0,files.length()-1);
                   pc.getOut().write("<script type=\"text/javascript\"> \n var dirlist = new Array("+files+"); \n </script>"); //send the string of filenames to the client

    what is the error you get?
    Even "http://localhost:8080/test" gives me an error
    You are not passing that url to the File object are you?

  • Need help reading file directory from applet!

    Hi i am writing a java applet which has to read in several text files from its codebase directory. I have this code at the moment which causes a nullpointerexception:
    public void initTables()
            File dir = new File(getCodeBase().getPath());
            File[] files = dir.listFiles();
            for (int i = 0; i < files.length; i++)//null pointer here
                String fileName = files.getName();
    if(fileName.endsWith("set.txt"))
    fileName = fileName.substring(0, (fileName.length() - 4));
    Table t = new Table(this, fileName);
    }Anybody know whats going on here?
    thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Sorry i thought it was a null pointer, it's actually this:
    java.security.AccessControlException: access denied (java.io.FilePermission C:\Users\Emud\Documents\pokemon read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkRead(Unknown Source)
         at java.io.File.list(Unknown Source)
         at java.io.File.listFiles(Unknown Source)
         at Gui.initTables(Gui.java:75)
         at Gui.init(Gui.java:16)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.security.AccessControlException: access denied (java.io.FilePermission C:\Users\Emud\Documents\pokemon read)
    yeah, i'm making a program about pokemon...cos i'm cool 8)

  • ODI Procedure to read a directory/folder in interface during package.

    Hello,
    A have a ODI package including 1 procedure and 1 interface
    I will like get the filename in interface (datastore source) with procedure.
    Its possible?
    Thanks!

    I would recommend to go for Java rather than Jython.
    Step 1. Assigned Variable for Path in Physical Schema and another Variable for Source Datastore. [ If directory path is fixed and only file name changes then skip assigning variable to physcial schema ]
    Step 2. Read via Java and find the files and assign the path and file name to two different Java Variable
    Step 3. Refresh the Variable with select '<@=java_path_variable@>' from dual and similarly refresh the variable for filename
    Step 4. Call the Interface.
    Does this helps.

  • Procedure to Read a Directory/folder

    Hi!
    I wanted to use Procedure that reads a FOLDER/DIRECTORY in some path and get all the file names within that folder(can be in any language like jython or java or SQL).
    And later I wanted to assign a variable to these fileNames and use it in my Interface.
    Please Help/Suggest.
    Thnx,
    Diwakar

    Hi madha! This is the last attempt I am making, afterwards I will change my logic..
    The error i got lately are:
    org.apache.bsf.BSFException: exception from Jython: Traceback (innermost last):
    (no code object) at line 0
    File "<string>", line 7
         if os.path.isdir(mydir + os.sep + dirOrFile):
         ^
    SyntaxError: invalid syntax
         at org.apache.bsf.engines.jython.JythonEngine.exec(Unknown Source)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    and the code I wrote was:
    import os
    ftrg = open('c:/listdir.txt', 'w')
    mydir = 'c:/wwc'
    mylist = os.listdir(mydir)
    mylist.sort()
    for dirOrFile in mylist:
    if os.path.isdir(mydir + os.sep + dirOrFile):
    print >> ftrg, 'DIRECTORY: %s' % dirOrFile
    else:
    print >> ftrg, 'FILE: %s' % dirOrFile
    ftrg.close()
    Please help me last time.

  • Reading a directory

    Is it possible to list files in a directory using action
    script for flash lite?
    How do mobile phones read storage device like SD cards when
    inserted in the mobile phone?
    Will be much appreciated for any advise, thanks.

    Look at the File object in the API. The name is a bit misleading: it can actually refer to a directory. If you construct a File object to represent a directory's path, then you can get a list of files in that directory using the list() method on your File instance. It returns an array of strings with names of files and directories contained in the directory.

  • Reading Active directory from ECC 6.0

    Hi All,
    During triggering of a workflow, to determine the manager of initiator of work flow we are trying to get the manager details from Active directory(we don't have HR org data).
    Precisely the requirement is using the SAP User id, read the active directory information for the same user and determine the manager user id in Active Directory.
    Does any body came across such situation? Are there any specific RFC enabled function modules which provides the require data?
    Your response will be highly appreciated.
    Regards,
    Nanda.

    Hi Nanda,
    Yes it is possible,  Lots of steps involved though..
    First  you need have the LDAP connector ativated in R/3.
    1) Create RFC destinatino of type T with the active directory server name . ( Contact Basis )
    2) Do the necessary configuration in transaction  transaction LDAP in R/3.
        But before you do that you need to ask your active directory folks the following details.
    --> Ask them to create a userid  and pwd in active directory which you can use for your configuration.
    --> Ask them for distinguished Name
    --> Ask  them for Base entry
    --> Ask them for the  correct port number.
    configure all as per the doucment which Karthikeya has given.
    3) use the following FMs in your program
      LDAP_SYSTEMBIND
      LDAP_SEARCH 
        here you will be passing your serach string
        which will return the person's manager.
      LDAP_UNBIND
    ofcourse based on SAP ID you have get this email id and then
    Thanks,
    Krishna

  • File *.xml Reading From Directory

    Hi Friends
    I want to read only *.xml (only File name not Contain)From Particular Directory and Store into a collection
    like
    File fileSel = new File("../../tomcat/webapps/examples/");
    From this I can reach upto Directory Now i want to read File Name with *.xml Extension Only
    u can mail me at : [email protected]
    Thanks in Advance
    Bye
    Tabs

    Something like this should work:
    public class MyFilter implements FilenameFilter {
        public boolean accept(File dir, String name) {
                return name.toLowerCase().endsWith(".xml");
    }Col

Maybe you are looking for

  • Not sure if I can install this edition on my computer (Adobe lightroom 3)

    So today I went to my local bestbuy and asked for Adobe lightroom 3, they gave it to me and I went home. When I got home I saw that its the Student and Teacher edition. I am not a student or teacher at any university, I am  in High School, I was wond

  • LIBPATH in AIX

    Peace! I'm running on AIX 4.3.3 wls 5.1 and it's unable to load performance pack, use java native I/O. I'm checked LIBPATH and it's exact (<wl_home>/lib/aix). Also, I'm running a test program that display system properties: I've not found (<wl_home>/

  • HTMLDocument.getText() issue: HTML tag br is translated to ' ' (space)??

    HTMLDocument.getText() issue: <br> (HTML.Tag.BR) is translated to ' ' (space), but I've expected the '\n'! I have the HTMLDocument that contains <html><body> <br> <br> <br> SOMETEXT <br> </body></html> The JTextPane is perfectly showing this formatti

  • RAC 10g rel2: OCFS or ASM ?

    Hi all, I have successfully installed a 10g_r2 RAC on Linux RH3, currently using ASM for all database files (data, control, redo and flash_reco_area). But I don't like very much ASM, I would prefer to have direct control on all files, so I am thinkin

  • I'm having problems with Bonjour in iTunes.

    I'm having problems with bonjour. It says "Bonjour service has been disabled", but I can't find it in [Control Panel, Administrative Tools, Services]. When I download it and try to install it, it says that there is later version of it already install