How to Get the Filename?
Posted on May 03, 2010 at 11.07 AM - Kuala Lumpur, Malaysia
It's very common to store file name in such away that we can perform reconciliation again. One typical example of this would be populating the IDOC field REFINT (reference interface) with the source file name. So how can we achieve it?
1. Create a UDF to get the file name
try {
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;
} catch (NullPointerException e) { return ""; }
2. Use the UDF to populate the target field
3. Don't forget to set the file specific attribute to the SAP dynamic configuration, especially the File Name
Life is beautiful! Let's make it meaningful and colorful!