cancel
Showing results for 
Search instead for 
Did you mean: 

Decide target directory dynamically.

0 Kudos

Hi All

I need to configure a receiver communication channel with file adapter. Important thing is target directory need to be decided dynamically based on some content in the message. Please let me know what are the possibilities to achieve this.

Thanks & Regards

Shantha

Edited by: Shantha Bandara on Feb 12, 2008 1:05 AM

Accepted Solutions (0)

Answers (5)

Answers (5)

0 Kudos

Thanks every one. I used the solution provided by

Mike Hamer.

Shantha Bandara

Former Member
0 Kudos
0 Kudos

Thank both of you . I will try this and come back to you soon.

Shantha Bandara

justin_santhanam
Active Contributor
0 Kudos

Shantha,

Ther is small change in Jag code

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

raj.

Former Member
0 Kudos

Shantha,

A simple way is to use the variable substitution in the receiver file adapter configuration via an xpath

Refer to this url http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm

Regards,

Mike

former_member214364
Active Contributor
0 Kudos

Hi Shantha,

Create UDF in that you derive directory name and/or file name based on message content and store them in Dynamic Configuration.

When you are giving Directory name just give generic name from UDF(from the following code in place of directory name just give %Directory% File name %FileName%).

Here the sample value UDF code

AbstractTrace trace = container.getTrace();

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

String fnam = conf.get(key);

String dir = <Path to directory>;

String newfnam = <File name>;

conf.put(key,newfnam);

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

conf.put(key,dir);

return("");

Please let me know if you have any issues.

Cheers,

Jag