SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow

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

SAP Code Inspector: Use of Database Hint in ABAP codes

==> 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.

SELECT vbeln posnr parvw lifnr kunnr
FROM vbpa
INTO TABLE gt_vbpa
  WHERE vbeln EQ gt_vbak-vbeln
%_HINTS ORACLE gv_hint.

SELECT vbeln posnr parvw lifnr kunnr
FROM vbpa
INTO TABLE gt_vbpa
  WHERE vbeln EQ gt_vbak-vbeln


Install SAP Free
CRM Companies List
Web Based CRM Software

Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.