Skip to Content
avatar image
Former Member

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    May 12, 2008 at 06:27 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 12, 2008 at 09:01 AM

    Hi Abhishek,

    You can write a module using Java EJBs to achieve what you want. When you read the file, read it's name and write it on file. When you receiver file adapter creates the file, choose the directory by reading the name from the file.

    Thanks,

    Varun

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 12, 2008 at 09:14 AM

    Hello,

    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

    Add comment
    10|10000 characters needed characters exceeded