DBA Data[Home] [Help]

APPS.WIP_REQUIREMENT_VALIDATIONS SQL Statements

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

Line: 12

    select interface_id
      from wip_job_dtls_interface wjdi
     where wjdi.group_id = p_group_id
       and wjdi.process_phase = wip_constants.ml_validation
       and wjdi.process_status in (wip_constants.running,
                                   wip_constants.warning)
       and wjdi.wip_entity_id = p_wip_entity_id
       and wjdi.organization_id = p_organization_id
       and wjdi.load_type = wip_job_details.wip_mtl_requirement
       and wjdi.substitution_type = p_substitution_type
       and wjdi.operation_seq_num = p_operation_seq_num
       and wjdi.inventory_item_id_old is null;
Line: 44

    update wip_job_dtls_interface wjdi
       set process_status = wip_constants.error
     where group_id = p_group_id
       and process_phase = wip_constants.ml_validation
       and process_status in (wip_constants.running,
                              wip_constants.warning)
       and wip_entity_id = p_wip_entity_id
       and organization_id = p_organization_id
       and wjdi.load_type = wip_job_details.wip_mtl_requirement
       and wjdi.substitution_type = p_substitution_type
       and wjdi.operation_seq_num = p_operation_seq_num
       and wjdi.inventory_item_id_old is null;
Line: 70

  select wjdi.interface_id,
         we.wip_entity_name,
         wjdi.wip_entity_id,
         wjdi.operation_seq_num,
         msik.concatenated_segments item_name,
         wjdi.inventory_item_id_old
    from wip_job_dtls_interface wjdi,
         wip_entities we,
         mtl_system_items_kfv msik
       where wjdi.group_id = p_group_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and wjdi.load_type = wip_job_details.wip_mtl_requirement
         and wjdi.substitution_type = p_substitution_type
         and wjdi.operation_seq_num = p_operation_seq_num
         and wjdi.inventory_item_id_old = p_inventory_item_id_old
         and wjdi.wip_entity_id = we.wip_entity_id
         and wjdi.inventory_item_id_old = msik.inventory_item_id
         and wjdi.organization_id = msik.organization_id
         and not exists (select 1
                           from wip_requirement_operations wro
                          where wro.wip_entity_id = wjdi.wip_entity_id
                            and wro.organization_id = wjdi.organization_id
                            and wro.operation_seq_num = wjdi.operation_seq_num
                            and wro.inventory_item_id = wjdi.inventory_item_id_old);
Line: 124

    update wip_job_dtls_interface wjdi
       set process_status = wip_constants.error
     where group_id = p_group_id
       and process_phase = wip_constants.ml_validation
       and process_status in (wip_constants.running,
                              wip_constants.warning)
       and wip_entity_id = p_wip_entity_id
       and organization_id = p_organization_id
       and wjdi.load_type = wip_job_details.wip_mtl_requirement
       and wjdi.substitution_type = p_substitution_type
       and wjdi.operation_seq_num = p_operation_seq_num
       and wjdi.inventory_item_id_old = p_inventory_item_id_old
       and not exists (select 1
                         from wip_requirement_operations wro
                        where wro.wip_entity_id = wjdi.wip_entity_id
                          and wro.organization_id = wjdi.organization_id
                          and wro.operation_seq_num = wjdi.operation_seq_num
                          and wro.inventory_item_id = wjdi.inventory_item_id_old);
Line: 146

procedure safe_delete(p_group_id              in number,
                      p_wip_entity_id         in number,
                      p_organization_id       in number,
                      p_substitution_type     in number,
                      p_operation_seq_num     in number,
                      p_inventory_item_id_old in number) IS

x_quantity_issued       number;
Line: 157

  select interface_id
    from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and wjdi.load_type = wip_job_details.wip_mtl_requirement
         and wjdi.substitution_type = p_substitution_type
         and wjdi.operation_seq_num = p_operation_seq_num
         and wjdi.inventory_item_id_old = p_inventory_item_id_old
         and exists (select 1
                       from wip_requirement_operations wro
                      where wro.wip_entity_id = wjdi.wip_entity_id
                        and wro.organization_id = wjdi.organization_id
                        and wro.operation_seq_num = wjdi.operation_seq_num
                        and wro.inventory_item_id = wjdi.inventory_item_id_old
                        and wro.quantity_issued <> 0);
