586: eng_to_bom CONSTANT NUMBER := 4;
587: model CONSTANT NUMBER := 1;
588: option_class CONSTANT NUMBER := 2;
589: planning CONSTANT NUMBER := 3;
590: STANDARD CONSTANT NUMBER := 4;
591: phantom CONSTANT NUMBER := 6;
592: x_from_sequence_id NUMBER := from_sequence_id;
593: x_from_org_id NUMBER := from_org_id;
594: to_rtg_seq_id NUMBER;
4258: get_current_item_rev (bcb.component_item_id,
4259: from_org_id,
4260: rev_date
4261: ),
4262: GET_MESSAGE ('BOM_COPY_ERR_COMP_NOT_STANDARD',
4263: bom_globals.get_item_name(bcb.component_item_id, from_org_id),
4264: bom_globals.get_item_name(to_item_id, from_org_id)
4265: ),
4266: 'BOM_COPY',
5167: -- Ensure the following rule matrix is observed
5168: --
5169: -- Y = Allowed N = Not Allowed
5170: -- P = Must be Phantom O = Must be Optional
5171: -- Configured items are ATO standard items that have a base item id.
5172: -- ATO items have Replenish to Order flags set to "Y".
5173: -- PTO items have Pick Component flags set to "Y".
5174: --
5175: -- Parent
5178: -- Planning | N N N N N N N
5179: -- Configured | Y Y Y Y Y Y Y
5180: -- ATO Model | P P P N P P N
5181: -- ATO Opt Class | P P P N N N N
5182: -- ATO Standard | Y Y Y Y O O N
5183: -- PTO Model | N N N N P P N
5184: -- PTO Opt Class | N N N N P P N
5185: -- PTO Standard | N N N N Y Y Y
5186: --
5181: -- ATO Opt Class | P P P N N N N
5182: -- ATO Standard | Y Y Y Y O O N
5183: -- PTO Model | N N N N P P N
5184: -- PTO Opt Class | N N N N P P N
5185: -- PTO Standard | N N N N Y Y Y
5186: --
5187: --
5188: -- Log errors for multi level structure copy.
5189: IF specific_copy_flag = 'Y'
5240: AND msib2.organization_id = to_org_id
5241: AND msib1.inventory_item_id = bcb.component_item_id
5242: AND msib1.organization_id = to_org_id;
5243:
5244: -- Standard bill without base model cannot have Option class or Model components.
5245: INSERT INTO mtl_interface_errors
5246: (unique_id,
5247: organization_id,
5248: transaction_id,
5286: mtl_system_items_b msib1,
5287: mtl_system_items_b msib2
5288: WHERE bcb.bill_sequence_id = to_sequence_id
5289: AND (msib1.bom_item_type IN (model, option_class)
5290: AND msib2.bom_item_type = STANDARD
5291: AND msib2.base_item_id IS NULL
5292: )
5293: AND msib2.inventory_item_id = to_item_id
5294: AND msib2.organization_id = to_org_id
5351: AND msib2.organization_id = to_org_id
5352: AND msib1.inventory_item_id = bcb.component_item_id
5353: AND msib1.organization_id = to_org_id;
5354:
5355: -- No ATO standard items for PTO standard bills
5356: INSERT INTO mtl_interface_errors
5357: (unique_id,
5358: organization_id,
5359: transaction_id,
5397: mtl_system_items_b msib1, -- Comp
5398: mtl_system_items_b msib2 -- Structure
5399: WHERE bcb.bill_sequence_id = to_sequence_id
5400: AND (msib1.replenish_to_order_flag = 'Y'
5401: AND msib1.bom_item_type = STANDARD
5402: AND msib2.pick_components_flag = 'Y'
5403: AND msib2.bom_item_type = STANDARD
5404: )
5405: AND msib2.inventory_item_id = to_item_id
5399: WHERE bcb.bill_sequence_id = to_sequence_id
5400: AND (msib1.replenish_to_order_flag = 'Y'
5401: AND msib1.bom_item_type = STANDARD
5402: AND msib2.pick_components_flag = 'Y'
5403: AND msib2.bom_item_type = STANDARD
5404: )
5405: AND msib2.inventory_item_id = to_item_id
5406: AND msib2.organization_id = to_org_id
5407: AND msib1.inventory_item_id = bcb.component_item_id
5474: WHERE ((msi2.bom_item_type = planning
5475: AND msi1.bom_item_type <> planning
5476: )
5477: OR (msi2.bom_item_type IN (model, option_class)
5478: AND msi1.bom_item_type = STANDARD
5479: AND msi1.base_item_id IS NULL
5480: )
5481: OR (msi2.replenish_to_order_flag = 'Y'
5482: AND msi2.bom_item_type = option_class
5485: OR (
5486: (nvl(fnd_profile.value('BOM:MANDATORY_ATO_IN_PTO'), 2) <> 1)
5487: and
5488: (msi2.replenish_to_order_flag = 'Y'
5489: AND msi2.bom_item_type = STANDARD
5490: AND msi1.pick_components_flag = 'Y'
5491: AND msi1.bom_item_type = STANDARD
5492: )
5493: )--modified for BOM ER 9904085
5487: and
5488: (msi2.replenish_to_order_flag = 'Y'
5489: AND msi2.bom_item_type = STANDARD
5490: AND msi1.pick_components_flag = 'Y'
5491: AND msi1.bom_item_type = STANDARD
5492: )
5493: )--modified for BOM ER 9904085
5494: OR (msi2.pick_components_flag = 'Y'
5495: AND msi1.replenish_to_order_flag = 'Y'
5531: FROM mtl_system_items msi1, -- assembly
5532: mtl_system_items msi2 -- component
5533: WHERE msi2.base_item_id IS NULL
5534: AND msi2.replenish_to_order_flag = 'Y'
5535: AND msi2.bom_item_type = STANDARD
5536: AND msi1.pick_components_flag = 'Y'
5537: AND msi1.bom_item_type = model
5538: AND msi2.inventory_item_id = bic.component_item_id
5539: AND msi2.organization_id = to_org_id
5549: FROM mtl_system_items msi1, -- assembly
5550: mtl_system_items msi2 -- component
5551: WHERE msi2.base_item_id IS NULL
5552: AND msi2.replenish_to_order_flag = 'Y'
5553: AND msi2.bom_item_type = STANDARD
5554: AND msi1.pick_components_flag = 'Y'
5555: AND msi1.bom_item_type = option_class
5556: AND msi2.inventory_item_id = bic.component_item_id
5557: AND msi2.organization_id = to_org_id
7243: eng_to_bom CONSTANT NUMBER := 4;
7244: model CONSTANT NUMBER := 1;
7245: option_class CONSTANT NUMBER := 2;
7246: planning CONSTANT NUMBER := 3;
7247: STANDARD CONSTANT NUMBER := 4;
7248: phantom CONSTANT NUMBER := 6;
7249: x_from_sequence_id NUMBER := from_sequence_id;
7250: x_from_org_id NUMBER := from_org_id;
7251: to_rtg_seq_id NUMBER;
10267: get_current_item_rev (bcb.component_item_id,
10268: from_org_id,
10269: rev_date
10270: ),
10271: GET_MESSAGE ('BOM_COPY_ERR_COMP_NOT_STANDARD',
10272: bom_globals.get_item_name(bcb.component_item_id, from_org_id),
10273: bom_globals.get_item_name(to_item_id, from_org_id)
10274: ),
10275: 'BOM_COPY',
10896: -- Ensure the following rule matrix is observed
10897: --
10898: -- Y = Allowed N = Not Allowed
10899: -- P = Must be Phantom O = Must be Optional
10900: -- Configured items are ATO standard items that have a base item id.
10901: -- ATO items have Replenish to Order flags set to "Y".
10902: -- PTO items have Pick Component flags set to "Y".
10903: --
10904: -- Parent
10907: -- Planning | N N N N N N N
10908: -- Configured | Y Y Y Y Y Y Y
10909: -- ATO Model | P P P N P P N
10910: -- ATO Opt Class | P P P N N N N
10911: -- ATO Standard | Y Y Y Y O O N
10912: -- PTO Model | N N N N P P N
10913: -- PTO Opt Class | N N N N P P N
10914: -- PTO Standard | N N N N Y Y Y
10915: --
10910: -- ATO Opt Class | P P P N N N N
10911: -- ATO Standard | Y Y Y Y O O N
10912: -- PTO Model | N N N N P P N
10913: -- PTO Opt Class | N N N N P P N
10914: -- PTO Standard | N N N N Y Y Y
10915: --
10916: --
10917: -- Log errors for multi level structure copy.
10918: -- Planning bill should contain only planning components
10968: AND msib1.inventory_item_id = bcb.component_item_id
10969: AND msib1.organization_id = to_org_id
10970: AND bcb.revised_item_sequence_id = rev_item_seq_id;
10971:
10972: -- Standard bill without base model cannot have Option class or Model components.
10973: INSERT INTO mtl_interface_errors
10974: (unique_id,
10975: organization_id,
10976: transaction_id,
11014: mtl_system_items_b msib1,
11015: mtl_system_items_b msib2
11016: WHERE bcb.bill_sequence_id = to_sequence_id
11017: AND (msib1.bom_item_type IN (model, option_class)
11018: AND msib2.bom_item_type = STANDARD
11019: AND msib2.base_item_id IS NULL
11020: )
11021: AND msib2.inventory_item_id = to_item_id
11022: AND msib2.organization_id = to_org_id
11078: AND msib1.inventory_item_id = bcb.component_item_id
11079: AND msib1.organization_id = to_org_id
11080: AND bcb.revised_item_sequence_id = rev_item_seq_id;
11081:
11082: -- No ATO standard items for PTO standard bills
11083: INSERT INTO mtl_interface_errors
11084: (unique_id,
11085: organization_id,
11086: transaction_id,
11124: mtl_system_items_b msib1, -- Comp
11125: mtl_system_items_b msib2 -- Structure
11126: WHERE bcb.bill_sequence_id = to_sequence_id
11127: AND (msib1.replenish_to_order_flag = 'Y'
11128: AND msib1.bom_item_type = STANDARD
11129: AND msib2.pick_components_flag = 'Y'
11130: AND msib2.bom_item_type = STANDARD
11131: )
11132: AND msib2.inventory_item_id = to_item_id
11126: WHERE bcb.bill_sequence_id = to_sequence_id
11127: AND (msib1.replenish_to_order_flag = 'Y'
11128: AND msib1.bom_item_type = STANDARD
11129: AND msib2.pick_components_flag = 'Y'
11130: AND msib2.bom_item_type = STANDARD
11131: )
11132: AND msib2.inventory_item_id = to_item_id
11133: AND msib2.organization_id = to_org_id
11134: AND msib1.inventory_item_id = bcb.component_item_id
11200: WHERE ((msi2.bom_item_type = planning
11201: AND msi1.bom_item_type <> planning
11202: )
11203: OR (msi2.bom_item_type IN (model, option_class)
11204: AND msi1.bom_item_type = STANDARD
11205: AND msi1.base_item_id IS NULL
11206: )
11207: OR (msi2.replenish_to_order_flag = 'Y'
11208: AND msi2.bom_item_type = option_class
11208: AND msi2.bom_item_type = option_class
11209: AND msi1.pick_components_flag = 'Y'
11210: )
11211: OR (msi2.replenish_to_order_flag = 'Y'
11212: AND msi2.bom_item_type = STANDARD
11213: AND msi1.pick_components_flag = 'Y'
11214: AND msi1.bom_item_type = STANDARD
11215: )
11216: OR (msi2.pick_components_flag = 'Y'
11210: )
11211: OR (msi2.replenish_to_order_flag = 'Y'
11212: AND msi2.bom_item_type = STANDARD
11213: AND msi1.pick_components_flag = 'Y'
11214: AND msi1.bom_item_type = STANDARD
11215: )
11216: OR (msi2.pick_components_flag = 'Y'
11217: AND msi1.replenish_to_order_flag = 'Y'
11218: )
11254: FROM mtl_system_items msi1, -- assembly
11255: mtl_system_items msi2 -- component
11256: WHERE msi2.base_item_id IS NULL
11257: AND msi2.replenish_to_order_flag = 'Y'
11258: AND msi2.bom_item_type = STANDARD
11259: AND msi1.pick_components_flag = 'Y'
11260: AND msi1.bom_item_type IN (model, option_class)
11261: AND msi2.inventory_item_id = bic.component_item_id
11262: AND msi2.organization_id = to_org_id