diff --git a/src/profiles/y_profile_admin_classes.prog.abap b/src/profiles/y_profile_admin_classes.prog.abap index d234d704..56274f64 100644 --- a/src/profiles/y_profile_admin_classes.prog.abap +++ b/src/profiles/y_profile_admin_classes.prog.abap @@ -269,6 +269,8 @@ CLASS lcl_util DEFINITION. "#EC NUMBER_METHODS RAISING cx_failed. CLASS-METHODS remove_all_checks. + CLASS-METHODS add_missing_checks. + PRIVATE SECTION. CLASS-METHODS request_confirmation IMPORTING @@ -383,6 +385,9 @@ CLASS lcl_check_events IMPLEMENTATION. WHEN 'BTN_REMOVE_ALL'. lcl_util=>remove_all_checks( ). + WHEN 'BTN_MISSING_CK'. + lcl_util=>add_missing_checks( ). + ENDCASE. lcl_util=>refresh_checks( ). @@ -517,6 +522,11 @@ CLASS lcl_util IMPLEMENTATION. butn_type = cntb_btype_button quickinfo = 'Remove All'(059) ). + checks_tree->toolbar_control( )->add_button( fcode = 'BTN_MISSING_CK' + icon = '@A7@' + butn_type = cntb_btype_button + quickinfo = 'Add Missing Checks'(000) ). + checks_tree->set_field_visibility( fieldname = 'START_DATE' is_visible = abap_true ). checks_tree->set_field_visibility( fieldname = 'END_DATE' @@ -1429,4 +1439,51 @@ CLASS lcl_util IMPLEMENTATION. MESSAGE 'Action Executed Successfully!'(056) TYPE 'S'. ENDMETHOD. + METHOD add_missing_checks. + TRY. + DATA(profile) = lcl_util=>get_selected_profile( )-profile. + CATCH ycx_entry_not_found. + MESSAGE 'Please select a profile!'(005) TYPE 'I'. + ENDTRY. + + TRY. + profile_manager->check_delegation_rights( profile ). + CATCH ycx_no_delegation_rights. + MESSAGE 'You are not a delegate of the profile!'(006) TYPE 'W'. + ENDTRY. + + TRY. + DATA(checks_available) = profile_manager->select_checks( profile ). + request_confirmation( | Would you like to add all missing checks? | ). + CATCH ycx_entry_not_found. + add_all_checks( ). + RETURN. + ENDTRY. + + DATA(list_of_all_checks) = profile_manager->get_checks_from_db( ). + + DATA missing_checks TYPE STANDARD TABLE OF ycicc_checkid. + LOOP AT list_of_all_checks ASSIGNING FIELD-SYMBOL(). + IF NOT line_exists( checks_available[ checkid = -obj_name ] ). + APPEND -obj_name TO missing_checks. + ENDIF. + ENDLOOP. + + IF missing_checks IS INITIAL. + MESSAGE 'No checks are missing!'(060) TYPE 'I'. + RETURN. + ENDIF. + + LOOP AT missing_checks ASSIGNING FIELD-SYMBOL(). + io_check_id = . + init_add_check( ). + TRY. + add_check( ). + CATCH cx_failed. + CONTINUE. + ENDTRY. + ENDLOOP. + MESSAGE 'Action Executed Successfully!'(056) TYPE 'S'. + ENDMETHOD. + ENDCLASS. diff --git a/src/profiles/y_profile_administrator.prog.xml b/src/profiles/y_profile_administrator.prog.xml index ff3ff103..c00f32c7 100644 --- a/src/profiles/y_profile_administrator.prog.xml +++ b/src/profiles/y_profile_administrator.prog.xml @@ -1540,6 +1540,12 @@ Remove All 27 + + I + 060 + No checks are missing! + 44 + R Profile Administrator for code pal for ABAP