2019 Feb 20 2:44 PM
I just had an issue with the syntax check, I couldn't post the question because I couldn't make you reproduce it, so now I can tell you how to reproduce but it's also the answer.
To reproduce, create the following program with 3 local classes, convert them automatically into class pools (SE24, menu Object type -> Import -> Local classes in program):
REPORT ztestprog.
CLASS animal DEFINITION ABSTRACT CREATE PROTECTED.
PROTECTED SECTION.
METHODS constructor IMPORTING animal_name TYPE csequence.
ENDCLASS.
CLASS arthropod DEFINITION ABSTRACT INHERITING FROM animal.
ENDCLASS.
CLASS crustacean DEFINITION CREATE PROTECTED INHERITING FROM arthropod.
PROTECTED SECTION.
METHODS constructor IMPORTING animal_name TYPE csequence.
ENDCLASS.
CLASS animal IMPLEMENTATION.
METHOD constructor.
ENDMETHOD.
ENDCLASS.
CLASS arthropod IMPLEMENTATION.
ENDCLASS.
CLASS crustacean IMPLEMENTATION.
METHOD constructor.
super->constructor( 'method argument' ).
ENDMETHOD.
ENDCLASS.
There's a little issue with the tool for ABSTRACT classes, so manually edit the class pools via the source-based editor of SE24 or via ADT, and respectively set CREATE PROTECTED for ZCL_ANIMAL and remove CREATE PUBLIC for ZCL_ARTHROPOD.
Activate all the 3 class pools.
Now edit ZCL_ARTHROPOD and remove the line "PROTECTED SECTION" (it's an empty block) and activate.
Go to ZCL_CRUSTACEAN and the syntax check says "'method argument'" is not valid (corresponds to MESSAGEG07 in the table TRMSG).
Why?
Thanks.
Sandra
2019 Feb 20 2:45 PM
Edit the abstract class pool from which the method originates (ZCL_ARTHROPOD in my example), add the following line:
PROTECTED SECTION.Activate.
Go to the subclass which had the syntax error message (ZCL_CRUSTACEAN in my example) and activate it, it should now work.
Edit the abstract class pool from which the method originates (ZCL_ARTHROPOD in my example), add the following line:
PROTECTED SECTION.Activate.
Go to the subclass which had the syntax error message (ZCL_CRUSTACEAN in my example) and activate it, it should now work.
2019 Feb 20 2:45 PM
Edit the abstract class pool from which the method originates (ZCL_ARTHROPOD in my example), add the following line:
PROTECTED SECTION.Activate.
Go to the subclass which had the syntax error message (ZCL_CRUSTACEAN in my example) and activate it, it should now work.
2019 Feb 20 2:45 PM
2019 Feb 20 9:00 PM
Little summary: the message ""'method argument'" is not valid" happens when the argument is not expected i.e. there's no corresponding parameter in the called method, but in my example snippet this parameter exists so the argument is valid... but there's a little "bug/flaw" in the ABAP syntax check.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |