[Home] [Help]
53: p_assembly_quantity,
54: l_include_yield, /* ER 4369064: Component Yield Enhancement */
55: nvl(wro.component_yield_factor, 1), /* Bug 8319533: component_yield_factor could be null
56: for jobs created prior to R12 */
57: wro.basis_type),wip_constants.inv_max_precision) transaction_quantity, /* LBM Project */
58: wro.inventory_item_id,
59: msinv.secondary_inventory_name subinventory_code,
60: wro.quantity_issued,
61: wro.required_quantity,
113: wro.wip_supply_type,
114: wro.required_quantity,
115: wro.quantity_issued,
116: p_assembly_quantity,
117: p_entity_type) = WIP_CONSTANTS.YES
118: AND WIP_COMPONENT.meets_criteria(
119: wro.operation_seq_num,
120: p_operation_seq_num,
121: wro.department_id,
120: p_operation_seq_num,
121: wro.department_id,
122: p_department_id,
123: wro.supply_subinventory,
124: p_criteria_sub) = WIP_CONSTANTS.YES
125: AND wdj.wip_entity_id = wro.wip_entity_id
126: AND wdj.organization_id = wro.organization_id
127: AND bd.department_id(+) = wro.department_id
128: AND bd.organization_id(+) = wro.organization_id
131: AND mum.uom_code = msi.primary_uom_code
132: AND msinv.organization_id(+) = wro.organization_id
133: AND msinv.secondary_inventory_name(+) =
134: decode(p_transaction_action_id,
135: WIP_CONSTANTS.SUBTRFR_ACTION, p_subinventory,
136: NVL(wro.supply_subinventory, p_subinventory))
137: AND mil.organization_id(+) = wro.organization_id
138: AND mil.inventory_location_id(+) =
139: decode(p_transaction_action_id,
136: NVL(wro.supply_subinventory, p_subinventory))
137: AND mil.organization_id(+) = wro.organization_id
138: AND mil.inventory_location_id(+) =
139: decode(p_transaction_action_id,
140: WIP_CONSTANTS.SUBTRFR_ACTION, p_locator_id,
141: NVL(wro.supply_locator_id, p_locator_id))
142: AND mp.organization_id = wro.organization_id
143: ORDER BY
144: wro.operation_seq_num;
184: GREATEST(bcd1.next_seq_num, p_next_seq_num)) *
185: wro.quantity_per_assembly * wrs.daily_production_rate *
186: decode(p_transaction_action_id, 1, -1, 2, -1, 33, -1, 1)/
187: decode(l_include_yield,2,1,nvl(wro.component_yield_factor,1))),
188: wip_constants.inv_max_precision) transaction_quantity /* ER 4369064: Component Yield Enhancement */
189: FROM mtl_parameters mp,
190: mtl_item_locations mil,
191: mtl_secondary_inventories msinv,
192: mtl_units_of_measure mum,
215: wro.wip_supply_type,
216: wro.required_quantity,
217: wro.quantity_issued,
218: NULL,
219: p_entity_type) = WIP_CONSTANTS.YES
220: AND WIP_COMPONENT.meets_criteria(
221: wro.operation_seq_num,
222: p_operation_seq_num,
223: wro.department_id,
222: p_operation_seq_num,
223: wro.department_id,
224: p_department_id,
225: wro.supply_subinventory,
226: p_criteria_sub) = WIP_CONSTANTS.YES
227: AND bd.department_id(+) = wro.department_id
228: AND bd.organization_id(+) = wro.organization_id
229: AND msi.inventory_item_id = wro.inventory_item_id
230: AND msi.organization_id = wro.organization_id
231: AND mum.uom_code = msi.primary_uom_code
232: AND msinv.organization_id(+) = wro.organization_id
233: AND msinv.secondary_inventory_name(+) =
234: decode(p_transaction_action_id,
235: WIP_CONSTANTS.SUBTRFR_ACTION, p_subinventory,
236: NVL(wro.supply_subinventory, p_subinventory))
237: AND mil.organization_id(+) = wro.organization_id
238: AND mil.inventory_location_id(+) =
239: decode(p_transaction_action_id,
236: NVL(wro.supply_subinventory, p_subinventory))
237: AND mil.organization_id(+) = wro.organization_id
238: AND mil.inventory_location_id(+) =
239: decode(p_transaction_action_id,
240: WIP_CONSTANTS.SUBTRFR_ACTION, p_locator_id,
241: NVL(wro.supply_locator_id, p_locator_id))
242: AND mp.organization_id = wro.organization_id
243: /* Fix for bug 2570492 Adding filtering by status_type */
244: AND status_type in (WIP_CONSTANTS.RELEASED, WIP_CONSTANTS.COMP_CHRG)
240: WIP_CONSTANTS.SUBTRFR_ACTION, p_locator_id,
241: NVL(wro.supply_locator_id, p_locator_id))
242: AND mp.organization_id = wro.organization_id
243: /* Fix for bug 2570492 Adding filtering by status_type */
244: AND status_type in (WIP_CONSTANTS.RELEASED, WIP_CONSTANTS.COMP_CHRG)
245: GROUP BY
246: wro.inventory_item_id,
247: msinv.secondary_inventory_name,
248: bd.department_id,
284: X_COMMIT_COUNTER := 0;
285:
286: /* Source Type and Source are set differently for Subinventory Replen */
287:
288: IF p_transaction_action_id = WIP_CONSTANTS.SUBTRFR_ACTION THEN
289: /*Start: Bug 6460181: Instead of a constant value for x_transaction_source_type_id, the value is selected from mtl_transaction_type table*/
290:
291: SELECT transaction_source_type_id
292: into x_transaction_source_type_id
310: x_released_revs_meaning
311: );
312:
313: --6 is eAM job
314: IF p_entity_type in (WIP_CONSTANTS.DISCRETE,WIP_CONSTANTS.LOTBASED,6) THEN
315: FOR C IN CDIS LOOP
316:
317: x_dummy := FND_FLEX_KEYVAL.validate_ccid(
318: appl_short_name => 'INV',
356: x_locator_id := null; --no locator when sub is not populated
357: x_locator_segments := NULL;
358: END IF;
359:
360: IF C.revision_qty_control_code = WIP_CONSTANTS.REV THEN
361: BOM_REVISIONS.Get_Revision
362: (type => 'PART',
363: eco_status => x_released_revs_meaning,
364: examine_type => 'ALL',
381: AND C.serial_control_code <> 1)
382: OR (C.transaction_quantity = 0
383: AND p_assembly_quantity IS NOT NULL
384: AND p_transaction_action_id IN
385: (WIP_CONSTANTS.RETNEGC_ACTION,
386: WIP_CONSTANTS.RETCOMP_ACTION)) THEN
387: x_wip_commit_flag := 'N';
388: X_COMMIT_COUNTER := X_COMMIT_COUNTER + 1;
389: ELSE
382: OR (C.transaction_quantity = 0
383: AND p_assembly_quantity IS NOT NULL
384: AND p_transaction_action_id IN
385: (WIP_CONSTANTS.RETNEGC_ACTION,
386: WIP_CONSTANTS.RETCOMP_ACTION)) THEN
387: x_wip_commit_flag := 'N';
388: X_COMMIT_COUNTER := X_COMMIT_COUNTER + 1;
389: ELSE
390: x_wip_commit_flag := 'Y';
500: 'N',
501: C.inventory_item_id,
502: C.subinventory_code,
503: /*Fix for bug 9371748*/
504: decode(C.eam_item_type, WIP_CONSTANTS.REBUILD_ITEM_TYPE, decode(p_entity_type,WIP_CONSTANTS.EAM,1,C.transaction_quantity), C.transaction_quantity),
505: decode(C.eam_item_type, WIP_CONSTANTS.REBUILD_ITEM_TYPE, decode(p_entity_type,WIP_CONSTANTS.EAM,1,C.transaction_quantity), C.transaction_quantity),
506: p_transaction_date,
507: p_organization_id,
508: p_acct_period_id,
501: C.inventory_item_id,
502: C.subinventory_code,
503: /*Fix for bug 9371748*/
504: decode(C.eam_item_type, WIP_CONSTANTS.REBUILD_ITEM_TYPE, decode(p_entity_type,WIP_CONSTANTS.EAM,1,C.transaction_quantity), C.transaction_quantity),
505: decode(C.eam_item_type, WIP_CONSTANTS.REBUILD_ITEM_TYPE, decode(p_entity_type,WIP_CONSTANTS.EAM,1,C.transaction_quantity), C.transaction_quantity),
506: p_transaction_date,
507: p_organization_id,
508: p_acct_period_id,
509: SYSDATE,
616: --x_locator_segments := FND_FLEX_KEYVAL.concatenated_values;
617: END IF;
618: END IF;
619:
620: IF C.revision_qty_control_code = WIP_CONSTANTS.REV THEN
621: BOM_REVISIONS.Get_Revision
622: (type => 'PART',
623: eco_status => x_released_revs_meaning,
624: examine_type => 'ALL',
641: AND C.serial_control_code <> 1)
642: OR (C.transaction_quantity = 0
643: AND p_assembly_quantity IS NOT NULL
644: AND p_transaction_action_id IN
645: (WIP_CONSTANTS.RETNEGC_ACTION,
646: WIP_CONSTANTS.RETCOMP_ACTION)) THEN
647: x_wip_commit_flag := 'N';
648: X_COMMIT_COUNTER := X_COMMIT_COUNTER + 1;
649: ELSE
642: OR (C.transaction_quantity = 0
643: AND p_assembly_quantity IS NOT NULL
644: AND p_transaction_action_id IN
645: (WIP_CONSTANTS.RETNEGC_ACTION,
646: WIP_CONSTANTS.RETCOMP_ACTION)) THEN
647: x_wip_commit_flag := 'N';
648: X_COMMIT_COUNTER := X_COMMIT_COUNTER + 1;
649: ELSE
650: x_wip_commit_flag := 'Y';