Line: 178

  select interface_id
    from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and wjdi.load_type = wip_job_details.wip_mtl_requirement
         and wjdi.substitution_type = p_substitution_type
         and wjdi.operation_seq_num = p_operation_seq_num
         and wjdi.inventory_item_id_old = p_inventory_item_id_old
         and exists (select 1
                       from mtl_material_transactions_temp mmtt
                      where mmtt.transaction_source_id = wjdi.wip_entity_id
                        and mmtt.organization_id = wjdi.organization_id
                        and mmtt.operation_seq_num = wjdi.operation_seq_num
                        and mmtt.inventory_item_id = wjdi.inventory_item_id_old);
Line: 198

  select interface_id
    from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and wjdi.load_type = wip_job_details.wip_mtl_requirement
         and wjdi.substitution_type = p_substitution_type
         and wjdi.operation_seq_num = p_operation_seq_num
         and wjdi.inventory_item_id_old = p_inventory_item_id_old
         and exists (select 1
                       from mtl_material_transactions mmt
                      where mmt.transaction_source_id = wjdi.wip_entity_id
                        and mmt.organization_id = wjdi.organization_id
                        and mmt.operation_seq_num = wjdi.operation_seq_num
                        and mmt.inventory_item_id = wjdi.inventory_item_id_old);
Line: 238

    update wip_job_dtls_interface wjdi
       set process_status = wip_constants.error
     where group_id = p_group_id
       and process_phase = wip_constants.ml_validation
       and process_status in (wip_constants.running,
                              wip_constants.warning)
       and wip_entity_id = p_wip_entity_id
       and organization_id = p_organization_id
       and wjdi.load_type = wip_job_details.wip_mtl_requirement
       and wjdi.substitution_type = p_substitution_type
       and wjdi.operation_seq_num = p_operation_seq_num
       and wjdi.inventory_item_id_old = p_inventory_item_id_old
       and exists (select 1
                     from wip_requirement_operations wro
                    where wro.wip_entity_id = wjdi.wip_entity_id
                      and wro.organization_id = wjdi.organization_id
                      and wro.operation_seq_num = wjdi.operation_seq_num
                      and wro.inventory_item_id = wjdi.inventory_item_id_old
                      and wro.quantity_issued > 0);
Line: 276

    update wip_job_dtls_interface wjdi
       set process_status = wip_constants.error
     where group_id = p_group_id
       and process_phase = wip_constants.ml_validation
       and process_status in (wip_constants.running,
                              wip_constants.warning)
       and wip_entity_id = p_wip_entity_id
       and organization_id = p_organization_id
       and wjdi.load_type = wip_job_details.wip_mtl_requirement
       and wjdi.substitution_type = p_substitution_type
       and wjdi.operation_seq_num = p_operation_seq_num
       and wjdi.inventory_item_id_old = p_inventory_item_id_old
       and exists (select 1
                     from mtl_material_transactions_temp mmtt
                    where mmtt.transaction_source_id = wjdi.wip_entity_id
                      and mmtt.organization_id = wjdi.organization_id
                      and mmtt.operation_seq_num = wjdi.operation_seq_num
                      and mmtt.inventory_item_id = wjdi.inventory_item_id_old);
Line: 313

    update wip_job_dtls_interface wjdi
       set process_status = wip_constants.error
     where group_id = p_group_id
       and process_phase = wip_constants.ml_validation
       and process_status in (wip_constants.running,
                              wip_constants.warning)
       and wip_entity_id = p_wip_entity_id
       and organization_id = p_organization_id
       and wjdi.load_type = wip_job_details.wip_mtl_requirement
       and wjdi.substitution_type = p_substitution_type
       and wjdi.operation_seq_num = p_operation_seq_num
       and wjdi.inventory_item_id_old = p_inventory_item_id_old
       and exists (select 1
                     from mtl_material_transactions mmt
                    where mmt.transaction_source_id = wjdi.wip_entity_id
                      and mmt.organization_id = wjdi.organization_id
                      and mmt.operation_seq_num = wjdi.operation_seq_num
                      and mmt.inventory_item_id = wjdi.inventory_item_id_old);
Line: 332

end safe_delete;
Line: 335

/* main delete, call the above. If any validation fail, it won''t go on
   with the next validations */
