mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 20:03:20 +08:00
Minor changes (#1442)
* remove try without catch * reduce nesting * reduce nesting * reduce line length
This commit is contained in:
parent
71bcc8afac
commit
10dbd74f57
|
@ -36,7 +36,7 @@ ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLASS zcl_abapgit_object_doma IMPLEMENTATION.
|
CLASS ZCL_ABAPGIT_OBJECT_DOMA IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD deserialize_texts.
|
METHOD deserialize_texts.
|
||||||
|
@ -223,23 +223,20 @@ CLASS zcl_abapgit_object_doma IMPLEMENTATION.
|
||||||
|
|
||||||
CATCH cx_sy_dyn_call_param_not_found.
|
CATCH cx_sy_dyn_call_param_not_found.
|
||||||
|
|
||||||
TRY.
|
CALL FUNCTION 'RS_DD_DELETE_OBJ'
|
||||||
CALL FUNCTION 'RS_DD_DELETE_OBJ'
|
EXPORTING
|
||||||
EXPORTING
|
no_ask = abap_true
|
||||||
no_ask = abap_true
|
objname = lv_objname
|
||||||
objname = lv_objname
|
objtype = 'D'
|
||||||
objtype = 'D'
|
* no_ask_delete_append = abap_true parameter not available in lower NW versions
|
||||||
* no_ask_delete_append = abap_true parameter not available in lower NW versions
|
EXCEPTIONS
|
||||||
EXCEPTIONS
|
not_executed = 1
|
||||||
not_executed = 1
|
object_not_found = 2
|
||||||
object_not_found = 2
|
object_not_specified = 3
|
||||||
object_not_specified = 3
|
permission_failure = 4.
|
||||||
permission_failure = 4.
|
IF sy-subrc <> 0.
|
||||||
IF sy-subrc <> 0.
|
zcx_abapgit_exception=>raise( 'error from RS_DD_DELETE_OBJ, DOMA' ).
|
||||||
zcx_abapgit_exception=>raise( 'error from RS_DD_DELETE_OBJ, DOMA' ).
|
ENDIF.
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
ENDTRY.
|
ENDTRY.
|
||||||
|
|
||||||
|
|
|
@ -338,31 +338,29 @@ CLASS zcl_abapgit_objects_program IMPLEMENTATION.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
zcl_abapgit_language=>restore_login_language( ).
|
zcl_abapgit_language=>restore_login_language( ).
|
||||||
ELSE.
|
ELSEIF strlen( is_progdir-name ) > 30.
|
||||||
* function module RPY_PROGRAM_INSERT cannot handle function group includes
|
* function module RPY_PROGRAM_INSERT cannot handle function group includes
|
||||||
|
|
||||||
IF strlen( is_progdir-name ) > 30.
|
" special treatment for extensions
|
||||||
" special treatment for extensions
|
" if the program name exceeds 30 characters it is not a usual
|
||||||
" if the program name exceeds 30 characters it is not a usual
|
" ABAP program but might be some extension, which requires the internal
|
||||||
" ABAP program but might be some extension, which requires the internal
|
" addition EXTENSION TYPE, see
|
||||||
" addition EXTENSION TYPE, see
|
" http://help.sap.com/abapdocu_751/en/abapinsert_report_internal.htm#!ABAP_ADDITION_1@1@
|
||||||
" http://help.sap.com/abapdocu_751/en/abapinsert_report_internal.htm#!ABAP_ADDITION_1@1@
|
" This e.g. occurs in case of transportable Code Inspector variants (ending with ===VC)
|
||||||
" This e.g. occurs in case of transportable Code Inspector variants (ending with ===VC)
|
INSERT REPORT is_progdir-name
|
||||||
INSERT REPORT is_progdir-name
|
FROM it_source
|
||||||
FROM it_source
|
STATE 'I'
|
||||||
STATE 'I'
|
EXTENSION TYPE is_progdir-name+30.
|
||||||
EXTENSION TYPE is_progdir-name+30.
|
IF sy-subrc <> 0.
|
||||||
IF sy-subrc <> 0.
|
zcx_abapgit_exception=>raise( 'error from INSERT REPORT .. EXTENSION TYPE' ).
|
||||||
zcx_abapgit_exception=>raise( 'error from INSERT REPORT .. EXTENSION TYPE' ).
|
ENDIF.
|
||||||
ENDIF.
|
ELSE.
|
||||||
ELSE.
|
INSERT REPORT is_progdir-name
|
||||||
INSERT REPORT is_progdir-name
|
FROM it_source
|
||||||
FROM it_source
|
STATE 'I'
|
||||||
STATE 'I'
|
PROGRAM TYPE is_progdir-subc.
|
||||||
PROGRAM TYPE is_progdir-subc.
|
IF sy-subrc <> 0.
|
||||||
IF sy-subrc <> 0.
|
zcx_abapgit_exception=>raise( 'error from INSERT REPORT' ).
|
||||||
zcx_abapgit_exception=>raise( 'error from INSERT REPORT' ).
|
|
||||||
ENDIF.
|
|
||||||
ENDIF.
|
ENDIF.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
|
|
|
@ -219,12 +219,11 @@ CLASS ZCL_ABAPGIT_SYNTAX_ABAP IMPLEMENTATION.
|
||||||
|
|
||||||
CASE <ls_match>-token.
|
CASE <ls_match>-token.
|
||||||
WHEN c_token-keyword.
|
WHEN c_token-keyword.
|
||||||
IF <ls_match>-offset > 0.
|
IF <ls_match>-offset > 0
|
||||||
|
AND substring( val = iv_line off = ( <ls_match>-offset - 1 ) len = 1 ) CA '-<'.
|
||||||
" Delete match if keyword is part of structure or field symbol
|
" Delete match if keyword is part of structure or field symbol
|
||||||
IF substring( val = iv_line off = ( <ls_match>-offset - 1 ) len = 1 ) CA '-<'.
|
DELETE ct_matches INDEX lv_index.
|
||||||
DELETE ct_matches INDEX lv_index.
|
CONTINUE.
|
||||||
CONTINUE.
|
|
||||||
ENDIF.
|
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
WHEN c_token-comment.
|
WHEN c_token-comment.
|
||||||
|
|
|
@ -69,7 +69,8 @@ CLASS ltcl_xml_output IMPLEMENTATION.
|
||||||
lv_value =
|
lv_value =
|
||||||
'<?xml version="1.0" encoding="utf-16"?>#<abapGit version="v1.0.0">#' &
|
'<?xml version="1.0" encoding="utf-16"?>#<abapGit version="v1.0.0">#' &
|
||||||
' <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">#' &
|
' <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">#' &
|
||||||
' <asx:values># <DATA># <FOO>2</FOO># <BAR>A</BAR># </DATA># </asx:values># </asx:abap>#</abapGit>#'.
|
' <asx:values># <DATA># <FOO>2</FOO># <BAR>A' &
|
||||||
|
'</BAR># </DATA># </asx:values># </asx:abap>#</abapGit>#'.
|
||||||
|
|
||||||
REPLACE ALL OCCURRENCES OF '#' IN lv_value WITH cl_abap_char_utilities=>newline.
|
REPLACE ALL OCCURRENCES OF '#' IN lv_value WITH cl_abap_char_utilities=>newline.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user