Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to Populate file name from a field value - Proxy To File

Hi All.

My scenario is Proxy to File.

I am getting file name from Proxy to one field Bsed on some condition.

Condition is for on cycle file name is fileon_201501091234.dat and for off cycle file name is fileoff_201501091234.

How to create file name based on that field value.

Whether I need to create UDF or is it possible with value mapping.

Please let me know the Answer.

Thanks In Advance,

Vishnu Pallamreddy.

Former Member replied

Hi Vishnu,

As the first step, please enable ASMA in receiver file channel.

In mapping level, pass the file name which is coming in the source structure(I assume only one variable which captures either on cycle or off cycle case).

Code snippet:

DynamicConfiguration dc = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey dck = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");

dc.put(dck,input);

return "";

Map the output of the udf to the root node in the target structure.

If you are getting filenames separately for on cycle & off cycle, then you need to pass these two fields to the udf, and add the below lines extra to the above code:

String input="";

input = input1.length()>=1?input1:input2;

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question