Freigeben über


SAP - can all fields in a table store mixed-case characters?

While investigating a possible bug, I ran the following two queries using the SAP ADO Provider:

SELECT NAME1, LAND1, KUNNR from KNA1 where (NAME1 LIKE 'Dan%'  AND LAND1 Like 'D%')

and

SELECT NAME1, LAND1, KUNNR from KNA1 where (NAME1 LIKE 'Dan%'  AND LAND1 Like 'd%')

(NOTE - the casing of the last value was modified).

The results returned varied. Actually, the first query returned some rows, while the second didn't. Digging deeper, here's what I found - Character comparisons in SAP are case sensitive

On top of that, all columns in SAP tables cannot store mixed-case characters. Some can, while others can only store UPPERCASE characters.

Here's how you can figure out whether a column in a table can store only uppercase, or both upper and lower case characters ..

  1. Log in to SAP GUI, and run transaction SE37. Execute DDIF_TABL_GET
  2. For the NAME parameter, enter the table name for which you want to determine the above (Let me call this table ABC). Hit Execute (or press F8)
  3. The first table parameter returned is named DD03P_TAB. Click on it, to bring up the rows in it.
  4. DD03P_TAB acts as the schema table for the table whose NAME you entered in (2), i.e. ABC . Every row in DD03P_TAB corresponds to a column in that table ABC. And every column in DD03P_TAB gives you the value of some property of the corresponding column in ABC (depending on which row in DD03P_TAB you are looking at currently). Confusing, isn't it? :-)
  5. Anyways, there is a column in DD03P_TAB named "LOWERCASE". If for a row in DD03P_TAB (i.e. for a column in ABC), if this value (for LOWERCASE) is 'X', it means that the corresponding column in ABC can store both upper case and lower case characters. If the value is ' ' (i.e. blank), it means that the corresponding column in ABC can only store upper case characters.