Case-insensitive comparison in SELECT condition

Dustin Sun picture Dustin Sun · Jun 22, 2011 · Viewed 14.6k times · Source

In ABAP SQL can I ignore the case when comparing fields in the WHERE clause of a SELECT?

SELECT * 
FROM some_table 
WHERE field1 = variable1.

How can I compare field1 to variable1 ignoring different case?

Answer

Psio picture Psio · Aug 8, 2018

Open SQL can do this with the function UPPER starting ABAP 7.51.

Example:

SELECT * 
FROM some_table 
WHERE UPPER( field1 ) = @variable1
INTO TABLE @DATA(internal_table).