How to pick files from multiple directories via Sender File Adapter?

Hi guys,
I have a scenario File to IDOC. The Sender File Adapter has to take all files: .xml from Source directory E://Current/.
Actually directories are like
E:/Plant1/Current/
E:/Plant1/History/
E:/Plant2/Current/
E:/Plant2/History/.
Can I have one Sender File Adapter to pick all *.xml files
from
E:/Plant1/Current/ and
E:/Plant2/Current/  and how can I write it in Source Directory of Communication Channel?
Or do I have to have a Sender File Adapter for each Plant?
Any suggestion please?
Kind regards,
Danijela Zivanovic

Hey
You might wanna have a look at "Additional selection for source file" parameter in sender file adapter.
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/singleSenderFileCC4MultipleDirectories
XI/PI: how to exclude files in a sender File adapter?
Even though this method works but there are some constraints,please check help.sap.com for constraints.
Thanx
Aamir

Similar Messages

  • Multiple source files from multiple directories in sender CC

    Dear all,
    My requirrement is that ,I need to use multiple directories in sender CC (only one) and send the files to receivers.
    Kindly let me know how it can be done.
    Thanks,
    Srinivasa

    Hi,
    under advanced tab.............If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.
    ●      Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.
    The variables can refer to attributes of the message header or elements of the message payload.
    ○       If the variables are to refer to an attribute of the message header, add the prefix message: to the name of the variable under Reference. You can specify the following attributes of the message header:
    sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace,
    message_id (message ID with hyphens, for example 9fbe1ff1-9a0d-11d9-8665-cbf10a126331)
    message_id_hex (message ID in hexadecimal format, for example 9fbe1ff19a0d11d98665cbf10a126331)
    For example, if you want to specify the interface name from the message header in the target directory or in the file name scheme, enter message:interface_name as the reference.
    If one of the message attributes contains characters that are not permitted in a file name, for example \, /, :, *, ?, ", <, >, |, then these characters are replaced by an underscore ("_").
    &#9675;       If the variable refers to an element in XML schema, add the prefix payload: to the information under Reference. The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....
    namea,nameb,...corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.
    The description begins at the root of the document and ends at the respective element.
    To reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2
    The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (&#8220;Example Value&#8221;) is set as the value for a specified variable.
    Thanks,
    Madhu

  • How to pickup files from multiple directories

    Hi all,
    How to pickup files from multiple directories and send it to two different folders at target
    Ex:
    files\xi\us\US.txt
    files\xi\uk\UK.txt
    i need to pick up the above mentioned two files and send it to the following paths
    app1\files\us\download\US.txt
    app1\files\uk\download\UK.txt
    US.txt has to goto US folder and UK.txt has to goto UK folder only
    Regards

    Hi,
    To pick form multiple folders, select Advanced Mode for file selection in file adapter..
    there u can specify directory name/file names
    Refer
    /people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter
    To put those files at multiple folders write a command line arguments for this.. go through this weblog...
    /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
    XI/PI: Command line sample functions
    /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    Hope this will help you....
    Regds,
    Pinangshuk.

  • FILES FROM MULTIPLE DIRECTORIES

    Hi Experts,
                    I got a doubt here plz clarify it
        1.How can we pick files from multiple directories ? and all the files will have different  names?
                    Plz clarify this, good explanations willbe rewarded .
                                                                                    Regards,
                                                                                    Vinod.

    Hi Vinod Reddy,
    One way that i know to solve this prob is by using the 'File Name Masking'.
    This can be done with the sender channel, where you have to specify the
    source directory as <NOTHING>
    source file as <NOTHING>
    This gives you an advanced selection option, where you need to give the Source Directories along with the File name masks (the source files).
    Hope this may solve your problem.
    regards
    vinod v
    reward me if its helpful.

  • Save file in multiple directories using receiver file adapter?

    Hi,
    Is it posible to save file in multiple directories using receiver file adapter?
    Regards,
    Ashish

    Well, there is a round about way to do that -
    The idea is to use multi mapping. 1:n mapping
    1) Map ur message to 2 different record set nodes. Since you want to use the same file both the mapping will look exactly the same. make sure that the filepath and filename are a part of the output payload message
    2) In the file adapter config. make sure the the file name and file path are from these payload fields. You can use a context object to refer these fields. Voila...the files are created in the 2 direcoties you mentioned.
    of course the simplest way is to route the same message to 2 business systems/services and write them out using 2 ccs.,
    Arvind R

  • File Adapter: picking files from multiple directories

    Hi all,
    In a sender file communication channel with Transport
    Protocol FTP, There are 2 parameters for Picking up the file
    called Source Directory and Filename. If I want to pick the
    files from 2 or more directories, What needs to be done.
    Or is it possible to do so ?
    Without making duplicate interfaces what else can be done ?
    Regards,
    Vijay

    Actually it is possible to select files from different folders for sender channel. It is available with SP14.
    I just copy following description from help.sap.com
    Advanced Selection for Source File
    If you want to set an exclusion mask for the File Name specified above, or if you want to specify multiple directories using a file name mask and exclusion mask, set the Advanced Selection for Source File indicator.
    ¡        Specify an Exclusion Mask for the file name specified above.
    Example
    You want to process all files that have the extension '.txt', but want to exclude all files that begin with the letter 'a'. To do this, enter .txt for File Name, and a for Exclusion Mask.
    ¡        You can enter additional specifications for source directories, file names, and exclusion masks in the table. This data is processed in addition to the details specified above.

  • Picking up files from multiple directories

    Hi All
    We have scenario where each sore has its one folder with all the files in the folder, now there is about 200 stores so and about 30 interfaces that picks up files from those directories. It's gonna take some time to add al the directories to all 30 interfaces. Is there an easier way to do this?
    Regards

    >
    stephan claassen wrote:
    > Hi
    >
    > Thx for reply
    >
    > abhishek salvi what do mean by ServerName/*? we only have the IP.
    > If I put in /SAPXI/METSAPXI/* it sais:  A file or directory in the path name does not exist
    >
    > Regards
    Suppose you have one File Server installed (say SAP).....it has only two sub-folders (say XI and PI)....now you want to pick files from both the sub-folders....so you can try SAP/* ........
    Please open your File Server location and any sub-folder within it and check if it is / or \ .....and then use the slash (/ or \) accordingly ......if you have IP and no name then give the IP.....rest logic remains the same....
    Regards,
    Abhishek.

  • How to write file into multiple directories by using file adapter?

    i need to write my file into multiple directories,i able to do in single directory.But i need to write to muliple directories.Please help me out.Thanks in advance.

    If you are passing the values at runtime then you can loop it and and invoke the file adapter in loop by dynamically passing the value in invoke properties for "File Directory and File name" etc.

  • Read files from multiple directories

    Hy to all! I have a little problem with reading files from a hierarchy of directories,something like this: directory A contains: 4 filed and directory B, and also B contains 3 files and 2 directories and so on. i want to make a method that reads all the files from directory A (including all files from subdirectory). I know i have to use recursive programming, i need a method that will be use to do this. Can U help me to do this????? Thank you all.

    Can U help me to do this?Sure. First, review basic File IO in Java: [http://java.sun.com/docs/books/tutorial/essential/io/file.html]
    Second, have a look at the numerous examples available on the Internet: [http://www.google.com/search?q=java+traverse+directory]
    Third, let us know if you run into any specific problems.
    Good luck!

  • Batch Script to display last modified file from multiple directories

    Hello,
    I am trying to find the name of the latest file  or the last modified file from a set of given directories.
    I approached the problem by breaking it into two parts: a.  read all the directories from a .txt file and display the names of those directories and files under those directories.  b. Find the latest file present in any given directory and
    Upto this point all worked well, but when I am trying to combine both these batch scripts, I am unable to get the desired result.
    I am using BATCH SCRIPT only to complete this.
    My tried script is as below:
    a.  TO SEE ALL THE DIRECTORIES SPECIFIED IN "path_123.txt" FILE
    for /f "delims=" %%i in ('type "C:\Users\sonkar\Desktop\path_123.txt" ') do (set locall=%%i
    echo %locall%
    echo %%i
    b.  TO FIND THE LATEST FILE PRESENT IN THE DIRECTORY
    set BUILDDROP="E:\"
    for /f "tokens=*" %%a in ('dir /A:-D /B /O:-D %BUILDDROP%') do set NEWEST=%%a&& goto :next
    :next
    echo %NEWEST%
    But when combining both is not working at all.
    Any help is appreciated.

    Since batch files lack the ability to do date arithmetic you are pushing them well beyond their limits. Either VBScript of PowerShell could handle this type of task. Here is a VBScript solution. You must save the code in a .vbs file, then modify it to suit
    your exact needs.
    'Find the most recent file in a collection of folders
    '11 Sep 2014 FNL
    Dim dDate, dDate_, sFile, sFile_
    Set oFSO = CreateObject("Scripting.Filesystemobject")
    Set oList = ofso.OpenTextFile("C:\Users\sonkar\Desktop\path_123.txt", 1)
    aList = Split(olist.ReadAll, vbCrLf)
    oList.close
    dDate = cdate("01/01/2000")
    For Each sFolder In aList
        dDate_ = cdate("01/01/2000")
        ProcessFolder(sFolder)
        If dDate_ > dDate Then
            dDate = dDate_
            sFile = sFile_
        End If
    Next
    WScript.Echo "Most recent file: """ & sFile & """"
    WScript.Echo "File date: " &dDate
    Sub ProcessFolder(sFldr)
        If LTrim(sFldr) = "" Then Exit Sub
        WScript.Echo "Processing """ & sFldr & """"
        For Each oFile In oFSO.GetFolder(sFldr).Files
            If oFile.DateLastModified > dDate_ Then
                dDate_ = oFile.DateLastModified
                sFile_ = oFile.Path
            End if
        Next
        For Each oFolder In oFSO.GetFolder(sFldr).SubFolders
            ProcessFolder(oFolder.path)
        Next
    End sub

  • [SOLVED]Copying multiple files from multiple directories to one folder

    Title says it all.  I have a discography folder with subfolders of the different years and albums of a band each containing music, some also have more sub folders.  What I want to do is copy all of the music (.mp3's) from all the folders and sub folders into just one music folder.  I found a find and -exec cp command before but it did absolutely nothing for whatever reason.  Perhaps I did it wrong.  Can anyone help me?
    Thanks
    Last edited by SiegeMachine (2009-11-15 06:54:40)

    . refers to the directory to search (the current directory), it's not a pattern - here's what you want:
    find . -iname '*.mp3' -type f -exec cp {} target_dir/ \;
    This is assuming you're in the music directory - if not, you want
    find /path/to/music -iname '*.mp3' -type f -exec cp {} target_dir/ \;
    Last edited by Pox (2009-11-15 06:53:59)

  • Delete multiple files from multiple locations using config file

    Hello All,
    I am fairly new to .net and I have to make a windows application to delete files older than 90 days from multi ple locations. these multiple locations cant be hard coded and have to be configurable, also the number of days to delete the files have to be
    configurable.
    I think the answer to this would be an app.config file. but dont know how to use the same.
    can anyone tell me about this and if possible help me out with a code snippet.?

    Add settings like picture below.  Add the string by press the double dot icon.
    The use the code below
    static void Main(string[] args)
    int deleteDays = Properties.Settings.Default.DeleteDays;
    StringCollection folders = Properties.Settings.Default.Folders;
    foreach (string folder in folders)
    DirectoryInfo info = new DirectoryInfo(folder);
    FileSystemInfo[] deleleteFiles = info.EnumerateFiles()
    .Where(x => x.LastWriteTime < DateTime.Today.AddDays(deleteDays))
    .ToArray() ;
    foreach(FileSystemInfo file in deleleteFiles)
    File.Delete(file.FullName);
    jdweng

  • Cant create adobe files from multiple excel or word files

    This is the first time I have placed anything on this forum so please forgive me if I am in the wrong p
    lace.  I have been frustrated by an error message I get when I try to convert multiple excel files or word files to
    PDF.  The files exist on a network location, and when I select 5 or 6 at random
    and then right click and choose "Convert to PDF", the operation bombs with a message that reads:
    "The file you selected does not contain any data (zero length file).  Please select another file."  I can
    not find anything on this on Adobe's website, or google.  I used to d
    o it fine until a few days ago, now it won't convert and I get the above message.  Anybody have any idea?  I a
    m using Windows XP SP3 and Office 2007 SP1.  Thanks
    Steve Szabo

    I can copy these files to the local drive and do the operation fine.  I can also convert files that are already on the hard drive.
      Just cannot convert the ones that are in the network location.  I used to be able to do it, but not now.
    Steve

  • Retrive files from multiple source directories

    Hi,
      I need to retrive diffirent formet files from multiple directories and based on file name I need to send it to destination folders. Can anybody suggest me How can I impliment this interface.
    Thanks & Regards
    VenkatK

    Venkat,
    I hope since you are taking different format files, you are not doing any mapping. You are moving from one location to another location, because if you different formats then you can do in one mapping your requirement.
    If it is correct then as shabharish mentioned you can pick the files using multiple file sender adapters. With this you can pick the files, but to send to different directories enable ASMA in sender file commkunication channel. Then in receiver communication check the extension for each format and then give the directory name so that it routes to the destination you mentioned.
    Regards,
    ---Satish

  • Send multiple files in different directories using Receiver File Adapter

    Hi Experts,
    I have one File to File without ESR scenario where I have to pick multiple files from different directories and to save them in different directories on receiver side.
    Can anyne help me to send multiple files in different directories using receiver file adapter.
    Is it possible??
    Any help will be appreciated.
    Regards,
    Danish

    hi ,
    that is possiable without esr,
    we need to create one sender communication channel , in that  we nend to use "adavnced selection for source file " for sending multiple files from multiple directories.
    we need to create 'n' receiver communication channels and 'n' receiver agreements based on communication channels .
    in receiver determination, provide multiple receivers
    In interface determination , provide * symbol for receiver communication components
    thanks,

Maybe you are looking for