SAP Knowledge Base Article - Public

3323455 - Rest Rule configuration sample

Symptom

As of 1H 2023 (2305) release, it is possible to set up rest rules for employees, so that there can be alert raised when the rest period (gap) of the recorded working time between two days is less than a required minimum length.

This KBA provides a sample rest rule configuration.

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

SAP SuccessFactors Time Tracking

Resolution

The What's New Viewer Rest Rules and Implementation guide page Configuring Rest Rules can be referred to for overall information on this new feature.

It is needed to have SAP SuccessFactors Time Tracking license together with time container feature and rest rule feature activated as prerequisite.

It requires five time valuations to achieve the rest rule function. Below are sample time valuations and explanations on how they achieve the rest rule function.

  1. Persist recorded working time daily.
    1. Create a Time Container BLUE_TimeContainerRestPeriod to persist the recorded time for each day.
      Note:
      Time Category = Calculated Time
      Time Container Type = Yes
    2. Create an Aggregate Input Groups and Split time valuation BLUE_PersistingDailyWorkingTimeforRestRules to move the recorded time to time container BLUE_TimeContainerRestPeriod (created in 1.a)
      Note:
      Valuation Method = Valuate Per Day
      Threshold Type = Fixed Value
      Threshold Value = 0

      Then the recorded time will all be moved to and persisted in the time container BLUE_TimeContainerRestPeriod (created in 1.a) for each day.
  2. Define the rest rule period.
    This period will be used later to calculate the gaps between days.
    1. Create a time type group BLUE_RecordedWorkingTimePerDay to read data from time container BLUE_TimeContainerRestPeriod (created in 1.a), so that the data can be used in time valuation.
      Note
      Time Category = Time Container
      Time Container Group = BLUE_TimeContainerRestPeriod (created in 1.a)
      By above setting, the time type group BLUE_RecordedWorkingTimePerDay retrieves data from time container BLUE_TimeContainerRestPeriod (created in 1.a) to make the data available for time valuation.
    2. Create a time type group BLUE_PeriodforGapDeduction to hold the overall rest period.
      Note:
      Time Category = Calculated Time
      Time Pay Type = No
      UI Component = No
      Time Collector Type = No
      Time Container Type =No
    3. Create a Create Time Record time valuation BLUE_CreateRecordTimeforGapDeduction to generate the whole rest period record.
      Note:
      Valuation Method = Valuate Whole Sheet 
      Time Record Type = Clock Time Record (The Time Record Type field may not show because its Visibility is Not Visible by default. You do not have to make it visible to fill. Currently Clock Time Record will be defaulted directly for this field if it is not visible.)
      Start Type = Time Type Group
      Start Time Type Group = BLUE_RecordedWorkingTimePerDay (created in 2.a)
      Start Time Type Group Attribute = Earliest Start Time
      End Type = Time Type Group
      End Time Type Group = BLUE_RecordedWorkingTimePerDay (created in 2.a)
      End Time Type Group Attribute = Latest End Time
      Time Type Group Above = BLUE_PeriodforGapDeduction (created in 2.b)


      Then the time type group BLUE_PeriodforGapDeduction (created in 2.b) will have an overall rest period, from which you can calculate the gaps by deducting the daily recorded time held in BLUE_RecordedWorkingTimePerDay (created in 2.a).
  3. Calculate gaps between working days.
    1. Create time type group BLUE_RestGaps to hold the gaps to be calculated.
      Note:
      Time Category = Calculated Time
      Time Pay Type = No
      UI Component = No
      Time Collector Type = No
      Time Container Type =No
    2. Create a Deduct Group from Input Groups BLUE_ToCalculateGap time valuation to calculate the gaps between days.
      Note:
      Valuation Method = Valuate Whole Sheet
      Deduction Group = BLUE_RecordedWorkingTimePerDay (created in 2.a)
      Input Time Type Group = BLUE_PeriodforGapDeduction (created in 2.b)
      Time Type Group Above = BLUE_RestGaps (created in 3.a)

      Then the gaps between days are calculated and moved to time type group BLUE_RestGaps (created in 3.a).
  4. Define the minimum rest period. 
    1. Create time type group BLUE_MinRestPeriodTTG to hold the minimum rest period. 
      Note:
      Time Category = Calculated Time
      Time Pay Type = No
      UI Component = No
      Time Collector Type = No
      Time Container Type =No
    2. Create a Create Time Record time valuation BLUE_MinRestPeriodDef to define the minimum rest period, which will be used for comparison between gaps calculated and minimum rest period.
      Note:
      Valuation Method = Valuate Per Day
      Time Record Type = Clock Time Record (The Time Record Type field may not show because its Visibility is Not Visible by default. You do not have to make it visible to fill. Currently Clock Time Record will be defaulted directly for this field if it is not visible.)
      Start Type = Fixed Clock Time Value
      End Type = Fixed Clock Time Value
      For Start Time and End Time, it is needed to set them so that End Time - Start Time is the minimum rest period requested.
      For example, if minimum rest period is 12 hours, then you can set Start Time = 12:00:00 AM, End Time = 12:00:00 PM. Or you can also set Start Time = 4:00:00 AM, End Time = 4:00:00 PM. 
      It is needed to make sure the duration between the Start Time and End Time is the minimum rest period requested.

      Then time type group BLUE_MinRestPeriodTTG (created in 4.a) holds the minimum rest period defined.
  5. Compare the gaps with the minimum rest period to raise alert when the gap is less than the rest period.
    Attention! Error is not allowed, you can only raise Alert and Warning!
    1. Create time type group BLUE_GapLessThanMin to hold the gaps that is less than the required minimum rest period.
      Note
      Time Category = Calculated Time
      Time Pay Type = No
      UI Component = No
      Time Collector Type = No
      Time Container Type =No
    2. Create a Filter Single Records from Input Groups time valuation to filter out the gap that is less than minimum rest period.
      Note:
      Valuation Method = Valuate Per Day
      Message Flag = Raise Message on Time Type Group Below
      Message Type = Alert and Warning
      Comparison Group = BLUE_MinRestPeriodTTG (created in 4.a)
      Comparison Group Attribute = Duration
      Input Time Type Group = BLUE_RestGaps (created in 3.a)
      Input Group Records Attribute = Duration
      Time Type Group Below = BLUE_GapLessThanMin (created in 5.a)
      Comparison Operator = Less than (<) or Less than or Equal To (<=) depending on whether you want to raise alert when the gap equals the minimum rest period exactly.

      When the gap duration in BLUE_RestGaps (created in 3.a) is less than the minimum rest period defined in time type group BLUE_MinRestPeriodTTG (created in 4.a), BLUE_RestGaps (created in 3.a) will be moved to time type group below BLUE_GapLessThanMin (created in 5.a).
      And alert is raised on time type group below BLUE_GapLessThanMin (created in 5.a
      *Currently Error message type is not supported with time valuation that is influenced by time container.

After above five time valuations are configured, they need to be included in one time recording profile. For example, like below.

After the time recording profile is assigned to an employee, in time sheet, it works like below.
On Apr. 10, the employee ends working at 5:00 AM +1 day, it means the actual ending time of attendance is 5:00 AM on Apr. 11.

And then on Apr. 11, the attendance recording starts from 4:56 PM.

So the rest period between Apr. 10 and 11 is 11 hours and 56 minutes, in other words 716 minutes. This is less than the 12 hours minimum gap defined in Step 4. So based on the configuration in Step 5, alert will be raised. 

In Admin Alerts, please search for Admin Alert Type Time Valuation, then you will see the alert.

Note: Currently the Value can only show in manner of minutes.

See Also

3326953 - Start of Time Record and End of Time Record sections are missing when configuring a Create Time Record time valuation.

3326960 - Time Container Group section missing when creating a Time Container category time type group

Keywords

TIM-34867, time container, feature, rest, period, create, time, record, legal, minimum, rule, gap , KBA , LOD-SF-TTR , Time Tracking , How To

Product

SAP SuccessFactors HCM suite all versions ; SAP SuccessFactors Time Tracking all versions