Is there any way to get the value of an objects' private attribute without a getter. Modifying the class is not permitted in any shape or form.
Please find below an example class with a private attribute.
CLASS counter DEFINITION.
METHODS: set IMPORTING value(set_value) TYPE i.
DATA count TYPE i.
ENDCLASS. "counter DEFINITION
CLASS counter IMPLEMENTATION.
count = set_value.
ENDCLASS. "counter IMPLEMENTATION
How can I get the value of
count? Inheriting from counter will not work because
count is private, not protected.
Unfortunately not, I have tried this myself in many different ways none of which work:
You are basically flat out of luck. There is one obscure option though depending on the class you are trying to access. Some classes have interfaces specified as friends and if you implement that interface you can access their private data (the ALV on 7.20 is like this) but unfortunately this will only work in a few limited cases.