HR_DIRECT_REPORTS is an Application Package used throughout the HCM system to achieve Supervisor Data, Peer Data and Direct Report Data. The package requires that you set either a Target Position or Target Emplid/Empl Rcd and Navigation Method.
Navigation Methods:
(1) "Department Security Tree"
Returns a flat list of all employee/jobs that are accessible
to the target employee, based upon the target employee's
RowSecClass. Note that there is no concept of a reporting
hierarchy when using this method.
This method cannot be used to determine an employee/job's supervisor.
It can only be used to generate a list of "direct reports".
(2) "Supervisor Id"
Uses the "Supervisor Id" field on the Job record to determine
reporting relationships. Note that this method does not differentiate
between multiple concurrent jobs that the supervisor might hold.
(3) "Department Manager Id"
The relationship between an employee/job and a supervisor is
defined by the Department table. The "Manager Id" defined on
the Department table for the employee/job's department id is
considered to be the employee/job's supervisor.
When determining the supervisor for an employee/job, if there
is no Manager Id associated with the employee's department, then
we walk up the Department Tree to get the next highest department
in the department hierarchy that has a Manager Id assigned.
Note that this method does not fully differentiate between
multiple concurrent jobs that the supervisor might hold.
(4) "Reports To"
This method requires that Full Position Management be implemented.
The relationship between an employee/job and a supervisor is
defined by the "Reports To" position on the Job record.
When determining the supervisor for an employee/job, if there is
no incumbent in the "Reports To" position on Job, then we walk the
Position_Data table to get the incumbent in the next highest position
in the position hierarchy.
(5) "Partial Position Management / Supervisor Id"
This method is a combination of "Reports To" and "Department Manager Id".
First, the "Reports To" method is executed, and then the "Department Manager Id"
method is executed. The results of these two methods are combined, giving
preference to the "Reports To" method.
This method should be used only when Partial Position Management
has been implemented.
(6) "Partial Position Management / Department Manager Id"
This method is a combination of "Reports To" and "Supervisor Id".
First, the "Reports To" method is executed, and then the "Supervisor Id"
method is executed. The results of these two methods are combined, giving
preference to the "Reports To" method.
This method should be used only when Partial Position Management
has been implemented.
(7) "Group Id"
This method is similar to the "Department Security Tree" method in that
a flat list of employee/jobs is presented. There is no sense of a hierarchy
when using this method. The list of employee/jobs returned is simply a list
of all group members.
This method cannot be used to determine an employee/job's supervisor. It
can only be used to generate a list of "direct reports"
Below is an example of method that utilizes the HR_DIRECT_REPORTS application package to find a person's manager and then it will use the manager's position number if the current manager is not active. This is useful if you are trying to skip manager's who are on leave. If the initial call does not return an active manager it will recursively call itself until it finds a manager who is active.
method getManager
Local integer &x;
Local Rowset &results;
Local string &rsltPosition;
%This.DirRpts = create HR_DIRECT_REPORTS:DirectReports();
%This.DirRpts.AsOfDate = %This.JobRecord.EFFDT.Value;
&rsltPosition = &position;
If All(&rsltPosition) Then
%This.DirRpts.TargetPosition = &position;
Else
%This.DirRpts.TargetEmplid = %This.JobRecord.EMPLID.Value;
%This.DirRpts.TargetERN = %This.JobRecord.EMPL_RCD.Value;
End-If;
%This.DirRpts.UseDirectReportsTables = False;
%This.DirRpts.ShowName = False;
%This.DirRpts.NavigationMethod = 4;
%This.DirRpts.GetSupervisor();
&results = %This.DirRpts.Supervisor;
For &x = 1 To &results.RowCount
If &results(&x).GetRecord(1).EMPL_STATUS.Value = "A" Then
%This.managerID = &results(&x).GetRecord(1).EMPLID.Value;
&mgrFound = True;
End-If;
End-For;
If Not &mgrFound Then
&rsltPosition = &results(1).GetRecord(1).POSITION_NBR.Value;
If All(&rsltPosition) Then
&position = &rsltPosition;
%This.getManager();
End-If;
End-If;
end-method;
If you want to play around with this API, you an use the following navigation Main Menu>>Set Up HRMS>>Common Definitions>>Direct Reports for Managers>>Invoke Direct Reports API and play around with the API through an easy to use GUI.