09-12-2017 1:25 PM
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.
09-12-2017 2:58 PM
09-12-2017 2:58 PM
09-12-2017 3:16 PM
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 😉
09-12-2017 3:38 PM
09-12-2017 4:18 PM
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.
09-12-2017 5:30 PM
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.
09-15-2017 2:51 PM