Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting all class attributes. How?

I want to read all the attributes from a class in ABAP, maybe via reflection? After that I want to filter out all constants from a specified type. How can i do this?

I know that i can read the all items of a structure via assign component of structure, also I can read them via a function module which reads the field catalog from a structure.

How to do this with the attributes of an class?

like image 507
cyptus Avatar asked May 25 '26 02:05

cyptus


1 Answers

Use the RTTS for this. You'll get an instance of CL_ABAP_OBJECTDESCR (either a CLASSDESCR or an INTFDESCR, depending on what kind of reference you throw in) that has some public attributes that contain the attributes of the class in question.

like image 111
vwegert Avatar answered May 30 '26 04:05

vwegert