cancel
Showing results for 
Search instead for 
Did you mean: 

target directory in file adapter

Former Member
0 Kudos

Hi,

Please let me know how can we set the target directory in the receiver file adapter by reading the database (maybe from a table in the database).

regards,

Raghu

Accepted Solutions (1)

Accepted Solutions (1)

prateek
Active Contributor
0 Kudos

Do JDBC lookup or RFC lookup to access ur required filename and then follow the above suggested blogs.

Regards,

Prateek

Answers (3)

Answers (3)

Shabarish_Nair
Active Contributor
0 Kudos

try to avoid variable substitution. You can make use of adapter specific attributes in this case. For example for the same file name you can ref:

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

Similar logic can be used for directory also.

http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm

Shabarish_Nair
Active Contributor
0 Kudos

if you have refered the above mentioned weblog, then by the by to access the directory in

your code you can use, a sample code like;

DynamicConfigurationKey keyD = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");

String Directory = conf.put(keyD);

etc ..

Based on this reference you can further build your logic.

Former Member
0 Kudos

Hi Raghavendra,

Suppose a filed from database is pointing to the path or the directory, map the field to the target message type and use <b>Variable Substitution</b> in Receiver File adapter Side.

Regards,

Ramesh P

Former Member
0 Kudos

I used these blogs to create a directory structure depending on the data within the xml:

Dynamic File Name Part 1

/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i

Dynamic File Name Part 2

/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii

Former Member
0 Kudos

thanks barry.. ur links have helped me get a fair idea of how i can go about it...

Former Member
0 Kudos

I use the %var1% for both the filename and folders for additional clarity.

This only works reading the data from the payload.