‎2007 Aug 13 9:30 AM
Dear Guys
I have a string e.g Ad$$$$$$$$$$$$$.
Now when I use REPLACE '$' WITH ' ' INTO L_NAME, replace command only replaces the first $ with ' ' from string.
While I want to replace all $ signs. Note I am using SAP 4.6C and I think the command replace all occurance not working 4.6C.
Also not no of occurances of $ is not fix in field.
‎2007 Aug 13 9:33 AM
Hi..
This is the Statement.
REPLACE ALL OCCURRENCES OF '$' WITH ' ' INTO L_NAME.
<b>Reward if Helpful</b>
‎2007 Aug 13 9:33 AM
Hi Adnan
use replace all occurances of '$' WITH ' ' INTO L_NAME.
reward points to all helpful answers
kiran.M
‎2007 Aug 13 9:34 AM
Hi,
The Replace Command will replace only the first String.
You can use Translate Command for this.
For Eg.,
Data : String(20) Type C Value 'Ad$$$$$$$$$$$$$'.
TRANSLATE STRING USING '$ '.
WRITE : STRING.
Regards,
Padmam.
‎2007 Aug 13 9:35 AM
Hi
otherwise find the length
len = strlen ( l_name).
do len times.
REPLACE '$' WITH ' ' INTO L_NAME.
l_name = l_name.
enddo.
reward points to all helpful answers
kiran.M
‎2007 Aug 13 9:42 AM
hi
good
try this process
USE STRLEN to get the length of the string,
declare a in index as i,
count from index one as first character and than you use the REPLACE statement.
thanks
mrutyun^
‎2007 Aug 13 10:19 AM
Hi,
alternatively you use this
[code]
sy-subrc = 0.
while sy-subrc = 0.
REPLACE '$' WITH ' ' INTO L_NAME.
endwhile.[/code]
Kostas