Procedure Delete_Req(p_group_id               in number,
                     p_wip_entity_id         in number,
                     p_organization_id       in number,
                     p_substitution_type     in number) IS

   CURSOR req_info(p_group_Id           number,
                   p_wip_entity_id      number,
                   p_organization_id    number,
                   p_substitution_type  number) IS
   SELECT distinct operation_seq_num,
          inventory_item_id_old, inventory_item_id_new,
          quantity_per_assembly,
          last_update_date, last_updated_by, creation_date, created_by,
          last_update_login, request_id, program_application_id,
          program_id, program_update_date,
          department_id, wip_supply_type, date_required,
          required_quantity, quantity_issued, supply_subinventory,
          supply_locator_id, mrp_net_flag, mps_required_quantity,
          mps_date_required, attribute_category, attribute1,
          attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,
          attribute8,attribute9,attribute10,attribute11,attribute12,
          attribute13,attribute14,attribute15
     FROM WIP_JOB_DTLS_INTERFACE
    WHERE group_id = p_group_id
      AND process_phase = WIP_CONSTANTS.ML_VALIDATION
      AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
      AND wip_entity_id = p_wip_entity_id
      AND organization_id = p_organization_id
      AND load_type = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
      AND substitution_type = p_substitution_type;
Line: 400

              Safe_Delete (p_group_id,
                        p_wip_entity_id,
                        p_organization_id,
                        p_substitution_type,
                        cur_row.operation_seq_num,
                        cur_row.inventory_item_id_old);
Line: 410

END Delete_Req;
Line: 419

  select interface_id
    from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and wjdi.load_type = wip_job_details.wip_mtl_requirement
         and wjdi.substitution_type = p_substitution_type
         and wjdi.operation_seq_num = p_operation_seq_num
         and (   wjdi.inventory_item_id_new is null
              or wjdi.quantity_per_assembly is null);
Line: 452

    update wip_job_dtls_interface wjdi
       set process_status = wip_constants.error
     where group_id = p_group_id
       and process_phase = wip_constants.ml_validation
       and process_status in (wip_constants.running,
                              wip_constants.warning)
       and wip_entity_id = p_wip_entity_id
       and organization_id = p_organization_id
       and wjdi.load_type = wip_job_details.wip_mtl_requirement
       and wjdi.substitution_type = p_substitution_type
       and wjdi.operation_seq_num = p_operation_seq_num
         and (   wjdi.inventory_item_id_new is null
              or wjdi.quantity_per_assembly is null);
Line: 479

  select interface_id
    from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and wjdi.load_type = wip_job_details.wip_mtl_requirement
         and wjdi.substitution_type = p_substitution_type
         and wjdi.operation_seq_num = p_operation_seq_num
         and wjdi.inventory_item_id_new = p_inventory_item_id_new
         /* bug#2814045 */
         and nvl(wjdi.inventory_item_id_new, -1) <> nvl(wjdi.inventory_item_id_old, -1)
         and (   exists (select 1
                           from wip_requirement_operations wro
                          where wro.wip_entity_id = wjdi.wip_entity_id
                            and wro.organization_id = wjdi.organization_id
                            and wro.operation_seq_num = wjdi.operation_seq_num
                            and wro.inventory_item_id = wjdi.inventory_item_id_new)
              or exists (select 1
                           from wip_job_dtls_interface wjdi2
                          where wjdi.interface_id <> wjdi2.interface_id
                            and wjdi.group_id = wjdi2.group_id
                            and wjdi.wip_entity_id = wjdi2.wip_entity_id
                            and wjdi.organization_id = wjdi2.organization_id
                            and wjdi.operation_seq_num = wjdi2.operation_seq_num
                            and wjdi.inventory_item_id_new= wjdi2.inventory_item_id_new)
             );
