2007 Jun 13 7:30 PM
Would anyone happen to have the logic to identify the position of the string that has a # sign?
2007 Jun 13 7:33 PM
Would anyone happen to have the logic to identify the position of the string that has a # sign?
2007 Jun 13 7:33 PM
2007 Jun 13 7:35 PM
hi,
The below code helps you to identify the number of times the character is present
data: var1(30) type c value 'ghghj#ghjgjgh#ghjghjg#ghjg#'.
data : totcnt type i,
cnt type i,
v type c,
n type i.
cnt = strlen( var1 ).
do cnt times.
move var1+n(1) to v.
if v eq '#'.
totcnt = totcnt + 1.
endif.
n = n + 1.
if n = cnt .
exit.
endif.
enddo.
write:/ 'No of #s', totcnt .
2007 Jun 13 7:37 PM
2007 Jun 13 7:37 PM
Hi,
Please try this.
search wa_string for '#'.
write: / 'Position # is', sy-fdpos.
Regards,
Ferry Lianto
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |