Skip to content

fabianlupa/abap-annotation-processing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AAP - ABAP Annotation Processing Build Status ABAP Doc License: MIT

Annotations in ABAP!

This project is a technology study / proof of concept of implementing a framework to manage class based annotations in ABAP. Since there is no native language support for annotations the assignments are done in customizing tables. The current state is still very much unfinished and not production ready. I am currently not planning on finishing this project (the necessary efforts and drawbacks are way too high). Feel free to fork it or take parts of it for reference.

DO NOT USE IN PRODUCTION.

Using annotations in ABAP code

DATA: lo_annotation TYPE REF TO zcl_my_annotation.

DATA(lo_annotated_class) = NEW zcl_annotated_class( ).

DATA(lo_processor) = zcl_aap_proc_object=>from_object( lo_annotated_class ).
IF lo_processor->is_annotation_present_by_data( lo_annotation ).
  lo_annotation ?= lo_processor->get_annotation_by_data( lo_annotation ).
  WRITE lo_annotation->mv_my_attribute.
ENDIF.

More example code

Adding annotations to classes/interfaces/attributes/methods/parameters

Using transaction ZAAP_CUST: Transaction ZAAP_CUST

API Overview

API Overview Detailed class diagram

License

MIT License Copyright (c) 2017 Fabian Lupa

Releases

No releases published

Packages

No packages published

Languages