Case insensitive SELECTs

images/thumbnail.jpg - Thumbnail

In SAP it’s normal to have tables in the database with a NAME field and another NAME_SEARCH which is filled in with exactly the same thing as NAME but in upper case.

Then, when you want to do case-insensitive searches you use NAME_SEARCH. You don’t need to do this anymore.

ABAP now lets you do this in SQL:

FINAL(search_pattern) = |%{ to_upper( search_string ) }%|.
SELECT full_name FROM zuser
 WHERE upper( full_name ) LIKE @search_pattern
 INTO TABLE @FINAL(full_names).

Crazy, right? ABAP SQL has come a long way!

Greetings from Abapinho