DBA Data[Home] [Help]

APPS.MSD_BOM_COLLECTIONS SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 102

/* Create the Collections needed for Bulk Insert */
C_INSTANCE     		          varchar2List := varchar2List(C_INIT_VARCHAR2);
Line: 117

SELECT DISTINCT
       mb.sr_instance_id,
       mb.organization_id,
       mbc.using_assembly_id,
       ascp_comp.sr_inventory_item_id,
       mbc.effectivity_date,
       mbc.disable_date,
       decode(mbc.usage_quantity/decode(mbc.usage_quantity,
                                        null,1,
                                        0,1,
                                        abs(mbc.usage_quantity)),
              1, (mbc.usage_quantity * mbc.Component_Yield_Factor),
             (mbc.usage_quantity /  mbc.Component_Yield_Factor))*msd_common_utilities.uom_conv(ascp_comp.uom_code,ascp_comp.inventory_item_id) usage_quantity,
       mbc.planning_factor,
       mb.bill_sequence_id,
       mbc.optional_component
  FROM msc_bom_components mbc,
       msc_boms mb,
       msc_system_items assemble,
       msc_system_items ascp_comp
 WHERE mbc.plan_id = -1
   AND mb.plan_id = mbc.plan_id
   AND ascp_comp.plan_id = mbc.plan_id
   AND mb.organization_id = mbc.organization_id
   AND mb.alternate_bom_designator is null
   AND mb.bill_sequence_id = mbc.bill_sequence_id
   AND assemble.sr_instance_id = mbc.sr_instance_id
   AND assemble.plan_id = mbc.plan_id
   AND assemble.inventory_item_id = mbc.using_assembly_id
   AND assemble.organization_id = mbc.organization_id
   AND (assemble.mrp_planning_code <> 6 or -- Exclude non plan ATO, but include PTO
                    (assemble.mrp_planning_code = 6 and assemble.pick_components_flag = 'Y'))
   AND assemble.ato_forecast_control <> 3
   AND (assemble.bom_item_type <> 4 or -- exclude Standard bom, but include Kit
                    (assemble.bom_item_type = 4 and assemble.pick_components_flag = 'Y'))
   AND mbc.inventory_item_id = ascp_comp.inventory_item_id
   AND mbc.organization_id = ascp_comp.organization_id
   AND mbc.sr_instance_id = ascp_comp.sr_instance_id
   AND ascp_comp.ato_forecast_control = C_CONSUME_DERIVE
   AND ascp_comp.bom_item_type in (C_MODEL,C_STANDARD)
   AND ( ascp_comp.mrp_planning_code <> C_NO_PLANNING or
         (ascp_comp.mrp_planning_code = C_NO_PLANNING and ascp_comp.pick_components_flag = 'Y'))
   AND mbc.sr_instance_id = mb.sr_instance_id;  -- Support PTO as component
Line: 165

select sr_inventory_item_id
  from msc_system_items
 where sr_instance_id = p_instance
   and plan_id = -1
   and organization_id = p_org_id
   and inventory_item_id = p_item_id;
Line: 174

numInsert number := 1;
Line: 197

Delete from msd_bom_components
where instance = p_instance_id;
Line: 201

    debug_line('Selecting Valid Components from Msc');
Line: 231

 mo_parents.delete;
Line: 299

          oc_parents.delete(compLastIndex);
Line: 315

           oc_parents.delete(compLastIndex);
Line: 317

           oc_parents.delete(compLastIndex);
Line: 325

       if (numInsert > C_INSTANCE.LAST) then
         C_INSTANCE.extend;
Line: 343

         if (numInsert > C_INSTANCE.LAST) then
          C_INSTANCE.extend;
Line: 355

         C_INSTANCE(numInsert) := L_INSTANCE(j);
Line: 356

         C_ORG_SR_PKS(numInsert)	:= L_ORG_SR_PKS(j);
Line: 357

         C_ASSEMBLY_SR_PKS(numInsert) := x_sr_level_pk;
Line: 358

         C_COMPONENT_SR_PKS(numInsert) := L_COMPONENT_SR_PKS(j);
Line: 359

         C_EFFECTIVE_DATES(numInsert)	:= L_EFFECTIVE_DATES(j);
Line: 360

         C_DISABLE_DATES(numInsert) := L_DISABLE_DATES(j);
Line: 361

         C_QUANTITY_PER(numInsert) := mo_parents(i).quantity_per;
Line: 362

         C_PLANNING_FACTOR(numInsert) := mo_parents(i).planning_factor;
Line: 363

         C_OPTIONAL_FLAG(numInsert) := L_OPTIONAL_FLAG(j);
Line: 365

         numInsert := numInsert + 1;
Line: 382

      if (numInsert > C_INSTANCE.LAST) then
        C_INSTANCE.extend;
Line: 394

      C_INSTANCE(numInsert) := L_INSTANCE(j);