Line: 528

    update wip_job_dtls_interface wjdi
       set process_status = wip_constants.error
     where group_id = p_group_id
       and process_phase = wip_constants.ml_validation
       and process_status in (wip_constants.running,
                              wip_constants.warning)
       and wip_entity_id = p_wip_entity_id
       and organization_id = p_organization_id
       and wjdi.load_type = wip_job_details.wip_mtl_requirement
       and wjdi.substitution_type = p_substitution_type
       and wjdi.operation_seq_num = p_operation_seq_num
       and wjdi.inventory_item_id_new = p_inventory_item_id_new
       /* Fix for Bug 5632150 */
	   /* and wjdi.inventory_item_id_new <> wjdi.inventory_item_id_old */
	   and nvl(wjdi.inventory_item_id_new,-1) <> nvl(wjdi.inventory_item_id_old,-1)
       and (   exists (select 1
                         from wip_requirement_operations wro
                        where wro.wip_entity_id = wjdi.wip_entity_id
                          and wro.organization_id = wjdi.organization_id
                          and wro.operation_seq_num = wjdi.operation_seq_num
                          and wro.inventory_item_id = wjdi.inventory_item_id_new)
            or exists (select 1
                         from wip_job_dtls_interface wjdi2
                        where wjdi.interface_id <> wjdi2.interface_id
                          and wjdi.group_id = wjdi2.group_id
                          and wjdi.wip_entity_id = wjdi2.wip_entity_id
                          and wjdi.organization_id = wjdi2.organization_id
                          and wjdi.operation_seq_num = wjdi2.operation_seq_num
                          and wjdi.inventory_item_id_new= wjdi2.inventory_item_id_new)
           );
Line: 571

  select interface_id
    from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and wjdi.load_type = wip_job_details.wip_mtl_requirement
         and wjdi.substitution_type = p_substitution_type
         and wjdi.operation_seq_num = p_operation_seq_num
         and wjdi.inventory_item_id_new = p_inventory_item_id_new
         and not exists (select 1
                           from mtl_system_items msi
                          where msi.inventory_item_id = wjdi.inventory_item_id_new
                            and msi.organization_id = wjdi.organization_id);
Line: 590

  select wjdi.interface_id
    from wip_job_dtls_interface wjdi, wip_job_schedule_interface wjsi
       where wjdi.group_id = p_group_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and wjdi.load_type = wip_job_details.wip_mtl_requirement
         and wjdi.substitution_type = p_substitution_type
         and wjdi.operation_seq_num = p_operation_seq_num
         and wjdi.inventory_item_id_new = p_inventory_item_id_new
         and wjdi.parent_header_id = wjsi.header_id
         and wjdi.group_id = wjsi.group_id
         and wjdi.organization_id = wjsi.organization_id
         and wjdi.wip_entity_id = wjsi.wip_entity_id
         and (wjdi.wip_supply_type = wip_constants.phantom
           or (wjsi.load_type in (wip_constants.create_eam_job, wip_constants.resched_eam_job)
                 and wjdi.wip_supply_type <> wip_constants.push));
Line: 611

  select wjdi.interface_id
    from wip_job_dtls_interface wjdi, wip_job_schedule_interface wjsi
       where wjdi.group_id = p_group_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and wjdi.load_type = wip_job_details.wip_mtl_requirement
         and wjdi.substitution_type = p_substitution_type
         and wjdi.operation_seq_num = p_operation_seq_num
         and wjdi.inventory_item_id_new = p_inventory_item_id_new
         and wjdi.parent_header_id = wjsi.header_id
         and wjdi.group_id = wjsi.group_id
         and wjdi.organization_id = wjsi.organization_id
         and wjdi.wip_entity_id = wjsi.wip_entity_id
         and (wjdi.mrp_net_flag not in (wip_constants.yes, wip_constants.no));
Line: 630

  select wjdi.interface_id
    from wip_job_dtls_interface wjdi, wip_job_schedule_interface wjsi
       where wjdi.group_id = p_group_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and wjdi.load_type = wip_job_details.wip_mtl_requirement
         and wjdi.substitution_type = p_substitution_type
         and wjdi.operation_seq_num = p_operation_seq_num
         and wjdi.inventory_item_id_new = p_inventory_item_id_new
         and wjdi.parent_header_id = wjsi.header_id
         and wjdi.group_id = wjsi.group_id
         and wjdi.organization_id = wjsi.organization_id
         and wjdi.wip_entity_id = wjsi.wip_entity_id
         and (upper(wjdi.auto_request_material) not in ('Y', 'N'));
Line: 651

 select interface_id
  from wip_job_dtls_interface wjdi
    where wjdi.group_id=p_group_id
      and wjdi.process_phase = wip_constants.ml_validation
      and wjdi.process_status in ( wip_constants.running,
                                   wip_constants.warning )
      and wjdi.wip_entity_id = p_wip_entity_id
      and wjdi.organization_id = p_organization_id
      and wjdi.load_type = wip_job_details.wip_mtl_requirement
      and wjdi.substitution_type = p_substitution_type
      and wjdi.operation_seq_num = p_operation_seq_num
      and wjdi.inventory_item_id_new = p_inventory_item_id_new
      and NOT exists ( select 1 from mtl_system_items msi
               where msi.inventory_item_id = wjdi.inventory_item_id_new
               and msi.organization_id = wjdi.organization_id
               and BOM_ENABLED_FLAG = 'Y'
               and BOM_ITEM_TYPE = 4
               and (( p_profile_value = WIP_CONSTANTS.YES)
               or (ENG_ITEM_FLAG = 'N' and p_profile_value = WIP_CONSTANTS.NO))
           );
