abap-cleaner icon indicating copy to clipboard operation
abap-cleaner copied to clipboard

Replace of boolean literals 'X' or space or ' ' with corresponding constant ABAP_TRUE/ABAP_FALSE

Open prokopp80 opened this issue 2 years ago • 1 comments

Hello team, would it be possible ot implement the requirement in the subject ?\

Here is a simple example:

if lv_condition = 'X'. endif. I would like to turn this into if lv_condition = abap_true. endif.

Thank you :) Br. Petr

prokopp80 avatar Oct 16 '23 09:10 prokopp80

Hi Petr,

I think as opposed to #150, chances are a bit better here, as long as the definition is "in sight" for ABAP cleaner, esp. for local variables (DATA lv_condition TYPE abap_bool). It won't work for components of structures, though, because if the code reads IF ls_any_struc-component = 'X'., ABAP cleaner can't do backend calls to determine whether component has type abap_bool.

Kind regards, Jörg-Michael

jmgrassau avatar Oct 18 '23 08:10 jmgrassau