F4 Help to get the path for a File source directory

There are numerous function modules for browsing a particular file in desktop and getting the file path (including the fine name)  , like F4_FILENAME , KD_GET_FILENAME_ON_F4 , WS_FILENAME_GET etc. But can anyone tell me how to fetch only the directory path to the field were the F4 help is given. Actually the filename has to come in some other field in the selection screen. Is there separate funtion modules for these OR will changing parameters in the above function modules work?
Pls Help....
Also are there function modules for providing F4 help for getting the path to a file in application directory?

Try this method CL_GUI_FRONTEND_SERVICES.
It is a Global CLASS which is having different methods for different purposes
see the documentation of it and use the methods of it
see
CL CL_GUI_FRONTEND_SERVICES
Short Text
Frontend Services
Functionality
The class CL_GUI_FRONTEND_SERVICES contains static methods for the following areas:
File functions
Directory functions
Registry
Environment
Write to / read from clipboard
Upload / download files
Execute programs / open documents
Query functions, such as Windows directory, Windows version, and so on
Standard dialogs (open, save, directory selection)
Example
Determine the temp directory on your PC:
DATA: TEMP_DIR TYPE STRING.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_TEMP_DIRECTORY
CHANGING
TEMP_DIR = TEMP_DIR
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2.
IF SY-SUBRC 0.
Error handling
ENDIF.
flush to send previous call to frontend
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
IF SY-SUBRC 0.
Error handling
ENDIF.
WRITE: / 'Temporary directory is:', TEMP_DIR.
Notes
The class CL_GUI_FRONTEND_SERVICES is based on the Control Framework. See the documentation for more information, in particular on CL_GUI_CFW=>FLUSH which must be called after many CL_GUI_FRONTEND_SERVICES methods.
Migration Information
The old file transfer model was based on function modules of the function group GRAP. The old features have been replaced by the class CL_GUI_FRONTEND_SERVICES. The following list contains the old function modules (italic) and the new methods (bold) that replace them:
CLPB_EXPORT
CLIPBOARD_EXPORT
CLPB_IMPORT
CLIPBOARD_IMPORT
DOWNLOAD
GUI_DOWNLOAD, dialog replaced by FILE_SAVE_DIALOG
PROFILE_GET
No replacement, use REGISTRY_* methods instead
PROFILE_SET
No replacement, use REGISTRY_* methods instead
REGISTRY_GET
REGISTRY_GET_VALUE, REGISTRY_GET_DWORD_VALUE
REGISTRY_SET
REGISTRY_SET_VALUE, REGISTRY_SET_DWORD_VALUE
UPLOAD
GUI_UPLOAD, dialog replaced by FILE_OPEN_DIALOG
WS_DDE
Obsolete: This function is no longer supported.
SET_DOWNLOAD_AUTHORITY
Obsolete: This function is no longer supported.
WS_DOWNLOAD
GUI_DOWNLOAD
WS_DOWNLOAD_WAN
Obsolete: This function is no longer supported.
WS_EXCEL
Obsolete: This function is no longer supported.
WS_EXECUTE
EXECUTE
WS_FILENAME_GET
FILE_SAVE_DIALOG, FILE_OPEN_DIALOG
WS_FILE_ATTRIB
FILE_SET_ATTRIBUTES, FILE_GET_ATTRIBUTES
WS_FILE_COPY
FILE_COPY
WS_FILE_DELETE
FILE_DELETE
WS_MSG
Obsolete: This function is no longer supported.
WS_QUERY
CD (current directory)
DIRECTORY_GET_CURRENT
EN (read/write environment)
ENVIRONMENT_GET_VARIABLE
ENVIRONMENT_SET_VARIABLE
FL (determine file length)
FILE_GET_SIZE
FE (check if file exists)
FILE_EXIST
DE (check if directory exists)
DIRECTORY_EXIST
WS (determine Windows system)
GET_PLATFORM
OS (operating system)
GET_PLATFORM
WS_UPLDL_PATH
Obsolete: This function is no longer supported.
WS_UPLOAD
GUI_UPLOAD
WS_VOLUME_GET
Obsolete: This function is no longer supported.
Reward points if useful.

Similar Messages

  • How to get the path when i select a directory or a file in a JTree

    How to get the path when i select a directory or a file in a JTree

    import java.lang.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.HeadlessException;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Iterator;
    * @author Frederic FOURGEOT
    * @version 1.0
    public class JTreeFolder extends JPanel {
    protected DefaultMutableTreeNode racine;
    JTree tree;
    protected JScrollPane scrollpane;
    final static int MAX_LEVEL = 1; // niveau max de descente "direct" dans l'arborescence
    * Sous-classe FSNode
    * @author Frederic FOURGEOT
    * @version 1.0
    private class FSNode extends DefaultMutableTreeNode {
    File file; // contient le fichier li� au noeud
    * Constructeur non visible
    private FSNode() {
    super();
    * Constructeur par initialisation
    * @param userObject Object
    FSNode(Object userObject) {
    super(userObject);
    * Constructeur par initialisation
    * @param userObject Object
    * @param newFile File
    FSNode(Object userObject, File newFile) {
    super(userObject);
    file = newFile;
    * Definit le fichier lie au noeud
    * @param newFile File
    public void setFile(File newFile) {
    file = newFile;
    * Renvoi le fichier lie au noeud
    * @return File
    public File getFile() {
    return file;
    public JTree getJTree(){
         return tree ;
    * Constructeur
    * @throws HeadlessException
    public JTreeFolder() throws HeadlessException {
    File[] drive;
    tree = new JTree();
    // cr�ation du noeud sup�rieur
    racine = new DefaultMutableTreeNode("Poste de travail");
    // cr�ation d'un noeud pour chaque lecteur
    drive = File.listRoots();
    for (int i = 0 ; i < drive.length ; i++) {
    FSNode node = new FSNode(drive, drive[i]);
    addFolder(drive[i], node); // on descend dans l'arborescence du lecteur jusqu'� MAX_LEVEL
    racine.add(node);
    // Gestion d'evenement sur JTree (on �coute les evenements TreeExpansion)
    tree.addTreeExpansionListener(new TreeExpansionListener() {
    public void treeExpanded(TreeExpansionEvent e) {
    // lorsqu'un noeud est ouvert
    // on descend dans l'arborescence du noeud jusqu'� MAX_LEVEL
    TreePath path = e.getPath();
    FSNode node = (FSNode)path.getLastPathComponent();
    addFolder(node);
    ((DefaultTreeModel)tree.getModel()).reload(node); // on recharche uniquement le noeud
    public void treeCollapsed(TreeExpansionEvent e) {
    // lorsqu'un noeud est referm�
    //RIEN
    // alimentation du JTree
    DefaultTreeModel model = new DefaultTreeModel(racine);
    tree.setModel(model);
         setLayout(null);
    // ajout du JTree au formulaire
    tree.setBounds(0, 0, 240, 290);
    scrollpane = new JScrollPane(tree);
         add(scrollpane);
         scrollpane.setBounds(0, 0, 240, 290);
    * Recuperation des sous-elements d'un repertoire
    * @param driveOrDir
    * @param node
    public void addFolder(File driveOrDir, DefaultMutableTreeNode node) {
    setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
    addFolder(driveOrDir, node, 0);
    setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
    * Recuperation des sous-elements d'un repertoire
    * (avec niveau pour r�cursivit� et arr�t sur MAX_LEVEL)
    * @param driveOrDir File
    * @param node DefaultMutableTreeNode
    * @param level int
    private void addFolder(File driveOrDir, DefaultMutableTreeNode node, int level) {
    File[] fileList;
    fileList = driveOrDir.listFiles();
    if (fileList != null) {
    sortFiles(fileList); // on tri les elements
    // on ne cherche pas plus loin que le niveau maximal d�finit
    if (level > MAX_LEVEL - 1) {return;}
    // pour chaque �l�ment
    try {
    for (int i = 0; i < fileList.length; i++) {
    // en fonction du type d'�l�ment
    if (fileList[i].isDirectory()) {
    // si c'est un r�pertoire on cr�� un nouveau noeud
    FSNode dir = new FSNode(fileList[i].getName(), fileList[i]);
    node.add(dir);
    // on recherche les �l�ments (r�cursivit�)
    addFolder(fileList[i], dir, ++level);
    if (fileList[i].isFile()) {
    // si c'est un fichier on ajoute l'�l�ment au noeud
    node.add(new FSNode(fileList[i].getName(), fileList[i]));
    catch (NullPointerException e) {
    // rien
    * Recuperation des sous-elements d'un noeud
    * @param node
    public void addFolder(FSNode node) {
    setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
    for (int i = 0 ; i < node.getChildCount() ; i++) {
    addFolder(((FSNode)node.getChildAt(i)).getFile(), (FSNode)node.getChildAt(i));
    setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
    * Tri une liste de fichier
    * @param listFile
    public void sortFiles(File[] listFile) {
    triRapide(listFile, 0, listFile.length - 1);
    * QuickSort : Partition
    * @param listFile
    * @param deb
    * @param fin
    * @return
    private int partition(File[] listFile, int deb, int fin) {
    int compt = deb;
    File pivot = listFile[deb];
    int i = deb - 1;
    int j = fin + 1;
    while (true) {
    do {
    j--;
    } while (listFile[j].getName().compareToIgnoreCase(pivot.getName()) > 0);
    do {
    i++;
    } while (listFile[i].getName().compareToIgnoreCase(pivot.getName()) < 0);
    if (i < j) {
    echanger(listFile, i, j);
    } else {
    return j;
    * Tri rapide : quick sort
    * @param listFile
    * @param deb
    * @param fin
    private void triRapide(File[] listFile, int deb, int fin) {
    if (deb < fin) {
    int positionPivot = partition(listFile, deb, fin);
    triRapide(listFile, deb, positionPivot);
    triRapide(listFile, positionPivot + 1, fin);
    * QuickSort : echanger
    * @param listFile
    * @param posa
    * @param posb
    private void echanger(File[] listFile, int posa, int posb) {
    File tmpFile = listFile[posa];
    listFile[posa] = listFile[posb];
    listFile[posb] = tmpFile;

  • How 2 get the path of a file

    how 2 get the path of a file Using jsp
    i have tried getPath...but i'm geting the error
    The method getPath(String) is undefined for the type HttpServletRequest
    any idea how 2 get the path of a file

    You need ServletContext#getRealPath().
    API documentation: http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String)

  • How 2 get the path of a file Using jsp

    how 2 get the path of a file Using jsp
    i have tried getPath...but i'm geting the error
    The method getPath(String) is undefined for the type HttpServletRequest
    any idea how 2 get the path of a file

    You need ServletContext#getRealPath().
    API documentation: http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String)

  • To Get The Path of A File

    hi
    i wanted to get the path of the file.i just need to get the path not the file.i wanted to do using swing.may be filechooser or tree. but i need to know how could i get tht if i know the exampl for this it would be useful for me ..

    i need it in a way that like in windows explore.. so tht if i get the path of it i can use that in another class file.
    anyway i am looking out in File class also.

  • Plz help to get the tag of html file

    hi
    I wants to convert the HTML file into PDF file dynamically.
    So first i wants to get the tag of html file when we pass the path of html file.
    so how i do this plz help me.

    Plz Tell me how I get the HTML Tag through the java code.

  • Hi Somw help to get the answers for these Questions

    Q1 Which one of the following is NOT polymorphic behavior?
    a.     Method overloading -- having methods with the same name but different signatures
    b.     Implicit type conversion -- for instance, a java.util.List class converts its members to Objects
    c.     Explicit type conversion -- when a class is converted to another class by a class cast statement
    d.     Method inheritance -- when a subclass inherits the behavior of the class from which it inherits
    e.     Using interfaces -- where any class can implement an interface for a given behavior, e.g. Runnable
    Q2 The following code defines the Example class.
    package com.brainbench.javaexamples;
    public class Example {
    public static final int VALUE = 10;
    // Additional code not shown.
    Referring to the sample code above, what classes modify the value of Example.VALUE
    a Inner classes of Example only
    b Classes in the same package only
    c Classes in the same source code unit only
    d. Classes in Java standard packages only
    e. None of the classes
    Q3 What is a classpath?
    a.     A search path for loading class files from disk
    b.     It exports Java code remotely
    c.     It protects the multiple JVMs from interfering with each other
    d.     It specifies which Java files must be compiled.
    e.     The security behavior of java.security
    Q4 Which one of the following is NOT a configurable JVM option?
    a.     Collect profiling and debugging statistics.
    b.     Set the maximum memory allocation pool size.
    c.     Set the initial memory allocation pool size.
    d.     Modify the garbage collector's behavior
    e.     Modify the number of bits a double variable uses.
    Q5 a. public void foo() {..}
    b. void foo() {..}
    c. protected void foo() {..}
    d. private void foo() {..}
    e public final void foo() {..}
    Which of the methods above are overridden via inheritance?
    a.     a and c
    b.     a and e
    c.     a, b and c
    d.     a, b and d
    e.     c, d and e

    Q1 Which one of the following is NOT polymorphic
    behavior?
    a.     Method overloading -- having methods with the same
    name but different signatures
    b.     Implicit type conversion -- for instance, a
    java.util.List class converts its members to Objects
    c.     Explicit type conversion -- when a class is
    converted to another class by a class cast statement
    d.     Method inheritance -- when a subclass inherits the
    behavior of the class from which it inherits
    e.     Using interfaces -- where any class can implement
    an interface for a given behavior, e.g. Runnable
    _________I would say c) beacause you need to state it clearly to the compiler, so it is not this great automatic polymorphic java behaviour.
    >
    >
    Q2 The following code defines the Example class.
    package
    com.brainbench.javaexamples;
    public class Example {
    public static final int VALUE = 10;
    // Additional code not shown.
    Referring to the sample code above, what
    classes modify the value of Example.VALUE
    a Inner classes of Example only
    b Classes in the same package only
    c Classes in the same source code unit only
    d. Classes in Java standard packages only
    e. None of the classes
    ___I would say e) beacause this variable is final which means you can't change it once initialized.
    >
    Q3 What is a classpath?
    a.     A search path for loading class files from disk
    b.     It exports Java code remotely
    c.     It protects the multiple JVMs from interfering
    with each other
    d.     It specifies which Java files must be compiled.
    e.     The security behavior of java.security
    ________a). Using classpath class loader load the classes.
    >
    Q4 Which one of the following is NOT a configurable
    JVM option?
    a.     Collect profiling and debugging statistics.
    b.     Set the maximum memory allocation pool size.
    c.     Set the initial memory allocation pool size.
    d.     Modify the garbage collector's behavior
    e.     Modify the number of bits a double variable uses.
    _______I would say e) because in Java every primitive value (including double) has the same size on every platform. Thats one thing why Java is portable.
    >
    >
    Q5 a. public void foo() {..}
    b. void foo() {..}
    c. protected void foo() {..}
    d. private void foo() {..}
    e public final void foo() {..}
    Which of the methods above are overridden via
    inheritance?
    a.     a and c
    b.     a and e
    c.     a, b and c
    d.     a, b and d
    e.     c, d and eI would say b) but I think the order is also important which is not stated in this question ( c) would be also good if methods in reverse order - c -> b -> a ) a) not because you can't reduce the visibility of a method. And two others includes private method, which doesn't take part in inhertiance at all (it is invisible when inheritted so can't be overriden, or you can't reduce visibility to private).

  • F4 help to give desktop path for retrieving file name

    Hi Guys,
    I want a big help from u people, I worked on module pool programming and in that i had written some BDC also in that. Now my concern is i need to give F4 help path for the user to goto Desktop and pick the file from his PC.He will goto transaction and then only he can run the Report.
    Now i had tried this
    at selection-screen on value-request for p_filename.
    v_mask = ',Tab Delimited (.txt),.txt.'.
    CALL FUNCTION 'WS_FILENAME_GET'
      EXPORTING
        DEF_FILENAME     = ' '
        DEF_PATH         = ' '
        MASK             = v_mask
        TITLE            = ' '
      IMPORTING
        FILENAME         = p_filename
      EXCEPTIONS
        INV_WINSYS       = 1
        NO_BATCH         = 2
        SELECTION_CANCEL = 3
        SELECTION_ERROR  = 4
        OTHERS           = 5.
    but in at selection screen i need to give parameters or select-options... which is not there as u know bcoz its a module pool programming.....
    Can u pls help me out its urgent!!!!!!!!
    Rewards will be definite....

    Hi Abdul,
    Refer demo program DEMO_DYNPRO_F4_HELP_MODULE in SE38.
    Check Flow Logic by double clicking on the screen 100.
    PROCESS BEFORE OUTPUT.
      MODULE INIT.
    PROCESS AFTER INPUT.
      MODULE CANCEL AT EXIT-COMMAND.
    PROCESS ON VALUE-REQUEST.
      FIELD CARRIER MODULE VALUE_CARRIER.
      FIELD CONNECTION MODULE VALUE_CONNECTION.
    <b>Reward points if it helps.</b>
    Regards,
    Amit Mishra
    Message was edited by: Amit Mishra

  • Load the path for properties files

    Hi;
    My application uses of the properties files which are stored in a repertory /properties at the same level that JAR.
    I search an good means to configure the path of the files properties: for example: a environment variable or another mean?
    My application will read from this env variable (or another means) the path where are stored the files to use them.
    Regards;

    If the properties file is fixed, then it's best to make it a resource as suggested and put it inside the jar.
    OTOH if you have a situation where the properties file is dependant on installation or even writable then that won't do.
    In a lot of cases where the properties are variable it's better to use the Preferences class, on Windows this will put the data in the registry.
    You can use a command line argument, of course, to specify the location of your configuration file. I tend to use java System.getProperty and -D command line switches. That has the advantage that you don't have to send the value down from main() to where you are using it.

  • How do I get the codec for .mov files recorded on an ipad, so I can edit them in premiere El. 12?

    I have .mov files recorded from an ipad with these specs:
    AAC, Mono, 44.100 KHZ
    H.264 320x568 (yes the ipad was used vertically, not horizontally)
    29.96 fps
    I want to edit them in premiere 12, but get this error message:
    This type of file is not supported or the required codec is not installed.
    What are my options? Thanks!

    linn749
    Thanks for the reply.
    As for orientation, there is a rotation feature in Premiere Elements 12....at the Timeline level, you can right click the clip and select Rotate 90 Left or Rotate  90 Right. So that may help.
    This is what you may want to try and see what this looks like
    1. Open Premiere Elements 12 to its Expert workspace
    2. Go to File Menu/New/Project and Change Settings
    3. In the Change Settings dialog, change the project preset to NTSC DV Widescreen.
    4. Before you exit that area, in the last dialog that you see (new project dialog), make sure you have a check mark next to "Force Selected Project Setting on this Project".
    5. Back in the Expert workspace, use Add Media/Files and Folders/ to bring your video into Project Assets from where you will drag it to Video Track 1. We can talk about edits if necessary.
    6. Publish+Share/Disc/DVD disc with preset set for NTSC_Widescreen_Dolby DVD.
    7. Place your DVD 4.7 GB/120 min disc in the burner, in the burn dialog, have a check mark next to "Fit Content to Available Space". Hit Burn.
    If you decide to take the Timeline to YouTube instead,
    Publish+Share/Social Websites/YouTube, using Presets = Flash Video for YouTube (Widescreen)
    Hit Next and follow the instructions.
    (Upload to YouTube from within Premiere Elements 12 has limits of 2 GB and 15 minutes. Anything exceeding that, you need to export to file saved to the computer hard drive and then upload that file to YouTube at the YouTube web site where you might be able to get extended limits.
    Please let us know if you are OK with the above information.
    Thanks.
    ATR
    Add On...If you want to "decorate" the black borders in the Timeline content, drag the video to Video Track 2 and put a colored background on Video Track 1 directly below the Video Track 2 content.

  • How to change the path for a file download? Sometimes, I want to save a file in a specific folder in my hard disc and I don't know how to do it. Thanks.

    There is a default folder for the download of files from the internet ("Descargas" or "Downloads"). But, what can I do if I wish to save the file in another location of the hard disk?
    Thank you.

    Use about:config and filter on browser.download, you'll see them
    '''More information on configuration variables''' available in
    [http://kb.mozillazine.org/About:config_entries about:config (entries)] and for users not familiar with the process there is [http://kb.mozillazine.org/About:config about:config (How to change)]

  • Change the path for attachments after changing a server

    Hello experts,
    I have a requirement which I cannot solve...
    By a customer a server which was used for saving the attachments is no longer active. The customer has now a file server. So in SAP we have changed the path information under Administration > System Initialisation > General Setting in the Path tab from the old server to the file server like this:
    Old path:              
    oldServer\ALLGEMEIN\SAP\DOKUMENT_TEXT\
    New Server:        
    newServer\ALLGEMEIN\SAP\DOKUMENT_TEXT\
    But now I have the problem that all the path information in the UDFs from type LINK and also in all attachment fields like in activities, where the customer has put in a file are still standing on the old status.
    We have allready copied all attachzments from the old server to the new one in the same structure as in the old server).
    Now I have to change in all fields, which are from type LINK (this concerns by the customer only item master date, BP master data and activities) the path information.
    That means I have to paste the string in all the fields 'oldServer' whith 'newServer'.
    Has anybody an idea how I could do this???
    Best regards,
    Vural

    Hi Vural,
    We are facing same kind of issue with our landscape, how did you changed the path for attachments.
    Tcode = IH01
    Worked with user and tried to change the path for few attachments from \\old_server\GROUPS\ to \\new_server\GROUPS\ (storage server) and its worked, but as per user there are lot of files exist in server, they wants to upgrade the path for all files automatically from old_server to new_server.
    Regards,
    Rishi

  • Hi , i didnt get the email for my secuity question , am trying from 2 weeks , please help , thanx

    hi
    i didnt get the answer for the security question

    I spoke with Apple Support this morning and they believe anything MobileMe related is due to the conversion over to iCloud that's taking place.
    As for other email clients, check with your host to see if settings have changed on their end. I use inmotionhosting.com and over the weekend the updated their outgoing requirements so that a password authentication is now needed.
    Hope that helps get some on the right path to resolving their issues!

  • How to get the path of the selected Jtree node for deletion purpose

    I had one Jtree which show the file structure of the system now i want to get the functionality like when i right click on the node , it should be delete and the file also deleted from my system, for that how can i get the path of that component
    i had used
    TreePath path = tree.getPathForLocation(loc.x, loc.y);
    but it gives the array of objects as (from sop)=> [My Computer, C:\, C:\ANT_HOME, C:\ANT_HOME\lib, C:\ANT_HOME\lib\ant-1.7.0.pom.md5]
    i want its last path element how can i get it ?

    Call getLastSelectedPathComponent() on the tree.

  • How do i get the path of the file selected for opening in JFileChooser

    hi
    I need to get the path of the file selected for opening or saving in the JFileChooser dialog box.Is there any method available.if not how do i get that?
    Thanks and Regards
    Saminathan.

    don't know if its the best/only way, but you could use the getSelectedFile() method in JFileChooser which returns a file and then use the getAbsolutePath() file method

Maybe you are looking for