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
CLASS zcl_demo_01 DEFINITION
PUBLIC FINAL
CREATE PUBLIC.
PUBLIC SECTION.
METHODS replace_text_in
IMPORTING
mailtext TYPE string
with TYPE clike
if TYPE clike
text TYPE clike OPTIONAL
RETURNING
VALUE(r_result) TYPE string.
PRIVATE SECTION.
TYPES: BEGIN OF _changed_parts,
one TYPE abap_bool,
two TYPE abap_bool,
three TYPE abap_bool,
END OF _changed_parts.
DATA changed_parts TYPE _changed_parts.
ENDCLASS.
CLASS zcl_demo_01 IMPLEMENTATION.
METHOD replace_text_in.
ASSIGN COMPONENT if OF STRUCTURE changed_parts TO FIELD-SYMBOL(<field>).
IF sy-subrc > 0.
RETURN.
ENDIF.
" TODO: variable is assigned but never used (ABAP cleaner)
DATA(findstr) = |${ if }%|.
r_result = mailtext.
DATA(replacestr) = |<p>{ with }{ COND #( WHEN text IS SUPPLIED THEN |: <b>{ text }</b>| ELSE `` ) }</p>|.
IF <field> IS NOT INITIAL.
REPLACE findstr WITH replacestr INTO r_result.
ELSE.
REPLACE findstr WITH `` INTO r_result.
ENDIF.
ENDMETHOD.
ENDCLASS.
ABAP cleaner thinks that the variable findstr is not used, but it is by REPLACE.
The text was updated successfully, but these errors were encountered:
Hey there!
please see the following code
ABAP cleaner thinks that the variable findstr is not used, but it is by REPLACE.
The text was updated successfully, but these errors were encountered: