on 11-26-2010 2:50 PM
Dear experts,
On PI, I need to create a (text-) file with a variable name and folder. The scenario is as follows:
idoc-> PI -> txt file
In my incoming Idoc I get the following data:
- directory where the txt file should be saved;
- name that the txt file should get.
How can I realise this in PI? Using variable substitution? As I never done this before, I have a hard time getting this to work...
Please help.
Thanks in advance
William
Hi,
Use Dynamic Configuration:
Input will be 2 variables var1, var2.
String Name1 = var1;
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
conf.put(key1, Name1);
String Name2 = var2;
DynamicConfigurationKey key2 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
conf.put(key2, Name2);
return "";
Maping:
Var1---
-
UDF----TargetMessageNode.
Var2---
Under ID: Enable ASMA in file receiver adapter and chk FileName and Directory.
and put * under File name and / underTarget Directory(File receiver).
NOTE: U can alter this UDF according to ur req.
Thanks
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi JWD,
Check the below Blogs, this gives a good idea of using variable substitution along with Dymanic configuration.
/people/madanmohan.agrawal/blog/2009/05/20/combining-three-different-aspects-of-pi-asma-af-module-and-variable-substitution-in-one-shot
/people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
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.