SAP / abap-cleaner

ABAP cleaner applies 95+ cleanup rules to ABAP code at a single keystroke
Apache License 2.0
457 stars 49 forks source link

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

Open prokopp80 opened 1 year ago

prokopp80 commented 1 year ago

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

jmgrassau commented 1 year ago

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