on 11-14-2014 10:03 PM
Hi,
I have a requirement to hardcode the file name+add the original file name in a file to file scenario.
Its a file to file scenario.
If the source file is ABCD, I need to send out adding constant text - SAPACHFILE....
So I need the target filename as SAPACHFILE.ABCD.
To achieve this I tried using ASMA + Variable substitution, but it still take just the original filename as ABCD not the hard-code, I can either get the harcode value or dynamic file name but not both....
Kindly help!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Harry,
Just use ASMA, no need of Variable Substitution:
UDF Code:
try {
String filename = "";
DynamicConfiguration conf1 = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
filename = conf1.get(key1);
filename = "SAPACHFILE." + filename;
conf1.put(key1,filename);
return "";
}
catch(Exception e)
{
String exception = e.toString();
return exception;
}
SAPTechnical.COM - Dynamic File name using ASMA (Adapter Specific Message Attributes) in XI / PI
Regards,
Nabendu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Harry,
If Filename is not coming under any Source Field, variable substitution would not make sense. For ASMA, if you had to pass same Source File name to Target, you are not required to create any ESR objects.
To achieve your case (anyhow it is custom requirement) you can create a Message Mapping (Source & Target Structure same and 1:1) and add this UDF. Just take any Source Field as input in the UDF and return the same (output of UDF) to the same Target field.
Otherwise check:
Dynamic file name for pass-through scenario - Process Integration - SCN Wiki
But in that case you have to again write Java Mapping, which is time consuming.
Regards,
Nabendu.
Hello,
You can write a simple AM to create dynamic file name in a file to file pass through scenario.
Thanks
Amit Srivastava
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.