ABAP – Code Inspector Results

I must say, I was pretty happy with the results of the code inspector.  I was fearing I would have a LOT of rework, but it turned out to be a manageable number of errors/warnings/information.

The only errors I had were all the same message:

Large table X: No WHERE condition

And these revolved around some search help functions that I built for my UI5 applications.  So it was a simple matter of finding an appropriate field to include in the WHERE statement.

Aside from that, all of my warnings/information messages were the same as well:

Possible use of <internal table> without prior content check.

This is the more important one for me.  This is an instance where I populated an internal table, but didn’t check to make sure it was populated before using it in a select statement FOR ALL ENTRIES IN.

I’ve run into this before, and it’s caused crazy long run times before it reads the entire table.  Short story… BAD.  So this is a great way to make sure that I fix any outstanding issues.  It’s a very simple fix.  Add an IF statement around the Select statement to check that it is NOT INITIAL.  Problem solved 🙂

I highly encourage running this, even if you don’t plan to upgrade to HANA anytime soon.  It’s a good method to make sure your code is following some simple standards.

Thanks for reading,

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top