‎2006 Nov 06 8:37 AM
Hi,
I wanted to check whether the input field has the numeric value or not. What is the function module to check whether it is numeric field or not.
‎2006 Nov 06 8:38 AM
hi,
<b>CATS_NUMERIC_INPUT_CHECK</b>
or
You can use the Function Module:
<b>numeric_check.</b>
Usage:
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
STRING_IN = X
IMPORTING
STRING_OUT = X
HTYPE = H_TYPE.
if h_type = 'CHAR'.
WRITE:/ 'NOt Numeric'.
else.
write:/ 'Numeric'.
ENDIF*****<b>With out Any FM</b>*******
data: field(10) type c value '1%56539'.
data: length type i. length = strlen( field ).
if field(length) co '1234567890'.
write:/ 'This is a number'.
else.
write:/ 'This is not a number'. endif.
******************
You can even use CATS_NUMERIC_INPUT_CHECK
* Check for Numeric Value
call function 'CATS_NUMERIC_INPUT_CHECK'
exporting
input = t_return-fieldval
exceptions
no_numeric = 1
others = 2.
if sy-subrc = 0.
read table t_f4_table index t_return-fieldval.
endif.rgards
Anver
<b><i>Kinly mark points if ur issue solved</i></b>
‎2006 Nov 06 8:38 AM
hi,
<b>CATS_NUMERIC_INPUT_CHECK</b>
or
You can use the Function Module:
<b>numeric_check.</b>
Usage:
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
STRING_IN = X
IMPORTING
STRING_OUT = X
HTYPE = H_TYPE.
if h_type = 'CHAR'.
WRITE:/ 'NOt Numeric'.
else.
write:/ 'Numeric'.
ENDIF*****<b>With out Any FM</b>*******
data: field(10) type c value '1%56539'.
data: length type i. length = strlen( field ).
if field(length) co '1234567890'.
write:/ 'This is a number'.
else.
write:/ 'This is not a number'. endif.
******************
You can even use CATS_NUMERIC_INPUT_CHECK
* Check for Numeric Value
call function 'CATS_NUMERIC_INPUT_CHECK'
exporting
input = t_return-fieldval
exceptions
no_numeric = 1
others = 2.
if sy-subrc = 0.
read table t_f4_table index t_return-fieldval.
endif.rgards
Anver
<b><i>Kinly mark points if ur issue solved</i></b>
‎2006 Nov 06 8:39 AM
Hi,
If it is type I or integer type then you can use
DATA: integer type i,
var1 type string.
var1 = integer
if var1 CO '0123456789.
its numberic
endif.
Regards,
Sesh