Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing 'special' characters

Sm1tje
Active Contributor
0 Kudos

Hi all,

I was wondering if thers is a function module, class (method) or whatever (codepage translation) to convert 'special' characters like:

è, é, ë, ï, etc with respectively e, e, e, i?

More generally speaking we need to convert all characters (whether it be Unicode, Latin-1, etc.) to plain text containing only the letters of the alphabet from a-z and A-Z.

Kind regards,

Micky.

1 ACCEPTED SOLUTION

rainer_hbenthal
Active Contributor
0 Kudos

That needs a translation table for all those "strange" characters... i dont think so that there is such a table inside SAP nor an algoithm to find out what a strange character is and what his plain ascii pendant is.

What do you do with klingon characters?

I had a similar problem and wrote a piece of code which is adopted everytime a new char pops up...

6 REPLIES 6

GauthamV
Active Contributor
0 Kudos

May be you can try this FM.

SCP_REPLACE_STRANGE_CHARS

rainer_hbenthal
Active Contributor
0 Kudos

That needs a translation table for all those "strange" characters... i dont think so that there is such a table inside SAP nor an algoithm to find out what a strange character is and what his plain ascii pendant is.

What do you do with klingon characters?

I had a similar problem and wrote a piece of code which is adopted everytime a new char pops up...

0 Kudos

@ Rainer,

both thanks a lot for your relevant replies which are quite helpful. And I do think that we still needs some sort of intermediate table to hold at least some characters to be translated/converted into plain text.

@ Gautham,

I'm currently testing this function module with several codepages (parameter INTER_CP) beside the default codepage 1146. For characters like ë and ï this is definitely the way to go, but when using some characters that are really out there like ¥ŖßÞu0152u03A9u03C6, we still seem to be needing an intermediate table to replace these characters.

But again, some very helpful answers.

P.S. Although both answers are potentially worth 10 pts, It only seems fair to give you both the credit you deserve.

0 Kudos

You can get more information related to code page and code segment from SCP transaction.

0 Kudos

So that leads me to an interesting approach:

U+0041 is A, and the Unicode name for that is LATIN CAPITAL LETTER A,

U+00C4 is Ä, and the Unicode name for that is LATIN CAPITAL LETTER A WITH DIAERESIS

There are a lot of namings like that. So, having Ä, i would go into that table behind SCP, translate that to LATIN CAPITAL LETTER A WITH DIAERESIS, delete everyting include und behind the WITH getting LATIN CAPITAL LETTER A. Going back in the table looking for the character i would find A.

I guess that table unicode|character|character description is somwehere in SAP, but i dont have the time to fugure that out.

0 Kudos

You can use TCP* tables like TCP01,TCP06,TCP08,TCP11.....