Skip to Content

File to Proxy: reading filename from sender and map with target field

Hi All,

I have following udf for getting file-name from sender, but how to map and what is the input field I have to give.

As udf expects input, what is the input field I have to pass.

I have taken field (random input) mapped one input field as below and used udf shown in below picture.  Please suggest if it is correct.

UDF is:

---------------------------------------------------

Untitled.png (19.4 kB)
Capture.PNG (29.2 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 24, 2014 at 02:17 PM

    Hi All,

    I just have doubt here that what input I have to pass to function.

    I only need filename on target side.

    shall I map:

    constant --> function  ---> target like below:

    Add comment
    10|10000 characters needed characters exceeded

    • Hello,

      If u just want to read filename and pass it to one of the fields in ur proxy then u don't need to pass any input to ur UDF.

      So ur UDF will be:

      String filename    = "";

      DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
      DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");

      filename = conf1.get(key1);
      return filename;

      Mapping:

      UDF -> Target Field

      Thanks

      Amit Srivastava

  • Jan 24, 2014 at 02:16 PM

    Hi SP - I dont think it works. you are not getting the file name in the above method.

    Use the below UDF and pass any input or map it with constant.

    String filename    = "";

    DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");

    filename = conf1.get(key1);
    conf1.put(key1,filename);
    return filename;

    Source : http://scn.sap.com/thread/3156237

    Add comment
    10|10000 characters needed characters exceeded