11-15-2007 1:02 PM
Hi all,
is there an SAP Command, or an SAP Fonction that check if a caractere is numeric?
Thank's
Bob.
11-15-2007 1:09 PM
hi Bob,
IF character CO '0123456789'.
==> numeric
ELSE.
==> not numeric
ENDIF.
ec
11-15-2007 1:09 PM
hi Bob,
IF character CO '0123456789'.
==> numeric
ELSE.
==> not numeric
ENDIF.
ec
11-15-2007 1:35 PM
11-15-2007 1:49 PM
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
11-15-2007 1:11 PM
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.
11-15-2007 1:19 PM
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.