larshp / abapOpenChecks

Open source checks for SAP Code Inspector / ABAP Test Cockpit
https://docs.abapopenchecks.org
MIT License
270 stars 79 forks source link

CHECK_45: corresponding #( ) adjust message #1019

Closed g-back closed 3 years ago

g-back commented 3 years ago

The check suggests to use CORRESPONDING #( ) instead of MOVE-CORRESPONDING - suggestion: adjust the check message to incorporate the "base", because

move-corresponding source to target.
" this is NOT analogous:
target = corresponding #( source ).
" but this is:
target = corresponding #( base ( target ) source ).

The check documentation mentions that target is initialized, but changing the check message to Use corresponding #( base( source ) target ) should make this clearer on first glance.

Thoughts?

MiLiCLN commented 3 years ago

We should also mention that "BASE" is only available from 7.40 SP08.

larshp commented 3 years ago

if the version is 740sp08 or above issue "Use corresponding #( base( source ) target )" for lower "Use corresponding #( source ) if source is initial"

🤷‍♂️

g-back commented 3 years ago

Ah, I assumed that base was already included when corresponding was released. Sounds good, will change it accordingly

g-back commented 3 years ago

Heh, it's been a while. I think I stopped following up on this because I couldn't find a method to check the current systems version. Do we have any other checks that have abap version dependent stuff?

larshp commented 3 years ago

see https://github.com/larshp/abapOpenChecks/blob/6b5d936db0e2227f4842453f445c27bf61d5c04f/src/checks/zcl_aoc_check_48.clas.abap#L162 and https://github.com/larshp/abapOpenChecks/blob/6b5d936db0e2227f4842453f445c27bf61d5c04f/src/checks/zcl_aoc_check_45.clas.locals_imp.abap#L47

MiLiCLN commented 3 years ago

Could you also adapt the documentation in this context?