Skip to Content
Author's profile photo Former Member

Fetching N Level Managers

Function module ZHR0275_DYN_MGR_FETCH is created the logic for the same is

Function Group – ZHR0275_MANAGER_FETCH

Import: OBJID, OTYPE, LEVEL

Tables: Output TYPE ZH0275_T_DYN_MGR

1.     A standard FM RH_GET_LEADING_POSITION is called in a loop whose number of    iterations is based on input parameter LEVEL.

2.     This Function module returns the top up position as output in the form of a table called leading_position of type hrobject

3.     Outputted position is checked for the assigned holder (Employee), if found then same is sent to the output of the FM

4.     If not found then position is sent to the output of the FM.

5.     A logic is written with the FM to get the description for the outputted OBJID, If it has otype ‘P’ then data is fetched from PA0002 else from HRP1000 table.

Following table structure was created.

ZH0275_DYN_MGR

LEVEL                CHAR2

OTYPE               OTYPE

OBJID               HROBJID

DESC                CHAR80

ZH0275_T_DYN_MGR

It is table type of ZH0275_DYN_MGR hence has same structure.

Program Code:

ZHR0275_DYN_MGR_FETCH

     Program code is attached in the document.

    Output Details:-

OM.png

This is OM Structure of the company, Employee 6204 to a position which is not held by anyone presently, Blank position Reports to 6228 and 6228 to 50050.

Output of the function module is as follows:

Input:

/wp-content/uploads/2015/01/output_619222.png

OBJID Field can have value for Employee Number or Position.

OTYPE field can have value as ‘S’ for Position and ‘P’ for Employee.

LEVEL field can have any numeral value up to 99, it determines the top up movement in the organization hierarchical structure.

Output:

/wp-content/uploads/2015/01/op_619223.png

Column wise description

LEVEL This column provides the Manager’s Level above requested employee / position. Immediate manager will have Level as ‘1’ like wise.

OTYPE This field can have two values either P or S, If returned value is P that means top up manager exist, if S is returned that means a top up position do exists over the employee but currently it is unassigned or vacant.

OBJID This field will contain Employee number or Position number for the top up position

Description This field will either display Employee name or vacant position description for the top up manager.

If no top up position exists over a particular position then program will return blank lines. In illustrated example Level 4 is top of the OM structure for the inputted employee, If function is executed for 10 levels then output will be like,

/wp-content/uploads/2015/01/final_619224.png

Assigned Tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      helpful thanks

      Author's profile photo Former Member
      Former Member

      Very helpful ..Especially for those who do not much of database knowledge related to HR Org structure.

      Author's profile photo Ramesh Palle
      Ramesh Palle

      Very useful document. Thanks Chirayu.

      Author's profile photo Rajveer Singh
      Rajveer Singh

      Hi, please can you share the code also as i cannot see the the attached document.

      Author's profile photo Zarina Begum
      Zarina Begum

      Hi

      Very useful blog, thank you for sharing .Where is the attachment?

      Could you please email me to zarina.bgum@gmail.com