Human Capital Management Blogs by SAP
Get insider info on SAP SuccessFactors HCM suite for core HR and payroll, time and attendance, talent management, employee experience management, and more in this SAP blog.
cancel
Showing results for 
Search instead for 
Did you mean: 
NeeleshKamath
Product and Topic Expert
Product and Topic Expert

We often receive the question to have a workflow based on different time valuation results. Most of them might not be aware that the time sheet workflow does not only handle simple cases like triggering a workflow to a manager, HR but can now also handle complex situations where you decide which workflow should be triggered based on a time valuation result like Overtime values


In this sample case, let me take an example of the following scenario




  •  0 overtime hours --> should trigger no workflow

  •             1-5 overtime hours --> manager approval

  •             6-20 overtime hours --> manager and HR


To handle, this I will make use of a sample duration-based time recording profile (DUR_POS) for illustration purposes. Please note, you can make use of any time recording profiles as long as you capture the overtime values in a time type group as part of the time valuation that you have

Sample Time Recording Profile



In the above time recording profile, we are basically splitting Recorded time in Public Holiday  group and then in Non PH Group.

In the final valuation we take the recorded hours on working days and compare it with scheduled working day for that day. Anything in access is moved to a time type group “OT1.5_WK”


Note: Again, This is just a sample time valuation. Your OT calculation could differ from mine. The basic idea is to capture OT , be it on a Public Holiday, Non-working Day (Sun, Sat) , working Day etc in a time type group. As an example, for demonstration, I am taking OT hours which are in Non-Public Holidays, but you could calculate for a full week or so.

Workflow Rule


Construct a workflow rule like below and attach it to Employee Time Sheet Object Definition



The Rule Does the following

  • The rule function “Get Number of Valuated Hours For Time Sheet ()” uses Time type group as a parameter. The Time Type Group OT1.5_WK is used here. The will retrieve the OT value from time valuation in time sheet when Workflow is submitted

  • Based on the value of this time type group appropriate workflow is triggered i.e. either to manager or manager & HR etc

  • The other conditions checks if the action is submit and current approval status is “To be Submitted “.

  • Further conditions can be added like, legal entity, Time Recording profiles,  Employee Group/Class etc if you further want to differentiate Overtime calculation and values for different employee groups


 

Testing


Case 1)

For a particular week, the OT value is 6 hours


So, Workflow triggered is “Manager and HR”


Case 2)

OT is 2 hours


For 2 hours, workflow is triggered to manager only


 

Some limitations where this will not work:

  • If your time type group (TTG) is a time collector, this will not work. Ensure that your TTG is not a collector

  • This will not work if you are using time type group value in rule which is part of time valuation "Filter Input groups ...." Ensure you use the TTG from valuation like "Aggregate and split " or "Deduct groups from input groups..."


 

With this, I believe you can make use of these concepts to derive a workflow based on any time valuation result. Hope this helps in your implementation projects

 

Best Regards

Neelesh

Product Management, SAP Best practices for SuccessFactors
13 Comments
mahmoudward
Advisor
Advisor
thanks a lot neelesh.kamath very fruitful blog
hamcle
Explorer
Very informative blog, thanks.

That workflow - is that functionality from within SuccessFactors or SAP Cloud Workflow?

https://blogs.sap.com/2017/08/19/extend-successfactors-with-sap-cloud-platform-workflow-part-12/

Thanks, Clemens
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Thanks Mahmoud
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Thanks, Clemens. This is Successfactors workflow
PetraRana
Participant
0 Kudos
Hi Neelesh,

thank you for the above solution. Do I understand correctly that this solution does not require Time Tracking Licenses? Thank you very much.

Kind Regards,

Petra
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
Hi Petra

Thanks for the feedback.

Yes this rule function is available for normal time sheet as well

Best Regards

Neelesh
PinarK
Discoverer
0 Kudos
Hello Neelesh,

Trying to configure above solution and having difficulties on the business rule on get number of valuated hours for time sheet block.

I'm able to see in the timesheet UI via trace button that the time time groups' values are different than Zero, but in the rule trace logs, following to function "'getNumberOfValuatedHoursForTimeSheet' it fails and compares Zero with the threshold number in the rule. (So get number function's result comes as zero).

So my question is, is the time type group assigned to the business rule a time collector? Would you be able to advise how to resolve and get the number of valuated hours? Should the time type group be configured in a certain way?

Thanks in advance.

Best regards,

Pinar.
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Pinar

Sorry for late response as I was on vacation last week.

For me, it works with normal time type groups which is OT (with calculated time as category). I dont have a collector.

Best Regards

Neelesh
yongqingliu
Explorer
0 Kudos

May I know if it possible to trigger a different workflow if any overtime of more than 3 hours in any one day in a week?

 MTWTFSSTrigger a different workflow?
Week1232 222N
Week222422  Y
Week3 44    Y

Best Regards,

Kathy

NevenaPetrova
Explorer
0 Kudos

Hi ,

 

I configured the rule , but it is not working for me.

What can be the reason?

 

BR,

Nevena

NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Nevena

You can check via rule trace if your workflow is tuggered and set

Also this would not work in below cases

Some limitations where this will not work:

  • If your time type group (TTG) is a time collector, this will not work. Ensure that your TTG is not a collector

 

  • This will not work if you are using time type group value in rule which is part of time valuation "Filter Input groups ...." Ensure you use the TTG from valuation like "Aggregate and split " or "Deduct groups from input groups..."

 

BR

Neelesh

NevenaPetrova
Explorer
0 Kudos

Hi ,

 

Thank you for the answer,

I saw the limitations, so all is covered there.

But every try in the rule is showing in the Rule trace that the calculation in the Valuation time type group is always zero, although there is a result on the Time sheet.

Do you have an idea what should be the problem?

 

Thank you,

Nevena

NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Nevena

I am not sure what is the problem in your case if you have followed all the steps.

I tried it in my preview instance today and it worked for me

The below is my config FYI and also the rule trace

In rule trace you can see that I have a positive value from time type group

Workflow Rule :

NeeleshKamath_0-1713947928054.png

Attached to onSave

NeeleshKamath_1-1713947970763.png

Time valuation group has 9 hours in time sheet

NeeleshKamath_2-1713948019385.png

 

Its using aggregate and split time val as I mentioned in my points

NeeleshKamath_3-1713948074157.png

 

Rule trace and workflow is triggered with status "To Be Approved" See above and below

NeeleshKamath_4-1713948137314.png

As you can see from above,  it works if things are configured in above ways.

I think this is a comprehensive Info that I can provide

Please check if your configurations are on similar lines

Kind Regards

Neelesh