14.01.2020 Views

ABAP_to_the_Future

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4

ABAP Test Cockpit

Figure 4.18 Problematic SELECT * Statements

Once that option is active, when you next perform a SELECT * a check occurs to

see how many of the fields you actually use in subsequent code. If it’s less than a

percentage you specify when setting up the check (the default is 20%), then you

get a slap round the face with a wet fish (Figure 4.19).

Figure 4.19 Error Message for Problematic SELECT * Query

This is a much more intelligent check than your average bear. In fact, if you don’t

use any fields that you’ve retrieved, then you get an existence check warning; that

is, you are most likely just seeing if the record exists, so there is no need to get

every single column in the table.

4.3.3 Improving FOR ALL ENTRIES (14/9/2)

If the programmers at SAP get any cleverer, their feet wi ll fall off. This check

searches for one SELECT followed by a FOR ALL ENTRIES that uses the result of the

first select—and then figures out, and tells you, whether a join would achieve the

exact same thing.

196

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!