SAP / code-pal-for-abap

code pal for ABAP is a highly configurable engine, fully integrated into the ABAP development framework ensuring Cloud’s built-in quality.
Apache License 2.0
353 stars 67 forks source link

SYNTAX_ERROR in Y_CATEGORY_CODE_PAL #548

Closed abap-weasel closed 2 years ago

abap-weasel commented 2 years ago

After upgrade to 1.17 code pal checks were removed from previously used check variant and are not displayed in SCI anymore. Trying to get it running again via report Y_CATEGORY_CODE_PAL and option REACTIVATE resulted in short dump. Please check.

The current ABAP program "Y_CI_CHECK_REGISTRATION" had to be terminated because it has come across a statement that unfortunately cannot be executed. In include "Y_CHECK_BASE==================CO ", in line 69 of program "Y_CATEGORY_CODE_PAL===========CP ", the following syntax errors have occurred: Type "IF_CI_QUICKFIX_ABAP_ACTIONS" is unknown.

Information on where terminated The termination occurred in ABAP program "Y_CI_CHECK_REGISTRATION", in "GET_CATEGORY_NAME". The main program was "Y_CI_CHECK_REGISTRATION".

In the source code, the termination point is in line 58 of (Include)
program "Y_CI_CHECK_REGISTRATION".

Source Code Extract

Line SourceCde

28 PUBLIC SECTION. 29 CLASS-DATA name_tab TYPE STANDARD TABLE OF scitests-name READ-ONLY. 30 31 CLASS-METHODS select_object_list 32 RETURNING VALUE(result) LIKE name_tab 33 RAISING cx_failed. 34 35 CLASS-METHODS activate_check 36 IMPORTING name TYPE sci_chk 37 RAISING cx_failed 38 cx_sy_create_object_error. 39 40 CLASS-METHODS deactivate_check 41 IMPORTING name TYPE sci_chk 42 RAISING cx_failed 43 cx_sy_create_object_error. 44 45 CLASS-METHODS is_check_compatible 46 IMPORTING name TYPE sci_chk 47 RAISING cx_sy_create_object_error. 48 49 CLASS-METHODS get_category_name 50 RETURNING VALUE(result) TYPE sci_chk. 51 52 PROTECTED SECTION. 53 PRIVATE SECTION. 54 ENDCLASS. 55 56 CLASS lcl_check_registration IMPLEMENTATION. 57 METHOD get_category_name.

result = cl_abap_objectdescr=>describe_by_object_ref( NEW y_category_code_pal( ) )->get_

59 ENDMETHOD. 60 61 METHOD is_check_compatible. 62 DATA code_pal_check TYPE REF TO y_check_base. 63 IF name <> get_category_name( ). 64 CREATE OBJECT code_pal_check TYPE (name). 65 ENDIF. 66 ENDMETHOD. 67 68 METHOD select_object_list. 69 SELECT SINGLE devclass FROM tadir 70 WHERE obj_name = @reference-check_base 71 AND object = @reference-class 72 AND delflag = @abap_false 73 INTO @DATA(packagename). 74 IF sy-subrc <> 0. 75 RAISE EXCEPTION TYPE cx_failed. 76 ENDIF. 77

abap-weasel commented 2 years ago

@lucasborin @eugen-guenther-sap Any ETA for a fix? As this broke our default check variant in ATC after the upgrade it was a quite unpleasant update to 1.17 for us.... 😟

ghost commented 2 years ago

i tried to replicate the issue but Y_CHECK_REGISTRATION works fine on my side. image

Could you please change the method into the example below and debug it to see where the error occurs exactly?

METHOD get_category_name.

    DATA(new_cat) = NEW y_category_code_pal( ).
    DATA(object_descr) = cl_abap_objectdescr=>describe_by_object_ref( new_cat ).
    result = object_descr->get_relative_name( ).

    "result = cl_abap_objectdescr=>describe_by_object_ref( NEW y_category_code_pal( ) )->get_relative_name( ).
ENDMETHOD.

Otherwise you could also check manually if the checks are enabled or not. For this you need to:

  1. Start the transaction /SCI

  2. Open the check overview image

  3. Activate it. In SCI just the "owner" can change the activation status, you can find the name on the right side. ⚠️Please activate Y_CATEGORY_CODE_PAL first.

image

abap-weasel commented 2 years ago

Syntax check of Y_CATEGORY_CODE_PAL shows this:

image

ghost commented 2 years ago

Thank you i updated our Dependencies.

abap-weasel commented 2 years ago

Hi @eugen-guenther-sap , thanks for the update, BUT an update in Readme does not "fix" the issue for us..... We are using SAP BASIS 7.40 and 7.50 for of our NON-S4HANA systems and update to 1.17 breaks code pal there. We still need those systems for add-ons by SAP SE that are not S4HANA ready yet (or not in feature scope anymore) and will continue to use them for several years. Any chances to rollback that quickfix feature and make it downward compatible (code pal interface instead SAP standard one, dynamic use of standard interface when it is available in system, dynamic code etc.), please? 🙏

PS: Dependency may not be 100% correct. Release 7.57 from dependency probably only exists in WDF by now? At least the interface that causes the syntax error already exists in our ref.system with rel. 7.55....

ghost commented 2 years ago

SAP does not support open source projects like code pal for ABAP.

The package with the interface IF_CI_QUICKFIX_ABAP_ACTIONS is not part of Code Pal and they implemented it for: image

Please use version 1.16.3, if version 1.17 does not work for you. The branch 1.16.3 is reopened for an easier download.

For now there is no intention of downporting code pal for ABAP.

fabianlupa commented 2 years ago

What's the point of having this project open source if the ABAP release required to use it or contribute to it is only available SAP internally?