[Home] [Help]
36: /* End OPM INVCONV change */
37:
38: l_stmt_num := 10;
39:
40: insert into cst_sc_bom_explosion
41: (
42: ROLLUP_ID,
43: ASSEMBLY_ITEM_ID,
44: ASSEMBLY_ORGANIZATION_ID,
375: )
376: is
377:
378: cursor CSBE_cursor is
379: select /*+ INDEX (CSBE CST_SC_BOM_EXPLOSION_N1)*/
380: CSBE.component_item_id,
381: CSBE.component_organization_id,
382: min( CSBE.plan_level ) prior_plan_level
383: from
380: CSBE.component_item_id,
381: CSBE.component_organization_id,
382: min( CSBE.plan_level ) prior_plan_level
383: from
384: cst_sc_bom_explosion CSBE
385: where
386: CSBE.rollup_id = i_rollup_id and
387: CSBE.exploded_flag = 'N' and
388: CSBE.plan_level <= decode( i_explosion_levels, null, CSBE.plan_level+1,
388: CSBE.plan_level <= decode( i_explosion_levels, null, CSBE.plan_level+1,
389: i_explosion_levels ) and
390: not exists
391: (
392: select /*+ INDEX (CSBE2 CST_SC_BOM_EXPLOSION_N1)*/ 'x'
393: from cst_sc_bom_explosion CSBE2
394: where
395: CSBE2.rollup_id = CSBE.rollup_id and
396: CSBE2.component_item_id = CSBE.component_item_id and
389: i_explosion_levels ) and
390: not exists
391: (
392: select /*+ INDEX (CSBE2 CST_SC_BOM_EXPLOSION_N1)*/ 'x'
393: from cst_sc_bom_explosion CSBE2
394: where
395: CSBE2.rollup_id = CSBE.rollup_id and
396: CSBE2.component_item_id = CSBE.component_item_id and
397: CSBE2.component_organization_id = CSBE.component_organization_id and
463: end if; -- i_assignment_set_id is not null
464:
465:
466: l_stmt_num := 30;
467: insert into cst_sc_bom_explosion
468: (
469: ROLLUP_ID,
470: ASSEMBLY_ITEM_ID,
471: ASSEMBLY_ORGANIZATION_ID,
654:
655:
656: l_stmt_num := 40;
657:
658: update cst_sc_bom_explosion
659: set exploded_flag = 'Y'
660: where rollup_id = i_rollup_id and
661: component_item_id = CSBE.component_item_id and
662: component_organization_id = CSBE.component_organization_id;
670:
671:
672: -- This will scale down the component_quantity of components of
673: -- assemblies that have partial Make sourcing rules.
674: update cst_sc_bom_explosion CSBE
675: set CSBE.component_quantity
676: = (
677: select CSBE.component_quantity *
678: nvl( sum( decode( CSSR.source_type, 2,
688:
689:
690: -- This will clear out all exploded rows, leaving only the
691: -- rows that are stuck in a loop.
692: update /*+ INDEX (CSBE CST_SC_BOM_EXPLOSION_N1)*/
693: cst_sc_bom_explosion CSBE
694: set exploded_flag = 'Y'
695: where
696: rollup_id = i_rollup_id and
689:
690: -- This will clear out all exploded rows, leaving only the
691: -- rows that are stuck in a loop.
692: update /*+ INDEX (CSBE CST_SC_BOM_EXPLOSION_N1)*/
693: cst_sc_bom_explosion CSBE
694: set exploded_flag = 'Y'
695: where
696: rollup_id = i_rollup_id and
697: exists (
694: set exploded_flag = 'Y'
695: where
696: rollup_id = i_rollup_id and
697: exists (
698: select /*+ INDEX (CSBE2 CST_SC_BOM_EXPLOSION_N1)*/ 'x'
699: from cst_sc_bom_explosion CSBE2
700: where
701: CSBE2.rollup_id = CSBE.rollup_id and
702: CSBE2.component_item_id = CSBE.component_item_id and
695: where
696: rollup_id = i_rollup_id and
697: exists (
698: select /*+ INDEX (CSBE2 CST_SC_BOM_EXPLOSION_N1)*/ 'x'
699: from cst_sc_bom_explosion CSBE2
700: where
701: CSBE2.rollup_id = CSBE.rollup_id and
702: CSBE2.component_item_id = CSBE.component_item_id and
703: CSBE2.component_organization_id = CSBE.component_organization_id and
983: select
984: CSBE.component_item_id,
985: CSBE.component_organization_id
986: from
987: cst_sc_bom_explosion CSBE
988: where
989: CSBE.rollup_id = i_rollup_id and
990: CSBE.assembly_item_id = -1 and
991: CSBE.deleted_flag = 'Y'; -- Bug 3665428: make snapshot only for valid items without loop
1072: i_prog_appl_id, -- PROGRAM_APPLICATION_ID
1073: i_prog_id, -- PROGRAM_ID
1074: sysdate -- PROGRAM_UPDATE_DATE
1075: from
1076: cst_sc_bom_explosion CSBE
1077: start with
1078: rollup_id = i_rollup_id and
1079: assembly_item_id = -1 and
1080: component_item_id = top_assm.component_item_id and
1306: IF i_explosion_levels is not null THEN
1307:
1308: l_stmt_num := 5;
1309:
1310: update cst_sc_bom_explosion CSBE
1311: set deleted_flag = 'Y'
1312: where
1313: CSBE.rollup_id = i_rollup_id and
1314: CSBE.deleted_flag = 'N' and
1354: i_prog_appl_id, -- PROGRAM_APPLICATION_ID
1355: i_prog_id, -- PROGRAM_ID
1356: sysdate -- PROGRAM_UPDATE_DATE
1357: from
1358: cst_sc_bom_explosion CSBE
1359: where
1360: CSBE.rollup_id = i_rollup_id and
1361: CSBE.deleted_flag = 'N' and
1362: not exists
1361: CSBE.deleted_flag = 'N' and
1362: not exists
1363: (
1364: select 'x'
1365: from cst_sc_bom_explosion CSBE2
1366: where
1367: CSBE2.rollup_id = CSBE.rollup_id and
1368: CSBE2.assembly_item_id = CSBE.component_item_id and
1369: CSBE2.assembly_organization_id = CSBE.component_organization_id and
1371: );
1372:
1373: l_stmt_num := 20;
1374:
1375: update cst_sc_bom_explosion CSBE
1376: set deleted_flag = 'Y'
1377: where
1378: CSBE.rollup_id = i_rollup_id and
1379: CSBE.deleted_flag = 'N' and
1379: CSBE.deleted_flag = 'N' and
1380: not exists
1381: (
1382: select 'x'
1383: from cst_sc_bom_explosion CSBE2
1384: where
1385: CSBE2.rollup_id = CSBE.rollup_id and
1386: CSBE2.assembly_item_id = CSBE.component_item_id and
1387: CSBE2.assembly_organization_id = CSBE.component_organization_id and