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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With