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

REPLACE ALL OCCURRENCES

Former Member
0 Likes
378

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
Read only

naimesh_patel
Active Contributor
0 Likes
345

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
Read only

naimesh_patel
Active Contributor
0 Likes
346

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