This is just a step to think over how do we allow the programs to be debuggable. Its one of the ideas that i come to think over. We keep writing lots of code but at the end we need to debug them especially in the Production system. So debugging becomes an important issue!!.
This way we can add or remove the parameters and enable the code to be debugged in any system.
Lets say: we create parameters like: debug level, debug tcode and debug program name.
Some code snippet is:
CONSTANTS: c_param_debug_level TYPE memoryid VALUE 'DEBUG_LEVEL',
c_param_debug_tcode TYPE memoryid VALUE 'DEBUG_TCODE',
c_param_debug_prog TYPE memoryid VALUE 'DEBUG_PROG'.
We will put a debug point in the program smth like this _debug_level 1. For more please see the implementation code i will attach!!
This should be called first then everything in the code! For example at the Standard report at initialization section.
As the code the name of this class is zcl_debug.
Why macro? Because via macro we can put Break-point and as macros can not be debugged thats the best candidate for this.
Code snippet: ***Writing the MAcros!!!
DEFINE _debug_level.
if zcl_Debug=>get_instance( )->is_debug_level_correct( iv_debug_level = CONV string( '&1' ) ) = abap_true. "#EC USER_OK BREAK-POINT. "#EC NOBREAK
endif.
END-OF-DEFINITION.
DEFINE _debug_configure.
zcl_Debug=>get_instance( )->configure_debug_level( ).
END-OF-DEFINITION.
DEFINE _debug_configure.
zcl_Debug=>get_instance( )->configure_debug_level( ).
END-OF-DEFINITION. …
İnitialization.
_debug_configure.
Start-of-selection.
_debug_level 3. …
By this way we can enable the code to be debuggable which will make our life much easier!!
Any suggestions, please feel free to suggest me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
5 | |
4 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 |