Forum Discussion

horsebaker's avatar
horsebaker
Regular Visitor
1 year ago

Creating recursive parent/child relationship

Dear esteemed forum.

This is an ERP structure problem which I am trying to solve. 
I have materials, which are structured as multilevel parent/child relationship (Bill of materials). 

There are 2 tables with the following relevant columns
T1:
Material 
Bill of material 
Bill of material Level (0 to X) 

T2: 
Bill of material Component
Bill of material 

Note: All columns are "many" and "Bill of material component" could be blank with established relationship. 

Now, T2 BOM component is considered child towards T1 Material, thus, first level of parent-child I can build easily. But, since the levels of Bill of material could be many (10-20 levels), I do not fully understand how to model this in a recursive way.  (Preferably something that can be used in a matrix). BOM level is there, sure, but I am not sure how it could be used in this scenario. 

If there's anyone out there with a simplistic view to this problem it would be incredibly helpful!

Kind regards,
Horsebaker