Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Find out the Character

Former Member
0 Kudos

Hai all

my Question

I have string exp( SAP Community) the stored in one variable and

particular character Repeat in the String .

exp

Data : d type string value 'SAP Community'.

How many time come repeat in 'mm' character.

by

imuthu.

1 ACCEPTED SOLUTION

GauthamV
Active Contributor
0 Kudos

Plz SEARCH in SCN before posting.

If var CA .......

............

endif.

you will get position from SY-FDPOS .

7 REPLIES 7

GauthamV
Active Contributor
0 Kudos

Plz SEARCH in SCN before posting.

If var CA .......

............

endif.

you will get position from SY-FDPOS .

Former Member
0 Kudos

sorry i can't understander your answer let you tell me give with example

by

imuthu

0 Kudos

Hi, Kumar

Test the following Sample Code

DATA: str1 TYPE string VALUE 'SAP Community',
      str_len TYPE i,
      no_char TYPE i.

str_len = strlen( str1 ).

DO str_len TIMES.
  sy-index = sy-index - 1.
  IF str1+sy-index(1) CA 'm'.
    add: 1 to no_char.
  ENDIF.
ENDDO.

WRITE: 'Total Number of Char = ', no_char.

Please Let me now if any Issue,

Best Regards,

Faisal

0 Kudos

Hi, Kumar

	 5 (5 unresolved)

Your all Questions are still open if you have got the answer Please Close all these.

Thanks and Regards,

Faisal

Former Member
0 Kudos

Hi,

Check this code

DATA : v_string(40) VALUE 'SAP COmmunity'.
DATA: v_cnt1 TYPE I.
DATA :v_len TYPE I.
DATA : BEGIN of itab occurs 0,
           char type c,
           count type i,
           end of itab.
TRANSLATE  v_string TO UPPER CASE.
v_len = strlen( v_string ).

DO v_len TIMES.
if v_string+v_cnt1(1) NE space.
itab-char = v_string+v_cnt1(1).
itab-count = '1'.
collect itab.
endif.
v_cnt1 = v_cnt1 + 1.
ENDDO.

Former Member
0 Kudos

This message was moderated.

0 Kudos

>

> now i have one ALV Grid Display format . and display the first list on screen.

>

> all event trigger on same page then push on back button goto selection screen

>

> how do write code this problem

>

> by

> imuthu.

Hi,

Please Close This Tread and Open a New for the new Requirements, Please

Regards,

Faisal