Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Checking custom code for functional correctness: (ATC FUNCTIONAL_DB)

esti1
Participant
0 Kudos

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.

1 ACCEPTED SOLUTION

esti1
Participant

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.

6 REPLIES 6

esti1
Participant
0 Kudos

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?

0 Kudos

Please check the SAP Note 2251947. It should cover this situation.

Regards, Thomas

0 Kudos

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

0 Kudos

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

0 Kudos

Thanks, I've done that 🙂

esti1
Participant

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.