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: 

REPLACE ALL OCCURRENCES

Former Member
0 Kudos
102

Hi experts,

that's my question;

this is my code :

DATA: spazio(1) VALUE '$'.

DATA: nome TYPE string VALUE '$blabla$blabla$blabla$blabla$'

REPLACE ALL OCCURRENCES OF spazio IN nome WITH space.

Why my result is 'blablablablablablablabla' all condensed ?

where am I wrong ?

Thanx in advance.

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos
69

Instead of REPLACE, use TRANSLATE.

Like:


DATA: spazio(1) VALUE '$'.
DATA: nome TYPE string VALUE '$blabla$blabla$blabla$blabla$'.

translate nome using '$ '.
write: nome.

Regards,

Naimesh Patel

1 REPLY 1

naimesh_patel
Active Contributor
0 Kudos
70

Instead of REPLACE, use TRANSLATE.

Like:


DATA: spazio(1) VALUE '$'.
DATA: nome TYPE string VALUE '$blabla$blabla$blabla$blabla$'.

translate nome using '$ '.
write: nome.

Regards,

Naimesh Patel