Line: 758

    update wip_job_dtls_interface wjdi
       set process_status = wip_constants.error
     where group_id = p_group_id
       and process_phase = wip_constants.ml_validation
       and process_status in (wip_constants.running,
                              wip_constants.warning)
       and wip_entity_id = p_wip_entity_id
       and organization_id = p_organization_id
       and wjdi.load_type = wip_job_details.wip_mtl_requirement
       and wjdi.substitution_type = p_substitution_type
       and wjdi.operation_seq_num = p_operation_seq_num
       and wjdi.inventory_item_id_new = p_inventory_item_id_new;
Line: 771

       and not exists (select 1
                         from mtl_system_items msi
                        where msi.inventory_item_id = wjdi.inventory_item_id_new
                          and msi.organization_id = wjdi.organization_id);
Line: 797

  select wjdi.interface_id
    from wip_job_dtls_interface wjdi /*, wip_job_schedule_interface wjsi */
       where wjdi.group_id = p_group_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and wjdi.load_type = wip_job_details.wip_mtl_requirement
         and wjdi.substitution_type = p_substitution_type
         and wjdi.operation_seq_num = p_operation_seq_num
         and (wjdi.inventory_item_id_new = p_inventory_item_id_new
              or p_inventory_item_id_new is null)
         and (wjdi.inventory_item_id_old = p_inventory_item_id_old
              or p_inventory_item_id_old is null)
         and (p_inventory_item_id_old is not null or
              p_inventory_item_id_new is not null)
         /*and (wjdi.parent_header_id = p_parent_header_id or
              WIP_JOB_DETAILS.STD_ALONE = 1)*/
         /*and wjdi.organization_id = wjsi.organization_id
         and wjdi.wip_entity_id = wjsi.wip_entity_id*/
         and wjdi.wip_supply_type = wip_constants.op_pull
         and not exists
         (select 1 from wip_operations
          where wip_entity_id = wjdi.wip_entity_id
          and organization_id = wjdi.organization_id);
Line: 842

    update wip_job_dtls_interface wjdi
       set process_status = wip_constants.error
     where interface_id = l_inv_row.interface_id;
Line: 864

   SELECT distinct operation_seq_num,
          inventory_item_id_old, inventory_item_id_new,
          quantity_per_assembly,component_yield_factor, /*Component Yield Enhancement(Bug 4369064)*/
          last_update_date, last_updated_by, creation_date, created_by,
          last_update_login, request_id, program_application_id,
          program_id, program_update_date,
          department_id, wip_supply_type, date_required,
          required_quantity, quantity_issued,
          basis_type,                                       /* LBM Project */
          supply_subinventory,
          supply_locator_id, mrp_net_flag, mps_required_quantity,
          mps_date_required, attribute_category, attribute1,
          attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,
          attribute8,attribute9,attribute10,attribute11,attribute12,
          attribute13,attribute14,attribute15
     FROM WIP_JOB_DTLS_INTERFACE
    WHERE group_id = p_group_id
      AND process_phase = WIP_CONSTANTS.ML_VALIDATION
      AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
      AND wip_entity_id = p_wip_entity_id
      AND organization_id = p_organization_id
      AND load_type = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
      AND substitution_type = p_substitution_type;
Line: 990

  select interface_id
    from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and wjdi.load_type = wip_job_details.wip_mtl_requirement
         and wjdi.substitution_type = p_substitution_type
         and wjdi.operation_seq_num = p_operation_seq_num
         and wjdi.inventory_item_id_new = p_inventory_item_id_new
         and wjdi.wip_supply_type is null;
