You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes I just want check, whether a database entry exists using the sy-subrc variable. I am forced to select the data into some table/structure, because a "SELECT" without "INTO" is not possible.
`" TODO: variable is assigned but never used (ABAP cleaner)
SELECT SINGLE * FROM pa0000 INTO @DaTa(ls_dummy) WHERE begda <= @sy-datum
AND endda >= @sy-datum.
IF sy-subrc = 0.
" further processing
ENDIF.`
Would it be possible to switch the message "TODO: variable is assigned but never used (ABAP cleaner)" off in such cases?
The text was updated successfully, but these errors were encountered:
I think the best way to suppress this would be to add a ##NEEDED pragma at the end of the line of @DATA(ls_dummy). With this, ABAP cleaner will not add such a TODO comment (in fact, it will even automatically remove the existing one). Without ##NEEDED, the Extended Check (transaction SLIN) would also create a Field Attributes warning:
This wasn't clear to me. I really like how it even automatically removes its own comment. How about adding examples to the rule to demonstrate the use of ##NEEDED?
How about adding examples to the rule to demonstrate the use of ##NEEDED?
Actually there is already a tiny, inconspicuous line in the "Delete unused variables" examples …
… but happy to add some more comment there to explain it! Anyway you could often continue the "no defect" label with "… but apparently not intuitive and documented well enough" :-)
Sometimes I just want check, whether a database entry exists using the sy-subrc variable. I am forced to select the data into some table/structure, because a "SELECT" without "INTO" is not possible.
`" TODO: variable is assigned but never used (ABAP cleaner)
SELECT SINGLE * FROM pa0000 INTO @DaTa(ls_dummy) WHERE begda <= @sy-datum
AND endda >= @sy-datum.
IF sy-subrc = 0.
" further processing
ENDIF.`
Would it be possible to switch the message "TODO: variable is assigned but never used (ABAP cleaner)" off in such cases?
The text was updated successfully, but these errors were encountered: