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

checking if chars

Former Member
0 Likes
422

hi experts

i have a string how can i check if the string contain numbers or letters

thanks

amit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
396

declare a constant that has number

gc_spl(20) type c value '0123456789'

if string CA gc_spl.

flag = 1.

exit.

endif.

if flag = 1.

write: string 'has numbers'.

endif.

Reward if helpful.

Thanks.

Imran.

2 REPLIES 2
Read only

Former Member
0 Likes
396

Hi Amit,

Try using String relational operators like CA (contains any).

ex: String1 CA String2.

Check out the following link.it will be useful.

http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3516358411d1829f0000e829fbfe/content.htm

Regards,

Satya,

Read only

Former Member
0 Likes
397

declare a constant that has number

gc_spl(20) type c value '0123456789'

if string CA gc_spl.

flag = 1.

exit.

endif.

if flag = 1.

write: string 'has numbers'.

endif.

Reward if helpful.

Thanks.

Imran.