Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/foundation/y_check_base.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ CLASS y_check_base DEFINITION PUBLIC ABSTRACT
RAISING cx_sy_range_out_of_bounds.

PRIVATE SECTION.
METHODS do_attributes_exist RETURNING VALUE(result) TYPE abap_bool.
METHODS profile_is_active_for_user RETURNING VALUE(result) TYPE abap_bool.

METHODS instantiate_objects.

Expand Down Expand Up @@ -172,7 +172,8 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
settings-documentation = |{ c_docs_path-main }check_documentation.md|.
settings-ignore_pseudo_comments = abap_false.

has_attributes = do_attributes_exist( ).
has_attributes = abap_true.
attributes_ok = abap_true.

relevant_statement_types = VALUE #( ( scan_struc_stmnt_type-form )
( scan_struc_stmnt_type-method )
Expand Down Expand Up @@ -244,14 +245,13 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
ENDMETHOD.


METHOD do_attributes_exist.
METHOD profile_is_active_for_user.
TRY.
DATA(profiles) = y_profile_manager=>create( )->select_profiles( sy-uname ).
attributes_ok = xsdbool( profiles IS INITIAL ).
result = xsdbool( profiles IS NOT INITIAL ).
CATCH ycx_entry_not_found.
attributes_ok = abap_true.
result = abap_true.
ENDTRY.
result = attributes_ok.
ENDMETHOD.


Expand Down Expand Up @@ -356,6 +356,11 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
DATA sci_attributes TYPE sci_atttab.
DATA message(72) TYPE c.

if profile_is_active_for_user( ).
message 'Settings cannot be maintained while a profile is active for the current user'(prf) type 'I'.
return.
endif.

READ TABLE check_configurations INTO DATA(check_configuration) INDEX 1.
IF sy-subrc <> 0 AND use_default_attributes = abap_true.
check_configuration-object_creation_date = settings-object_created_on.
Expand Down Expand Up @@ -535,7 +540,7 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
ENDIF.

" Profile
IF has_attributes = abap_false.
IF profile_is_active_for_user( ).
TRY.
check_configurations = clean_code_manager->read_check_customizing( myname ).
CATCH ycx_no_check_customizing.
Expand Down