Application Development and Automation 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: 
Read only

escape character

Former Member
0 Likes
3,038

Hi, I need to replace de character ' (the character placed below of "?" in the keyboard) in a string.

I use the next code:

REPLACE ALL OCCURRENCES OF ' á' IN:

pvt_desc WITH 'a'.

This code doesnt´t work with the character '. Which is the escape character in ABAP ??

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,566

You need a double

'

like

''


REPORT zdummy_atg_2.

data: pvt_desc type string.

pvt_desc = ' ''á'.

REPLACE ALL OCCURRENCES OF ' ''á' IN
pvt_desc WITH 'a'.

write: pvt_desc.

Greetings,

Blag.

5 REPLIES 5
Read only

Former Member
0 Likes
1,567

You need a double

'

like

''


REPORT zdummy_atg_2.

data: pvt_desc type string.

pvt_desc = ' ''á'.

REPLACE ALL OCCURRENCES OF ' ''á' IN
pvt_desc WITH 'a'.

write: pvt_desc.

Greetings,

Blag.

Read only

VXLozano
Active Contributor
0 Likes
1,566

Please, excuse us if we move this thread to Spanish (I will try to keep an appropiate English translation too, but I bet the explanation in Spanish will not be the same than in English)

Quiero entender que lo que necesitas es eliminar todos los acentos de una cadena. La cosa está muy mal

Primero asegurate el tiro con las mayúsculas, lo tuyo no tiene nada que ver con los códigos de escape (éstos se usan para impresiones).

Lamentablemente, me temo que el ALL OCCURRENCES viene en la 4.7, y mi sistema no llega tan lejos, así que no puedo probar otras cosas... ¿Puedes proporcionarnos un poco más de código? (tipos de las variables y demás)

-

-


Free provided translation:

I will understand you want to drop the "accent" from your string.

Be sure you are checking the caps, nothing related with escape codes (they are related with printing).

Sadly, ALL OCCURRENCES clause appears (I think) in 4.7, and my system is older, I cannot test other things. Can you provide us a bit more of coding? (value types and so)

Read only

Former Member
0 Likes
1,566

Ok Vicenç, I'm going to allowed this one...But next time, all answers only in English please -:)

Greetings,

Blag.

Read only

Former Member
0 Likes
1,566

Sorry...

No, no son los acentos,los acentos los elimino perfectamente con esta sentencia:

REPLACE ALL OCCURRENCES OF 'Á' IN:

pvt_desc WITH 'A'.

Lo que necesito es sustituir las comillas en una cadena.

(Estoy trabajando con la version 6.0)

pvt_desc es de tipo cadena. Por tanto necesitaria eliminar las comillas simples que apareciesen en ella por espacios en blanco, por ejemplo.

No, I don´t want to drop the accents in my string. I need to drop the "simple quotes".

Thanks.

Read only

naveen1241
Participant
0 Likes
1,566

u can use escape character `.

the key lying on the bottom of Esc.

Regards,

Naveen Natarajan