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: 

SAP COMMAND

Former Member
0 Kudos

Hi all,

is there an SAP Command, or an SAP Fonction that check if a caractere is numeric?

Thank's

Bob.

1 ACCEPTED SOLUTION

JozsefSzikszai
Active Contributor
0 Kudos

hi Bob,

IF character CO '0123456789'.

==> numeric

ELSE.

==> not numeric

ENDIF.

ec

5 REPLIES 5

JozsefSzikszai
Active Contributor
0 Kudos

hi Bob,

IF character CO '0123456789'.

==> numeric

ELSE.

==> not numeric

ENDIF.

ec

0 Kudos

Thank's ec,

but l used 'CA' instead of 'CO'.

Bob

0 Kudos

Beware:

IF string CA/CO '0123456789'.

CA ==> contains any, this will true if there is at least one number in the string

CO ==> contains only, this will true if only numers are in the string

Former Member
0 Kudos

HI,

use this.

<b>describe filed</b> functionality

<b>example:</b>

data:fld1(10),fld2(5) type n.

data:typ.

describe field fld1 type typ.

write:/ typ.

describe field fld2 type typ.

write:/ typ.

rgds,

bharat.

Former Member
0 Kudos

DATA: chr(10) TYPE c,

num TYPE p DECIMALS 2,

itype TYPE c.

***TO GET THE FIELD TYPE

DESCRIBE FIELD chr TYPE itype.

chr = 'ASDASDA'.

****TO CHECK THE FIELD VALUE

CATCH SYSTEM-EXCEPTIONS convt_no_number = 1.

MOVE chr TO num.

ENDCATCH.

IF sy-subrc NE '0'.

WRITE 😕 'ERROR'.

ENDIF.