cancel
Showing results for 
Search instead for 
Did you mean: 

Changing File Type

Former Member
0 Kudos

I am having XML file to XML file scenario. I want same file name as receiver. So I have used message speific attributes. But I want file ext .mxml instead of .xml. Any help is appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

then you need to change the extension in the mapping for example (using ASMA)

Regards,

Michal Krawczyk

Answers (4)

Answers (4)

Former Member
0 Kudos

This could be done with dynamic configuration(change the file extension in the udf as already been suggested) and without variable substitution.

Additional reference for Dynamic Configuration /people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name

Hope that helps!

former_member187339
Active Contributor
0 Kudos

Hi,

1. Use Adapter specifc identifiers in sender file adapter

2. use the following code (you can use it by assigning this to the root node of the target)

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

// access dynamic configuration

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

String valueOld = conf.get(key);

if(valueOld == null) valuNew="default.mxml";

else {

// compute new value

String valueNew = valueOld.replaceAll(".xml", ".mxml");

// set new value

conf.put(key, valueNew);

}

3. Use variable substitution in receiver channel

Regards

Suraj

Former Member
0 Kudos

or u can use the message transform bean for changing the same...

Rajesh

Former Member
0 Kudos

Hi,

You can use OS command (after processing) to rename the processed file.

The syntax should be something like "ftp rename f% /<path>/f%.txt"

Ps note : I am doubtful about this solution....but can have try.

Even Adapter module will be an open option...

Thanks

Swarup

Edited by: Swarup Sawant on Aug 31, 2009 9:06 AM