Skip to Content

Source File name passing to Traget field name

Hi Experts ,

I am having one requirement to read the source filename and pass this value to Target field name.

I used Dynamic configuration UDF :

  String FileValue = "";
  try{
    //Get the DynamicConfiguration instance
    DynamicConfiguration config = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
  
    //Define key to read from the Dynamic Configuration
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
  
    //Read the FileName parameter from the Dynamic Configuration based on the key
  String filename = conf.get(key);
  }catch(Exception ee)
{
    FileValue = "";
  }
  return FileValue;

I am getting an error like while activating mapping :

String filename = conf.get(key) is not valid .

Can anyone suggest, how to fix this.

Best , Shiva

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 09 at 10:20 AM

    Hi Shiva,

    It should be conf.get(key1)

    Regards,

    Vivek Jain

    Add comment
    10|10000 characters needed characters exceeded