03-28-2007 9:50 AM
Hi i have declared the following,
PARAMETERS p_prefix(2) TYPE c OBLIGATORY.
how to i ensure that the information entered into p_prefix contains only alphabets?
thanks!
regards,
r3venant
03-28-2007 9:53 AM
hi for this u can use the string operations like CS,CA,CP
operator & meaning
CO Contains Only
CN Contains Not only
CA Contains Any
NA contains Not Any
CS Contains String
NS contains No String
CP Matches pattern
NP Does not match pattern
03-28-2007 9:52 AM
hi,
IF p_prefix CO sy-abcde.
* only alphabets.
ur code.......
Endif..
rgds
Reshma
03-28-2007 9:52 AM
if p_prefix co sy-abcde.
else.
error message.
endif.
reward points if help full
03-28-2007 9:53 AM
hi for this u can use the string operations like CS,CA,CP
operator & meaning
CO Contains Only
CN Contains Not only
CA Contains Any
NA contains Not Any
CS Contains String
NS contains No String
CP Matches pattern
NP Does not match pattern
03-28-2007 9:54 AM
At selection-screen on p_prefix.
if p_prefix cs 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
Message e000(0) with ' contains alphabets'.
endif.
03-28-2007 10:01 AM
hiii,,
For this you can validate the field under AT SELECTION SCREEN event as follows..
****************************************************************************************
REPORT ZTEST NO STANDARD PAGE HEADING LINE-SIZE 255.
PARAMETERS P_PREFIX(2) TYPE C OBLIGATORY.
AT SELECTION-SCREEN ON P_PREFIX.
CASE P_PREFIX.
WHEN 'a' OR 'b' OR 'c' OR 'd' OR 'e' OR 'f' OR 'g' OR 'h' OR 'i' OR 'j' OR 'k' OR 'l' OR 'm'
OR 'n' OR 'o' OR 'p' OR 'q' OR 'r' OR 's' OR 't' OR 'u' OR 'v' OR 'w' OR 'x' OR 'y' OR 'z'
OR 'A' OR 'B' OR 'C' OR 'D' OR 'E' OR 'F' OR 'G' OR 'H' OR 'I' OR 'J' OR 'K' OR 'L' OR 'M'
OR 'N' OR 'O' OR 'P' OR 'Q' OR 'R' OR 'S' OR 'T' OR 'U' OR 'V' OR 'W' OR 'X' OR 'Y' OR 'Z'.
WHEN OTHERS.
MESSAGE 'error' TYPE 'E'.
ENDCASE.
****************************************************************************************
just copy paste this code and this will work...
<b>REWARD POINTS FOR USEFUL ANSWERS.</b>
Regards,
Tejas
03-28-2007 10:07 AM
parameters : p_text(2).
at selection-screen.
if p_text co 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. " or you can use sy-abcde
else.
message 'Not only alphabets' type 'E'.
endif.
regards
shiba dutta
03-28-2007 10:07 AM
PARAMETERS p_prefix(2) TYPE c OBLIGATORY.
at selection-screen.
if p_prefix co sy-abcde.
< code >
else.
error message.
endif.
03-28-2007 10:09 AM
hi ,
i answerd ur query correctly and even at first.
But still 2 points...
Rgds
Reshma
03-28-2007 10:09 AM
at selection-sereen on field p_prefix.
if p_prefix co sy-abcde.
else.
error message.
endif
regards,
ananth
03-28-2007 10:10 AM
alright, tahnks for all the reply!... i got it working now!
regards,
r3venant
03-28-2007 10:11 AM