[Home] [Help]
14: | Parameters: org_id organization_id
15: | order_by 1 - Op seq, item seq
16: | 2 - Item seq, op seq
17: | grp_id unique value to identify current explosion
18: | use value from sequence bom_small_expl_temp_s
19: | session_id unique value to identify current session
20: | use value from bom_small_expl_temp_session_s
21: | levels_to_explode
22: | bom_or_eng 1 - BOM
16: | 2 - Item seq, op seq
17: | grp_id unique value to identify current explosion
18: | use value from sequence bom_small_expl_temp_s
19: | session_id unique value to identify current session
20: | use value from bom_small_expl_temp_session_s
21: | levels_to_explode
22: | bom_or_eng 1 - BOM
23: | 2 - ENG
24: | impl_flag 1 - implemented only
241: SELECT
242: COMPONENT_CODE,
243: LOOP_FLAG,
244: PLAN_LEVEL
245: FROM BOM_SMALL_EXPL_TEMP
246: WHERE GROUP_ID = c_group_id
247: AND LOOP_FLAG = 1;
248: BEGIN
249:
248: BEGIN
249:
250: SELECT NVL( TOP_ALTERNATE_DESIGNATOR, 'none' ), ORGANIZATION_ID
251: INTO top_alt, org_id
252: FROM BOM_SMALL_EXPL_TEMP
253: WHERE GROUP_ID = grp_id
254: AND ROWNUM = 1
255: AND PLAN_LEVEL = 0;
256:
374: BET.common_bill_sequence_id curCBSI,
375: msi1.organization_id t_master_org_id,
376: msi1.primary_uom_code t_master_uom,
377: msi2.primary_uom_code t_child_uom
378: from BOM_SMALL_EXPL_TEMP BET, bom_bill_of_materials bbm, mtl_system_items msi1, mtl_system_items msi2
379: where BET.bill_sequence_id <> BET.common_bill_sequence_id
380: and bbm.bill_sequence_id = BET.common_bill_sequence_id
381: and msi1.inventory_item_id = BET.component_item_id
382: and msi1.organization_id = bbm.organization_id
410: raise parameter_error;
411: end if;
412:
413: stmt_num := 2;
414: insert into bom_small_expl_temp
415: (
416: group_id,
417: bill_sequence_id,
418: component_sequence_id,
580: END LOOP; -- curCSI.count loop
581:
582: /* Bug 9355186 : Individual updates converted into bulk update
583: if is_cost_organization <> 'Y' then
584: UPDATE BOM_SMALL_EXPL_TEMP
585: SET item_cost = item_cost*t_conversion_rate
586: WHERE group_id = cr.curGI and
587: component_sequence_id = cr.curCSI and
588: bill_sequence_id = cr.curBSI and
589: common_bill_sequence_id = cr.curCBSI;
590: end if;
591: --Bug 2157325 End
592:
593: UPDATE BOM_SMALL_EXPL_TEMP
594: SET component_quantity = trunc(component_quantity/t_conversion_rate, 22), --Bug 9173185 fix
595: extended_quantity = extended_quantity/t_conversion_rate,
596: -- item_cost = item_cost*t_conversion_rate,
597: primary_uom_code = cr.curPUC
602: */
603:
604: FORALL i IN 1..curCSI.COUNT
605: /* Bug 9355186: Proving hint to improve performance */
606: UPDATE /*+ index(BOM_SMALL_EXPL_TEMP BOM_SMALL_EXPL_TEMP_n1) */ BOM_SMALL_EXPL_TEMP
607: SET
608: -- Bug 2157325 Begin
609: -- If cost_organization is Master organization then the item cost should be
610: -- calculated by multiplying the conversion_rate.
705: no_level_access EXCEPTION;
706: no_assy EXCEPTION;
707: no_list EXCEPTION;
708:
709: -- cursor to obtain exploded bom from bom_small_expl_temp table
710: CURSOR export_tab (l_organization_id NUMBER, l_group_id NUMBER) IS
711: SELECT
712: TOP_BILL_SEQUENCE_ID ,
713: BILL_SEQUENCE_ID ,
771: ATTRIBUTE14 ,
772: ATTRIBUTE15 ,
773: ITEM_COST ,
774: EXTEND_COST_FLAG
775: FROM bom_small_expl_temp
776: WHERE
777: Organization_id = l_organization_id
778: AND GROUP_ID = l_group_id;
779:
865:
866: SELECT bom_explosion_temp_s.nextval
867: INTO l_group_id from dual;
868:
869: DELETE from bom_small_expl_temp where group_id =l_group_id;
870:
871: --dbms_output.put_line('calling explosion . . . ');
872:
873: exploder_userexit (
1003: bom_export_tab(i_count).EXTEND_COST_FLAG :=
1004: loop_tab.EXTEND_COST_FLAG ;
1005: i_count := i_count +1;
1006: end loop ;
1007: DELETE from bom_small_expl_temp where group_id =l_group_id;
1008: end if;
1009: end if;
1010: l_assembly_found := TRUE;
1011: END LOOP;