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

DECIMAL CHECK

Former Member
0 Likes
639

HI ALL.

CAN SOME ONE TELL ME ABOUT ANY FUNCTION MODULE TO VALIDATE SIGN DECIMALS ONLY.

EX I AM ENTERING 123.56 IT IS ONLY VALID ,

123@.34 IS NOT VALID .

CAN YOU PLEASE TELL ME HOW TO DO ?

3 REPLIES 3
Read only

Former Member
0 Likes
578

Write coding as ..

data : v_decimal(10) type p decimals 2 value '12345.00'.

data : v_char(11).

v_char = v_decimal.

if v_char CO ' 0123456789. '.

Write 😕 'Valid'.

endif.

Read only

Former Member
0 Likes
578

Hi,

Pass that value to a field of type CHAR and then use

IF var CO '0123456789.'.

WRITE var.

else.

WRITE : 'Invalid number'.

ENDIF.

Read only

Former Member
0 Likes
578

HI,



data : lv_amt(16) type c,
        lv_amount like bsis-dmbtr value '1234.00'.

lv_amt = lv_amount.
 
IF lv_amt CO '.0123456789'.
write : 'Amount is valid'.
else.
write : 'Invalid amount'.
endif.

Thanks,

Sriram Ponna.