cancel
Showing results for 
Search instead for 
Did you mean: 

User Function wich replaces umlauts

Former Member
0 Kudos
345

Hi,

i need a User-Function in Java for XI wich replace the following characters of a text for example:

ä in ae

ü in ue

ö in oe

can anyone tells me how the java has to look like?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Christian,

did this solve your problem?

If yes, please award points.

Dominic

manuel_bassani
Contributor
0 Kudos

Hi,

try this UDF:


String retString;
retString = a.replaceAll("ä", "ae");
retString = retString.replaceAll("ü", "ue");
retString = retString.replaceAll("ö", "oe");
return(retString);

this will replace any occurrence all "ä" , "ü" , "ö" in your text in "ae" , "ue" , "oe"

Regards,

Manuel

Former Member
0 Kudos

Or shorter:

String replace;

replace = a.replaceAll("ö", "oe").replaceAll("ä", "ae").replaceAll("ü", "ue");

return replace;

Regards

Dominic

Former Member
0 Kudos

Hi Dominic,

Thanks!

Cheers!

Samarjit

Former Member
0 Kudos

Hi,

you need three diferent udf for this.

/*******UDF*******/

1.

if(a.equalsIgnoreCase("ä")){

a = "ae";

}

return(a);

2.

if(b.equalsIgnoreCase("ü"){

b="ue";

}

return(b);

3.

if(c.equalsIgnoreCase("ö"){

c="oe";

}

return(c);

Cheers!

Samarjit

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>>you need three diferent udf for this.

/*******UDF*******/

1.

if(a.equalsIgnoreCase("ä")){

a = "ae";

}

return(a);

1. not true - you can put everything in one

2. it's better to use standard function (fixed values) to do that

that's what standard fucntions are for

Regards,

michal

-

-


<a href="https://answers.sap.com/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

Hi Michal,

We can not put in one.I mention that need three udf for this scenario.

Cheers!

Samarjit

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>>We can not put in one.I mention that need three udf for this scenario.

trust me we can do multiple if statements in java

Regards,

michal

Former Member
0 Kudos

Hi,

>>>>trust me we can do multiple if statements in java

That time i do not know the exact logic.Now Dominic solved the purpose

Cheers!

Samarjit

henrique_pinto
Active Contributor
0 Kudos

> hi,

>

> >>>>We can not put in one.I mention that need three

> udf for this scenario.

>

> trust me we can do multiple if statements in java

>

>

> Regards,

> michal

hehe

Henrique.

MichalKrawczyk
Active Contributor
0 Kudos

hi,

you can use <b>fixvalues</b> standard function (from conversion functions)

and put this inside

Regards,

michal

Former Member
0 Kudos

This doesn't work when i have a Text for example:

"die häuser sind schön"

the result must be:

"die haeuser sind schoen"

Message was edited by:

Christian Maier

Former Member
0 Kudos

Hi Christian,

Then you need proper logic behind it.I will try your problem.If i successed i will post it.

Cheers!

Samarjit