Code: Alles auswählen.
method read_methods.
data: lt_compname type ztt_seocmpname,
lr_describer type ref to cl_abap_typedescr,
lr_describer_ref type ref to cl_abap_refdescr,
tmp_abap_abstypename type abap_abstypename,
lv_abap_abstypename type abap_abstypename.
*&---------------------------------------------------------------------*
" Feststellen, in welcher Klasse wir uns gerade bewegen
lr_describer_ref ?= cl_abap_typedescr=>describe_by_data( me ).
lr_describer = lr_describer_ref->get_referenced_type( ).
tmp_abap_abstypename = lr_describer->absolute_name .
lv_abap_abstypename = tmp_abap_abstypename+7.
*&---------------------------------------------------------------------*
select cmpname
from seocompo
into table lt_compname
where clsname eq lv_abap_abstypename
and cmpname like 'SA_%'.
atr_comp_name = lt_compname.
endmethod.
In der internen Tabelle lo_class_descr->methods stehen sowohl die eigenen als auch alle geerbten (public) Methoden.METHOD read_methods.
" Zusammenstellen der Methoden zu den Satzarten
DATA: lo_class_descr TYPE REF TO cl_abap_classdescr.
FIELD-SYMBOLS: <fs_method> TYPE abap_methdescr.
lo_class_descr ?= cl_abap_typedescr=>describe_by_object_ref( me ).
DATA: lv_sa(3) TYPE c VALUE 'SA_'.
LOOP AT lo_class_descr->methods ASSIGNING <fs_method>.
IF <fs_method>-name+0(3) eq lv_sa.
APPEND <fs_method>-name TO atr_methods.
ENDIF.
ENDLOOP.
ENDMETHOD. "READ_METHODS