cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Name from attribute : Variable Substitution

Former Member
0 Kudos

Hey there,

Can I use the variable subsititution feature of the File Adapter to set the filename dynamically from the payload. The filename is to come from a attribute and NOT an element. Is there a way how I can set this in the file schema subsitition .

Thanks is advance,

Zubair

Accepted Solutions (0)

Answers (1)

Answers (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

I dont think you can use the Attributes in order to use Variable name substitituion.

Another option would be to use Adapter Specific identifiers --> Filename and the following code in your mapping to set the file adapters file name dynamically,

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

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

Also take a look at this blog,

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

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

Regards,

Bhavesh