Get the App
SLTechnology News&Howtos  ›  Servers  › 

What is the technique for viewing the static properties of a class in the ABAP debugger

Shulou Source: shulou.com Published: 2022-05-31 15:49:54 09月25日 Update

This article mainly introduces "what is the skill of viewing the static properties of a class in the ABAP debugger". In daily operation, I believe that many people have doubts about the skills of viewing the static properties of a class in the ABAP debugger. I have consulted all kinds of materials and sorted out a simple and useful method of operation. I hope it will be helpful to answer the doubts of "what is the skill of viewing the static properties of a class in the ABAP debugger?" Next, please follow the editor to study!

We know that a static property like figure 1 is not owned by an instance of the class, so when debugging inside the method of this class, the value of the property can only be displayed in the debugger in the two ways shown in figure 2. Once debugged to the outside of this class method, static property values can usually only be displayed by "class name = > property name" (figure 3). In fact, there is another way, as shown in figures 4 and 5.

Figure 1: static properties of the ABAP class

Figure 2: how to view the static properties of a class in the ABAP debugger

Figure 3: how to view static properties after jumping out of a class method in the debugger

Figures 4 and 5 enter {C:ZCL_STATIC} manually in the debugger's Objects panel, where the ZCL_STATIC is replaced with other class names containing static attributes, which can be viewed by entering enter.

Some friends may find this tip useless. I used to use it when debugging a lot of framework code implemented in singleton pattern (Singleton). When you need to view multiple static properties of a class implemented in a singleton pattern, if you use the "class name = > attribute name" described in figure 3, you have to type a lot of characters repeatedly, and the time complexity of keystroke is o (n), where n is the number of static attributes. With the technique of Object panel, the time complexity of keystroke is reduced to o (1), and the efficiency of debugging is improved.

At this point, the study on "what is the skill of viewing the static properties of a class in the ABAP debugger" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Properties static debugger technique method learning class name figure 3 complexity complexity time more mode keyboard panel figure 2 such as figure help practical Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Shulou Tech Info MariaDB Huawei Shulou Information