Oracle Ebs-sql (BOM-15): Check the multilayer BOM (with common BOM). SQL

Source: Internet
Author: User

SELECT DISTINCT

B.LVL level,

B.operation_seq_num process,

Msi1.segment1 the parent code,

Msi1.description Parent Part description,

Msi1.item_type Parent Type,

Msi1.inventory_item_status_code The parent code State,

Msi2.segment1 Sub-piece code,

Msi2.description description of child parts,

Msi2.item_type type of sub-piece,

B.component_quantity dosage,

B.component_yield_factor yield

From Inv.mtl_system_items_b Msi1,

Inv.mtl_system_items_b Msi2,

Apps. Bom_bill_of_materials BOM,

(Select Level LVL,

BIC.BILL_SEQUENCE_ID,

BIC.COMPONENT_ITEM_ID,

Bic.component_quantity,

Bic. Operation_seq_num,

Bic.component_yield_factor,

BIC.COMPONENT_SEQUENCE_ID,

Bic.item_num,

Bic.wip_supply_type,

Bic.supply_subinventory,

Bic.effectivity_date

From apps. Bom_inventory_components Bic

where Bic.disable_date is NULL

and Bic. Implementation_date is not NULL

Start with bic.bill_sequence_id in

(select NVL (common_bill_sequence_id,bill_sequence_id)

From apps. Bom_bill_of_materials Bom2,

Inv.mtl_system_items_b MSI

where bom2.assembly_item_id = msi.inventory_item_id

and bom2.organization_id = msi.organization_id

and msi.organization_id in (1,157)

and Bom2.alternate_bom_designator is null)

CONNECT by bill_sequence_id in prior

(SELECT distinct NVL (common_bill_sequence_id,bill_sequence_id)

From apps. Bom_bill_of_materials BO,

Inv.mtl_system_items_b MSI

WHERE bo.assembly_item_id = bic.component_item_id

and bo.organization_id in (1,157)

and bo.organization_id = msi.organization_id

and Bo. assembly_item_id = msi. inventory_item_id

and Bo.alternate_bom_designator is null

and Disable_date is NULL)) b

where b.bill_sequence_id = NVL (bom.common_bill_sequence_id,bom.bill_sequence_id)

and bom.organization_id in (1,157)

and bom.organization_id = msi1.organization_id

and BOM. assembly_item_id = Msi1. inventory_item_id

and bom.organization_id = msi2.organization_id

and b.component_item_id = MSI2. inventory_item_id

and Msi2.inventory_item_status_code <> ' Inactive '

ORDER BY B.LVL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.