‎2007 Dec 17 2:06 PM
how can i check that value entered in input field is numeric n it shud give error if value is non numeric
‎2007 Dec 17 2:24 PM
Hi karan,
1. u can use the FM NUMERIC_CHECK
2. To give error messge u can use like this.
message 'Enter numeric value' type 'E'.
regards,
amit m.
‎2007 Dec 17 2:26 PM
the validation check is built-in, if u declare the input field as numeric.
Reward if useful.
‎2007 Dec 17 2:27 PM
try this code..
PARAMETERS : num TYPE char20.
IF num CA sy-abcde.
MESSAGE 'ERROR IN INPUT' TYPE 'S'.
ELSE.
MESSAGE 'INPUT OK' TYPE 'S'.
ENDIF
‎2007 Dec 17 2:28 PM
Hi,
You can declare a parameter of type i, p, or n.
System automatically check for the validation.
Thanks,
Sriram Ponna.
‎2007 Dec 17 2:30 PM
acctually i need to chk for quantity field
type packed with 3 decimal places
is there a FM for that
‎2007 Dec 17 2:36 PM
Ok..then
If your field is type P with 3 decimals you need not do any checks...
‎2007 Dec 17 2:32 PM
Hi Karan,
You can check weather a field is numeric or not by using function contains any(CA).
Eg.
if test CA '0123456789'.
*raise error
endif.
Reward points if Helpful.
Regards,
Sachin
‎2007 Dec 17 2:49 PM
i need to chk 4 general value not a single value
how can i chk for a type in dat field
the assignment is
ls_plantdata-reorder_pt = int_table-nvalue.
the thing is int_table-nvalue is char type from table control
and ls_plantdata-reorder_pt is quan i cant change int_table-nvalue to quan bt need to chk it b4 assinment only as it gives dump after assignment
‎2007 Dec 17 2:54 PM
Right...do like this..
IF int_table-nvalue CA sy-abcde.
"Do not assign.
ELSE.
"assign value.
ls_plantdata-reorder_pt = int_table-nvalue.
ENDIF.
‎2007 Dec 17 3:05 PM
this only checks 4 alphanumeric values
i need to chk 4 other characters also
i mean only num value till 3 decimals needs to be added
‎2007 Dec 17 7:28 PM
If you want check for other characters as well along with Alphabets, use the below (Slight modfication to Pervez)
IF int_table-nvalue CN '0123456789'.
"Do not assign.
ELSE.
"assign value.
ls_plantdata-reorder_pt = int_table-nvalue.
ENDIF.
I think u got my point, reward if useful
Pra
‎2007 Dec 17 6:09 PM
Hi Karan,
I did not get ur requirement but if the question deals with selection screens, I have an answer for it.
before u do all these things, first you need to trigger an event called AT SELECTION-SCREEN.
example code is :
AT SELECTION-SCREEN.
IF (fld name) > (value) -
> any logic which u need
message
endif.
‎2007 Dec 17 7:23 PM
the assignment is
ls_plantdata-reorder_pt = int_table-nvalue.
the thing is int_table-nvalue is char type from table control
and ls_plantdata-reorder_pt is quan i cant change int_table-nvalue to quan bt need to chk it b4 assignment only as it gives dump after assignment
‎2007 Dec 17 7:31 PM
its wont wrk bcoz i need to enter packed value
like 1.229 so single decimal needs to be included also
bt again problem comes if we enter 12..3 ie two decimals