‎2007 May 16 8:49 AM
Hi,
Is there any variant of command Replace or other command to replace on a field all letters by A and all numbers by 1?
Thanks in advance,
Nuno
‎2007 May 16 8:54 AM
data str type string value 'BACADA......ZA'
translate field with str. "this will replace all letters (B-Z) with A
do similarly with the numbers (use type n )
regards,
Priyank
‎2007 May 16 8:51 AM
Hi,
use this :
REPLACE ALL OCCURENCES OF 'A' IN field WITH '1'.
Hope this is what you wanted
‎2007 May 16 8:55 AM
Hi Shailesh,
not exacly...
what I need is: all letters are replaced by A and all numbers by 1
ex:
BANKN (Bank account) is FS-012345.12
after the replace it should be AA-11111.11
‎2007 May 16 8:54 AM
data str type string value 'BACADA......ZA'
translate field with str. "this will replace all letters (B-Z) with A
do similarly with the numbers (use type n )
regards,
Priyank
‎2007 May 21 1:46 PM
Hi Priyank,
It doesn't seems to work... any other suggestions?
Thanks in advance,
Nuno
‎2007 May 21 1:55 PM
Hi nuno,
1. <b>FS-012345.12 -
> AA-111111.11</b>
2. Just copy paste
3.
report abc.
*----
data : s1(15) type c.
data : s2(15) type c.
data : ch(26) type c.
data : nu(10) type c.
data : ln type i.
data : pos type i.
*----
ch = sy-abcde.
nu = '0123456789'.
s1 = 'FS-012345.12'.
s2 = s1.
ln = strlen( s2 ).
do ln times.
pos = sy-index - 1 .
if ch CA s2+pos(1) .
s2+pos(1) = 'A'.
endif.
if nu CA s2+pos(1) .
s2+pos(1) = '1'.
endif.
enddo.
*----
write 😕 s1.
write 😕 s2.
regards,
amit m.
‎2007 May 21 1:51 PM
hi,
goto edit -> click on find/replace -> giv nam to be replaced -> continue ->ok
if helpful reward some points.
with regards,
suresh babu aluri.