Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Legend

2020-10-10 v1.05.0
------------------
* profile message check runs only once
! check messages
- db access in ut when OSQL/CDS framework is being used
! category description
Expand Down
57 changes: 55 additions & 2 deletions src/checks/y_check_profile_message.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ CLASS y_check_profile_message DEFINITION
PROTECTED SECTION.
METHODS execute_check REDEFINITION.
METHODS inspect_tokens REDEFINITION.
METHODS inform REDEFINITION.
PRIVATE SECTION.
CLASS-DATA ran TYPE abap_bool.
METHODS get_profiles RETURNING VALUE(result) TYPE y_if_profile_manager=>profile_assignments.
METHODS list_profiles IMPORTING profiles TYPE y_if_profile_manager=>profile_assignments
RETURNING value(result) TYPE string.
ENDCLASS.

CLASS y_check_profile_message IMPLEMENTATION.
Expand All @@ -26,12 +31,13 @@ CLASS y_check_profile_message IMPLEMENTATION.
settings-apply_on_productive_code = abap_true.
settings-prio = c_note.

set_check_message( 'code pal for ABAP Profile is being used.' ).
set_check_message( '&1 Profile(s) in use: &2.' ).
ENDMETHOD.


METHOD execute_check.

CHECK ran = abap_false.
CHECK has_attributes = abap_false.

DATA(check_configuration) = detect_check_configuration( VALUE #( level = 1 ) ).
Expand All @@ -40,10 +46,16 @@ CLASS y_check_profile_message IMPLEMENTATION.
RETURN.
ENDIF.

DATA(profiles) = get_profiles( ).

raise_error( statement_level = 1
statement_index = 1
statement_from = 1
error_priority = check_configuration-prio ).
error_priority = check_configuration-prio
parameter_01 = |{ lines( profiles ) }|
parameter_02 = |{ list_profiles( profiles ) }| ).

ran = abap_true.

ENDMETHOD.

Expand All @@ -53,4 +65,45 @@ CLASS y_check_profile_message IMPLEMENTATION.
ENDMETHOD.


METHOD inform.
super->inform( p_sub_obj_type = 'TRAN'
p_sub_obj_name = 'Y_CODE_PAL_PROFILE'
p_position = ''
p_line = ''
p_column = ''
p_errcnt = p_errcnt
p_kind = p_kind
p_test = p_test
p_code = p_code
p_suppress = p_suppress
p_param_1 = p_param_1
p_param_2 = p_param_2
p_param_3 = p_param_3
p_param_4 = p_param_4
p_inclspec = p_inclspec
p_detail = p_detail
p_checksum_1 = p_checksum_1
p_comments = p_comments
p_finding_origins = p_finding_origins ).
ENDMETHOD.


METHOD get_profiles.
TRY.
result = y_profile_manager=>create( )->select_profiles( sy-uname ).
CATCH ycx_entry_not_found.
RETURN.
ENDTRY.

ENDMETHOD.


METHOD list_profiles.
LOOP AT profiles ASSIGNING FIELD-SYMBOL(<profile>).
result = COND #( WHEN result IS INITIAL THEN <profile>-profile
ELSE |{ result }, { <profile>-profile }| ).
ENDLOOP.
ENDMETHOD.


ENDCLASS.
2 changes: 1 addition & 1 deletion src/checks/y_check_profile_message.clas.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<VSEOCLASS>
<CLSNAME>Y_CHECK_PROFILE_MESSAGE</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>code pal for ABAP Profile Message</DESCRIPT>
<DESCRIPT>Profile Feature Notification (code pal for ABAP)</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
Expand Down