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 ?

Former Member
0 Likes
812

For in_par-value = <b>999.999,66.</b>

REPLACE '.' WITH ' ' INTO in_par-value.

is making in_par-value = <b>999 999,66.</b>

Incase of in_par-value = <b>999.999.999,66</b>

REPLACE '.' WITH ' ' INTO in_par-value.

is making in_par-value as <b>999 999.999,66</b>

But I need it as <b>999 999 999,66</b>

How to achieve this ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
784

Another option is to use TRANSLATE.

TRANSLATE in_par-value with '. '.

Regards

Anurag

7 REPLIES 7
Read only

Former Member
0 Likes
784

Use ALL OCCURRENCES OF addition.

Read only

Former Member
0 Likes
785

Another option is to use TRANSLATE.

TRANSLATE in_par-value with '. '.

Regards

Anurag

Read only

Former Member
0 Likes
784

Hi,

Do this way...

replace all occurances of '.' with ''.

Regards,

Santosh

Read only

0 Likes
784

If you are on earlier versions and the ALL OCCURANCES is not avaiable it is better to use TRANSLATE. The REPLACE statement will only replace the first hit on the string. You can also do a loop using the replace.

while sy-subrc = 0.
 REPLACE '.' WITH ' ' INTO in_par-value.
endwhile.

Regards,

RIch Heilman

Read only

0 Likes
784

Hi Guys,

How can I replace all occurrences of space with some other character in a given string. Many thanks for your quick responce.

Regards,

Hari

Read only

former_member404244
Active Contributor
0 Likes
784

hi hari,

chk the same..

data : string(10) type c.

string = 'HIT & TRIAL'.

translate string using ' A'.

Write:/ string.

Regards,

nagaraj

Read only

Former Member
0 Likes
784

hi ,

Do this way ...

Eg :

Replace all occurrences of '.' in var with ',' .

Thanks and regards

Santosh