‎2007 Apr 02 9:38 AM
Hi,
I want to display only list of all 'Text-...' in given code.
I am able to get entire string containing 'Text-...'
eg:
READ REPORT 'ZTEST_AM_ALV1' into itab.
loop at itab into wa.
if wa co 'text-'.
write : / sy-tabix,
result.
endif.
endloop.
o/p:all the lines having 'Text-...'
but,
I want only the list of 'Text-...'
Thanks.
‎2007 Apr 02 9:45 AM
Try this..
<b>data : begin of it_text occurs 0,
text(8),
end of it_text.</b>
READ REPORT 'ZTEST_AM_ALV1' into itab.
loop at itab into wa.
<b>search wa for 'TEXT-'.
if sy-subrc eq 0.
it_text-text = wa+sy-fdpos(8).
append it_text.
clear it_text.
endif.</b>endloop.
‎2007 Apr 02 9:46 AM
Hi,
data: w_text(10) type c.
READ REPORT 'ZTEST_AM_ALV1' into itab.
loop at itab into wa.
if wa cs 'text-'.
w_text = wa+sy-fdpos(5).
concatenate w_text 'text-' into w_text.
write : / sy-tabix,w_text.
endif.
endloop.
only the list of 'Text-...'
Message was edited by:
Rammohan Nagam
‎2007 Apr 02 9:55 AM
READ REPORT 'ZTEST_AM_ALV1' into itab.
data count type i.
loop at itab into wa.
REPLACE ALL OCCURRENCES OF 'Text-' IN text WITH new REPLACEMENT COUNT rcount
count = count + rcount.
write : 'Count in iteartion number , sy-tabix , 'is' , count.
endloop.
write 😕 'total text counts' , Count.
Use ignoring case if necessary