‎2007 Nov 05 7:42 AM
Hi frnds,
This is a simple logic which i felt shuld work in my exit where we are making the Telephone number field as mandatory entry of numbers only between
0-9.
so This is what i tried.
<code>
DATA : V_TELF1(16) TYPE C.
V_TELF1 = I_KNA1-TELF1.
if v_telf1 CA '0123456789'.
MESSAGE 'GOOD' TYPE 'S'.
ELSE .
message 'PLEASE ENTER NUMBERS BETWEEN 0-9 ONLY' type 'E'.
ENDIF.
</code>
Here the problem is when i m giving only characters then its going out but when i giving some charcters and some values then the condition is getting true.
I have also tried with 'CO' ,its always becoming false.
so any solutions frnds.
regards,
sanjay
‎2007 Nov 05 7:46 AM
You can use the SY-ABCDE infact.
Check this code below
PARAMETERS : p_123(10) TYPE c.
AT SELECTION-SCREEN.
IF p_123 CA sy-abcde.
MESSAGE e000(zam) WITH 'Contains Alphabets'.
ENDIF.Regards
Gopi
‎2007 Nov 05 8:13 AM
declare one more variable of type n
i.e
DATA : V_TELF1(16) TYPE N.
DATA : CV_TELF1(16) TYPE C.
CV_TELF1 = I_KNA1-TELF1.
V_TELF1 = CV_TELF1.
if V_TELF1 CS CV_TELF1.
write : 'correct number'.
else
write: ' wrong number'.
endif.