Tuesday, August 18, 2015

BOM Bill of Materials explosion query in BOM Oracle Apps


SELECT TRIM (RPAD (' ', LEVEL + 1, '.')) || (LEVEL) assm_level,
                 LEVEL COMPONENT_LEVEL,
                 c.component_item_id,
                 a.organization_id,
                 c.ITEM_NUM assm_ITEM_NUM,
                 c.OPERATION_SEQ_NUM assm_OPERATION_SEQ_NUM,
                 c.EFFECTIVITY_DATE assm_EFFECTIVITY_DATE,
                 c.DISABLE_DATE assm_DISABLE_DATE,
                 c.COMPONENT_QUANTITY assm_COMPONENT_QUANTITY,
                 (SELECT MAX (revision)
                    FROM mtl_item_revisions
                   WHERE     organization_id = P_ORGANIZATION_ID
                         AND EFFECTIVITY_DATE <= SYSDATE
                         AND inventory_item_id = c.COMPONENT_ITEM_ID)
                    assm_item_rev
            FROM (SELECT *
                    FROM apps.bom_inventory_components
                   WHERE TRUNC (SYSDATE) BETWEEN TRUNC (effectivity_date)
                                             AND TRUNC (
                                                    NVL (disable_date,
                                                         SYSDATE + 1))) c,
                 (SELECT *
                    FROM apps.bom_bill_of_materials
                   WHERE     alternate_bom_designator IS NULL
                         AND organization_id = P_organization_id) a
           WHERE 1 = 1 AND a.bill_sequence_id = c.bill_sequence_id
      START WITH a.assembly_item_id = P_ITEM_ID
      CONNECT BY NOCYCLE PRIOR c.component_item_id = a.assembly_item_id;

1 comment:

  1. Thanks for sharing this great information I am impressed by the information that you have on this blog. Same as your blog i found another one Oracle APEX . Actually I was looking for the same information on internet for Oracle APEX and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject, you can learn more aboutOracle APEX . By attending Oracle APEX Training.

    ReplyDelete