12: return 0;
13: end if;
14:
15: SELECT count(bill_sequence_id) INTO l_first_level_count
16: FROM bom_inventory_components
17: WHERE bill_sequence_id = p_cbill_sequence_id
18: AND implementation_date is NOT NULL;
19:
20: RETURN l_first_level_count;
41: END get_change_order_count;
42: -- -----------------------------------------------------------------------
43: FUNCTION get_second_level_components
44: (p_component_item_id IN
45: BOM_INVENTORY_COMPONENTS.component_item_id%TYPE,
46: p_organization_id IN NUMBER,
47: p_alternate_bom_designator IN VARCHAR2)
48: RETURN NUMBER is
49: l_component_count NUMBER := 0;
55: end if;
56:
57: SELECT count(*) into l_component_count
58: FROM
59: BOM_INVENTORY_COMPONENTS bomc
60: WHERE
61: implementation_date is NOT NULL
62: AND bomc.bill_sequence_id IN -- For Bug Fix . 2832017
63: (SELECT common_bill_sequence_id
188: AND NVL(brd.acd_type, X_Add) = X_Add
189: UNION
190: SELECT brd.component_reference_designator
191: FROM bom_reference_designators brd,
192: bom_inventory_components bic
193: WHERE DECODE(bic.old_component_sequence_id, NULL,
194: bic.component_sequence_id,
195: bic.old_component_sequence_id) = p_old_component_sequence_id
196: AND bic.component_sequence_id = brd.component_sequence_id
198: AND brd.acd_type = X_Add
199: MINUS
200: SELECT brd.component_reference_designator
201: FROM bom_reference_designators brd,
202: bom_inventory_components bic
203: WHERE DECODE(bic.old_component_sequence_id, NULL,
204: bic.component_sequence_id,
205: bic.old_component_sequence_id) = p_old_component_sequence_id
206: AND bic.component_sequence_id = brd.component_sequence_id
229: l_dummy VARCHAR(80);
230:
231: CURSOR c_acdtype IS
232: SELECT acd_type, old_component_sequence_id
233: FROM bom_inventory_components bic
234: WHERE bic.component_sequence_id = p_component_seq_id;
235:
236: CURSOR c_QuantityRelated IS
237: SELECT component_quantity
234: WHERE bic.component_sequence_id = p_component_seq_id;
235:
236: CURSOR c_QuantityRelated IS
237: SELECT component_quantity
238: FROM bom_inventory_components
239: WHERE component_sequence_id = p_component_seq_id
240: AND quantity_related = 1;
241:
242: BEGIN
249: IF p_acd_type = 3 THEN
250:
251: BEGIN
252: SELECT component_reference_designator INTO l_dummy
253: FROM bom_reference_designators brd,bom_inventory_components bic
254: WHERE bic.component_sequence_id = p_component_seq_id
255: AND brd.component_sequence_id = bic.old_component_sequence_id
256: AND brd.component_reference_designator = p_ref_desig_name;
257:
295:
296: BEGIN
297: SELECT 'Non-Standard Comp'
298: INTO l_dummy
299: FROM bom_inventory_Components bic
300: WHERE bic.component_sequence_id = p_component_seq_id
301: AND bic.bom_item_type IN (1, 2, 3); /*MODEL,OPTION CLASS,PLANNING*/
302:
303: -- If no exception is raised then
323: FROM sys.dual
324: WHERE EXISTS (SELECT 'Planning Item'
325: FROM bom_bill_of_materials bom,
326: mtl_system_items msi,
327: bom_inventory_components bic
328: WHERE msi.bom_item_type = 3 /* PLANNING */
329: AND msi.inventory_item_id = bom.assembly_item_id
330: AND msi.organization_id = bom.organization_id
331: AND bom.bill_sequence_id = bic.bill_sequence_id
416: -- Check Reference Designator Access
417: BEGIN
418: SELECT 'parent not disabled'
419: INTO l_dummy
420: FROM bom_inventory_components bic
421: WHERE bic.component_sequence_id = p_component_seq_id
422: AND NVL(bic.acd_type, 0) <> 3;
423: EXCEPTION
424: WHEN NO_DATA_FOUND THEN
445: l_quantity NUMBER;
446:
447: CURSOR c_acdtype IS
448: SELECT acd_type, old_component_sequence_id
449: FROM bom_inventory_components bic
450: WHERE bic.component_sequence_id = p_component_seq_id;
451:
452: CURSOR c_QuantityRelated IS
453: SELECT component_quantity
450: WHERE bic.component_sequence_id = p_component_seq_id;
451:
452: CURSOR c_QuantityRelated IS
453: SELECT component_quantity
454: FROM bom_inventory_components
455: WHERE component_sequence_id = p_component_seq_id
456: AND quantity_related = 1;
457:
458: