cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically generate terget directory in receiver FTP adapter

Former Member
0 Kudos

Hi guys,

I'm trying to set up a scenario where the file will be placed into a terget directiry based on values from the incoming message. I can't use variable substitution as my target message does not contain the needed value, so I'm trying to set up a dynamic configuration in an UDF. Unfortunately, this is not working.. Any ideas, what could be wrong? The receiver FTP adapter always just takes values from it's configuration. It doesn't help when I try to change it in mapping.

This is the java map code in the UDF:

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

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

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

conf.put(key, a);

conf.put(key2, "tfilename.txt");

return "";

Thanks a lot for any help,

Olian

Accepted Solutions (1)

Accepted Solutions (1)

former_member200962
Active Contributor
0 Kudos

I hope that you have checked the ASMA variables (FileName and Directory) in your File receiver CC

Former Member
0 Kudos

sure! asma.. I forgot

thanks guys!

Olian

Answers (2)

Answers (2)

prateek
Active Contributor
0 Kudos

I hope you have mapped this UDF to a node properly.

In sxmb_moni, could you find DynamicConfiguration tab in Soap Header?

Also have you selected "Adapter Specific Message Attributes" in file channel?

Regards,

Prateek

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

use below code it will work fine

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 a=conf.get(key);

String b=conf.get(key1);

var1 = a+b; ;

return var1;

map this udf to root element of your receiver structure.

Regards,

Raj

Former Member
0 Kudos

Hi Raja,

I need to SET the values, not to GET them. So the target receiver adapter would change the directory name based on these values.

Thanks, Olian