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 ?

Former Member
0 Kudos
146

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

Former Member
0 Kudos
118

Another option is to use TRANSLATE.

TRANSLATE in_par-value with '. '.

Regards

Anurag

7 REPLIES 7

Former Member
0 Kudos
118

Use ALL OCCURRENCES OF addition.

Former Member
0 Kudos
119

Another option is to use TRANSLATE.

TRANSLATE in_par-value with '. '.

Regards

Anurag

Former Member
0 Kudos
118

Hi,

Do this way...

replace all occurances of '.' with ''.

Regards,

Santosh

0 Kudos
118

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

0 Kudos
118

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

former_member404244
Active Contributor
0 Kudos
118

hi hari,

chk the same..

data : string(10) type c.

string = 'HIT & TRIAL'.

translate string using ' A'.

Write:/ string.

Regards,

nagaraj

Former Member
0 Kudos
118

hi ,

Do this way ...

Eg :

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

Thanks and regards

Santosh