Skip to Content
0

PI Receiver File Content Conversion - File name

Oct 17, 2016 at 07:46 PM

135

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Ryan Crosby Oct 17, 2016 at 08:10 PM
1

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thank you Ryan. That was exactly what I needed!

0
Praveen Gandepalli Oct 18, 2016 at 02:11 AM
1

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.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thank you Praveen. Very helpful!

0