ABAP 没有一个和 Java Spring 里的 @Component 完全等价的原生注解。更准确地讲,ABAP 没有 Spring 那种通过 classpath scanning 自动扫描类、识别 stereotype annotation、注册 bean、再由 IoC container 管理生命周期和依赖注入的统一运行时容器。Spring 官方对 @Component 的定义很直接,它是一种 stereotype annotation,被标注的类会成为 classpath scanning 的候选组件,其他被 @Component 元注解标注的注解,也会被视为 stereotype annotation。(Home)
ABAP 世界里确实也有大量 @ 形式的注解,尤其是在 ABAP CDS、RAP、OData 暴露、UI metadata、authorization、semantics、analytics 这些地方。SAP 官方文档对 CDS annotation 的说明是,CDS annotation 给 CDS object 增加超出 ABAP SQL 语法本身的元数据,并且只能使用 SAP 预定义的 annotation,目前不支持用户自定义 annotation。(