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: 

How to check if a character is a digit

Former Member
0 Kudos

Hello All,

I have a string that I need to parse depending of what digits do it contains. My question is: are there any FM that determines if a character is a digit or not?

Thank you,

Diana

1 ACCEPTED SOLUTION

JozsefSzikszai
Active Contributor
0 Kudos
IF char CO '0123456789'
==> digit
ELSE.
==> something else
ENDIF.
3 REPLIES 3

Former Member
0 Kudos

Hi,

try with operators CO, CN, CA, NA, CS.

Former Member
0 Kudos

use the below function module.

CALL FUNCTION 'NUMERIC_CHECK'

EXPORTING

string_in =

IMPORTING

htype = .

JozsefSzikszai
Active Contributor
0 Kudos
IF char CO '0123456789'
==> digit
ELSE.
==> something else
ENDIF.