Previous Topic: Accessing Bill-of-Materials StructuresNext Topic: Retrieving a Bill-of-Materials Structure


Storing a Bill-of-Materials Structure

To store a bill-of-materials structure in the database, perform the following steps:

  1. Establish currency at the owner record in the automatic set:
    MOVE 15 TO EMP-ID-0415.
    OBTAIN CALC EMPLOYEE.
    
  2. Initialize and store the junction record:
    PERFORM A100-INITIALIZE-STRUCTURE.
    STORE STRUCTURE.
    

    The DBMS automatically connects the STRUCTURE record to the automatic set (MANAGES); EMPLOYEE 15 is now defined as the manager in the bill-of-materials structure.

  3. Set run-unit currency at the owner record in the manual set:
    MOVE 467 TO EMP-ID-0415.
    OBTAIN CALC EMPLOYEE.
    
  4. Connect the junction record to the manual set:
    CONNECT STRUCTURE TO REPORTS-TO.
    

    The bill-of-materials structure is now complete; EMPLOYEE 467 reports to EMPLOYEE 15.

Example of Storing a Bill-of-Materials Structure

The figure below shows the steps and currencies involved in storing an occurrence of a bill-of-materials structure.

To define EMPLOYEE 15 as the manager of EMPLOYEE 467, store and connect a STRUCTURE record as a member of the two EMPLOYEE records: EMPLOYEE 15 in the MANAGES set and EMPLOYEE 467 in the REPORTS-TO set.