Skip to Content
avatar image
Former Member

Property File in UDF

Hi guys;

is it possible to access a property file e.g. abc.properties in UDF?

Where to put the file in the integration server?

And how to access to file?

any help appreciated, maybe code sample?

Kind regards

Jochen

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    May 06, 2008 at 12:01 PM

    Are you looking for this??

    /people/sap.user72/blog/2006/06/07/property-file-a-smart-use-in-xi-context

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 06, 2008 at 12:02 PM

    Hi,

    Wat do u mean by property file. wat it contents.

    can u explain properly.

    chirag

    Add comment
    10|10000 characters needed characters exceeded

  • May 06, 2008 at 12:04 PM

    Hi,

    Can you brief your requirement.

    Thanks

    Gujjeti

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi guys;

      thanks for all your answers.

      sekhar´s link is accurately that what I was looking for.

      I want to define a UDF, that´s used for some kind of "FixValue Mapping".

      but there is a huge list of values, so that defining it as FixValue is not very nice.

      Therefore I want to put the values in a property file and access them in UDF

      thanks again to all

      Kind regards

      Jochen

  • avatar image
    Former Member
    May 06, 2008 at 12:10 PM

    Hi,

    >>>is it possible to access a property file e.g. abc.properties in UDF?

    yes.

    >>> And how to access to file?

    we can use the property file at message mapping level.

    in message mapping, we have edit java selection option.

    u can find out three sections.

    1.Intialisation section

    2.global variable section

    3.clen-up section

    u can use property file accoring to u r requiremnt.

    >>>Where to put the file in the integration server?

    place the file on xi server (convient to u ) like /temp/prop/...etc

    regards

    mahesh.

    Add comment
    10|10000 characters needed characters exceeded

  • May 06, 2008 at 12:17 PM

    imports: java.util.Properties;

    function myudf(Resultlsit result, Container container)

    {

    Properties propSet;

    try{

    propSet= new Properties();

    propSet.load(new FileInputStream("/path/file.properties"));

    Enumeration enum = propSet.propertyNames();

    for (; enum.hasMoreElements(); ) {

    String propName = (String)enum.nextElement();

    String propValue = (String)_propSet.getProperty(propName);

    result.addValue(propValue);

    }

    }

    catch (Exception e)

    {

    trace.addWarning(e.getMessage());

    }

    }

    Add comment
    10|10000 characters needed characters exceeded