SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software SAP ABAP Programming and HANA Database Tutorials
Development resources, articles, tutorials, code samples and tools and downloads for ASP.Net, SQL Server, R Script, Windows, Windows Phone, AWS, SAP HANA and ABAP, like SAP UI5, Screen Personas, etc.

Install SAP Free

ATC Check Error: Empty SELECT/ENDSELECT Problematic Statements

ABAP Test Cockpit ATC check variant executed on SAP S/4HANA systems can be configured to list empty SELECT / ENDSELECT statements under Problematic Statements.

ABAP Test Cockpit ATC checks problematic statements on SAP S4HANA like empty SELECT/ENDSELECT statements that can be suppressed with pseudo comment CI_NOORDER

In ATC checks result list, I had items listed with following details

Search problematic statements for result of SELECT/OPEN CURSOR without ORDER BY
Empty SELECT/ENDSELECT at ... line ...
Priority 3
Finding can be suppressed with pseudo comment CI_NOORDER

If ABAP programmer decides to suppress the ATC check error for Empty SELECT/ENDSELECT statements, pseudo comment CI_NOORDER can be used as seen in below ABAP code sample

select smtp_addr from adr6 into v_emailadr up to 1 rows
where addrnumber = kna1-adrnr
and smtp_addr ne space. "#EC CI_NOORDER

Although supressing the error with pseudo comment #EC CI_NOORDER instead of solving it with proper ABAP coding is not the best way of dealing with such ATC check results for improving code quality, it is an option for ABAP programmers to get rid of such ATC checks at the end.

The best solution also ensuring to read the correct data from SAP database is using the appropriate sort order with ORDER BY clause in SELECT statement.

SELECT addrnumber name1
 FROM adrc WHERE addrnumber = t_listp-sarep_adrnr
 AND nation = space ORDER BY date_from DESCENDING.
  MOVE adrc-name1 TO t_alv_xxl_norm-zsarep_name1.

Hope that helps for improving your code quality.

SAP Tutorials

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table

Meetup Sunumu 1 meetup

Copyright © 2004 - 2020 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems