on 09-09-2015 11:14 AM
Dear All,
I have created a FILE to FILE scenario where the source file name is read using Dynamic Configuration in a Java Mapping. The code is as follows
DynamicConfiguration conf = (DynamicConfiguration) inputobj.getDynamicConfiguration();
DynamicConfigurationKey keyFileName = DynamicConfigurationKey.create("http://sap.com/xi/XI/System","FileName");
String sourceFileName = conf.get(keyFileName);
I have marked the checkbox in Sender File Adapter -> Set Adapter Specific Message Attributes and the File Name.
When I do an end-to-end run I can see the Dynamic Configuration coming successfully in the SOAP Header segment of the Inbound Message in sxi_monitor.
I have added the conf and keyFileName in the trace and they are successfully printed.
But at the third step it is returning null i.e. SourceFileName = null
What can be the reason for this? Please suggest.
Thanks and Regards,
Rana Brata De
Hello Rana,
I guess the namespace your mentioning is wrong
try with this namespace-http://sap.com/xi/XI/System/File"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks to everybody for the kind help.
I have put the namespace wrong.
I have corrected it and now it is working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please check the namespace you are using in the UDF. It should be http://sap.com/xi/XI/System/File
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I think as mentioned by Raghuraman, issue seems to be with the namespace.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rana,
Since your saying its file to file scenario simply you can place the file with dynamic name at target side by enabling ASMA on both sides,no need of UDF.
Anyhow if you need UDF change as below.
Use return file name in the end,it will work
DynamicConfiguration conf = (DynamicConfiguration) inputobj.getDynamicConfiguration();
DynamicConfigurationKey keyFileName = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String sourceFileName = conf.get(keyFileName);
return sourceFileName;
Otherwise
use this below code
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
String filename=conf.get(key);
return filename;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.