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: 

how to delete accent symbol in Spanish language ?

0 Kudos

Hi  experts,

When we extract the addresses, the string contains the accent symbol " ' " . We need to delete it via our coding,

Could you please provide any guidance and sample code for that?

The symbol looks like this, it should be converted to "o" .

many thanks!

Kelvin

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Have a look at this snippet.

  1. DATA str TYPE string VALUE 'Grün kräft kör çå és große'.
  2. TRANSLATE str USING 'ÀAÁAÂAÃAÄAÅAàaáaâaãaäaåaĀAāaĂAăaĄAąaÇCçcĆCćcĈCĉcĊCċcČCčcÐDðdĎDďdĐDđdÈEÉEÊEËEèeéeêeëeĒEēeĔEĕeĖEėeĘEęeĚEěeĜGĝgĞGğgĠGġgĢGģgĤHĥhĦHħhÌIÍIÎIÏIìiíiîiïiĨIĩiĪIīiĬIĭiĮIįiİIıiĴJĵjĶKķkĸkĹLĺlĻLļlĽLľlĿLŀlŁLłlÑNñnŃNńnŅNņnŇNňnʼnnŊNŋn'.
  3. TRANSLATE str USING 'ÒOÓOÔOÕOÖOØOòoóoôoõoöoøoŌOōoŎOŏoŐOőoŔRŕrŖRŗrŘRřrŚSśsŜSŝsŞSşsŠSšsſsŢTţtŤTťtŦTŧtÙUÚUÛUÜUùuúuûuüuŨUũuŪUūuŬUŭuŮUůuŰUűuŲUųuŴWŵwÝYýyÿyŶYŷyŸYŹZźzŻZżzŽZžz'.
  4. TRANSLATE str USING 'ßs'.
  5. WRITE / str.

/.

9 REPLIES 9

PeterJonker
Active Contributor
0 Kudos

Are you using a custom (Z) program ? Or standard SAP ?

Where is the screenshot of the XML coming from ?

Please provide more details if you want help.

E.g in ABAP you can do replace all occurrences of ò with o.

0 Kudos

Dear  Peter,

It's a Z program we developed to generate the XML file through information in SAP. However, as required by the receiver of the exported XML, the related accent should be deleted.

We found most of the accent symbol is located in the address which is input manually by users, and we can't require them to neglect the symbol when input.

Therefore, we have to append some abap codes to convert the string so as to delete these accent symbols.

Could you please kindly advise how to do it with abap coding? Or SAP have provided some function we can call to convert the strings?

Many thanks!

Kelvin

0 Kudos

Like I said in my previous answer. Use REPLACE ALL OCCURRENCES of 'õ' in XML_STRING with '0'.

I think that should do the trick. Check the documentation on REPLACE keyword.

0 Kudos

Hi,

Please try this FM its may solved your Problem. '' SCP_REPLACE_STRANGE_CHARS''. Also read the documentation of FM

Thanks

Sam

0 Kudos

Dear Sam,

Many thanks for your kind suggestion.

We've tried this FM but it requires us to list all the required symbols to be replaced.

Could you kindly suggest is that any other fm we can call to replace all the accent symbols in Spanish languages?

Many thanks.

Kelvin

0 Kudos

To export to XML or HTML, if you are in a release greater or equal to 7.31, you could use the Escape Function (Perform some tests with demo report DEMO_ESCAPE)

Regards,

Raymond

0 Kudos

Hello Kelvin,

Try this one FM Name '  ES_REMOVE_SPECIAL_CHARACTER'.

Thanks

Sam

Former Member
0 Kudos

Have a look at this snippet.

  1. DATA str TYPE string VALUE 'Grün kräft kör çå és große'.
  2. TRANSLATE str USING 'ÀAÁAÂAÃAÄAÅAàaáaâaãaäaåaĀAāaĂAăaĄAąaÇCçcĆCćcĈCĉcĊCċcČCčcÐDðdĎDďdĐDđdÈEÉEÊEËEèeéeêeëeĒEēeĔEĕeĖEėeĘEęeĚEěeĜGĝgĞGğgĠGġgĢGģgĤHĥhĦHħhÌIÍIÎIÏIìiíiîiïiĨIĩiĪIīiĬIĭiĮIįiİIıiĴJĵjĶKķkĸkĹLĺlĻLļlĽLľlĿLŀlŁLłlÑNñnŃNńnŅNņnŇNňnʼnnŊNŋn'.
  3. TRANSLATE str USING 'ÒOÓOÔOÕOÖOØOòoóoôoõoöoøoŌOōoŎOŏoŐOőoŔRŕrŖRŗrŘRřrŚSśsŜSŝsŞSşsŠSšsſsŢTţtŤTťtŦTŧtÙUÚUÛUÜUùuúuûuüuŨUũuŪUūuŬUŭuŮUůuŰUűuŲUųuŴWŵwÝYýyÿyŶYŷyŸYŹZźzŻZżzŽZžz'.
  4. TRANSLATE str USING 'ßs'.
  5. WRITE / str.

/.

0 Kudos

In above snippet, example string is taken from:

And character mapping is taken from:

activerecord - How do I replace accented Latin characters in Ruby? - Stack Overflow