14.01.2020 Views

ABAP_to_the_Future

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Other Modifications to ABAP for SAP HANA 15.5

Figure 15.12 Check for SELECT on Cluster/Pool without Order By

Check on Statements Following a SELECT without Order By (14/9/3)

This check was mentioned back in Chapter 4 when discussing the ABAP Test

Cockpit; now the subject is revisited withan SAP HANA twist. You will by now be

very familiar with the idea that in most databases (Oracle, for example) the result

of the query (usually) comes back alread y sorted by the prim ary key. You can’t

rely on that, however; sometimes the results come out in the expected order in

DEV and production, but backwards in TE ST. You can’t tell what will happen

when using other databases than the on e you normally use, and you certainly

can’t rely on it using SAP HANA. Always sort it yourself to be sure.

Therefore, if after a SELECT the ABAP code does a BINARY search on the retrieved

data, expecting it to be sorted already—or reads the first line expecting that to be

the row with the lowest primary key—then everything will fall to pieces. To protect

yourself from this sort of situation, switch on the check to warn you of code

in which you retrieve data but then do not sort it (Figure 15.13).

Figure 15.13 Check for Dodgy Statements after SELECT without Order By

699

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

Saved successfully!

Ooh no, something went wrong!