SAP Code Inspector for ABAP Internal Table without Content Check
Using SAP Code Inspector ABAP programmers can check existing code quality for HANA migration and for better performance and code security. "Possible use of internal table without prior content check" is one of the errors listed by SAP Code Inspector tool to inform ABAP developers for a possible code performance killer.
ABAP programmers run SAP Code Inspector for existing ABAP programs even within the program in an SE38 ABAP Editor using menu selections:
Program > Check > Code Inspector
Here is a small list of errors, warnings and information after I execute the SAP Code Inspector tool before I release my developments to test systems.
Possible use of LT_VBFA without prior content check
For example, above warning is thrown for ABAP code lines below by the Code Inspector.
The warning can be supressed by using pseudo CI_FAE_LINES_ENSURED
The reason is explained in detail if the ABAP programmer clicks on the blue i icon and reads the problem description section.
In fact, every ABAP developer knows the reason.
In ABAP where "SELECT FOR ALL ENTRIES" is used, database table rows are returned according to match criteria from the contents of the internal table.
The point that ABAP developer should check is that if the internal table is empty then all database table rows are returned by the SELECT statement.
To prevent this pitfall with SELECT FOR ALL ENTRIES command, before using the internal table in this ABAP statement it should be checked that it is not empty or initial.
ABAP programmers can use one of the following options to secure the performance of their codes: