As part of an upgrade from Oracle to HANA (ECC), we have checked all (used) custom programs using the Code Inspector using check variant FUNCTIONAL_DB to find possible HANA issues. Now, during functional testing, one specific issue pops up related to a SELECT SINGLE statement with an incompletely specified key. (SELECT SINGLE * FROM KNVV INTO WA_KNVV WHERE KUNNR = I_KUNNR). According to the tester, the row that is selected now is different from the expected one.
I have used the Code Inspector to check for all SELECT SINGLE statements with incomplete specified key and found a lot of them. However, SAP did not add this check to the variant FUNCTIONAL_DB, so I'm wondering if there really is a problem here.
So my questions are:
- Do all tables still have a primary index? I have performed a database object check for KNVV via SE11 and this says there is still a consistent index KNVV~0 so I presume these indices still exist.
- In general, if I perform SELECT SINGLE without using fully qualified primary key, will HANA still use the primary index (if for example the first keys are specified and the last key field isn't)
- Are there situations where a SELECT SINGLE without fully qualified key on a HANA database can return a different row from the table than on an Oracle or other non-HANA database?
I fully understand that the best solution is analyzing and changing these SELECT SINGLE statements, but for the moment I want to know if there actually is a real problem. If this is the case, I am going to add the check on SELECT SINGLE to my next HANA upgrade projects.