Database Hint Pseudo-Comment for SAP Code Inspector
During ABAP code optimization for SAP HANA, I got "Use of Database Hint: %_HINTS ORACLE" in SAP Code Inspector result set. Although with HANA migration the SAP database will change from Oracle, SQL Server or Sybase to SAP HANA. This means database hints will not be required for ABAP developers. But till the time of migration, as an ABAP programmer I want to keep the code unchanged. So the best thing to do is to use pseudo comment or pragmas for by passing this warning. To use pragmas or pseudo comments after ABAP SELECT statement will enable SAP Code Inspector to ignore this as an error or warning.
To run SAP Code Inspector, ABAP developer can call SAP transaction SCI or execute the Code Inspector using the menu in SE38 ABAP Code Editor:
Program > Check > Code Inspector
Within the list messages related with database hint usage is listed at:
Drill-down on the list "Security Checks > Critical Statements > Warnings > Message Code 0008
==> Use of Database Hint: %_HINTS ORACLE GV_HINT
If the ABAP developer checks the detailed documentation about this warning message, following help text will be displayed.
Critical Statements
Database hint used: %_HINTS ...
A database hint contains database-specific code and should only be used in exceptional cases.
The message can be hidden using the pseudo-comment "#EC CI_HINTS.
If the ABAP developer has to use the Oracle hint for performance or for other issues up to HANA migration is done, using pseudo comment work-around can be implemented.
The warning message about "Use of Database Hint: %_HINTS ORACLE" can be hidden using following pseudo comment "#EC CI_HINTS right after the ABAP code statement.
Here is sample ABAP code. The first example causes the SAP Code Inspector to give warning about database hint usage. The second database SELECT statement is followed by the pseudo comment "#EC CI_HINTS and is not listed in the code inspector check.