Last active
March 19, 2018 13:42
-
-
Save antelio/d451e8440a4ec3868331 to your computer and use it in GitHub Desktop.
ABAP Get Attributes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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