on 04-12-2011 5:40 AM
HI,
my requirement is to create filename dynamically(UDF) in Receiver communication channel but I dont want the name should be populated in the target field as target field is not provided by business.
I received the below UDF from SDN
String date = var1[0];
String RFCL = var2[0] ;
String FN = RFCL + date ;
AbstractTrace trace = container.getTrace();
trace.addWarning("Test" + FN);
String NameSpace = "http:/"+"/sap.com/xi/XI/Syatem/File";
DynamicConfiguration conf =
(DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(NameSpace, "FileName" );
conf.put(key,FN);
//trace.addWarning("Test" + var2);
//trace.addWarning("Test" + RFCL);
result.addValue(var2);
Can any one suggest me how I can achieve my requirement
Thanks
Hi
In your code your namespace is wrong...
String NameSpace = "http:/"+"/sap.com/xi/XI/Syatem/File";
it should be System
HTH
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Use the code
public String getFileName(Container container) throws StreamTransformationException{
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//For getting filename
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
// Retrieve the filename
String FileName = conf.get(key);
return FileName;}
Map this to the root node. Do not forget to keep the Adapter Specific Message Attributes(ASMA) checked in the communication channels.
Set Adapter Specific Message Attributes
File Name.
Regards
Monika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anurag,
you can use UDF in mapping .. it will generate Filename at runtime and it will get assign to file..
in that case you need to use variable substitute in communication channel and few other option ..it depends on your requirement..
refer following weblog..
/people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name
and search with dynamic file name and variable substitute and you will get many links.. for this..
Thanks,
Bhupesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
map your UDF to root node of your target structure, thats it..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.