在接口中定义默认方法会出现语法错误 "Unable to interpret DEFAULT"

Defining a default method in interface gives syntax error "Unable to interpret DEFAULT"

我在 7.40 系统上尝试演示接口中的默认方法。为此,我将 example code of the ABAP Keyword Documentation 复制到报告中。最小代码:

INTERFACE intf.
  CLASS-METHODS m1 DEFAULT FAIL.
  METHODS       m2 DEFAULT IGNORE
                   RETURNING VALUE(r) TYPE i.
ENDINTERFACE.

令人惊讶的是,这给出了语法错误

Unable to interpret "DEFAULT". Possible causes of error: Incorrect spelling or comma error`.

我还尝试使用基于源代码的视图将接口定义为全局接口,但结果相同。基于表单的视图似乎没有提供 default 选项。

如何正确处理?

新添加的 DEFAULT 仅从 7.4 SP08 开始有效:

https://help.sap.com/doc/abapdocu_740_index_htm/7.40/en-US/abennews-740_sp08-abap_objects.htm