mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
Rename methods returning boolean (#5436)
Just a bit of Clean ABAP: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-nouns-for-classes-and-verbs-for-methods Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
parent
3d158a3fbc
commit
3666dda767
|
@ -135,7 +135,7 @@ CLASS zcl_abapgit_object_fugr DEFINITION PUBLIC INHERITING FROM zcl_abapgit_obje
|
||||||
!ii_xml TYPE REF TO zif_abapgit_xml_input
|
!ii_xml TYPE REF TO zif_abapgit_xml_input
|
||||||
RAISING
|
RAISING
|
||||||
zcx_abapgit_exception .
|
zcx_abapgit_exception .
|
||||||
METHODS belongs_incl_to_other_fugr
|
METHODS is_part_of_other_fugr
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_include TYPE sobj_name
|
!iv_include TYPE sobj_name
|
||||||
RETURNING
|
RETURNING
|
||||||
|
@ -147,40 +147,6 @@ ENDCLASS.
|
||||||
CLASS zcl_abapgit_object_fugr IMPLEMENTATION.
|
CLASS zcl_abapgit_object_fugr IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD belongs_incl_to_other_fugr.
|
|
||||||
" make sure that the include belongs to the function group
|
|
||||||
" like in LSEAPFAP Form TADIR_MAINTENANCE
|
|
||||||
DATA ls_tadir TYPE tadir.
|
|
||||||
DATA lv_namespace TYPE rs38l-namespace.
|
|
||||||
DATA lv_area TYPE rs38l-area.
|
|
||||||
DATA lv_include TYPE rs38l-include.
|
|
||||||
|
|
||||||
rv_belongs_to_other_fugr = abap_false.
|
|
||||||
IF iv_include(1) = 'L' OR iv_include+1 CS '/L'.
|
|
||||||
lv_include = iv_include.
|
|
||||||
ls_tadir-object = 'FUGR'.
|
|
||||||
|
|
||||||
CALL FUNCTION 'FUNCTION_INCLUDE_SPLIT'
|
|
||||||
IMPORTING
|
|
||||||
namespace = lv_namespace
|
|
||||||
group = lv_area
|
|
||||||
CHANGING
|
|
||||||
include = lv_include
|
|
||||||
EXCEPTIONS
|
|
||||||
OTHERS = 1.
|
|
||||||
IF lv_area(1) = 'X'. " "EXIT"-function-module
|
|
||||||
ls_tadir-object = 'FUGS'.
|
|
||||||
ENDIF.
|
|
||||||
IF sy-subrc = 0.
|
|
||||||
CONCATENATE lv_namespace lv_area INTO ls_tadir-obj_name.
|
|
||||||
IF ls_tadir-obj_name <> ms_item-obj_name.
|
|
||||||
rv_belongs_to_other_fugr = abap_true.
|
|
||||||
ENDIF.
|
|
||||||
ENDIF.
|
|
||||||
ENDIF.
|
|
||||||
ENDMETHOD.
|
|
||||||
|
|
||||||
|
|
||||||
METHOD check_rfc_parameters.
|
METHOD check_rfc_parameters.
|
||||||
|
|
||||||
* function module RS_FUNCTIONMODULE_INSERT does the same deep down, but the right error
|
* function module RS_FUNCTIONMODULE_INSERT does the same deep down, but the right error
|
||||||
|
@ -680,7 +646,7 @@ CLASS zcl_abapgit_object_fugr IMPLEMENTATION.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
"Make sure that the include does not belong to another function group
|
"Make sure that the include does not belong to another function group
|
||||||
IF belongs_incl_to_other_fugr( iv_include = <lv_include> ) = abap_true.
|
IF is_part_of_other_fugr( <lv_include> ) = abap_true.
|
||||||
DELETE rt_includes.
|
DELETE rt_includes.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
ENDLOOP.
|
ENDLOOP.
|
||||||
|
@ -755,6 +721,40 @@ CLASS zcl_abapgit_object_fugr IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD is_part_of_other_fugr.
|
||||||
|
" make sure that the include belongs to the function group
|
||||||
|
" like in LSEAPFAP Form TADIR_MAINTENANCE
|
||||||
|
DATA ls_tadir TYPE tadir.
|
||||||
|
DATA lv_namespace TYPE rs38l-namespace.
|
||||||
|
DATA lv_area TYPE rs38l-area.
|
||||||
|
DATA lv_include TYPE rs38l-include.
|
||||||
|
|
||||||
|
rv_belongs_to_other_fugr = abap_false.
|
||||||
|
IF iv_include(1) = 'L' OR iv_include+1 CS '/L'.
|
||||||
|
lv_include = iv_include.
|
||||||
|
ls_tadir-object = 'FUGR'.
|
||||||
|
|
||||||
|
CALL FUNCTION 'FUNCTION_INCLUDE_SPLIT'
|
||||||
|
IMPORTING
|
||||||
|
namespace = lv_namespace
|
||||||
|
group = lv_area
|
||||||
|
CHANGING
|
||||||
|
include = lv_include
|
||||||
|
EXCEPTIONS
|
||||||
|
OTHERS = 1.
|
||||||
|
IF lv_area(1) = 'X'. " "EXIT"-function-module
|
||||||
|
ls_tadir-object = 'FUGS'.
|
||||||
|
ENDIF.
|
||||||
|
IF sy-subrc = 0.
|
||||||
|
CONCATENATE lv_namespace lv_area INTO ls_tadir-obj_name.
|
||||||
|
IF ls_tadir-obj_name <> ms_item-obj_name.
|
||||||
|
rv_belongs_to_other_fugr = abap_true.
|
||||||
|
ENDIF.
|
||||||
|
ENDIF.
|
||||||
|
ENDIF.
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD main_name.
|
METHOD main_name.
|
||||||
|
|
||||||
DATA: lv_area TYPE rs38l-area,
|
DATA: lv_area TYPE rs38l-area,
|
||||||
|
|
|
@ -10,7 +10,7 @@ CLASS zcl_abapgit_object_vcls DEFINITION PUBLIC INHERITING FROM zcl_abapgit_obje
|
||||||
CONSTANTS c_cluster_type TYPE c VALUE 'C' ##NO_TEXT.
|
CONSTANTS c_cluster_type TYPE c VALUE 'C' ##NO_TEXT.
|
||||||
CONSTANTS c_mode_insert TYPE obj_para-maint_mode VALUE 'I' ##NO_TEXT.
|
CONSTANTS c_mode_insert TYPE obj_para-maint_mode VALUE 'I' ##NO_TEXT.
|
||||||
|
|
||||||
METHODS check_lock
|
METHODS is_locked
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_tabname TYPE tabname
|
!iv_tabname TYPE tabname
|
||||||
!iv_argument TYPE seqg3-garg
|
!iv_argument TYPE seqg3-garg
|
||||||
|
@ -22,10 +22,10 @@ ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLASS zcl_abapgit_object_vcls IMPLEMENTATION.
|
CLASS ZCL_ABAPGIT_OBJECT_VCLS IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD check_lock.
|
METHOD is_locked.
|
||||||
|
|
||||||
DATA:
|
DATA:
|
||||||
ls_rstable_key TYPE rstable, " Lock argument for table RSTABLE
|
ls_rstable_key TYPE rstable, " Lock argument for table RSTABLE
|
||||||
|
@ -190,15 +190,15 @@ CLASS zcl_abapgit_object_vcls IMPLEMENTATION.
|
||||||
lv_argument_langu = |@{ ms_item-obj_name }|.
|
lv_argument_langu = |@{ ms_item-obj_name }|.
|
||||||
|
|
||||||
"Check all relevant maintein tabeles for view clusters
|
"Check all relevant maintein tabeles for view clusters
|
||||||
IF check_lock( iv_tabname = 'VCLDIR'
|
IF is_locked( iv_tabname = 'VCLDIR'
|
||||||
iv_argument = lv_argument ) = abap_true
|
iv_argument = lv_argument ) = abap_true
|
||||||
OR check_lock( iv_tabname = 'VCLDIRT'
|
OR is_locked( iv_tabname = 'VCLDIRT'
|
||||||
iv_argument = lv_argument_langu ) = abap_true
|
iv_argument = lv_argument_langu ) = abap_true
|
||||||
OR check_lock( iv_tabname = 'VCLSTRUC'
|
OR is_locked( iv_tabname = 'VCLSTRUC'
|
||||||
iv_argument = lv_argument ) = abap_true
|
iv_argument = lv_argument ) = abap_true
|
||||||
OR check_lock( iv_tabname = 'VCLSTRUCT'
|
OR is_locked( iv_tabname = 'VCLSTRUCT'
|
||||||
iv_argument = lv_argument_langu ) = abap_true
|
iv_argument = lv_argument_langu ) = abap_true
|
||||||
OR check_lock( iv_tabname = 'VCLMF'
|
OR is_locked( iv_tabname = 'VCLMF'
|
||||||
iv_argument = lv_argument ) = abap_true.
|
iv_argument = lv_argument ) = abap_true.
|
||||||
|
|
||||||
rv_is_locked = abap_true.
|
rv_is_locked = abap_true.
|
||||||
|
|
|
@ -45,7 +45,7 @@ CLASS zcl_abapgit_requirement_helper DEFINITION
|
||||||
VALUE(rt_status) TYPE ty_requirement_status_tt
|
VALUE(rt_status) TYPE ty_requirement_status_tt
|
||||||
RAISING
|
RAISING
|
||||||
zcx_abapgit_exception .
|
zcx_abapgit_exception .
|
||||||
CLASS-METHODS version_greater_or_equal
|
CLASS-METHODS is_version_greater_or_equal
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!is_status TYPE ty_requirement_status
|
!is_status TYPE ty_requirement_status
|
||||||
RETURNING
|
RETURNING
|
||||||
|
@ -90,7 +90,7 @@ CLASS zcl_abapgit_requirement_helper IMPLEMENTATION.
|
||||||
<ls_status>-installed_release = <ls_installed_comp>-release.
|
<ls_status>-installed_release = <ls_installed_comp>-release.
|
||||||
<ls_status>-installed_patch = <ls_installed_comp>-extrelease.
|
<ls_status>-installed_patch = <ls_installed_comp>-extrelease.
|
||||||
<ls_status>-description = <ls_installed_comp>-desc_text.
|
<ls_status>-description = <ls_installed_comp>-desc_text.
|
||||||
<ls_status>-met = version_greater_or_equal( <ls_status> ).
|
<ls_status>-met = is_version_greater_or_equal( <ls_status> ).
|
||||||
ELSE.
|
ELSE.
|
||||||
" Component is not installed at all
|
" Component is not installed at all
|
||||||
<ls_status>-met = abap_false.
|
<ls_status>-met = abap_false.
|
||||||
|
@ -118,6 +118,39 @@ CLASS zcl_abapgit_requirement_helper IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD is_version_greater_or_equal.
|
||||||
|
|
||||||
|
DATA:
|
||||||
|
lv_installed_release TYPE n LENGTH 4,
|
||||||
|
lv_installed_patch TYPE n LENGTH 4,
|
||||||
|
lv_required_release TYPE n LENGTH 4,
|
||||||
|
lv_required_patch TYPE n LENGTH 4.
|
||||||
|
|
||||||
|
TRY.
|
||||||
|
MOVE EXACT: is_status-installed_release TO lv_installed_release,
|
||||||
|
is_status-installed_patch TO lv_installed_patch,
|
||||||
|
is_status-required_release TO lv_required_release,
|
||||||
|
is_status-required_patch TO lv_required_patch.
|
||||||
|
CATCH cx_sy_conversion_error.
|
||||||
|
" Cannot compare by number, assume requirement not fullfilled (user can force install
|
||||||
|
" anyways if this was an error)
|
||||||
|
rv_true = abap_false.
|
||||||
|
RETURN.
|
||||||
|
ENDTRY.
|
||||||
|
|
||||||
|
" Versions are comparable by number, compare release and if necessary patch level
|
||||||
|
IF lv_installed_release > lv_required_release
|
||||||
|
OR ( lv_installed_release = lv_required_release
|
||||||
|
AND ( lv_required_patch = 0
|
||||||
|
OR lv_installed_patch >= lv_required_patch ) ).
|
||||||
|
|
||||||
|
rv_true = abap_true.
|
||||||
|
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD requirements_popup.
|
METHOD requirements_popup.
|
||||||
|
|
||||||
DATA: lt_met_status TYPE ty_requirement_status_tt,
|
DATA: lt_met_status TYPE ty_requirement_status_tt,
|
||||||
|
@ -216,37 +249,4 @@ CLASS zcl_abapgit_requirement_helper IMPLEMENTATION.
|
||||||
ENDTRY.
|
ENDTRY.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD version_greater_or_equal.
|
|
||||||
|
|
||||||
DATA:
|
|
||||||
lv_installed_release TYPE n LENGTH 4,
|
|
||||||
lv_installed_patch TYPE n LENGTH 4,
|
|
||||||
lv_required_release TYPE n LENGTH 4,
|
|
||||||
lv_required_patch TYPE n LENGTH 4.
|
|
||||||
|
|
||||||
TRY.
|
|
||||||
MOVE EXACT: is_status-installed_release TO lv_installed_release,
|
|
||||||
is_status-installed_patch TO lv_installed_patch,
|
|
||||||
is_status-required_release TO lv_required_release,
|
|
||||||
is_status-required_patch TO lv_required_patch.
|
|
||||||
CATCH cx_sy_conversion_error.
|
|
||||||
" Cannot compare by number, assume requirement not fullfilled (user can force install
|
|
||||||
" anyways if this was an error)
|
|
||||||
rv_true = abap_false.
|
|
||||||
RETURN.
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
" Versions are comparable by number, compare release and if necessary patch level
|
|
||||||
IF lv_installed_release > lv_required_release
|
|
||||||
OR ( lv_installed_release = lv_required_release
|
|
||||||
AND ( lv_required_patch = 0
|
|
||||||
OR lv_installed_patch >= lv_required_patch ) ).
|
|
||||||
|
|
||||||
rv_true = abap_true.
|
|
||||||
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user