You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
10
10
11
11
Made by [Marc Bernard Tools](https://marcbernardtools.com/) giving back to the [SAP Community](https://community.sap.com/)
12
12
13
13
NO WARRANTIES, [MIT License](LICENSE)
14
14
15
+
## Background
16
+
17
+
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.
18
+
19
+
You can implement a `GET_SOURCE_POSITION` method in your exception class, but unfortunately, the debugger does not call it :shrug:.
20
+
15
21
## Usage
16
22
17
-
<description>
23
+
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.
18
24
19
25
## Prerequisites
20
26
21
-
SAP Basis 7.02 or higher
27
+
- SAP Basis 7.02 or higher
28
+
- Add `SRC_INFO` attribute to your exception class
22
29
23
-
## Installation
30
+
```abap
31
+
DATA src_info TYPE tpda_sys_srcinfo.
32
+
```
33
+
34
+
- Add `GET_SOURCE_POSITION` method in your exception class
24
35
25
-
You can install ABAP XXX using [abapGit](https://github.com/abapGit/abapGit) either creating a new online repository for https://github.com/Marc-Bernard-Tools/ABAP-XXX or downloading the repository [ZIP file](https://github.com/Marc-Bernard-Tools/ABAP-XXX/archive/main.zip) and creating a new offline repository.
36
+
- Add the following to the end of the `CONSTRUCTOR` method of your exception class
26
37
27
-
Recommended SAP package: `$XXX`.
38
+
```abap
39
+
METHOD constructor.
40
+
41
+
"...
42
+
43
+
" Save for debugger
44
+
get_source_position(
45
+
IMPORTING
46
+
program_name = src_info-program
47
+
include_name = src_info-include
48
+
source_line = src_info-line ).
49
+
50
+
ENDMETHOD.
51
+
```
52
+
53
+
## Installation
28
54
29
-
```abap
55
+
You can install the Debugger Extension for abapGit using [abapGit](https://github.com/abapGit/abapGit) either creating a new online repository for https://github.com/Marc-Bernard-Tools/Debugger-Ext-for-abapGit or downloading the repository [ZIP file](https://github.com/Marc-Bernard-Tools/Debugger-Ext-for-abapGit/archive/main.zip) and creating a new offline repository.
30
56
31
-
```
57
+
Recommended SAP package: `$ABAPGIT-EXT-DEBUGGER`.
32
58
33
59
## Contributions
34
60
@@ -38,7 +64,7 @@ All contributions are welcome! Read our [Contribution Guidelines](CONTRIBUTING.m
38
64
39
65
Made with :heart: in Canada
40
66
41
-
Copyright 2023 Marc Bernard <https://marcbernardtools.com/>
67
+
Copyright 2025 Marc Bernard <https://marcbernardtools.com/>
42
68
43
69
Follow [@marcfbe](https://twitter.com/marcfbe) on Twitter
0 commit comments