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

checking the case of a string

Former Member
0 Likes
704

Hi experts,

I need to know what is string function or FM used to check whether a string is in lower case or in upper case?

Hi experts,

I need to know what is string function or FM used to check whether a string is in lower case or in upper case?

2 REPLIES 2
Read only

Former Member
0 Likes
502

I don't think so that there is any function module for this..

but you can do it in this way...

DATA: uabcd TYPE sy-abcde ,

labcd TYPE sy-abcde ,

source(1) .

source = 'a' .

uabcd = sy-abcde .

labcd = sy-abcde .

TRANSLATE labcd TO LOWER CASE .

FIND source IN uabcd RESPECTING CASE .

IF sy-subrc EQ 0 .

WRITE:/ 'uppercase' .

ENDIF .

FIND source IN labcd RESPECTING CASE .

IF sy-subrc EQ 0 .

WRITE:/ 'lowercase' .

ENDIF .

Thanks & Regards

ilesh 24x7

Read only

Former Member
0 Likes
502

Hi

There is a string function

TRANSLATE

to conver the string to Upper or LOWER case.

or declare the alphabets in two varaibles of 26 char length like

var1 = 'abcdefghijklmnopqrstuvwxyz' and

var2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.

NOW YOU CAN USE THE STRING COMMANDS LIKE

CS-Contains string

CA -COntains any

like that

IF STR CS VAR1.

....................

ELSEIF STR CS VAR2.

................

ENDIF.

Regards

Anji