A bill-of-materials structure can contain a variable number of levels. Tracing all records under a given record (for example, finding a manager and all subordinates, and all of their subordinates, and so on) is called an explosion of the structure for that record. Tracing all records above a given record (for example, finding an employee and manager, and the manager's manager, and so on) is called an implosion of the structure for that record.
To perform a multilevel explosion or implosion, you must maintain a stack of db-keys in order to reestablish the appropriate currencies.
Steps to Retrieve One Bill-of-Materials Level
To retrieve a manager and one level of employees, perform the following steps:
MOVE 15 TO EMP-ID-0415. OBTAIN CALC EMPLOYEE.
FIND NEXT STRUCTURE WITHIN MANAGES.
IF NOT REPORTS-TO MEMBER GO TO A100-EXIT.
OBTAIN OWNER WITHIN REPORTS-TO.
FIND CURRENT STRUCTURE.
FIND NEXT STRUCTURE WITHIN MANAGES.
Perform steps 3 through 6 iteratively until step 6 returns a status of 0307 (DB-END-OF-SET).
Example of One Bill-of-Materials Level
The figure below shows the relationship between manager and employees by showing all the employees managed by employee 15.
Steps to Retrieve Additional Levels
To retrieve an EMPLOYEE record, its manager's EMPLOYEE record, its manager's manager, and so on, perform the following steps:
MOVE 91 TO EMP-ID-0415. OBTAIN CALC EMPLOYEE.
FIND NEXT STRUCTURE WITHIN REPORTS-TO. IF ERROR-STATUS = '0307' GO TO A100-EXIT.
OBTAIN OWNER EMPLOYEE WITHIN MANAGES.
Perform steps 2 through 4 iteratively until step 2 returns a status of 0307, indicating that the REPORTS-TO set is empty.
Example of Retrieving Additional Levels
The figure below shows the relationship between an employee and all managers on the P2 project by showing the hierarchy of managers above EMPLOYEE 91 on the project.
Copyright © 2013 CA.
All rights reserved.
|
|