cancel
Showing results for 
Search instead for 
Did you mean: 

Property File in UDF

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Are you looking for this??

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

Answers (4)

Answers (4)

GabrielSagaya
Active Contributor
0 Kudos

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());

}

}

former_member859847
Active Contributor
0 Kudos

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.

former_member181985
Active Contributor
0 Kudos

Hi,

Can you brief your requirement.

Thanks

Gujjeti

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

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

can u explain properly.

chirag