‎2009 Feb 13 6:58 AM
Hi Experts,
my requirement is one field needed to be validate , it is coming from portal,
and that string must be only UPPERCASE, if it is lower case error message is needed .
like'only enter capital letters ' .
plz give me logic for upper case.
Thanks.
‎2009 Feb 13 7:01 AM
Hi,
U can validate just like this
data : text type string value 'ABC'D.
if text CA 'abacdefghij.....z'.
write:/ 'wrong'.
else.
write:/ 'right'.
endif.thanks\
Mahesh
‎2009 Feb 13 7:01 AM
Hi,
U can validate just like this
data : text type string value 'ABC'D.
if text CA 'abacdefghij.....z'.
write:/ 'wrong'.
else.
write:/ 'right'.
endif.thanks\
Mahesh
‎2009 Feb 13 7:02 AM
in screen painter double click on filed then there is one one pop-up ... in that one check thet bottom check box as lower/upper case .... please check that .. then i think your problem is solved
‎2009 Feb 13 7:03 AM
Hi,
use sy-abcde for check.( This contains only capital letters ).
data w_str(20) type c.
data w_i type i.
data w_t type c.
w_str = strlen( field ).
do w_str times.
w_t = field+w_i(1).
search sy-abcde for w_t.
if sy-subrc ne 0.
message .
else.
add 1 to w_i.
clear w_t.
endif.
enddo.
OR
if field CO 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
logic.
else.
message.
endif.
‎2009 Feb 13 7:04 AM
‎2009 Feb 13 7:04 AM
hi
you can go with following code...
ITS A WORKING CODE WITH MY OWN DATA.
you are getting w_source from portal
data: w_char type string.
start-of-selection.
w_char = w_source.
translate w_char to upper case.
if w_char <> w_source.
message 'only enter capital letters' type 'S' display like 'E'.
endif.
regards
‎2009 Feb 13 7:06 AM
Hi ,
Try thy this -
If w_field CA 'abcde..........'.
Message 'Invalid' TYPE 'E'.
Endif.Regards
Pinaki
Edited by: Pinaki Mukherjee on Feb 13, 2009 8:06 AM
‎2009 Feb 13 7:11 AM