Line: 1026

    update wip_job_dtls_interface wjdi
       set process_status = wip_constants.error
     where group_id = p_group_id
       and process_phase = wip_constants.ml_validation
       and process_status in (wip_constants.running,
                              wip_constants.warning)
       and wip_entity_id = p_wip_entity_id
       and organization_id = p_organization_id
       and wjdi.load_type = wip_job_details.wip_mtl_requirement
       and wjdi.substitution_type = p_substitution_type
       and wjdi.operation_seq_num = p_operation_seq_num
       and wjdi.inventory_item_id_new = p_inventory_item_id_new
       and wjdi.wip_supply_type is null;
Line: 1050

    select interface_id
      from wip_job_dtls_interface wjdi
     where wjdi.group_id = p_group_id
       and wjdi.process_phase = wip_constants.ml_validation
       and wjdi.process_status in (wip_constants.running,
                                   wip_constants.warning)
       and wjdi.wip_entity_id = p_wip_entity_id
       and wjdi.organization_id = p_organization_id
       and wjdi.load_type = wip_job_details.wip_mtl_requirement
       and wjdi.substitution_type = p_substitution_type
       and wjdi.operation_seq_num = p_operation_seq_num
       and (   wjdi.inventory_item_id_old is null
            or (wjdi.inventory_item_id_old <> nvl(wjdi.inventory_item_id_new, wjdi.inventory_item_id_old)
                and wjdi.quantity_per_assembly is null
                and not exists
                      ( select 1
                        from   bom_substitute_components bsc
                        where  bsc.substitute_component_id = wjdi.inventory_item_id_new
                        and    bsc.component_sequence_id =
                            (select wro.component_sequence_id
                             from   wip_requirement_operations wro
                             where  wro.inventory_item_id        = wjdi.inventory_item_id_old
                             and    wro.wip_entity_id            = wjdi.wip_entity_id
                             and    wro.operation_seq_num        = wjdi.operation_seq_num
                             and    wro.organization_id          = wjdi.organization_id
                             )
                         and  bsc.acd_type is null
                        )
                  )
              ) ;
Line: 1103

    update wip_job_dtls_interface wjdi
       set process_status = wip_constants.error
     where group_id = p_group_id
       and process_phase = wip_constants.ml_validation
       and process_status in (wip_constants.running,
                              wip_constants.warning)
       and wip_entity_id = p_wip_entity_id
       and organization_id = p_organization_id
       and wjdi.load_type = wip_job_details.wip_mtl_requirement
       and wjdi.substitution_type = p_substitution_type
       and wjdi.operation_seq_num = p_operation_seq_num
       and (   wjdi.inventory_item_id_old is null
            or (    wjdi.inventory_item_id_old <> nvl(wjdi.inventory_item_id_new, wjdi.inventory_item_id_old)
                and wjdi.quantity_per_assembly is null
               )
           );
Line: 1160

         SELECT start_quantity
          INTO X_start_quantity
          FROM WIP_DISCRETE_JOBS
         WHERE wip_entity_id = p_wip_entity_id
          AND organization_id = p_organization_id;
Line: 1168

             SELECT nvl(component_yield_factor,1),required_quantity,quantity_per_assembly
             INTO x_component_yield_factor_wro,x_required_quantity_wro,x_quantity_per_assembly_wro
             FROM wip_requirement_operations
             WHERE wip_entity_id = p_wip_entity_id
             AND organization_id = p_organization_id
             AND inventory_item_id = p_inventory_item_id_old;
Line: 1246

          UPDATE WIP_JOB_DTLS_INTERFACE
          SET    quantity_per_assembly   = nvl(X_quantity_per_assembly, quantity_per_assembly),
                 required_quantity       = x_required_quantity,
                 mps_required_quantity   = nvl(x_mps_required_quantity,mps_required_quantity),
                 component_yield_factor  = nvl(x_component_yield_factor,component_yield_factor)
                                                /*Component Yield Enhancement(Bug 4369064)*/
          WHERE   group_id = p_group_id
          AND     wip_entity_id = p_wip_entity_id
          AND     organization_id = p_organization_id
          AND     load_type = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
          AND     substitution_type = p_substitution_type
          AND     operation_seq_num = p_operation_seq_num
          AND     inventory_item_id_old = p_inventory_item_id_old;
