Set focus: fix code inspector warning + improve error handling (#4843)

* Set Focus: fix code inspector warning 

+ improve error handling

* fix method signature
This commit is contained in:
Christian Günter 2021-06-14 10:58:01 +02:00 committed by GitHub
parent a9c40ea972
commit 6f8e3f45fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 4 deletions

View File

@ -51,7 +51,9 @@ CLASS zcl_abapgit_gui DEFINITION
RAISING
zcx_abapgit_exception .
METHODS free .
METHODS set_focus .
METHODS set_focus
RAISING
zcx_abapgit_exception .
PROTECTED SECTION.
PRIVATE SECTION.
@ -369,7 +371,16 @@ CLASS zcl_abapgit_gui IMPLEMENTATION.
METHOD set_focus.
cl_gui_control=>set_focus( mi_html_viewer->get_viewer( ) ).
cl_gui_control=>set_focus(
EXPORTING
control = mi_html_viewer->get_viewer( )
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error in: cl_gui_control=>set_focus - SUBRC = { sy-subrc }| ).
ENDIF.
ENDMETHOD.

View File

@ -73,7 +73,8 @@ FORM branch_popup TABLES tt_fields TYPE zif_abapgit_popups=>ty_sval_tt
ENDFORM. "branch_popup
FORM output.
DATA: lt_ucomm TYPE TABLE OF sy-ucomm.
DATA: lx_error TYPE REF TO zcx_abapgit_exception,
lt_ucomm TYPE TABLE OF sy-ucomm.
PERFORM set_pf_status IN PROGRAM rsdbrunt IF FOUND.
@ -86,7 +87,11 @@ FORM output.
TABLES
p_exclude = lt_ucomm.
zcl_abapgit_ui_factory=>get_gui( )->set_focus( ).
TRY.
zcl_abapgit_ui_factory=>get_gui( )->set_focus( ).
CATCH zcx_abapgit_exception INTO lx_error.
MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'.
ENDTRY.
ENDFORM.
FORM exit RAISING zcx_abapgit_exception.