Skip to Content

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.

/wp-content/uploads/2016/08/scal_1026158.png

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.

/wp-content/uploads/2016/08/enhancement_1026147.png

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.

/wp-content/uploads/2016/08/msmp_1026104.png

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.

/wp-content/uploads/2016/08/audit_log_1026146.png

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

Best Regards,

Zoltan Galik

To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. Artem Ivashkin

    Dear Zoltan,

    Is it possible to make enhancement depending on the time zone of approver?

    Example, a user from California created a request, the request selected an approver from Europe where operational day is ended. The alternative approver is placed in Japan. So the request might have been approved in the end of the day in the US by Japanese approver, but due to escalation it will be forwarded to Japanese approver after European approver (in end of the day after). The best way of this would be counting time for the escalation basing on the time zone of the current approver. In this way, the request will not run from the the European approver and US user will get the access by his operational day. Escalation will check time zone for the approver and if the time has finished for main approver in his TZ, then it will forward the request to alternative approver.

    I suppose that I made some mess in the example with US, Japan, Europe, but I hope you get the idea 🙂

    Regards,

    Artem

    (0) 

Leave a Reply