Dynamic taget directory usinf Filename

Hi all
I have a requirement in which I have to Dynamically choose target directory depending on the filename??
Example
If File name is FI08.txt ,it should be posted to following folder
server\Test\<FileName>. If it has deiiferent file name it should be posted to different directory.
I am usind a simple file to file interface without using IR.
So there is no Mapping involved.
Regards
Abhishek Mahajan
Is there any other solution possible without using Variable Substitution.

Variable substitution :
When you specify the target directory and file name schema, you now have the option of setting variables and defining them in a table. The variables are replaced by elements from the XML structure at runtime.
Contrary to the description in the documentation, you cannot yet replace with attributes from the XI message header. Do not use the prefix during variable substitution
http://help.sap.com/saphelp_nw2004s/helpdata/en/8e/464442c1a1c253e10000000a1550b0/content.htm
Also see the below links to use the dynamic variable substitution
/people/michal.krawczyk2/blog/2005/03/29/xi-error--unable-to-convert-the-sender-service-to-an-ale-logical-system
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1
/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2
reward points if found helpfull
regards
chandra.k

Similar Messages

  • File Adapter : Dynamic Target Directory

    Hi EveryBody,
    I have an IDOC to File Scenario in which based on some field value X in IDOC i need to send the file to Different locations under the same FTP Server.
    For Example : if X = 01 then Target folder T1
                            X = 02 then Target folder T2.
    Can somebody help me out on the same.Possibly this can be done by Dynamic Configuration.Can somebody send me some links.
    Regards,
    Zabiulla

    Hi,
    First of all I would suggest to avoid the mail communications for the query.
    Its against the SDN rules.
    please read [Rules of Engagement|/thread/117188 [original link is broken];.
    About Solution, you need not have to go for Dynamic Target Directory
    You can use the Variable substitution concept here.
    In the Target directory pass the %Var1%
    and use Var1 ---> payload:<fieldName>
    Refer to the last part of this link to understand this better,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    For dynamic configuration you can also refer below link
    Dynamic configuration of Receiver FTP File channel
    Thanks
    Swarup

  • Dynamic FTP Directory Address in File Adapter - is this possible?

    We have a customer who would like us to pick up a file via an FTP file adapter once per day. The problem is, they have a different directory each day containing the file. The directory name is of the form YYYY-MM-DD. The name of the file in the directory is always the same.
    Is it possible to dynamically calculate the Source Directory name in the FTP file adapter? If so, how?
    Kind Regards,
    Tony.

    >
    Dharamveer Gaur wrote:
    > Hi
    > Look this same thread:
    > Re: Dynamic folder name (when reading file in file adapter)
    Hi,
    All the examples I have seen are to configure the Receiver File Adapter, not the Sender File Adapter. I don't thinl I have seen one blog yet whereby the source directory of a Sender File Adapter has been dynamically configured. I wonder if it can be done because the sender file adapter does not have Variable Substitution possibilities for filenames and directories.
    So has anybody a link to a blog where this dynamic choice of a source directory has been done for a SENDER file adapter?
    BR,
    Tony.

  • Dynamic file Directory : Sender File Adapter

    Hi all
    In one of our interface development ,at  we require a dynamic Directory path at the sender file adapter ..
    ex :
    path = Root/A/B/C
    filename = test.txt
    now in Root Directory, Folder & subfolder  " A ( B ( C )))  are dynamic.
    Subfolder "C"  wil contain the source file..
    Will it possible...with Z module development..??
    Regards,
    Ashutosh

    hi,
    if you want your directory name dynamically from Payload, you can use the option variable substitustion;
    For example follow below procedure:
    1)in the Target directory name --> /%dir%
    2)go to advanced tab and check for the variable substitution option(enable),
    3)variable name:dir
       Reference:Payload:mt_filetest,1,name,1
    according to the given details in the communication channel your  payload should be like this
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:mt_filetest xmlns:ns0="urn://filetest">
       <name>madhav</name>
    </ns0:mt_filetest>
    now  directory is created with the name of madhav (Dynamically according to the payload directory name is created).
    Note: points if it is useful
    Thanks
    Madhav

  • Dynamic source directory in sender adapter

    Hi Experts,
    I have a File to File scenario, where my source directory needs to be dynamic. The directory structure is like:
    Y:\ParentDrive\<DynamicFolder>\<DynamicFolder>\<DynmicFileName>
    And then on the receiver side, I need to create the DynamicFolders and the file.
    Please let me know if this can be achieved using modules or if there is any other approach.

    hi,
    refer my article:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70c89607-e4d9-2910-7280-f6746e964516
    it shows using filename. similarly u can use directory attribute.
    [reward if helpful]
    regards,
    latika.

  • Dynamic File, Directory names - File2File Scenario

    We donot have message mapping in our Scenario  ( Ftp file 2 Ftp file scenario ) where we like to change filename, directory before writing file on the target ftp server. Basically Dynamic configuration has to be manipulated based on  file name pattern. How can we change Dynamic configuration variables without message mapping step.
    Thanks

    Bhavesh, Aamir,
    I am not as learned as you all are...However i have one doubt...
    Can you tell me how..you would use variable substitution  or any of the other features besides the dynamic Config bean...to make a decision..with this logic.
    If(filename.equals(a)){
    String dir = /usr/sap;
    else if(filename.equals(b)){
    String dir = /usr/pas;
    Can someone please enlighten me as this is a problem i have had before and had to do a workaround on...
    Regards
    Ravi Raman

  • Dynamic target Directory

    Hi All
          I have a scenario in which all my master IDOCS should flow form R3 to XI and form XI to the FTP Server's respective Folder loaction.
    The Folder option is storewise , so for example for ST01 , the corresponding WP_PLU should be placed at ST01 folder location in the ftp server.
    there is an UDF written foe file naminf convention:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http:" + "/" + "/" + "sap.com/xi/XI/System/File", "FileName");
    Calendar cal = Calendar.getInstance();
    Date date = cal.getTime();
    String s = date.toString();
    String a1 = s.substring(8,10);
    String b = s.substring(4,7);
    String b1="a";
    if(b.equals("Jan"))
    {b1="01";}
    if(b.equals("Feb"))
    {b1="02";}
    if(b.equals("Mar"))
    {b1="03";}
    if(b.equals("Apr"))
    {b1="04";}
    if(b.equals("May"))
    {b1="05";}
    if(b.equals("Jun"))
    {b1="06";}
    if(b.equals("Jul"))
    {b1="07";}
    if(b.equals("Aug"))
    {b1="08";}
    if(b.equals("Sep"))
    {b1="09";}
    if(b.equals("Oct"))
    {b1="10";}
    if(b.equals("Nov"))
    {b1="11";}
    if(b.equals("Dec"))
    {b1="12";}
    String c = s.substring(24);
    String sDate = a1b1c;
    String e = s.substring(11,13);
    String f = s.substring(14,16);
    String g = s.substring(17,19);
    String sTime = efg;
    String d = a.substring(9,25);
    String Idoc = d;
    String RecieverFilename = "WPDBBY_"Idoc"_"sDate"_"sTime".txt";
    //<Receiver Filename> ; //you have to give the filename that has to be generated in the receiver adapter.
    conf.put(key, RecieverFilename);
    return a;
    Could any1 please help how to add the directory to it,please let me know the code as i am not a JAVA developer
    regards
    Prajna

    Hi,
    add this extra code
    DynamicConfigurationKey DIR_NAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    String Dirname = "";
    //write logic to generate a dynamic directory and make sure that this directory exists in FTP
    //(or) the Receiver file channel Channel has access rights to create the folder.
    conf.put(DIR_NAME, Dirname );//now put that Dirname value generated here
    Also Make sure that in the receiver file channel Adapter Specific message Attributes is checked along with FileName & Directory.
    Thanks,
    Gujjeti.
    Edited by: Praveen Gujjeti on Nov 21, 2008 1:07 PM

  • Dynamically change directory  in FileAdapter while write file

    my situation is:
    I would like to write a file to a specified directory with specified file name. I found there is not directory parameter in fileAdapterOutboundHeader.wsdl. When I specify fileName, it is always plus with the Logical/PhysicalDirectory. And if I configure the Logical/PhysicalDirectory as empty, it doesn't work.
    please check it for me.
    thanks

    File directory information goes to second WSDL which is created by FileAdapter it looks like this
    <jca:operation
    PhysicalDirectory="C:\Project\Integration\temp\FileWrite"
    InteractionSpec="oracle.tip.adapter.file.outbound.FileInteractionSpec"
    FileNamingConvention="service_%SEQ%.xml"
    NumberMessages="1"
    ElapsedTime="60"
    FileSize="1024000"
    OpaqueSchema="false" >
    </jca:operation>
    I also want to change it dynamically. lets see if we get lucky :)

  • File Sender Adapter - Dinamic Source Directory and Filename

    Hi Experts,
    I have to receive in XI a file and depeding of some info, put it in diferent directories with diferent fieldnames.
    In receiver File Adapter we can set the directory and fieldname dinamically by ABAP-CLASS mapping, but not in Sender.
    I've read Michal's blog
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    and sap help
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
    But, I can't find Adapter-Specific Message Attributes in my File Adapter...:-) I've checked SP version is SP16, where are my Adapter-Specific Message Attributes?
    How can I set Directory and Fieldname at runtime for Sender File Adapter?
    Please help...
    Thanks all in advance,
    Regards.
    Urtzi.

    Hi Nilesh,
    Your threath is not about my issue...
    Answering to other friends, what I want is not to write p.e.: '/server/dir/' in each File Sender Adapter Channel, and put it with any other way looking some 'customizing' or checking a condition.
    The problem is that frecuently in the Company changes servers and we have to enter to the Directory and change every Channel one by one...We would like to reduce the maintain of the Channels with a mapping, variable, customizing table...or something similar. Do I explain?
    I don't know if its possible but I had the hope...:-)
    Thanks all.
    Urtzi.

  • Dynamic Configuration for determining filename

    Hi ,
    I am using dynamic configuration for determining the filename sent by the sender
    I am using the following code::
    int i = 0;
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    if  (ourSourceFileName.equals("data.txt"))
    for (i = 0 ; i < 1 ; i++)
    result.addValue(ourSourceFileName);
    i have also 'checked' filename in set Adapter specific message propertiesas  in sender communication channel.
    But Still it is not working.
    Please provide some help on it.
    Thanks & Regards
    Nilima

    Hi,
    Michal
    In SXMB-MONIthe response part contains DYNAMIC CONFIGURATION node
    and it displays::
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <!--  Response
      -->
    <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName"><b>try1.txt</b></SAP:Record>
      </SAP:DynamicConfiguration>
    please sir provide some help on it.
    Thanks once again.

  • How to include partner number dynamically in the archive filename ?

    Hi,
    I am working on IDOC archiving. Since we have a lots of IDOCs with the same Master IDOC name but coming from different partners, it would make sense to generate as much archive files as there are different partners.
    I have seen that the archive filename is dynamically built with concatenation of parameters.
    I guess we could use the filename_exit function module to set a parameter to the value of the partner number, but how to get the partner number ?

    Welcome to SDN.
    check out this weblog.
    <a href="/people/sap.user72/blog/2005/06/02/dynamic-includes-for-bsp">Dynamic Includes for BSP</a>
    Regards
    Raja

  • Dynamic construction of temporary filename for receiver file hcannel

    Hi,
    We are using a receiver file channel and we need to populate the temporary file name dynamically , in the message mapping (similar to main file name and folder).
    Please let me know as to how to achieve this in message mapping and what configuration needs to be done in the receiver file channel.
    Regards
    Ganesh

    Hi,
         A way to fetch File name Dynamically (from source File Adapter) in message mapping is through a UDF and then pass this Filename in XML payload of your message.
    Then this Dyanamic File name can be put into Receiver File Adapter by configuring Advanced Tab in Receiver File Adapter as explained in this Link:
    under Advanced Tab Page
    http://help.sap.com/saphelp_nw70/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm
    UDF is as Follows:
        DynamicConfiguration conf  = (DynamicConfiguration) container
      .getTransformationParameters()
      .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String valueOld = conf.get(key);
    return (valueOld);
    This code fetches File Name of the files picked up by Sender File Adapter.Give a suitable file name in Sender as  "*.txt" or anthing you wish.
    If you find the information helpful, rewards points.
    Thanks,
    Anurag Garg

  • Dynamic Target Directory name: DEV QUA and PRD

    Dear All,
    Scenario Idoc to File:
    I need to configure file directory's dynamically - when the object is moved to D, Q and Prd. for that am using plant and location to differenciate.
    InExample: D:\SX\Common\ <plant><location>
    TinAdvance
    Swarna.

    Swarna wrote:
    Dear All,
    >
    > Scenario Idoc to File:
    >
    > I need to configure file directory's dynamically - when the object is moved to D, Q and Prd. for that am using plant and location to differenciate.
    >
    > InExample: D:SXCommon <plant><location>
    >
    > TinAdvance
    > Swarna.
    I am assuming that the plan and location fields are part of the data structure and the path D:SXCommon will always remain the same in all the environments.
    In that case, you can write a generic UDF for this that will handle in Dev, QA and PRD
    use this blog to help you - Dynamic Configuration vs Variable Substitution - The Ultimate Battle for the File Name

  • Dynamic target directory with variable substitution

    Hi everyone.
    I'm trying to save a file in a folder with receiver adapter.
    This folder is determined in runtime and passed to the adapter with variable substitution. My problem is that in RWB i get a error like this : 'Content of variable XXXXX is not safe'
    Does anybody have done a variable substituion for output directory receiver file adapter?
    Regards,
    Inigo.

    Hi,
    Check this links,
    /people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    Regards,
    Phani

  • How to browse a local PC directory and filename in Forms 10g?

    I am adding a Text Item and a Push Button. When the Push Button is pressed, I would like to select files from the local PC on Windows XP.
    What is the code that is required in order to select folder and filename and pass the value to a Text Item?

    I can now compile webutil.pll to webutil.plx after I start the create_webutil_db.sql bundled with the webutil in the schema I am using to connect from forms.
    I can run the form, but at run-time, another Error Alert appears:
    oracle.forms.webutil.file FileFunctions bean not found. WEBUTIL_FILE.FILE.SELECTION_DIALOG_INT will not work.
    What has gone wrong?
    I found that there is a batch file to sign jar files:
    sign_webutil.bat - Sample script to sign frmwebutil.jar and jacob.jar
    I can sign frmwebutil.jar but I cannot fond the file jacob.jar.
    Message was edited by:
    wyfwong

Maybe you are looking for

  • Can I use home sharing with two different Apple IDs?

    Can I use home sharing for two different Apple IDs?

  • How to add one task in manager task list in CRM

    Hello, I have one scenario like when the user status is changed in service request then manager should get one email notification and that one task should be added in the manager task list. To send the email I have configure the Action profile and it

  • Active Directory Time Error

    The last 3 days or so random Macs from our 350 or so here have been falling off our Active Directory domain. When trying to unbind/rebind them Directory Utility tells me all about how AD "only permits slight variations between clocks on your computer

  • ChaRM for 2 tier landscape

    Hi I need to setup ChaRM for a 2 tier landscape. I know how to do the technical side however i need some clarity in regards to the process flow that will be used. Does someone have a diagram or document detailing this process. Basically i just need t

  • Storage configuration on 2008 r2 Hyper V

    I work for an IT company that just recently signed a client that uses a clustered Hyper-V environment running on Windows Server 2008r2, and uses Shared Cluster Storage or Shared Volume.  The setup seems very strange to me.  They are configured in a f