A today’s experience has made me something thoughtful…

report zdm_003.

definition.
public section.
class-methods:
doit.
endClass.

class lcl_test implementation.
doit method.
write ‘ only a test.
EndMethod.

endClass.

data:
go_test type ref to lcl_test.

start-of-selection.

create object go_test.
lcl_test => doit ().

go_test -> doit ().
“This shouldnt work…

In the SAP NetWeaver system (base release 7.31), there was no warning message program above to… I expected at least a hint that a static method does not equal as an instance method can be called. Unfortunately, nothing, not even the ABAP test cockpit is an indication of above situation!

I get a syntax error when I method an instance from the static method do (only methods instead of class-methods): “The indication”class => method”may be used only for static methods.” Vice versa I would hope at least a hint 😉