Choose all  files in folder in selection screen.

Hello experts,
I have select option with type FC_PHYSFIL, and in this case i can choose only 1 file each time ,
if i want to choose all files that exist in some folder , how can i do this?
I use in this F.M. to load file : 'WS_UPLOAD'.
and  " AT SELECTION-SCREEN" event i use in F.M. " WS_FILENAME_GET"  to get the name of file .
how can i get  the all files that exist in folder?
Thanks for the help.
Avi.
Edited by: avi azulay on Apr 21, 2010 3:55 PM

Dear Avi,
Firstly try to avoid using the FMs you mentioned. Those are kind of obsolete now. Refer to the link provided below.
https://wiki.sdn.sap.com/wiki/display/ABAP/NEW%20FM%20in%20Place%20of%20Obsolete%20FM
Now for your problem, you can make use of the methods of the class CL_GUI_FRONTEND_SERVICES.
I guess the following 2 methods will serve your purpose:
1. DIRECTORY_BROWSE - This will display a directory selection window, you can select the directory here.
2. DIRECTORY_LIST_FILES - You pass the directory selected above to this method and this method will return you the list of files in the directory chosen in an internal table.
Have a look how these methods are implemented by using the 'Where-used' functionality..:)
Hope you find this useful.
Cheers!!!
s@k

