on 09-01-2015 8:08 PM
Hi All.
My scenario is Proxy to File.
I am getting file name from Proxy to one field Bsed on some condition.
Condition is for on cycle file name is fileon_201501091234.dat and for off cycle file name is fileoff_201501091234.
How to create file name based on that field value.
Whether I need to create UDF or is it possible with value mapping.
Please let me know the Answer.
Thanks In Advance,
Vishnu Pallamreddy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishnu,
If you are populating any field on the target side by maintaining the validations on the filename field present on the source side, then you can go with variable substitution option available onthe receiver adapter. But if you are using any content conversion to convert xml file to a flat file, then this variable substitution does not work.
In this case, you need to use a udf in the mapping level. Please activate ASMA in the receiver file channel.
Please let me know if you want any help on the udf part.
HiVishnu,
You can use dynamic configuration.Please find the code for the same:
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
String a=conf.get(key);
var1 = a;
return var1;
Hi Vishnu,
As the first step, please enable ASMA in receiver file channel.
In mapping level, pass the file name which is coming in the source structure(I assume only one variable which captures either on cycle or off cycle case).
Code snippet:
DynamicConfiguration dc = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey dck = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
dc.put(dck,input);
return "";
Map the output of the udf to the root node in the target structure.
If you are getting filenames separately for on cycle & off cycle, then you need to pass these two fields to the udf, and add the below lines extra to the above code:
String input="";
input = input1.length()>=1?input1:input2;
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.