Skip to Content
0
Feb 26, 2014 at 09:27 PM

Dynamic directory and file name

35 Views

Hi

I have requirement of dynamic file name and dynamic directory with condition based on doctype from source

I have used the following code and for file and directory with two different udfs. If I am using only file it is working but not with the directory

try
{
String directory = new String("");
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","Directory");

if (var1.equals( "DOR" ))
{
directory = "/Inbound/DOR";
}
else {

directory = "/Inbound/KOR";

}
conf1.put(key1,directory);
return directory ;
}
catch(Exception e)
{
String Exception=e.toString();
return Exception;
}

in message mapping i used var1 to one of the not used field in target

similary i did for file with different udf and mapped sourcefield- to targetrootnode with same condition with different filename

But it is not working getting the following exception Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.exception.standard.SAPIllegalArgumentException: The parameter "argument" has the value "remote://*/PACK _TEST20140226-152149-483.dat", so it contains the character "remote://*/PACK _TEST20140226-152149-483.dat" which is not allowed

Thanks for your help