cancel
Showing results for 
Search instead for 
Did you mean: 

source file name is coming null in Dynamic Configuration

former_member200339
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member186851
Active Contributor
0 Kudos

Hello Rana,

I guess the namespace your mentioning is wrong

try with this namespace-http://sap.com/xi/XI/System/File"

Answers (4)

Answers (4)

former_member200339
Participant
0 Kudos

Thanks to everybody for the kind help.

I have put the namespace wrong.

I have corrected it and now it is working.

0 Kudos

Please check the namespace you are using in the UDF. It should be http://sap.com/xi/XI/System/File

former_member186851
Active Contributor
0 Kudos

Hello Rajat,

I guess already I mentioned the same.

r_s_kulkarni11
Participant
0 Kudos

Hello,

I think as mentioned by Raghuraman, issue seems to be with the namespace.

Former Member
0 Kudos

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;