Skip to content

Marc-Bernard-Tools/Debugger-Ext-for-abapGit

Repository files navigation

Version

License Contributor Covenant REUSE Status

Debugger Extension for abapGit

Enhancement for the ABAP debugger to jump to the correct trigger location for exception classes that use static methods to raise exceptions like ZCX_ABAPGIT_EXCEPTION used in abapGit.

Made by Marc Bernard Tools giving back to the SAP Community

NO WARRANTIES, MIT License

Background

The ABAP debugger has a feature to "show the trigger location" of the last raised exception. The feature works well when RAISE EXCEPTION is used directly. However, if you embed RAISE EXCEPTION in a static method of your exception class, for example in ZCX_ABAPGIT_EXCEPTION=>RAISE(...), then the debugger will jump to the location inside your static method and not to the location of the method call.

You can implement a GET_SOURCE_POSITION method in your exception class, but unfortunately, the debugger does not call it 🤷.

Usage

After installing this enhancement, the debugger will check if an exception class contains the SRC_INFO (or MS_SRC_INFO) attribute and use it to determine the trigger location of the exception.

Prerequisites

  • SAP Basis 7.02 or higher

  • Add SRC_INFO attribute to your exception class

    DATA src_info TYPE tpda_sys_srcinfo.
  • Add GET_SOURCE_POSITION method in your exception class

  • Add the following to the end of the CONSTRUCTOR method of your exception class

    METHOD constructor.
    
      "...
    
      " Save for debugger
      get_source_position(
        IMPORTING
          program_name = src_info-program
          include_name = src_info-include
          source_line  = src_info-line ).
    
    ENDMETHOD.

Installation

You can install the Debugger Extension for abapGit using abapGit either creating a new online repository for https://github.com/Marc-Bernard-Tools/Debugger-Ext-for-abapGit or downloading the repository ZIP file and creating a new offline repository.

Recommended SAP package: $ABAPGIT-EXT-DEBUGGER.

Contributions

All contributions are welcome! Read our Contribution Guidelines, fork this repo, and create a pull request.

About

Made with ❤️ in Canada

Copyright 2025 Marc Bernard https://marcbernardtools.com/

Follow @marcfbe on Twitter

MBT Logo

About

Debugger - Extension for abapGit

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Languages