Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

field validation only for UPPER CASE

Former Member
0 Likes
2,052

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.

1 ACCEPTED SOLUTION
Read only

former_member222860
Active Contributor
0 Likes
1,251

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

7 REPLIES 7
Read only

former_member222860
Active Contributor
0 Likes
1,252

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

Read only

Former Member
0 Likes
1,251

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

Read only

Former Member
0 Likes
1,251

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.

Read only

Former Member
0 Likes
1,251

Hi Kalyan

Check this

[;

Pushpraj

Read only

Former Member
0 Likes
1,251

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

Read only

Former Member
0 Likes
1,251

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

Read only

Former Member
0 Likes
1,251

Thanks to all