05-30-2006 8:56 AM
Hi All.
I have a string like
pavan,kumar and i want this displayed like
pavan , kumar how to achieve this.
I want space after pavan and space after ,.
Regrads
Pavan
05-30-2006 8:58 AM
05-30-2006 8:58 AM
05-30-2006 9:11 AM
HI WENCELAUS,
Whats the difference between normal single quote ' ' and
` `.
I tried ur solution with normal quote it is not giving correct output.
but when tried with ` ` output is correct...
can u elaborate it??
cheers,
simha.
05-30-2006 9:16 AM
Hi Narasimha,
When you use single quotes, the SPACE character is not preserved.
But when you use `, the SPACE character is preserved.
Regards,
Wenceslaus.
05-30-2006 8:59 AM
data : m(50) type c,
n(50) type c.
data : myspace(50) type c.
data : number type i.
number = 2.
concatenate 'pawan' ',' into m separated by myspace(number).
concatenate m 'kumar' into n separated by myspace(number).
05-30-2006 9:02 AM
Hi Kumar,
Use <b>REPLACE</b> statement.
DATA V_STRING TYPE STRING VALUE 'PAVAN,KUMAR'.
<b>REPLACE ',' WITH ' , ' INTO V_STRING.</b>
<b>WRITE:/ V_STRING.</b>
Now V_STRING will have value 'PAVAN , KUMAR'.
REPLACE will do one occurence replacement.If you need to have replacement for all occurences use the following syntax.
<b>REPLACE ALL OCCURRENCES OF ',' IN V_STRING
WITH ' , '.
WRITE V_STRING.</b>
Thanks,
Vinay
Message was edited by: Vinaykumar Gorrela
05-30-2006 9:06 AM
Hi pavan
Check the following Code.
DATA: lv_str(30) VALUE 'pavan,kumar',
lv_str1(3) VALUE ' , '.
REPLACE ',' WITH lv_str1 INTO lv_str.
WRITE lv_str.
05-30-2006 9:10 AM
copy paste and try this
REPLACE ALL OCCURReNCES OF ',' IN v_STRING WITH ` , ` .
use the quote symbols key as the key above tab key
Message was edited by: Chandrasekhar Jagarlamudi
05-30-2006 9:13 AM
Hi,
check this...
REPORT ZTEST .
data: text(50),delimit(20).
text = 'pavan,kumar'.
concatenate ` ` ',' ` ` into delimit separated by space.
REPLACE ALL OCCURRENCES OF ',' IN text WITH delimit.
write text.
Regards
vijay