Skip to end of metadata
Go to start of metadata

We can check whether a string contains lower case character or not by the operator CA (Contains  Any)  as follows  ---

Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'
REPORT ZVALIDATION .
DATA : W_STRING(5) TYPE C VALUE 'ABCDa',
W_ABCDE(26) TYPE C VALUE 'abcdefghijklmnopqrstuvwxyz'.
IF W_STRING CA W_ABCDE.
  MESSAGE 'String contains lower case character' TYPE 'I'.
ELSE.
  MESSAGE 'It is a pure Upper case string' TYPE 'S'.
ENDIF.

Result -

 Info message will come saying "String contains lower case character".

Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'
REPORT ZVALIDATION .
DATA : W_STRING(5) TYPE C VALUE 'ABCD',
W_ABCDE(26) TYPE C VALUE 'abcdefghijklmnopqrstuvwxyz'.
IF W_STRING CA W_ABCDE.
  MESSAGE 'String contains lower case character' TYPE 'I'.
ELSE.
  MESSAGE 'It is a pure Upper case string' TYPE 'S'.
ENDIF. 

Result -

 Success message will come saying "It is a pure Upper case string".

Similarly  we can check whether a string contains upper case character or not  as follows -

Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'
REPORT ZVALIDATION .
DATA : W_STRING(5) TYPE C VALUE 'Aabcd'.
IF W_STRING CA SY-ABCDE.
  MESSAGE 'String contains upper case character' TYPE 'I'.
ELSE.
  MESSAGE 'It is a pure lower case string' TYPE 'S'.
ENDIF.

Result  -

Info message will come saying "String contains upper case character".

Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'
REPORT ZVALIDATION .
DATA : W_STRING(5) TYPE C VALUE 'abcd'.
IF W_STRING CA SY-ABCDE.
  MESSAGE 'String contains upper case character' TYPE 'I'.
ELSE.
  MESSAGE 'It is a pure lower case string' TYPE 'S'.
ENDIF.

Result -

 Success message will come saying "It is a pure lower case string". 

  • No labels