Catch exception in exit form (#4966)

Closes #4965
This commit is contained in:
Marc Bernard 2021-09-22 09:12:01 -04:00 committed by GitHub
parent 7e55a358cf
commit 81a70274be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,9 +2,6 @@
*& Include ZABAPGIT_FORMS
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form run
*&---------------------------------------------------------------------*
FORM run.
DATA: lx_exception TYPE REF TO zcx_abapgit_exception.
@ -32,25 +29,11 @@ FORM open_gui RAISING zcx_abapgit_exception.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form branch_popup
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->TT_FIELDS text
* -->PV_CODE text
* -->CS_ERROR text
* -->CV_SHOW_POPUP text
* -->RAISING text
* -->zcx_abapgit_exception text
* -->##CALLED text
* -->##NEEDED text
*----------------------------------------------------------------------*
FORM branch_popup TABLES tt_fields TYPE zif_abapgit_popups=>ty_sval_tt
USING pv_code TYPE clike
CHANGING cs_error TYPE svale
cv_show_popup TYPE c
RAISING zcx_abapgit_exception ##called ##needed.
RAISING zcx_abapgit_exception ##CALLED ##NEEDED.
* called dynamically from function module POPUP_GET_VALUES_USER_BUTTONS
DATA: lx_error TYPE REF TO zcx_abapgit_exception,
@ -73,6 +56,7 @@ FORM branch_popup TABLES tt_fields TYPE zif_abapgit_popups=>ty_sval_tt
ENDFORM. "branch_popup
FORM output.
DATA: lx_error TYPE REF TO zcx_abapgit_exception,
lt_ucomm TYPE TABLE OF sy-ucomm.
@ -92,9 +76,12 @@ FORM output.
CATCH zcx_abapgit_exception INTO lx_error.
MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'.
ENDTRY.
ENDFORM.
FORM exit RAISING zcx_abapgit_exception.
FORM exit.
DATA lx_error TYPE REF TO zcx_abapgit_exception.
" The exit logic should only be applied for our 'main' selection screen 1001.
" All other selection-screens are called as popups and shouldn't influence
@ -103,14 +90,19 @@ FORM exit RAISING zcx_abapgit_exception.
RETURN.
ENDIF.
CASE sy-ucomm.
WHEN 'CBAC' OR 'CCAN'. "Back & Escape
IF zcl_abapgit_ui_factory=>get_gui( )->back( ) = abap_true. " end of stack
zcl_abapgit_ui_factory=>get_gui( )->free( ). " Graceful shutdown
ELSE.
LEAVE TO SCREEN 1001.
ENDIF.
ENDCASE.
TRY.
CASE sy-ucomm.
WHEN 'CBAC' OR 'CCAN'. "Back & Escape
IF zcl_abapgit_ui_factory=>get_gui( )->back( ) = abap_true. " end of stack
zcl_abapgit_ui_factory=>get_gui( )->free( ). " Graceful shutdown
ELSE.
LEAVE TO SCREEN 1001.
ENDIF.
ENDCASE.
CATCH zcx_abapgit_exception INTO lx_error.
MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'.
ENDTRY.
ENDFORM.
FORM password_popup