Stop SAP ABAP parameter values converting to uppercase



You may have noticed that with a standard ABAP parameter which is type char/text/string always converts the entered value to uppercase. So if the user enters the text in Uppercase, lowercase or a mixture of both it will always get converted to UPPERCASE.

For example, using the standard ABAP parameter code


PARAMETERS: p_val(20) TYPE c,
            p_val2 TYPE string.

If the user enters the following text into the parameters:

It will be stored in the parameter field all in upper case

How to fix the ABAP parameter always converting to uppercase

The solution to this is very simple, you just need to add the “LOWER CASE” keyword to the parameter declaration


i.e.
PARAMETERS: p_val(20) TYPE c LOWERCASE,
            p_val2 TYPE string LOWERCASE.

The LOWER CASE keyword also allows uppercase

But note just because you add the LOWER CASE keyword it still allows uppercase entry. In-fact it will store the value in exactly the same case as it is entered by the user.

So if they enter the text like this with a mix of upper and lower case characters

When you look at the parameter value via debug it will contain the text exactly as the user entered it.

About the Author se80