2008 Nov 21 5:26 AM
Hi all,
i have need one ABAP program , which can dispaly how many same number of charecter are there.
ex : my input is suresh.
output is,,,
2 - s
1 - u
1 - r
just like that..
pls help me..
thanks in advance.
indu
2008 Nov 21 5:39 AM
Hello
Try this:
data: string(100),
length type i.
data: begin of itab occurs 0,
chart,
count type i,
end of itab.
string = 'suresh'.
length = strlen( string ).
do length times.
length = length - 1.
clear itab.
itab-chart = string+length(1).
itab-count = 1.
collect itab.
enddo.
loop at itab.
write: itab-chart, itab-count. new-line.
endloop.
2008 Nov 21 5:32 AM
HI,
Data : Begin of Itab occurs 0,
txt type char2,
tot type i,
end of itab.
data: value type string value 'TEST PROGRAM'.
data :len type i.
translate value to uppercase.
len = strlen( value ).
do len times.
itab-txt = value+len(1).
tot = '1'.
collect itab.
clear itab.
enddo.
2008 Nov 21 5:39 AM
Hello
Try this:
data: string(100),
length type i.
data: begin of itab occurs 0,
chart,
count type i,
end of itab.
string = 'suresh'.
length = strlen( string ).
do length times.
length = length - 1.
clear itab.
itab-chart = string+length(1).
itab-count = 1.
collect itab.
enddo.
loop at itab.
write: itab-chart, itab-count. new-line.
endloop.