2007 Dec 27 10:21 AM
hi,
i want to validating some fields and i want only alphabets to be entered.. it can be in lower case or upper case,
but no special characters and numerics..
wot can be done?
2007 Dec 27 10:26 AM
Hi Sneha,
You could use the "regular expressions" technique for this, but it depends on the version you are on.
Regards,
John.
2007 Dec 27 10:30 AM
Hi Sneha,
When you will execute this code and you will put anything in parameter on selection screen you will get only alphabets.
REPORT z_test.
PARAMETERS: p_text(80) TYPE c DEFAULT 'R~a!m?m@o#h$a%n?4^5&j*A(G)A}N'.
DATA: w_text(80) TYPE c VALUE
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.
DATA: w_len TYPE i,
w_off TYPE i.
w_len = STRLEN( p_text ).
DO w_len TIMES.
w_off = sy-index - 1.
IF w_text CS p_text+w_off(1).
ELSE.
p_text+w_off(1) = space.
ENDIF.
ENDDO.
CONDENSE p_text NO-GAPS.
WRITE : p_text.
2007 Dec 27 10:37 AM
Hi,
You can check by sy-abcde and numbers.., if anything other than these is a special character.
if v_text na sy-abcde.
if v_text na '0123456789 '.
message i000 with 'invalid text'.
endif.
endif.
Regards
Sailaja.
2007 Dec 27 10:46 AM
simply you can use this.
sy-abcde.
if val ca sy-abcde.
ok
else .
worng value in val.
endif.
Vijay