Line: 395

      C_ORG_SR_PKS(numInsert)	:= L_ORG_SR_PKS(j);
Line: 396

      C_ASSEMBLY_SR_PKS(numInsert) := x_sr_level_pk;
Line: 397

      C_COMPONENT_SR_PKS(numInsert) := L_COMPONENT_SR_PKS(j);
Line: 398

      C_EFFECTIVE_DATES(numInsert)	:= L_EFFECTIVE_DATES(j);
Line: 399

      C_DISABLE_DATES(numInsert) := L_DISABLE_DATES(j);
Line: 400

      C_QUANTITY_PER(numInsert) := L_QUANTITY_PER(j);
Line: 401

      C_PLANNING_FACTOR(numInsert) := L_PLANNING_FACTOR(j);
Line: 402

      C_OPTIONAL_FLAG(numInsert) := L_OPTIONAL_FLAG(j);
Line: 404

      numInsert := numInsert + 1;
Line: 413

    debug_line('There is no data to insert.');
Line: 419

  INSERT INTO msd_bom_components (
    instance,
    sr_organization_pk,
    sr_assembly_pk,
    sr_component_pk,
    effectivity_date,
    disable_date,
    quantity_per,
    planning_factor,
    creation_date,
    created_by,
    last_update_date,
    last_updated_by,
    last_update_login,
    optional_flag)
  VALUES (
    C_INSTANCE(k),
    C_ORG_SR_PKS(k),
    C_ASSEMBLY_SR_PKS(k),
    C_COMPONENT_SR_PKS(k),
    C_EFFECTIVE_DATES(k),
    C_DISABLE_DATES(k),
    C_QUANTITY_PER(k),
    C_PLANNING_FACTOR(k),
    sysdate,
    fnd_global.user_id,
    sysdate,
    fnd_global.user_id,
    fnd_global.user_id,
    C_OPTIONAL_FLAG(k) );
Line: 451

    debug_line('The number of rows inserted is : ' || numInsert);
Line: 471

SELECT bom_item_type
  FROM msc_system_items
 WHERE sr_instance_id = p_instance
   AND organization_id = p_sr_org_pk
   AND inventory_item_id = p_sr_inventory_item_pk
   AND plan_id = -1;
Line: 490

 * a component is selected and its parent is an option class. When this
 * occurs, the option class's nearest model needs to be found. Therefore,
 * the components grandparents which are the assemblies parents are
 * placed in a stack for further inspection.
 *
 * Model A
 *   |
 *   |--- Option Class A
 *   |            |
 *   |            |--- Option Class A'
 *   |                            |
 *   |                            |--- Component A
 *   |
 * Model B
 *   |
 *   |--- Option Class A
 *   |            |
 *   |            |--- Option Class A'
 *   |                            |
 *   |                            |--- Component A
 * Model C
 *   |
 *   |--- Option Class A'
 *                |
 *                |--- Component A
 *
 *
 * In this case, Component A needs to find Model A, B, C. Option Class A' is an
 * option class, but is used in several places.  The procedure will search
 * the components using Depth First Search (DFS) and append possible parents
 * to the argument parameter.
 *
 *
 * Parameters : 1. p_parents - vector containing all of the assemblies.
 *              2. p_instance - source location
 *              3. p_sr_org_pk - Organization source primary key.
 *              4. p_asmb_ascp_pk - The assembly whose parents we are looking for.
 *              5. p_planning_factor - Planning factor from this assembly
 */

Procedure get_all_parents(
  P_parents         in out nocopy parents,
  P_instance        in     varchar2,
  p_sr_org_pk       in     varchar2,
  p_asmb_ascp_pk    in     varchar2,
  p_planning_factor in     number,
  p_quantity_per    in     number) is

endPos number := p_parents.last;
Line: 541

select using_assembly_id,
       planning_factor,
       decode(mbc.usage_quantity/decode(mbc.usage_quantity,
                                        null,1,
                                        0,1,
                                        abs(mbc.usage_quantity)),
              1, (mbc.usage_quantity * mbc.Component_Yield_Factor),
             (mbc.usage_quantity /  mbc.Component_Yield_Factor))*msd_sr_util.uom_conv(msi.uom_code,msi.sr_inventory_item_id) usage_quantity
  from msc_bom_components mbc,
       msc_system_items msi
 where mbc.plan_id = -1
   and msi.plan_id = -1
   and msi.organization_id = mbc.organization_id
   and msi.sr_instance_id = p_instance
   and mbc.organization_id = p_sr_org_pk
   and mbc.sr_instance_id = p_instance
   and mbc.inventory_item_id = msi.inventory_item_id
   and msi.inventory_item_id = p_asmb_ascp_pk
   and (mbc.optional_component = 1 or msi.ato_forecast_control in (C_CONSUME ,C_CONSUME_DERIVE));