Drop the files into different directories based on the filename

Hi,
I had a reqiuirement based on the file name, i should drop the files in to different directories.
I can get the filename through variable substitution in receiver file communication channel, now i want to drop the file into different folders based on conditions.
suppose, if the file name is DDDX234
i should do substring of filename0+(4), if the value is L then i should drop in X directory
suppose, if the file name is DDDY234
i should do substring of filename0+(4), if the value is L then i should drop in Y directory.
How can i drop the file into differnent directories based on filename.
Thanks
Srinivas

Thanks Michal,
I mapped the directory and filename to the target header in the mapping
Filename --> UDF --> Header(target)
and in the receiver channel checked the ASMA and given * in the filename and directory name.
But in runtime iam getting the error as
Attempt to process file failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header
MY UDF is
public String Directory(String a,Container container){
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key  = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "Directory");
String FileName = conf.get(key);
FileName = a;
conf.put(key, FileName);
%%%based on filename the directory should change
String Directory = conf.get(key1);
Directory = "/SAPInterface/XI/PPD/DHX/out";
conf.put(key1, Directory);
return "";
Help me in correcting this error.
Thanks
Srinivas

Similar Messages

  • How to read the files in different directories

    how to read the files in different directories here directory names will change dynamically under root node.
    let me say
    rootnode---->subnode1
    >subnode2
    >subnode3
    >subnode n
    how to specify these in file adapter.

    Hi
    look at this thread your problem is solved here
    File Adapter
    Regards
    Abhishek
    Edited by: Abhishek Agrahari on Dec 16, 2008 11:37 AM

  • Dropping csv file into a cell?

    After updating "Numbers", I can no longer call drop csv files into a cell and have the row complete. What am I missing here?

    Hello fellow sufferers of CSV headaches from commas within fields and ; instead of , etc.. They've been around as long as I can remember. 
    If you don't want to use Excel (which is good at this sort of thing), this script should help. (Dropbox download, AppleScript file). The effect is similar to Excel's Text to Columns but the usage is slightly different.
    If you end up with text all in one column as Cuky describes, you simply select the body cells in that column containing the text, run the script, click on a cell (the first cell in the body of the next column to the right often works best) and paste.
    The results here look like this:
    I deliberately made the unexpanded column untidy and threw some difficult things at it, and it did a pretty good job in testing here. Return or shift-return within a field, even if quoted, will cause Numbers to move to a new line, but that's a Numbers thing that can't be helped. Otherwise, it handles the usual csv conventions better than expected.
    If your separator is ; instead of , there is a place you can change that it the script.
    If you frequently import data, this is easily placed in the menu, either as an Automator Service or under Scripts.
    And it could be modified to read a csv file rather than grabbing values already in a Numbers column, making it almost as convenient as the old drag and drop. It could ask for the csv file and put the results on the clipboard for pasting into a table.
    If there is interest in that let me know. And suggestions/feedback on this one welcome.
    SG

  • Breaking up the weblogs into different categories

    It will be really nice to break up the weblogs into different categories based on technical areas(kind of like forum but not that many categories). There could be one category where all the general discussion weblog could be posted. I think this will generate more traffic towards weblogs. Right now lot of the technical weblogs are getting lost among the general content. Just a suggestion. Love to hear back from SDN members.

    Hi Sing,
    Once in a while this request comes up and I have the same reaction as Craig has. It's there, just select Topics and every one of them has it's own page.
    For example here is the EP page:
    https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/weblogs/topic/22
    Your latest Weblog still on top although there were many other posts on the most recent weblogs page.
    It makes me think how we could better make it available to people. The weblogs as well as the link on the main EP page is directly to this page.
    Not sure what else can be done, besides a Weblog pointing it out again.
    Best, Mark.

  • I can't save previous word files I have into iWork's, I have dropped the file into pages, but it says it can't convert text, even though I have changed a selective fond from pages

    I can't save previous word files I have into iWork's, I have dropped the file into pages, but it says it can't convert text, even though I have changed a selective fond from pages! Help!

    Take us through this in more detail.
    What is the Word file? From a PC?
    What version of Word and what is the file extension?
    What is it about the text that is different?
    When you say fond do you mean font/typeface? If so what font, and is it on your Mac? Is there something special/different about this font?
    Peter

  • When moving a file using drag and drop, as I hover over the destination folder it no longer opens, so I can't drop the file into the folder.  Why?

    When moving a file using drag and drop, as I hover over the destination folder it no longer opens, so I can't drop the file into the folder.  Why?  I have a heirarchical embedded folder structure under \Documents.  Usually, as I drag the file to be moved over the various folders, they will blink twice, then expand/open to reveal contents (in Finder).  Now, when the file to be moved is held (hovering) over the destination folder, it will not blink or expand, so there's no place to drop the file.  If I release the mouse button, the file image disappears, showing that it is "going back to the place it came from", a.k.a. was not moved.  This just started happening.  I noticed it after upgrading to Mavericks.  Is this a bug or could anything else be causing this?

    As of today, Apple Support discovered during a remote support session with me that the same thing happens on their own system.  It is isolated to "Column View"; the Icon and List views in Finder behave correctly.  Issue is being escalated to engineering, and Apple will call to report status in a couple days.  In all likelihood, this is a bug that will need to be addressed in a future update.

  • If I actually import full files into FCP, can I then drop source files into the trash?

    If I actually import full files into FCP, can I then drop source files into the trash?   I'm editing now and want to free up HD space.

    Just to confirm: in Preferences, Import, Files..."copy to library storage location" is selected.
    So I assume I can dispose of source files.
    Thanks for quick reply and also the the cautionary note. 
    This is low-level family footage I export to .mov and share on YouTube, so originals are not critical.

  • Is it possible to have 2 different output config XML files and index the data into 2 endeca apps using the same indexing component ProductCatalogSimpleIndexingAdmin

    Hi ,
    We have a catalog that defines 2 types of products (they have too many different properties), so wanted to keep them on two different MDEX engines and serve the applications requests. Here DB catalog and front end ATG application is same for both the MDEX instances.
    Is it possible to have 2 different output config XML files and index the data into 2 endeca apps using the same indexing component ProductCatalogSimpleIndexingAdmin?
    Thanks
    Dev

    Hi, also have had some problem some monthes ago - I created separete component ProductCatalogSimpleIndexingAdminSecond. After that one of my colleage gave me some advice:
    The creating separate component like ProductCatalogSimpleIndexingAdmin for the second IOC is possible way for resolving your situation. But I afraid that this way will be required creating mane duplicates for already existed components.
    In my opinion the better way is the following:
    starting from AssemblerApplicationConfiguration and ApplicationConfiguration component. It contains details for connecting between ATG and Endeca. Of course you should configure different components for different Endeca Apps.
    After that:
    Find all components that uses AssemblerApplicationConfiguration and ApplicationConfiguration. Customize these components for using one or another  *Configuration component depending on what index works. (many variants released it: the most simple global custom component with flag.)
    Then customize the existed ProductCatalogSimpleIndexingAdmin. Using one or another IOC  and setting the flag in global custom component when index started. You can add some methods into your custom ProductCatalogSimpleIndexingAdmin like:
    Execute baseline index for both IOC (one by one)
    Execute baseline for IOC 1
    Execute baseline for IOC 2.
    Note: you should be afraid about incremental (partial) index in this configuration. But resolving conflicts in incremental index should be done after full implementation these changes.
    Regards

  • Create multiple files in different directories for receiver system

    Hi,
    My scenario is File-XI-File. Based on a value of a field(1...Unbounded) & its occurance in source file XI needs to create same file number of times(based on occurance of field in source file) in different directories on receiver system(Single Business System).
    What different ways/solutions are available to achieve this?
    Regards,
    Bharat
    Edited by: Bharat Rathod on Nov 21, 2009 5:24 PM

    Hi Bharath,
    >>Based on a value of a field(1...Unbounded) & its occurance in source file XI needs to create same file number of times(based on occurance of field in source file) in different directories on receiver system(Single Business System).
    This logic needs to be handled in message mapping ... and you need to use multimapping..check the link here
    http://help.sap.com/saphelp_nw04/helpdata/en/42/f3b31d48fb1bc8e10000000a11466f/content.htm
    Regards
    Suraj

  • How to configure a scenario which posts same file to different directories

    How to configure a scenario which posts same file to different directories of a receiving system?
    Consider an Idoc to file scenario where I have to post same file to two different directories but logical receiver system has to be same.

    Hi,
    You can try out like this: Using multiple receiver interfaces you can send it to multiple directories with the help of enhanced interface determination/conditions and with the help of multiple receiver communication channels.
    Another option is to copy the file from one target directory into another directory  with the help of Unix script by executing the same from the OS command level.
    One more option is to create a Java Server Proxy and inside the proxy, you can write java code to FTP into different locations.
    Hope this helps,
    Regards,
    Moorthy

  • I have 2 iphones syncing on one computer and on the same apple ID. Before i updatad my Itunes to the last available update and my Iphones to 5.01 i had no problem draging jpg. and mp3 files into my iphones DCIM folder (the picture folder that opens when c

    I have 2 iphones syncing on one computer and on the same apple ID.
    Before i updatad my Itunes to the last available update and my Iphones to 5.01
    i had no problem draging jpg. and mp3 files into my iphones DCIM folder (the picture folder that opens
    when conecting to Itunes). Since my updates Itune wont let me drag and drop any files' even pictures that
    were taken with my Iphone on 4.3.3.
    Please help as we have no itunes music in Israel, only apps and i cant copy any of my old music from my computer
    to my iphones.
    If it helps, i am using a pc with 32 bit windows 7.
    Other from the obove Itunes works fine and does sync pictures from my computer to my Iphone from "my pictures" folder.
    Thank you for your time
    Yoni Bliss
    [email protected]

    The title of my initial post is a bit misleading. I already took a chance deleting one of the iPhones, hoping if I deleted the wrong one, I can still reauthorize it (all with the same Apple ID acct, so not subject to 90-day waiting period, right?) The iTunes database just updated itself, and it says I have 4 "devices" "in the Cloud", but 5 "computers" associated w my account. How can I find out what computers are associated? Isn't there a list I can see? I dont have a clue what computers they might be. If I use the  "Deauthorize All" option, is it a pain to add them all back in. I assume I would have to log in from each computer to reauthorize each one. Would I have to be running the newest OS or version of iTunes to reauthorize? I think I have a PowerBook G4 Titanium with an older OS and iTunes. I'd like to keep that authorized, if possible.

  • How to include header files from different directories?

    Hi,
    Sorry for the newb question, but I can't figure this out. I'm trying to compile a simple piece of code (C++) that uses header files in a directory different from the Project directory; header files are in /opt/csw/postgresql/include/pqxx. I've tried a few different things, adding that directory to the include directives under Resource Files, add existing files from a folder, etc etc. Whenever I try to build, dmake bails with status -1. I can't seem to get this working, can someone explain how to use header files from different directories?
    Thanks,
    SlowToady

    Header files are usually specified relative to a base directory. If the base directory is not a system directory -- /usr/include or the compiler installation directory -- add a command-line directive
    -I path/to/base/dirfor each such directory.
    The path can be absolute, such as
    -i /opt/csw/postgresql/includeor relative, such as
    -I ../../my/includeIn your source code, specify the header file relative to the base directory, and be sure to use quotes, not angle brackets. Example:
    #include "header.h"  // right
    #include <header.h>  // wrongThe angle brackets are used for system headers, like <iostream> or <stdlib.h>.
    The rules above are common to all compilers on Unix and Linux, and generally to all C and C++ compilers.
    For more details, read about the -I option in the C++ Users Guide. You can find the guide by pointing your browser to the "docs" directory in the compiler installation, or go here:
    http://docs.sun.com/app/docs/doc/819-5267
    All command-line options are described in Appendix A.

  • 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.

  • 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,

  • Why can I no longer drag and drop .mid files into GB?

    I can no longer drag and drop .mid files into GB. When I try, the track files flash and disappear. Please help
    Mac mini   Mac OS X (10.4.6)  

    found solution, thanx everyone

Maybe you are looking for