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

string containig only 0-9 or '.'

Former Member
0 Likes
1,613

hi all,

actually i want to check a string as it should contain only characters only [0-9] or a dor[.] .. so can anyone plz tell me how to do tat..

v_string should contain only either 0 to 9 or a dot (.)

i hope the point is clear

supporting answers will be rewarded

regards

Nikesh

hi all,

actually i want to check a string as it should contain only characters only [0-9] or a dor[.] .. so can anyone plz tell me how to do tat..

v_string should contain only either 0 to 9 or a dot (.)

i hope the point is clear

supporting answers will be rewarded

regards

Nikesh

2 REPLIES 2
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,356

hi,

try this:

IF string CO '0123456789.'.

...

ENDIF.

hope this helps

ec

Read only

Former Member
0 Likes
1,356

Hi,

pls follow the below code.

data:

l_values(11) type c value '0123456789.'.

if v_string co l_values.

"Then your string variable V_STRING contains only 0-9 or dot'

else.

"Then the string variable V_STRIN contains at least one some other value"

endif.

If the comparison is true, the system field SY-FDPOS contains the length of <f1>. If it is false, SY-FDPOS contains the offset of the first character of <f1> that does not occur in <f2>

reward if useful.

Thanks,

Sreeram.