Escalation only on workdays in the MSMP workflow: I really like the concept of enhancements, as it gives the flexibility to change the behavior of the application from the standard to a custom requirement. There is a step by step WIKI about creating simple enhancements, which is helpful to get started: Enhancement Framework – Class Enhancements – Pre-exit, Post-exit and Overwrite-exit methods – Concept and Simple Scenari…

In SAP GRC Access Control 10.x releases the weekend days and public holidays are also considered setting the escalation time according to MSMP stage level settings per standard. Although it can be a requirement to restrict the escalation to working days only and this can be easily achieved by creating an enhancement. To determine the workdays the best approach is to use the factory calendar in the SAP system, see Creating Factory/Holiday Calendar. First it needs to be decided to choose an existing factory calendar or create a new one in SCAL transaction.

To enable escalation only on workdays the class CL_GRFN_MSMP_WF_TEMPLATE_BASE has to be enhanced by applying an overwrite-exit method to the method GET_ESCALATION_SETTINGS. This method calls the function module END_TIME_DETERMINE, which has the optional parameter FACTORY_CALENDAR. Copy the standard code into the overwrite-exit method and add the Factory Calendar ID, which has been chosen from SCAL transaction. Now the escalation date and time is calculated considering working days only, as maintained in the factory calendar.

METHOD iow_z_workday_escalation~get_escalation_settings.

*”————————————————————————*

*” Declaration of Overwrite-method, do not insert any comments here please!

*”

*”methods GET_ESCALATION_SETTINGS

*”  importing

*”    !IS_MSMP_EXEC_CONTEXT type GRFN_MW_S_EXECUTION_CONTEXT

*”    !IS_STAGE type GRFNMWCNSTGV

*”  returning

*”    value(ES_ESCALATION_SETTINGS) type GRFNMW_S_TEMPLATE_ESCALATION

*”  raising

*”    CX_GRFN_MSMP_CONFIGURATION_ERR

*”    CX_GRFN_MSMP_NO_APPROVER

*”    CX_GRFN_MSMP .

*”————————————————————————*

     DATA: ls_escalation_settings TYPE grfnmw_s_template_escalation,

           l_escalation_user      TYPE grfn_mw_wf_appr_usr.

     DATA ls_global_settings TYPE grfnmwcnglbset.

     DATA: end_date   LIKE sydatum,

           end_time   LIKE syuzeit,

           start_date LIKE sydatum,

           start_time LIKE syuzeit.

     DATA: lv_timestamp TYPE timestampl.

     ls_global_settings = cl_grfn_msmp_configuration=>get_global_settings( is_msmp_exec_contextprocess_id ).

     IF  is_stageescalation_type <> grfnw_msmp_c_escalation_typeno_escalation.

       IF ( ls_global_settingsescalation_enble EQ abap_true ).

         ls_escalation_settingsrequested_esclation_date = ls_global_settingsescalation_date.

       ENDIF.

       ls_escalation_settingsescalation_type = is_stageescalation_type.

       GET TIME STAMP FIELD lv_timestamp.

* convert to date and time

       CONVERT TIME STAMP lv_timestamp TIME ZONE  syzonlo INTO DATE start_date TIME start_time.

* calculate time

       CALL FUNCTION ‘END_TIME_DETERMINE’

         EXPORTING

           duration               = is_stageescalation_time

           unit                   = grfnw_msmp_c_duration_unitsminutes

           factory_calendar           = ‘EU’ “Factory Calendar ID from SCAL transaction

         IMPORTING

           end_date               = end_date

           end_time               = end_time

         CHANGING

           start_date             = start_date

           start_time             = start_time

         EXCEPTIONS

           factory_calendar_not_found = 1

           date_out_of_calendar_range = 2

           date_not_valid             = 3

           unit_conversion_error      = 4

           si_unit_missing            = 5

           parameters_no_valid        = 6

           error_message              = 7

           OTHERS                     = 7.

       IF sysubrc = 0.

         ls_escalation_settingslatest_end_date = end_date.

         ls_escalation_settingslatest_end_time = end_time.

       ELSE.

         RAISE EXCEPTION TYPE cx_grfn_msmp_configuration_err.

       ENDIF.

     ENDIF.

     es_escalation_settings = ls_escalation_settings.

   ENDMETHOD.

In MSMP stage level settings I have maintained 2 days / 48 hours as escalation time to test the enhancement.

The request has been submitted on Friday. Per standard it would escalate on Sunday. Activating the described enhancement the request escalated and moved to the next stage on Tuesday, as it is recorded in the audit log.

I think who sets escalation in the workflow customizing, will also like this enhancement.

Best Regards,

Zoltan Galik

New NetWeaver Information at SAP.com

Very Helpfull

 

 

User Rating: Be the first one !