‎2008 Dec 02 9:58 AM
Hi All,
I have a Integer Field.
I need to do a validation that this field should not be initial ie it is mandatory. But this validation should not happen if '0' ie ZERO is entered on the field.
But if i check by 'INITIAL' or 'SPACE', it is taking zero also as initial.
I dont want the validation to happen if ZERO is entered.
Is there any way to do so?
Thanks.
‎2008 Dec 02 10:19 AM
REPORT ZSRK_075 MESSAGE-ID ZMSG .
PARAMETERS : P_F1 TYPE I MEMORY ID PID.
DATA : L_F1(6).
AT SELECTION-SCREEN.
GET PARAMETER ID 'PID' FIELD L_F1.
IF L_F1 EQ ' '.
MESSAGE E001 WITH 'Enter a value in P_F1'.
ENDIF.
‎2008 Dec 02 10:02 AM
‎2008 Dec 02 10:04 AM
i think u have to validate only for characters .
u can try like this also .
IF field1 CA sy-abcde.
ENDIF.
‎2008 Dec 02 10:04 AM
Hi,
You can do like this.
1.)
If field ne 0.
perform validation.
endif.or
2.)
Declare field as a string and use like this.
IF field CA '0123456789'.
perform validation.
endif.Thanks
Nitesh
Edited by: Nitesh Kumar on Dec 2, 2008 3:34 PM
‎2008 Dec 02 10:07 AM
Hello Tejas,
1)If u want this validation on selection screen,
At selection-screen.
if int_field = ' 0'.
leave to screen 0.
or u can display error msg
endif.
2)if u want it in module pool.
write same if else condition in PAI.
‎2008 Dec 02 10:16 AM
Hi,
Try like this:
parameters: p_int type i.
at selection-screen on p_int.
if p_int is initial.
if p_int = 0.
if p_int EQ space.
message e000(00) with 'Enter value other than 0 is not initial.'.
endif.
endif.
endif.
Regards,
Bhaskar
‎2008 Dec 02 10:19 AM
REPORT ZSRK_075 MESSAGE-ID ZMSG .
PARAMETERS : P_F1 TYPE I MEMORY ID PID.
DATA : L_F1(6).
AT SELECTION-SCREEN.
GET PARAMETER ID 'PID' FIELD L_F1.
IF L_F1 EQ ' '.
MESSAGE E001 WITH 'Enter a value in P_F1'.
ENDIF.