2007 Mar 15 12:57 PM
Hi,
I need to give only numeric value in the field.wat validation must be done on it?
2007 Mar 15 1:58 PM
hi,
***************************************************************************************
data:
p_fld(10) type c .
......................................
................................
at selection-screen on field p_fld.
if p_fld cn '0123456789'.
message 'enter valid number' type 'E'.
endif.
............................................
............................
regards,
naresh.
2007 Mar 15 12:59 PM
2007 Mar 15 1:00 PM
this is my code --
DATA : VA_COND(50) VALUE 'ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&()_+=-/'.
IF SY-UCOMM EQ 'SAVE' OR SY-UCOMM EQ 'ENTER'.
IF NOT SCR_WGT IS INITIAL .
IF SCR_WGT CA VA_COND.
IF SY-SUBRC NE 0.
SET CURSOR FIELD 'SCR_WGT'.
CLEAR SCR_WGT.
MESSAGE E100 WITH 'Please enter a numeric value here'.
CALL SCREEN 200.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
2007 Mar 15 1:23 PM
You can can write as below.
DATA : VA_COND(10) VALUE '0123456789'.
IF SY-UCOMM EQ 'SAVE' OR SY-UCOMM EQ 'ENTER'.
IF NOT SCR_WGT IS INITIAL .
IF SCR_WGT CO VA_COND.
ELSE.
IF SY-SUBRC NE 0.
SET CURSOR FIELD 'SCR_WGT'.
CLEAR SCR_WGT.
MESSAGE E000(0) WITH 'Please enter a numeric value here'.
CALL SCREEN 200.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
2007 Mar 15 1:58 PM
hi,
***************************************************************************************
data:
p_fld(10) type c .
......................................
................................
at selection-screen on field p_fld.
if p_fld cn '0123456789'.
message 'enter valid number' type 'E'.
endif.
............................................
............................
regards,
naresh.
2007 Mar 15 2:35 PM
Hi,
Check this, It will work.
if fld1 CO '12345 67890'.
write 'Numeric'
else.
write 'Non-Numeric'
endif.
Regards
L Appana