Discussion:
Recursive BOM level search
(too old to reply)
2007-05-03 11:34:03 UTC
Permalink
Problem:
Step (1): For an item Id in the ‘Planned order’ form, find the BOM of the
item Id on the ReqPO line (ReqPO.ItemBOMId). Find each component of that BOM.
Find the available physical on hand inventory of the component using
(InventSum.AvailPhysical() – no issues in this)
Step (2): Repeat the above step for each component in the BOM. However, if
the component is a Phantom type BOM item, repeat above steps again.

I think there must be a function in the standard Axapta that will make a
recursive call to the next BOM level (and then calculate the physical on
hand).
--
Vishal
ACO
2007-05-03 12:00:00 UTC
Permalink
There would have to be at least three variations to handle "in order," "pre
order," and "post order" tree traversal methods. There are situations where
physical versus available versus planned versus on order and every
permutation thereof is desired as a return. Since it is (would be) a
recursive routine (i.e., it calls itself), how would one interrupt the flow
to obtain data throughout the tree traversal?

I believe this one is a "roll-your-own".
Post by
Step (1): For an item Id in the ‘Planned order’ form, find the BOM of the
item Id on the ReqPO line (ReqPO.ItemBOMId). Find each component of that BOM.
Find the available physical on hand inventory of the component using
(InventSum.AvailPhysical() – no issues in this)
Step (2): Repeat the above step for each component in the BOM. However, if
the component is a Phantom type BOM item, repeat above steps again.
I think there must be a function in the standard Axapta that will make a
recursive call to the next BOM level (and then calculate the physical on
hand).
--
Vishal
2007-05-07 06:43:00 UTC
Permalink
I got the solution to this problem. There is a standard functionality to get
the "Max Report As Finished" in the InventTable (BOM Button). I followed the
same logic to check how many BOMs we can create for this. One thing I missed
to tell earlier (and that too was not known to me at that time) is we have to
traverse the BOM up to one level only as the standard is doing in this
functionality for "Max Report As Finished".
--
Vishal
Technical consultant Microsoft Axapta
Post by ACO
There would have to be at least three variations to handle "in order," "pre
order," and "post order" tree traversal methods. There are situations where
physical versus available versus planned versus on order and every
permutation thereof is desired as a return. Since it is (would be) a
recursive routine (i.e., it calls itself), how would one interrupt the flow
to obtain data throughout the tree traversal?
I believe this one is a "roll-your-own".
Post by
Step (1): For an item Id in the ‘Planned order’ form, find the BOM of the
item Id on the ReqPO line (ReqPO.ItemBOMId). Find each component of that BOM.
Find the available physical on hand inventory of the component using
(InventSum.AvailPhysical() – no issues in this)
Step (2): Repeat the above step for each component in the BOM. However, if
the component is a Phantom type BOM item, repeat above steps again.
I think there must be a function in the standard Axapta that will make a
recursive call to the next BOM level (and then calculate the physical on
hand).
--
Vishal
Loading...