‎2008 Dec 05 12:39 PM
Hi,
Am having parameter field name p_1 of charater type 50.
ill be giving value as 1,2,3 or 30,80,900,600 numbers with comma separation.
if other than numbers or comm i need display an error message how to do.
‎2008 Dec 05 12:45 PM
Refer this code.
Data: a type string.
IF a CA '01234,56789'.
...Do something..
ELSE.
Messsage 'Characters other than comma and numerals are not allowed' TYPE 'I'.
ENDIF.Thanks
Nitesh
‎2008 Dec 05 12:40 PM
‎2008 Dec 05 12:43 PM
tried with ca not wrking.
when i give 1,2 its not wrking.
if p_key2 ca '123456789,' .
else.
message e000 with 'Table2 Enter numbers and comma only'.
endif.
‎2008 Dec 05 12:45 PM
Refer this code.
Data: a type string.
IF a CA '01234,56789'.
...Do something..
ELSE.
Messsage 'Characters other than comma and numerals are not allowed' TYPE 'I'.
ENDIF.Thanks
Nitesh
‎2008 Dec 05 12:48 PM
Hi Nitesh,
but here my combination may be in 1,2 or 40,50 or 50,45,85 etc
‎2008 Dec 05 1:11 PM
Hi,
Try like this.
PARAMETERS: P1 TYPE CHAR50.
AT SELECTION-SCREEN.
DATA: LV_VAR TYPE N,
LV_VAR1 TYPE N.
LV_VAR1 = STRLEN( P1 ).
DO LV_VAR1 TIMES.
IF P1+LV_VAR(1) NA '0123456789,'.
MESSAGE 'message' TYPE 'E'.
ENDIF.
LV_VAR = LV_VAR + 1.
ENDDO.
Regards,
Suresh
‎2008 Dec 05 12:46 PM
hi ,
you may try like this.
AT SELECTION-SCREEN.
IF p_1 CA sy-abcde OR p_1 CA '~!@#$%^&*()_-=+/'.
MESSAGE 'message' TYPE 'E'.
ENDIF.Thanks & REgards
Edited by: Always Learner on Dec 5, 2008 1:53 PM
‎2008 Dec 05 12:46 PM
‎2008 Dec 05 12:47 PM
Hi Martin,
U can NA(Contains Not any) also to check .
Regards,
lakshman.
Edited by: Lakshman N on Dec 5, 2008 1:47 PM