Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get class' attributes
METHOD get_attributes.
DATA:
lo_ref_obj TYPE REF TO cl_abap_objectdescr.
FIELD-SYMBOLS:
<attr_desc> TYPE abap_attrdescr.
" Get class description
lo_ref_obj ?= cl_abap_classdescr=>describe_by_object_ref( me ).
" Select only pure attributes, not tables
LOOP AT lo_ref_obj->attributes ASSIGNING <attr_desc>.
APPEND <attr_desc> TO me->attributes.
ENDLOOP.
ENDMETHOD.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment