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
The 'Use FINAL for immutable variables' formatting option does not consider some EML statements as write access. It therefore transforms the inline DATA() declarations to FINAL() which leads to syntax errors.
get_rap_create_data(
IMPORTING et_rap_create_root = DATA(lt_create_root_data) "<< Replaced with FINAL
et_rap_create_child = DATA(lt_create_child_data) ). "<< Replaced with FINAL
MODIFY ENTITIES OF <CDS view>
ENTITY <root_entity>
CREATE FROM lt_create_root_data "<< This is OK
ENTITY <child_entity>
CREATE BY \_<association>
SET FIELDS WITH lt_create_child_data "<< Syntax error: "The field lt_create_child_data cannot be modified"
FAILED failed_early
REPORTED reported_early
MAPPED mapped.
Can you please check whether this can be fixed?
Thanks & Regards,
Peter
The text was updated successfully, but these errors were encountered:
thanks a lot for reporting this – this particular write position was indeed not yet considered by ABAP cleaner!
The issue should be fixed with the next release. Unfortunately, with the different variants of FROM fields_tab / AUTO FILL CID WITH fields_tab / FIELDS ( comp1 comp2 ... ) WITH fields_tab / [AUTO FILL CID] SET FIELDS WITH fields_tab, it seems that it is not always possible to statically determine read-only cases. Therefore, ABAP cleaner now always assumes a write access (shown in red) to these fields tables …
… to avoid introducing FINAL(…) where it is wrong.
Kind regards,
Jörg-Michael
jmgrassau
added a commit
to jmgrassau/abap-cleaner
that referenced
this issue
Sep 30, 2023
Uh oh!
There was an error while loading. Please reload this page.
Dear Community,
The 'Use FINAL for immutable variables' formatting option does not consider some EML statements as write access. It therefore transforms the inline DATA() declarations to FINAL() which leads to syntax errors.
Can you please check whether this can be fixed?
Thanks & Regards,
Peter
The text was updated successfully, but these errors were encountered: