cancel
Showing results for 
Search instead for 
Did you mean: 

PI Receiver File Content Conversion - File name

former_member244059
Participant
0 Kudos

Hi Experts.

I'm reading a flat file using receiver file adapter in PI 7.5, and then converting it to xml using FCC.

However, I need to save the file name to an element of the resulting XML after conversion, to later pass that value to a RFC.

Any ideas on how can I achieve this?

Thanx

Accepted Solutions (1)

Accepted Solutions (1)

Ryan-Crosby
Active Contributor

Hi Jesus,

You can use the ASMA options of the file sender channel to record the file name. Then you can do a simple graphical mapping with a UDF to extract the dynamic configuration data and pass the result to an element within the XML message. The basic UDF code would be:

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

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
return conf.get(key);

Regards,

Ryan Crosby

former_member244059
Participant
0 Kudos

Thank you Ryan. That was exactly what I needed!

Answers (1)

Answers (1)

former_member182412
Active Contributor

Hi Jesus,

Create a generic UDF in common software component and reuse the UDF in all the message mappings for this kind of requirement as shown in below blog.

Reuse FunctionLibrary for DynamicConfiguration and Message Header Attributes

Regards,

Praveen.

former_member244059
Participant
0 Kudos

Thank you Praveen. Very helpful!