ABAP new CASE functions

ulNew ABAP features provide to use CASE functions to TO_UPPER() & TO_LOWER() to convert strings from lower to upper & vice-versa.

 

Program- OLD way of doing case translation

DATAlv_str1 TYPE string VALUE ‘abap new feature’.
DATAlv_str2 TYPE string VALUE ‘WELCOME TO ABAP’.

WRITE:‘Before Translation’ COLOR 3.
WRITE:/ lv_str1.
WRITE:/ lv_str2.

WRITE:‘After Translation’ COLOR 3.
TRANSLATE lv_str1 TO UPPER CASE.
WRITE:‘Lower case to upper case’ COLOR 5,  lv_str1.

TRANSLATE lv_str2 TO LOWER CASE.
WRITE:/  ‘Upper case to lower case’ COLOR 5,lv_str2.


1.jpg

Output

2


Program- NEW way of doing case trasnlation

DATAlv_str1 TYPE string VALUE ‘abap new feature’.
DATAlv_str2 TYPE string VALUE ‘WELCOME TO ABAP’.

WRITE:‘Before Translation’ COLOR 3.
WRITE:/ lv_str1.
WRITE:/ lv_str2.

WRITE:‘After Translation’ COLOR 3.
“TRANSLATE lv_str1 TO UPPER CASE.
lv_str1 to_upperlv_str1 ).
WRITE:‘Lower case to upper case’ COLOR 5,  lv_str1.

“TRANSLATE lv_str2 TO LOWER CASE.
lv_str2 to_lowerlv_str2 ).
WRITE:/  ‘Upper case to lower case’ COLOR 5,lv_str2.

3

Output

4


 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s