Application Development and Automation 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: 
Read only

Find char position

Former Member
0 Likes
430

Hi friends

I have a text (number stored text) like '123,99' I want learn how many char after the comma.

In this sample 2. Another sample 123,987 after comma it have 3 char.

How can I learn this value?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
394

suppose the text field is w_char .

<b>data :

w_len type i,

w_places type i.

w_len = strlen( w_char ).

search w_char for ',' . <i>**( search returns the position of the searched character in the string )</i>

if sy-subrc eq 0.

w_places = w_len - sy-fdpos - 1.

endif.</b>

now w_places contains the no of characters after ','.

reward if it helps u..

sai ramesh

Hi friends

I have a text (number stored text) like '123,99' I want learn how many char after the comma.

In this sample 2. Another sample 123,987 after comma it have 3 char.

How can I learn this value?

1 REPLY 1
Read only

Former Member
0 Likes
395

suppose the text field is w_char .

<b>data :

w_len type i,

w_places type i.

w_len = strlen( w_char ).

search w_char for ',' . <i>**( search returns the position of the searched character in the string )</i>

if sy-subrc eq 0.

w_places = w_len - sy-fdpos - 1.

endif.</b>

now w_places contains the no of characters after ','.

reward if it helps u..

sai ramesh