Skip to Content

PI Receiver File Content Conversion - File name

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 17, 2016 at 08:10 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 18, 2016 at 02:11 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded