Получение информации о структуре класса/интерфейса
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
PARAMETERS: p_cls TYPE seoclsname DEFAULT 'CL_GUI_ALV_GRID'. TRY. DATA(o_cls) = NEW cl_oo_class( clsname = p_cls with_inherited_components = abap_true with_interface_components = abap_true ). WRITE: / 'Public:', o_cls->is_public( ). WRITE: / 'Final:', o_cls->is_final( ). WRITE: / 'Abstract:', o_cls->is_abstract( ). WRITE: / 'Super:', o_cls->get_superclass( ). LOOP AT o_cls->get_methods( ) ASSIGNING FIELD-SYMBOL(<m>). WRITE: / 'Method:', <m>-cmpname. ENDLOOP. LOOP AT o_cls->get_events( ) ASSIGNING FIELD-SYMBOL(<e>). WRITE: / 'Event:', <e>-cmpname. ENDLOOP. CATCH cx_root INTO DATA(e_txt). WRITE: / e_txt->get_text( ). ENDTRY. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
PARAMETERS: p_cls TYPE seoclsname DEFAULT 'CL_GUI_ALV_GRID'. TRY. DATA(o_cls) = cl_oo_object=>get_instance( p_cls ). LOOP AT o_cls->get_methods( ) ASSIGNING FIELD-SYMBOL(<m>). WRITE: / 'Method:', <m>-cmpname. ENDLOOP. LOOP AT o_cls->get_events( ) ASSIGNING FIELD-SYMBOL(<e>). WRITE: / 'Event:', <e>-cmpname. ENDLOOP. CATCH cx_root INTO DATA(e_txt). WRITE: / e_txt->get_text( ). ENDTRY. |
1 2 3 4 5 6 7 8 9 10 |
PARAMETERS: p_cls TYPE seoclsname DEFAULT 'CL_GUI_ALV_GRID'. TRY. LOOP AT cl_oo_classname_service=>get_all_class_includes( p_cls ) ASSIGNING FIELD-SYMBOL(<ci>). WRITE: / 'Include:', <ci>. ENDLOOP. CATCH cx_root INTO DATA(e_txt). WRITE: / e_txt->get_text( ). ENDTRY. |