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: 

ADT debugger doesn't show constant values

pokrakam
Active Contributor

When debugging, the ADT debugger won't show class constants, SE80 does.

NetWeaver 750 SP6 / ADT 2.80.3 on Oxygen, example:

REPORT zadt_debug_no_constants.

CLASS lcl_test DEFINITION.
  PUBLIC SECTION.
    CONSTANTS t1 TYPE string VALUE `A`.
    DATA      t2 TYPE string VALUE `B`.
ENDCLASS.

CLASS lcl_test IMPLEMENTATION.
ENDCLASS.

DATA(test) = NEW lcl_test( ).
BREAK-POINT.

In the SE80 debugger I see both data elements:

But in Eclipse the constant is missing:

Has anyone else experienced this, is this a bug? Couldn't find any settings in ADT that would hide it.

1 ACCEPTED SOLUTION

fabianlupa
Contributor

It's a feature!

6 REPLIES 6

fabianlupa
Contributor

It's a feature!

pokrakam
Active Contributor

Yay!

On Oxygen that menu is cleverly hidden behind an unintuitive triangle icon that looks like it's part of the window functions.

Would have been better if it were on by default, like SE80.
And no I'm not saying that because it cost me an hour's frustration because I *thought* my code wasn't working when it was 😉

horst_keller
Product and Topic Expert
Product and Topic Expert

Sent notification to product owner Thomas Fiedler.

For me personally I always disliked the display of constants in the (old new / SE80) debugger. Quite often I am debugging classes which "implement" a constants-interface with dozens of constants, so I need to scroll some pages to get to the variables I want to see. And it's not like their value is going to change at any point in time...

Also since they are constants in most cases the value shouldn't matter much at all, because you always access it using the constant.

But to each their own 🙂 By the way, you also can see them when you hover over the reference variable in the source code in the debugger.

pokrakam
Active Contributor

Understand, I guess that's why having it switchable makes sense. But as it was always there in SE80, I wouldn't expect them to disappear by default.

In my case I was casting an interface reference parameter back to it's implementing class, to try to read a constant that can vary by class (don't ask!). All dynamic - actually that's a topic for another question...

At first it didn't work due to an error on my part. But then when I fixed it and it still didn't appear, I set off down a false rabbit hole that was entirely due to this little 'feature'. It's only when I tried it in SE80 that I finally 'got it'. I did search through all the Eclipse config dialogs but found nothing.

You can use "at"-replies now: thomasfiedler 😉