Using the HR organizational structure in workflows
This is a little follow up for this Whether or not to use HR organizational module in workflow rules?. In it I mentioned in it that there are problems you will have to overcome if you decide to use the HR organizational module, for example for approving an employee absence, course etc. Here are a few attempts to solve those problems:
The first solution is to go up the organizational tree. There is a flag in the T77S0 table (WFLOW VAPOS) which will cause the standard rules (168) to go up the org structure if the position is empty. This will help in some cases, but is not a perfect solution since the higher level might not want to handle workflows of lower level employees/processes see for example the 3-rd story in A few workflow stories Or just have too many employees to handle in this case (let say 2 lower level managers are missing in the same time).
I recommend using a responsibility type rule based on organizational unit, so you can direct the workflow of employees assigned to this unit to a specific user. The rule is based on the org unit key and a function module based rule which calls it.
Org unit key 50001234 for example will be assigned to user A as the responsibly holder bypassing the regular org structure and sending all workitem that should go to the manager of 50001234 to user A if no user is assigned to the rule in the responsibility rule get the org unit manager using RH_GET_LEADER function module.
This is not designed to bypass an HR admin but to solve situations where:
- The manager is not there, for example he/she retired and a formal replacement has not being selected yet, in this case this is a temporary solution and new manager will be selected so the time of the assignment should be limited since a new employee will be selected as manger in the future.
- High ranking Organizational units, let’s say directly under the CEO, for example the company’s legal advisor usually there is a specific employee which handles HR requests related to them.
Finding a specific level in the org structure
Another common issue when creating HR workflows is that you require a specific level in the organizational structure, for example department manager.
There are usually definitions for this in the HR org structure made by the HR team, for example a relationship between the position/org unit and a customized object defined for this, is this case there should be an evaluation path with leads to it that you can use using function module RH_GET_STRUCTURE.
It is a good idea is you are working with HR workflows that you understand the concept see https://help.sap.com/saphelp_erp60_sp/helpdata/en/c5/e4b2c8453d11d189430000e829fbbd/frameset.htm for more details – did you know that the workflow responsibility rules use an evaluation path following the relationships from org. unit to position, person and user to find the workitem agents?
It is also important to pay attention that you need to handle end cases, for example no department manager since employee’s direct org. unit is a division.
Using the HR evaluation paths is also an option for maintaining replacement approvers by creating a z relationship linked to the org unit and the replacing manager and changing the workflow rules to follow a relevant evaluation path.
An important point to remember is that a lot of times the manger will have a personal assistant and mails will have to go to them in addition or instead of the manager. Again the HCM evaluation paths are the most likely solution to help you find them.
It is also good to know that the employee’s mail is maintained in infotype 105, subtype 10. For example to inform them about a promotion approval, since the employee might not be a user and the workflow was started by the HR team and approved by the manager. You need the employee’s mail to send the congratulation mail.