Fix dump related to exit implementations (#6268)

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>
Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
Marc Bernard 2023-05-11 16:35:30 +02:00 committed by GitHub
parent cd134cd0de
commit ea1964ef47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,9 +22,18 @@ CLASS zcl_abapgit_exit IMPLEMENTATION.
METHOD get_instance.
DATA lv_class_name TYPE string.
lv_class_name = 'ZCL_ABAPGIT_USER_EXIT'.
IF zcl_abapgit_factory=>get_environment( )->is_merged( ) = abap_true.
" Prevent accidental usage of exit handlers in the developer version
lv_class_name = |\\PROGRAM={ sy-repid }\\CLASS={ lv_class_name }|.
ENDIF.
IF gi_exit IS INITIAL.
TRY.
CREATE OBJECT gi_exit TYPE ('ZCL_ABAPGIT_USER_EXIT').
CREATE OBJECT gi_exit TYPE (lv_class_name).
CATCH cx_sy_create_object_error ##NO_HANDLER.
ENDTRY.
ENDIF.