Find all the bom items below the main item.

Hi All,

I need to find the item ids of all the bom items below the main item. Is there any way in standard for it?

For example : A → B → C-> D → E

A is the main item, which has B as bom item, Similarly item C is bom item for B.

Now when i send the item A, i need to get B,C,D,E.

Thank you.