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: 

View local class static/constant values in Eclipse ABAP debugger

matt
Active Contributor
0 Kudos

I have a custom class with a local class. My local class has static attributes but I never have an instance outside of the class. (It does a lot of instantiation within the class, and then stores the results in a static table - it's complicated, and on reflection, not the best design - in my defence, it's stuff I wrote quite a while ago ).

How can I view the values of the static attributes of a local class?

4 REPLIES 4

Patrick_vN
Active Contributor
0 Kudos

For a global class I'd reply something like this:

[variable]= cl_abap_char_utilities=>horizontal_tab

So I'd imagine that for a local class it would be like:

[variable]= lcl_test=>static_attribute

But that makes me think I don't understand your question correctly..

And if it considers a PRIVATE/PROTECTED method, you can of course only use it within the local class. So if you need it in another class, make them friends, or provide a getter-method.

[Update]

Anyway, after re-reading the question again, I realized my mistake :). So I opened my eclipse debugger..

There is the "<enter_variable>" option in the tab Variables. After entering "lcl_test=>static_attribute", I saw it's contents. Mind you, if this is a private attribute, you'll have to be 'in the class' to get the value, if not I got 'undefined'.

In ADT debugger, I can even see the values of private static attributes from outside the local class!

Sandra_Rossi
Active Contributor
0 Kudos

I don't understand your question. It's possible to see their contents as Patrick explained. Do you mean you'd like to see the list of all static attributes, as it is the case for an instance?

0 Kudos

Hello Matthew,

If the current debugger cursor is inside the global class you can simply use lcl_test=>static_attribute.

If the current debugger cursor is outside of the class, it's more complicated, you have to put the classes' program name in brackets in front:

(CL_YOUR_CLASS=================CP)lcl_test=>static_attribute

Note that "CP" is always on position 31/32.

This notation can always be used to access program global variables both in the debugger, and also also using a dynamic assign statement in abap code.

Regards,

Stratos