on 01-27-2014 5:26 PM
I have a scenario where i am picking multiple files from one server and writing it on another. While writing the files, i want to write them to different folders using one communication channels based on the filename. is it possible? if yes how?
Hi Nishant,
you have two option
1 using OS command after message processing at receiver CC use copy command with %F option
2other option is create another Receiver CC and define that with another Receiver
Regards
GB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
IMO, best solution is to either write a adapter module or java mapping to define target folders dynamically.
Adapter module:
Java mapping:
http://wiki.sdn.sap.com/wiki/display/XI/Dynamic+file+name+for+pass-through+scenario
Thanks
Amit Srivastava
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nishat,
If you dont need to make any mapping the easier way in my opinion is to access to the global variable fileName and in the condition of the Configured Receivers determine the final target. Check Indrajit Sarkar's answer in this thread , and you can do something similar but with filename instead of directory.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to go for dynamic configuration UDF in the mapping.
Refer to the below document
Also http://saptechnical.com/Tips/XI/ASMA/Index.htm
You just need to add filters/fix value lookup and pass it to UDF to determine the target directory
Message was edited by: Hareesh Gampa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have mapping in place then i would try with the below UDF -
String filename = new String("");
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
DynamicConfigurationKey key2 = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","Directory");
filename = conf1.get(key1); //reading source filename
if (filename.equals("test"))
{
conf1.put(key2,"first directory name");
}
else
{
conf1.put(key2,"second directory name");
}
return "";
You need to enable dynamic attributes in both sender and receiver channel..
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.