Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

If I know a name of class , how can I get it's attribute and methods

Former Member
0 Kudos

If I know a name of class , how can I get it's attribute and methods as well as it's detail information by ABAP code ?

Best regards ,

1 ACCEPTED SOLUTION

sharat_chandra
Active Participant
0 Kudos

Hi,

You can use the class CL_OO_CLASS to get the class related data.

You need to create an instance using the static method GET_INSTANCE & use this instance to get the required data using the available methods.

4 REPLIES 4

sharat_chandra
Active Participant
0 Kudos

Hi,

You can use the class CL_OO_CLASS to get the class related data.

You need to create an instance using the static method GET_INSTANCE & use this instance to get the required data using the available methods.

0 Kudos

HI, Chandra ,

Thank you very much , I can get the result

Best regards,

DATA lo_class TYPE REF TO cl_oo_class.

DATA lt_attribs TYPE seo_attributes.

FIELD-SYMBOLS: <attrib> TYPE vseoattrib.

TRY.

CREATE OBJECT lo_class

EXPORTING

clsname = 'CLASS_NAME'.

CATCH cx_class_not_existent .

ENDTRY.

lt_attribs = lo_class->get_attributes( ).

BREAK-POINT.

0 Kudos

hi, Sharat ,

Do you know how to get message parameters from the class ?

Get_methods can only get method name.

Best regards,

0 Kudos

This will only get the attribute.except the attribute's value.May U know how to get the value ?