Similar Messages

  • How to make button to format a HardDrive or USB, How to remove all files from folder, and How to delete a process in listbox with a textbox?

    Hello!
    Here's the question with explaniation: How can i format the USB or Drive by clicking a button what's meant for it?
    and the second question what's also in vb.net: How can i remove all files from folder ? 
     Here's the Look of program: *
    Using the PC button, it will delete the free space of the PC, do you guys/girls know where it's location?

    Example Code:
    Imports System.Runtime.InteropServices
    Imports System.IO
    Public Class Form1
    Dim CBoxDrives As New ComboBox
    WithEvents FButton As New Button
    <DllImport("shell32.dll")> _
    Private Shared Function SHFormatDrive(ByVal hwnd As IntPtr, ByVal drive As UInteger, _
    ByVal fmtID As UInteger, ByVal options As UInteger) As ULong
    End Function
    Private Enum SHFormatFlags As Integer
    SHFMT_ID_DEFAULT = &HFFFF
    SHFMT_OPT_FULL = &H1
    SHFMT_OPT_SYSONLY = &H2
    SHFMT_ERROR = &HFFFFFFFF
    SHFMT_CANCEL = &HFFFFFFFE
    SHFMT_NOFORMAT = &HFFFFFFD
    SHFD_FORMAT_FULL = 0 ' full format
    SHFD_FORMAT_QUICK = 1 ' quick format
    End Enum
    Private Sub FButton_Click_1(sender As System.Object, e As System.EventArgs) Handles FButton.Click
    If CBoxDrives.Text = "" Then
    MsgBox("No Drive Selected")
    Exit Sub
    End If
    Dim Iresult As ULong = SHFormatDrive(CType(Me.Handle.ToInt32, IntPtr), CUInt(Asc(CBoxDrives.Text.Substring(0, 1)) - Asc("A")), CUInt(SHFormatFlags.SHFMT_ID_DEFAULT), 1)
    End Sub
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    Me.Size = New Size(200, 100)
    With FButton
    .Size = New Size(50, 25)
    .Location = New Point(5, 5)
    .Text = "Format"
    End With
    Me.Controls.Add(FButton)
    With CBoxDrives
    .Size = New Size(50, 25)
    .Location = New Point(75, 5)
    .DropDownStyle = ComboBoxStyle.DropDown
    End With
    Me.Controls.Add(CBoxDrives)
    Dim DrivesFound As Integer = 0
    Dim allDrives() As DriveInfo = DriveInfo.GetDrives()
    Dim d As DriveInfo
    For Each d In allDrives
    If ((d.DriveType = DriveType.Fixed) Or (d.DriveType = DriveType.Removable)) AndAlso Environment.GetEnvironmentVariable("SYSTEMROOT").StartsWith(d.Name) = False Then
    CBoxDrives.Items.Add(d.Name)
    DrivesFound += 1
    End If
    Next
    CBoxDrives.SelectedIndex = DrivesFound - 1
    End Sub
    End Class

  • Physical file path on the selection screen from AL11 Tcode

    Hi All,
    Please let me know some body how do we give only physical file path(only directory not the file names) on the selection screen?I need to see when I press F4 only the physical file directories of the application server.
    Thanks in advance.
    Mahesh

    Hi,
    This FM will be helpful.....
    F4_dxfilename_toprecursion
    CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
    * EXPORTING
    *   I_LOCATION_FLAG       = ' '
    *   I_SERVER              = '?'
    *   I_PATH                =
    *   FILEMASK              = '*.*'
    *   FILEOPERATION         = 'R'
    * IMPORTING
    *   O_LOCATION_FLAG       =
    *   O_SERVER              =
    *   O_PATH                =
    *   ABEND_FLAG            =
    * EXCEPTIONS
    *   RFC_ERROR             = 1
    *   ERROR_WITH_GUI        = 2
    *   OTHERS                = 3
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards,
    Mdi.Deeba Najam.

  • Unable to Upload data from text file into BEx Analyzer selection screen

    Hi,
    No response from BEx Analyzer when I am trying to upload around 40,000 material from text file into BEx Analyzer selection screen using "Upload selections" options. But I am able to upload only 10,000 material from text file.  I never faced same kind of issue when I am using BEx Analyzer 3.x.  Please let me know I have to change any settings related to BEx or any other.
    Thanks
    Sri Krishna Ponnada.

    Hello
    It seems you are reaching the .NET memory limitation informed in note 1040454.
    Because 3.5 does not use .NET it can work that.
    Regards,
    Ricardo

  • How to read list of all files in folder on application server?

    How to read list of all files in folder on application server?

    Hi,
    First get the files in application server using the following function module.
        CALL FUNCTION 'RZL_READ_DIR_LOCAL'
          EXPORTING
            name     = loc_fdir
          TABLES
            file_tbl = int_filedir.
    Here loc_fdir contains the application server path.
    int_filedir contains all the file names in that particular path.
    Now loop at int_filedir.
    OPEN DATASET int_filedir-name FOR INPUT IN TEXT MODE ENCODING  DEFAULT MESSAGE wf_mess.
    MESSAGE wf_mess.
        IF sy-subrc = 0.
          DO.
            READ DATASET pa_sfile INTO wf_string.
            IF sy-subrc <> 0.
              EXIT.
    endif.
    close datset int_filedir-name.
    endloop.

  • Detect what file or folder was selected in Windows File Dialog

    Hi, We have an Vibration Crontroller application that has is no DLL and no ActiveX support. I want to detect when that or any Windows application opnes a Windows "Open File Dialog" box. I'd then like to detect what file or folder was selected. Is that possible with LabVIEW? Thanks.

    That routine decodes the binary data from registry to file path.
    http://msdn.microsoft.com/en-gb/library/windows/de​sktop/bb762194(v=vs.85).aspx
    Basically, the first byte of MRUListEx listing in registry is the index of last accessed file in the file list in the sub key. If you open up your registry and navigate to the key, you will figure it out.
    Also you can drag and drop snippets on to your block diagram, if that doesnt work, save the png file to your computer and then drag and drop.
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • Applescript: choose file AND folder (multiple selection allowed)

    Hi all;
    is there any way to select files and folder with and apple script?
    I'm trying to write something to compress some stuff and I'd need this stuff to be both files and folders at once…
    Thank you!

    Plain AppleScript doesn't have that kind of dialog, but you can access various Cocoa methods in Snow Leopard and Lion.  In Lion, you create a Cocoa-AppleScript Applet from a template in the AppleScript Editor, where you can use AppleScriptObjC statements.  Since the script can only be run in the application and not the AppleScript Editor though, it is a little bit of a pain to troubleshoot - Shane Stanley has written an ASObjC Runner background application that can be run from the AppleScript Editor, if you wanted to check that out.
    Running the Cocoa-AppleScript template, you can use something like the following - see the NSOpenPanel Class Reference for other methods and settings:
    set defaultDirectory to POSIX path of (path to desktop) -- a place to start
    tell current application's NSOpenPanel's openPanel()
      setFloatingPanel_(true)
      setTitle_("Choose some stuff:")
      setPrompt_("Choose") -- the button name
      setDirectoryURL_(current application's NSURL's URLWithString_(defaultDirectory))
      setCanChooseFiles_(true)
      setCanChooseDirectories_(true)
      setShowsHiddenFiles_(false)
      setTreatsFilePackagesAsDirectories_(false)
      setAllowsMultipleSelection_(true)
      set theResult to it's runModal() as integer -- show the panel
      if theResult is current application's NSFileHandlingPanelCancelButton then quit -- cancel button
      set theFiles to URLs() as list
    end tell
    repeat with X from 1 to (count theFiles) -- coerce the file paths in place
      set (item X of theFiles) to (item X of theFiles)'s |path|() as text -- as POSIX file
    end repeat
    choose from list theFiles
    if result is false then quit

  • PSE9 Organizer - How to see all files in Folder view?

    In v8, there is a tab under Edit/Preferences named "Folder Location View" that allowed one to select either to see all files or just those in the folder that is selected.  I can't find this option in PSE9.  Anyone know what happened to it?
    PSE0 defaults to seeing only those files in the selected folder, which is normally my preference as well, except when I am doing certain things and then I really need to see all files in all folders.
    For example, I need/want to write my tags to the file meta data in all of my files, but I have to go to each folder individually to do this and then I can only do it on that individual folder.  I really would like to be able to select all of my files and fire it off (yes, I know that would take forever, but I could go do something else while it is processing.)
    This is the second reason that upgrading to PSE9 is really downgrading.  One shouldn't lose functionality that has existed in several (all?) previous versions!
    Hopefully, this setting has just moved and I can't find it.  If not, Adobe, please add it back in ASAP!!
    Thanks,
    ...Rich

    Oh, I forgot to comment on the ability to create an album instantly by folder name.
    That really seems like a pretty useless "feature" for all but the most challenged user.
    All you need to do without the feature is select all photos in a folder (ctrl a) and then drag them to the folder name.  That just doesn't seem to be all that difficult.
    Thanks again.
    ...Rich

  • How to give dynamic file path in the selection  screen

    Hi All,
    How to give dynamic file path f4 functionality to user on the selection so that he can browse for the path in the presentation serve? I believe there is one fun module is there for this purpose I am not getting that
    Please help me in this regard.
    Thanks&Regards
    Mahesh

    HI,
    check this program.
    <b>report ZWA_TEST2.
    PARAMETERS: a(100) default 'PRESS F4'.
    data: filet type table of FILE_TABLE.
    data: wa type file_table.
    data: count type i.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR a.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
      CHANGING
        FILE_TABLE              = filet
        RC                      = count .
    loop at filet into wa.
      a = wa-FILENAME.
    endloop.</b>
    Regards,
    HRA

  • All files in folder of Application server.

    Hi Frnds,
    how to get the all files from a folder of application server. I have to get the all files in internal table when i selecting only folder?
    thanks in advance.
    regards,
    Balu

    Here is an example program, which acts like an application server file browser.
    report zrich_0001 .
    data: begin of itab occurs 0,
          rec(1000) type c,
          end of itab.
    data: wa(1000) type c.
    data: p_file type localfile.
    data: ifile type table of  salfldir with header line.
    parameters: p_path type salfile-longname
                        default '/usr/sap/TST/DVEBMGS01/data/'.
    call function 'RZL_READ_DIR_LOCAL'
         exporting
              name           = p_path
         tables
              file_tbl       = ifile
         exceptions
              argument_error = 1
              not_found      = 2
              others         = 3.
    loop at ifile.
      format hotspot on.
      write:/ ifile-name.
      hide ifile-name.
      format hotspot off.
    endloop.
    at line-selection.
      concatenate p_path ifile-name into p_file.
      clear itab.  refresh itab.
      open dataset p_file for input in text mode.
      if sy-subrc = 0.
        do.
          read dataset p_file into wa.
          if sy-subrc <> 0.
            exit.
          endif.
          itab-rec = wa.
          append itab.
        enddo.
      endif.
      close dataset p_file.
      loop at itab.
        write:/ itab.
      endloop.
    Regards,
    Rich Heilman

  • Allowing a User to choose the ALV layout format on selection-screen

    Hi all,
    I would like to know how i can add a parameter to my selection-screen which would allow the User to choose a saved ALV layout format before pressing F8 rather than after. As used in CO15 or MB51.
    Thanks  femi.

    yes , You can check the program BCALV_TEST_FULLSCREEN_LAYOUT  to check how F4 help is to be used .
    to check existene of variant is pretty simple.
    Pass the variant name in the ALV display FM .

  • Want to see the previous file name in the selection screen field

    Hi,
    I am working with flat file upload. Now my problem is in the selection screen field when i press space bar or backspace i want to see the previous file path which i have taken before. How to do this functionality.
    Thanks in advance,
    Vijay.

    Hi,
    Hope the following code will help u.
    PARAMETER: in_file type ibipparms-path MEMORY ID FID.
    at selection-screen on value-request for in_file.
      call function 'KD_GET_FILENAME_ON_F4'
        exporting
          mask      = ',CSV,*.csv,'
        changing
          file_name = in_file.
    But here when u give a path and execute and come back or executing it again the previous path will automatically come to the in_file field.
    Just check this code.
    Thanks.

  • Check the file extension in the selection screen

    hi,
    in the selection screen i am giving a file path. the file should be of type PDF only.
    how to validate it ?
    i am splitting the file path at "." and checking for the last three letters , if it pdf or not.
    but it is throwing error for pdf format also.
    throw some light on it and let me know.
    thanks  and regards.
    suki

    hi,
    You need to pass only COMPLETE_FILENAME
    say C:\ABC\A\ABC.TXT
    data  : v_filename type PCFILE-PATH.
    v_filename = "C:\ABC\A\ABC.TXT".
      CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
           EXPORTING
                COMPLETE_FILENAME = v_FILENAME
           IMPORTING
                DRIVE             = v_DRIVE
                EXTENSION         = v_EXTENSION
                 NAME              = v_name
                 NAME_WITH_EXT     = v_namewithtxt
                PATH              = PATH_VALUE
            EXCEPTIONS
                 INVALID_DRIVE     = 1
                 INVALID_EXTENSION = 2
                 INVALID_NAME      = 3
                 INVALID_PATH      = 4
                 OTHERS            = 5.
    you will get the output as
    DRIVE                           C     
    EXTENSION                   TXT   
    NAME                            ABC   
    NAME_WITH_EXT          ABC.TXT
    PATH                            \ABC\A\
    Hope this helps.
    Regards,
    Richa

  • Reading All Files inside folder codeBase, Applet!

    I have an applet, placed in a Jar file.. everything is ok,,
    I have a resource folder outside the Jar, which has some files.
    how can I read what is inside the resource folder, which is located outisde the Jar, without having their addresses before hand!!
    in short, I would like the applet to open the resource folder, get an array of all files in the folder, and then reads them.
    I tried encapsulating the getCodeBase().toURI() with a File Object.
    But when I call the file.list() it throws an AccessControlException
    thank you.

    Here is a simple example of using ftp to obtain file list using Jakarta common net package.
    // ftp - related imports
    import org.apache.commons.net.ftp.FTPClient;
    import org.apache.commons.net.ftp.FTPReply;
    // main method
              FTPClient ftpClient = null;
              try {
                   ftpClient = new FTPClient();
                   ftpClient.connect("REMOTE_HOST", "remote port, use 21 in common case");
                   System.out.print(ftpClient.getReplyString());
                   int reply = ftpClient.getReplyCode();
                   if(!FTPReply.isPositiveCompletion(reply)) {
              ftpClient.disconnect();
              System.err.println("FTP server refused connection.");
              System.exit(1);
                   boolean isLoggedIn = ftpClient.login("your login", "your pass");
                   ftpClient.changeWorkingDirectory("/your remote dir/");
                   String[] fNames = ftpClient.listNames();
                   for (int i = 0; i < fNames.length; i++) {
                        System.out.println(fNames);
                   ftpClient.logout();
              } catch (IOException e) {
                   e.printStackTrace();
              } finally {
                   if(ftpClient.isConnected()) {
                        try {
                             ftpClient.disconnect();
                        } catch(IOException ioe) {
                             ioe.printStackTrace();
    System.exit(0);

  • Change Tiger default Folder Action to parse all files in folder?

    I'd like to be able to use Automator and OSX Tigers Folder Actions to parse all files in a folder to an automator workflow, but it seems the default is that Folder Actions just pass the newest file added to a folder. Is it possible to modify the default applescript that says something like open_added to open_all? Sorry, not an applescripter so don't shout at me. What I'm trying to do is get automator to construct a variable URL from various txt files in a folder. I'm using the txt files as variables as Tigers Automator doesn't seem to be able to use variables or save and combine a result.

    That is the way that folder actions work. You can edit the AppleScript wrapper that Automator makes for your folder action, though, since the folder action handler also returns an alias to the attached folder.
    If you look in your user's *~/Library/Scripts/Folder Action Scripts* folder, the folder action script for your workflow looks something like this:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #DAFFB6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    on adding folder items to this_folder after receiving added_items
    tell application "path:to:your:workflow.app"
    open added_items
    end tell
    end adding folder items to
    </pre>
    By changing the line open added_items to open {this_folder}, the script will pass the folder instead of the files, so you can then use that in your workflow (e.g. *Get Folder Contents*, etc).

Maybe you are looking for