‎2008 Nov 03 3:59 AM
My code is:
DATA: V_VAR1 TYPE STRING VALUE ' -*/'.
if ZTAB2-REGNO NA V_VAR1.
message E010(ZMSG) with 'Enter Valid Registration Number'.
Endif.
my requirement is in registration Number field it it should accept only numeric,Characters,and the special characters i specified in the local variable.
As per my code it is accepting if i give any of the special characters with one among the above.
PLZ help me
Thanks in Advance
‎2008 Nov 03 4:18 AM
Hi........
Try this code.....
parameter p_name type string.
DATA: LEN TYPE I,
T TYPE I VALUE 0,
GV_CHAR,
SPCHAR(35) TYPE C VALUE '~`!@#$%^&*()_-+={[}]|\:;"''<,>.?/',
INP(50) TYPE C.
CONDENSE p_name.
LEN = STRLEN( p_name ).
DO LEN TIMES.
MOVE p_name+T(1) TO GV_CHAR.
IF GV_CHAR CA SPCHAR.
move p_namet(1) to inpt(1).
concatenate 'Special Characters are not allowed:' inp into inp.
*<Your error message here>
ENDIF.
T = T + 1.
ENDDO.
Hope this will help you.
Thanks & Regards
Raja.
‎2008 Nov 03 4:18 AM
Hi........
Try this code.....
parameter p_name type string.
DATA: LEN TYPE I,
T TYPE I VALUE 0,
GV_CHAR,
SPCHAR(35) TYPE C VALUE '~`!@#$%^&*()_-+={[}]|\:;"''<,>.?/',
INP(50) TYPE C.
CONDENSE p_name.
LEN = STRLEN( p_name ).
DO LEN TIMES.
MOVE p_name+T(1) TO GV_CHAR.
IF GV_CHAR CA SPCHAR.
move p_namet(1) to inpt(1).
concatenate 'Special Characters are not allowed:' inp into inp.
*<Your error message here>
ENDIF.
T = T + 1.
ENDDO.
Hope this will help you.
Thanks & Regards
Raja.
‎2008 Nov 03 4:40 AM
Hi,
Try this manner
.
Use CO( contains only ) relational opertaor
DATA: V_VAR1 TYPE STRING VALUE ' -*/'.
if ZTAB2-REGNO CO V_VAR1.
else.
message E010(ZMSG) with 'Enter Valid Registration Number'.
Endif
regards
prasanth
‎2008 Nov 03 4:57 AM
>my requirement is in registration Number field it it should accept only numeric,Characters,and the special characters i specified in the local variable.
what should it accept, and what not..?