Line: 1280

   SELECT distinct operation_seq_num,
          inventory_item_id_old, inventory_item_id_new,
          quantity_per_assembly,component_yield_factor, /*Component Yield Enhancement(Bug 4369064)*/
          last_update_date, last_updated_by, creation_date, created_by,
          last_update_login, request_id, program_application_id,
          program_id, program_update_date,
          department_id, wip_supply_type, date_required,
          required_quantity, quantity_issued,
          basis_type,                                       /* LBM Project */
          supply_subinventory,
          supply_locator_id, mrp_net_flag, mps_required_quantity,
          mps_date_required, attribute_category, attribute1,
          attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,
          attribute8,attribute9,attribute10,attribute11,attribute12,
          attribute13,attribute14,attribute15
     FROM WIP_JOB_DTLS_INTERFACE
    WHERE group_id = p_group_id
      AND process_phase = WIP_CONSTANTS.ML_VALIDATION
      AND process_status in (WIP_CONSTANTS.RUNNING, WIP_CONSTANTS.WARNING)
      AND wip_entity_id = p_wip_entity_id
      AND organization_id = p_organization_id
      AND load_type = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
      AND substitution_type = p_substitution_type;
Line: 1369

                Safe_Delete (p_group_id,
                        p_wip_entity_id,
                        p_organization_id,
                        p_substitution_type,
                        cur_row.operation_seq_num,
                        cur_row.inventory_item_id_old);
Line: 1461

    IF p_substitution_type = WIP_JOB_DETAILS.WIP_DELETE THEN
        SELECT count(*)
          INTO x_count
          FROM WIP_JOB_DTLS_INTERFACE
         WHERE group_id         = p_group_id
           AND process_status   = WIP_CONSTANTS.ERROR
           AND wip_entity_id    = p_wip_entity_id
           AND organization_id  = p_organization_id
           AND load_type        = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
           AND substitution_type= p_substitution_type
           AND operation_seq_num= p_operation_seq_num
           AND inventory_item_id_old = p_inventory_item_id_old;
Line: 1475

        SELECT count(*)
          INTO x_count
          FROM WIP_JOB_DTLS_INTERFACE
         WHERE group_id         = p_group_id
           AND process_status   = WIP_CONSTANTS.ERROR
           AND wip_entity_id    = p_wip_entity_id
           AND organization_id  = p_organization_id
           AND load_type        = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
           AND substitution_type= p_substitution_type
           AND operation_seq_num= p_operation_seq_num
           AND inventory_item_id_new = p_inventory_item_id_new;
Line: 1488

         SELECT count(*)
          INTO x_count
          FROM WIP_JOB_DTLS_INTERFACE
         WHERE group_id         = p_group_id
           AND process_status   = WIP_CONSTANTS.ERROR
           AND wip_entity_id    = p_wip_entity_id
           AND organization_id  = p_organization_id
           AND load_type        = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
           AND substitution_type= p_substitution_type
           AND operation_seq_num= p_operation_seq_num
           AND inventory_item_id_old = p_inventory_item_id_old
           AND inventory_item_id_new = p_inventory_item_id_new;
Line: 1521

    IF p_substitution_type = WIP_JOB_DETAILS.WIP_DELETE THEN
        SELECT count(*)
          INTO x_count
          FROM WIP_JOB_DTLS_INTERFACE
         WHERE group_id         = p_group_id
           AND process_status   = WIP_CONSTANTS.ERROR
           AND wip_entity_id    = p_wip_entity_id
           AND organization_id  = p_organization_id
           AND load_type        = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
           AND substitution_type= p_substitution_type
           AND operation_seq_num= p_operation_seq_num
           AND inventory_item_id_old IS NULL;
Line: 1535

        SELECT count(*)
          INTO x_count
          FROM WIP_JOB_DTLS_INTERFACE
         WHERE group_id         = p_group_id
           AND process_status   = WIP_CONSTANTS.ERROR
           AND wip_entity_id    = p_wip_entity_id
           AND organization_id  = p_organization_id
           AND load_type        = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
           AND substitution_type= p_substitution_type
           AND operation_seq_num= p_operation_seq_num
           AND (inventory_item_id_new IS NULL
            OR  quantity_per_assembly IS NULL);
Line: 1549

        SELECT count(*)
          INTO x_count
          FROM WIP_JOB_DTLS_INTERFACE
         WHERE group_id         = p_group_id
           AND process_status   = WIP_CONSTANTS.ERROR
           AND wip_entity_id    = p_wip_entity_id
           AND organization_id  = p_organization_id
           AND load_type        = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
           AND substitution_type= p_substitution_type
           AND operation_seq_num= p_operation_seq_num
           AND (inventory_item_id_old IS NULL
            OR  quantity_per_assembly IS NULL);