08-12-2016 3:07 AM
I am running the functional correctness check across our codebase, but some objects that I believe are functionally incorrect is not being picked up:
I have the following piece of code, that does not use a complete key, and has no order by statement: But it passes the check (Search problematic statements for result of SELECT/OPEN CURSOR without ORDER BY). Are there any known issues with the ATC, or is the code below considered functionally correct?
select frgco from zmm_rel_codes up to 1 rows
into lv_frgco
where ekorg = lv_ekorg
and bsart = lv_bsart
and knttp = lv_knttp
and zcap = lv_capex
and zlimit ge lv_gnetw.
endselect.
System details: Netweaver 7.4 SP 8 running on Hana DB.
08-29-2016 1:32 AM
I have received a reply from SAP. The short answer is that there is a concern that implementing this check in the ATC would result in too many false positives.
SAP is considering to add an information message, similar to that of SELECT SINGLE.
08-12-2016 6:20 AM
Ok, looks like I may have misunderstood the purpose of this check:
Search problematic statements for result of SELECT/OPEN CURSOR without ORDER BY
Seems like it only triggers an error if you have subsequent operations that makes assumptions on the order of the result set.
I still don't think the code above is functionally correct. Is there a different ATC check that would highlight it?
08-12-2016 7:03 AM
Please check the SAP Note 2251947. It should cover this situation.
Regards, Thomas
08-14-2016 9:25 PM
Thank you for your answer, Thomas I have implemented the note, but the program still passes as correct. The note references Codeinspector Test cl_ci_test_no_order_by. I assume that is still the same check?
Search for problematic statements for result of SELECT/OPEN CURSOR without ORDER BY
08-15-2016 7:23 AM
Looks like the test covers only SELECT SINGLE and not SELECT UP TO 1 ROWS.
Please open an OSS ticket on component BC-ABA-LA.
Regards, Thomas
08-15-2016 11:39 PM
08-29-2016 1:32 AM
I have received a reply from SAP. The short answer is that there is a concern that implementing this check in the ATC would result in too many false positives.
SAP is considering to add an information message, similar to that of SELECT SINGLE.