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: 

Why the ATC message "Search SELECT statement with DELETE" is a problem ?

Former Member
0 Kudos

I´m analysing the ATC report and have a Check mesage : "DELETE statement for result of SELECT statement found"

The code is:

" SELECT <column1>FROM <table>

INTO TABLE <t1> WHERE Zvar_ID = <l_id> AND Ztbl_ID = "zzzz".

IF SY-SUBRC = 0

SORT <t1> BY ZSEQUENCE_NUM ASCENDING.

DELETE ADJACENT DUPLICATES FROM <t1> COMPARING ZSEQUENCE_NUM

ELSE

ASSERT 0 = 0.

ENDIF."

Whats the problem with code above? Why ATC marks it as a problem?

Thanks!

2 REPLIES 2

matt
Active Contributor

ATC is indicating that rather than select some data, then delete a subset of that, you should write your select so that it doesn't select the unwanted data in the first place.

pokrakam
Active Contributor
0 Kudos

What's the point of

ASSERT 0 = 0.

?