2007 Jun 06 12:38 PM
Hello,
I need to build a function that replace the character "," by the string " ',' "
Example: Char1: 1,2,3
Char1 after conversion: 1','2','3
I m using the code:
DATA text TYPE string VALUE '1,2,3,4'.
REPLACE ALL OCCURRENCES OF REGEX ',' IN text WITH __?____.
I don´t know how to use the "escape character" so as to I can use the charater " ' " after of with.
Can someone help me ??
Thanks
2007 Jun 06 12:45 PM
Hi,
REPLACE all occurances of space IN your_string WITH 'Your_character' INTO lv_date
example code
data: string(10) type c,
string = '1212121212'.
translate string using '20'.
So in this case the value will now be '1010101010'
*Reward points
Regards
2007 Jun 06 12:45 PM
Hi,
REPLACE all occurances of space IN your_string WITH 'Your_character' INTO lv_date
example code
data: string(10) type c,
string = '1212121212'.
translate string using '20'.
So in this case the value will now be '1010101010'
*Reward points
Regards
2007 Jun 06 1:02 PM
But I need to replace "," by " ',' " (3 characters) ...
I don´t understand how to do....
2007 Jun 06 1:08 PM
data: replacetext type string .
replacetext = `','` .
replace all occurrences of ',' in <sourcevar> with replacetext .
please pay attendtion to
`','`
the sorround quote is actually the key (in your keyboard) to the left of number 1 .
Message was edited by:
Durairaj Athavan Raja
2007 Jun 06 1:01 PM
hi,
try like this
REPLACE ALL OCCURRENCES OF ',' WITH ' '" ,"'.
if helpful reward some points.
with regards,
suresh.
2007 Jun 06 1:08 PM
It happens the next syntax error:
"." expected after '" ,"'.
Thanks.
2007 Jun 06 1:10 PM
Hi,
check this out
data: char(10) type c,
char1(10) type c.
data: len TYPE I.
char = 'a,b'.
replace ',' with <b>''','''</b> into char.
write char.
--Patil
2007 Jun 06 1:24 PM
Hi,
try like this
data : string(10) type c.
string = 'boy_&_girl'.
translate string using '_ '.
Write:/ string.
<b>*Reward points</b>
Regards