DBA Data[Home] [Help]

APPS.CSD_HV_WIP_JOB_PVT SQL Statements

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

Line: 66

 select wcti.transaction_quantity,
        wcti.transaction_uom from
           wip_cost_txn_interface wcti
                  where
                   wcti.wip_entity_id = p_wip_entity_id and
                   wcti.operation_seq_num = p_operation_seq_num and
                   wcti.resource_seq_num  = p_resource_seq_num and
                  process_phase = 1 and
                  process_status = 1;
Line: 119

  select 'exists' from wip_job_schedule_interface where
  group_id = p_group_id
  and process_status = lc_error_process_status;
Line: 146

  select 'exists' from mtl_transactions_interface where
  transaction_header_id = p_transaction_header_id
  and process_flag = lc_error_process_status;
Line: 158

   SELECT error_explanation --,error_code
   FROM mtl_transactions_interface mti
   WHERE   transaction_header_id = p_transaction_header_id
   AND mti.process_flag = lc_error_process_status
   AND mti.lock_flag = 2;
Line: 215

       select wie.error,
        wie.error_type,
        wie.error_type_meaning,
        wjsi.wip_entity_id,
        wjsi.organization_id,
        we.wip_entity_name,
        wjdi.operation_seq_num,
        wjdi.inventory_item_id_new,
        wjdi.resource_id_new
      from
        wip_interface_errors_v wie,
        wip_job_schedule_interface wjsi,
        wip_entities we,
        wip_job_dtls_interface wjdi
      where wie.interface_id = wjsi.interface_id
        and we.wip_entity_id = wjsi.wip_entity_id
        and wjsi.group_id = wjdi.group_id
        and wjsi.group_id = p_group_id;
Line: 235

      select bom.resource_code
      from   bom_resources bom
      where  bom.resource_id = p_resource_id_new;
Line: 241

      select mtl.concatenated_segments
      from   mtl_system_items_kfv mtl
      where  mtl.inventory_item_id = p_inventory_item_id_new
        and  mtl.organization_id = p_organization_id;
Line: 301

      Select count(*) into l_job_count from wip_entities where wip_entity_name = p_job_name and
            organization_id = p_organization_id ;
Line: 310

            Select count(*) into l_job_count from wip_job_schedule_interface where job_name = p_job_name and
                organization_id = p_organization_id ;
Line: 371

            Select p_job_prefix || TO_CHAR( CSD_JOB_NAME_S.NEXTVAL ) into
            x_job_name From Dual;
Line: 399

PROCEDURE insert_job_header
(
      p_job_header_rec           IN          wip_job_schedule_interface%ROWTYPE,
      x_return_status               OUT   NOCOPY   VARCHAR2
)
IS

      -- Job Record to hold the Job header, bills and routing information being inserted
      -- into wip_job_schedule_interface

   l_job_header_rec                wip_job_schedule_interface%ROWTYPE := p_job_header_rec;
Line: 416

      l_mod_name                      VARCHAR2(2000) := 'csd.plsql.csd_wip_job_pvt.insert_job_header.';
Line: 443

                  'Entering procedure insert_job_header' );
Line: 463

      l_job_header_rec.last_update_date := SYSDATE;
Line: 465

      l_job_header_rec.last_updated_by := fnd_global.user_id;
Line: 466

      l_job_header_rec.last_update_login := fnd_global.login_id;
Line: 471

         INSERT INTO wip_job_schedule_interface
         (
         wip_entity_id,
         interface_id,
         last_update_date,
         last_updated_by,
         creation_date,
         created_by,
         last_update_login,
         load_type,
         process_phase,
         process_status,
         group_id,
         header_id,
         source_code,
          source_line_id,
         job_name,
         organization_id,
         status_type,
         first_unit_start_date,
         last_unit_completion_date,
         completion_subinventory,
         completion_locator_id,
         start_quantity,
         net_quantity,
         class_code,
         primary_item_id,
         bom_reference_id,
         routing_reference_id,
         alternate_routing_designator,
         alternate_bom_designator,
         project_id,              --bug#13472453
         task_id,                 --bug#13472453
         end_item_unit_number     --bug#13472453
         )
         VALUES
         (
         l_job_header_rec.wip_entity_id,
             l_job_header_rec.interface_id,
         l_job_header_rec.last_update_date,
         l_job_header_rec.last_updated_by,
         l_job_header_rec.creation_date,
         l_job_header_rec.created_by,
         l_job_header_rec.last_update_login,
         l_job_header_rec.load_type,
         l_job_header_rec.process_phase,
         l_job_header_rec.process_status,
         l_job_header_rec.group_id,
         l_job_header_rec.header_id,
         l_job_header_rec.source_code,
      l_job_header_rec.source_line_id,
         l_job_header_rec.job_name,
         l_job_header_rec.organization_id,
         l_job_header_rec.status_type,
         l_job_header_rec.first_unit_start_date,
            l_job_header_rec.last_unit_completion_date,
         l_job_header_rec.completion_subinventory,
         l_job_header_rec.completion_locator_id,
         l_job_header_rec.start_quantity,
         l_job_header_rec.net_quantity,
         l_job_header_rec.class_code,
         l_job_header_rec.primary_item_id,
         l_job_header_rec.bom_reference_id,
         l_job_header_rec.routing_reference_id,
         l_job_header_rec.alternate_routing_designator,
         l_job_header_rec.alternate_bom_designator,
         l_job_header_rec.project_id,            --bug#13472453
         l_job_header_rec.task_id,               --bug#13472453
         l_job_header_rec.end_item_unit_number   --bug#13472453
         );
Line: 543

         FND_MESSAGE.SET_NAME('CSD','CSD_JOB_HEADER_INSERT_ERR');
Line: 554

                  'Leaving procedure insert_job_header');
Line: 558

END insert_job_header;
Line: 564

PROCEDURE insert_job_details
(
      p_job_details_rec          IN          wip_job_dtls_interface%ROWTYPE,
      x_return_status               OUT   NOCOPY   VARCHAR2
)
IS

      -- Job Record to hold the Job Details information being inserted
      -- into wip_job_dtls_interface

       l_job_details_rec                wip_job_dtls_interface%ROWTYPE := p_job_details_rec;
Line: 581

      l_mod_name                      VARCHAR2(2000) := 'csd.plsql.csd_wip_job_pvt.insert_job_header.';
Line: 608

                  'Entering procedure insert_job_details' );
Line: 626

      l_job_details_rec.last_update_date := SYSDATE;
Line: 628

      l_job_details_rec.last_updated_by := fnd_global.user_id;
Line: 629

      l_job_details_rec.last_update_login := fnd_global.login_id;
Line: 634

    INSERT INTO wip_job_dtls_interface
       (last_updated_by,
        last_update_date,
        last_update_login,
        created_by,
        creation_date,
        date_required,
        start_date,
        group_id,
        parent_header_id,
        inventory_item_id_old,
        inventory_item_id_new,
        resource_id_old,
        resource_id_new,
        resource_seq_num,
        load_type,
        mrp_net_flag,
        operation_seq_num,
        organization_id,
        process_phase,
        process_status,
   --     quantity_issued,
        quantity_per_assembly,
        required_quantity,
        uom_code,
        usage_rate_or_amount,
        assigned_units,
        wip_entity_id,
        wip_supply_type,
        autocharge_type,
        basis_type,
        completion_date,
        scheduled_flag,
        standard_rate_flag,
        substitution_type,
        supply_subinventory,
        supply_locator_id, --bug8465719
        -- swai: add columns for operations
        backflush_flag,
        count_point_type,
        department_id,
        first_unit_completion_date,
        first_unit_start_date,
        last_unit_completion_date,
        last_unit_start_date,
        minimum_transfer_quantity,
        standard_operation_id,
        description
        )
        Values
        (
            l_job_details_rec.last_updated_by,
            l_job_details_rec.last_update_date,
            l_job_details_rec.last_update_login,
            l_job_details_rec.created_by,
            l_job_details_rec.creation_date, -- sysdate,
            l_job_details_rec.date_required,
            l_job_details_rec.start_date,
            l_job_details_rec.group_id,
            l_job_details_rec.parent_header_id,
            l_job_details_rec.inventory_item_id_old,
            l_job_details_rec.inventory_item_id_new, -- 'WIP Completion',
            l_job_details_rec.resource_id_old,
            l_job_details_rec.resource_id_new,
            l_job_details_rec.resource_seq_num,
            l_job_details_rec.load_type,
            l_job_details_rec.mrp_net_flag,
            l_job_details_rec.operation_seq_num,
            l_job_details_rec.organization_id,
            l_job_details_rec.process_phase,
            l_job_details_rec.process_status,
        --    l_job_details_rec.quantity_issued,
        --    null,
            l_job_details_rec.quantity_per_assembly,
            l_job_details_rec.required_quantity,
            l_job_details_rec.uom_code,
            l_job_details_rec.usage_rate_or_amount,
            l_job_details_rec.assigned_units,
            l_job_details_rec.wip_entity_id,
            l_job_details_rec.wip_supply_type,
            l_job_details_rec.autocharge_type,
            l_job_details_rec.basis_type,
            l_job_details_rec.completion_date,
            l_job_details_rec.scheduled_flag,
            l_job_details_rec.standard_rate_flag,
            l_job_details_rec.substitution_type,
            l_job_details_rec.supply_subinventory,
            l_job_details_rec.supply_locator_id, --bug#8465719
            -- swai: add columns for operations
            l_job_details_rec.backflush_flag,
            l_job_details_rec.count_point_type,
            l_job_details_rec.department_id,
            l_job_details_rec.first_unit_completion_date,
            l_job_details_rec.first_unit_start_date,
            l_job_details_rec.last_unit_completion_date,
            l_job_details_rec.last_unit_start_date,
            l_job_details_rec.minimum_transfer_quantity,
            l_job_details_rec.standard_operation_id,
            l_job_details_rec.description
            );
Line: 738

         FND_MESSAGE.SET_NAME('CSD','CSD_JOB_DETAILS_INSERT_ERR');
Line: 749

                  'Leaving procedure insert_job_details');
Line: 753

END insert_job_details;
Line: 756

PROCEDURE insert_transactions_header
(
      p_transactions_interface_rec           IN          mtl_transactions_interface%ROWTYPE,
      x_return_status               OUT   NOCOPY   VARCHAR2
)
IS

      -- Job Record to hold the Job Details information being inserted
      -- into wip_job_dtls_interface

       l_transactions_interface_rec                mtl_transactions_interface%ROWTYPE := p_transactions_interface_rec;
Line: 771

      lc_mod_name    CONSTANT                 VARCHAR2(2000) := 'csd.plsql.csd_hv_wip_job_pvt.insert_transactions_header.';
Line: 788

                  'Entering procedure insert_transactions_header' );
Line: 805

      l_transactions_interface_rec.last_update_date := SYSDATE;
Line: 807

      l_transactions_interface_rec.last_updated_by := fnd_global.user_id;
Line: 808

      l_transactions_interface_rec.last_update_login := fnd_global.login_id;
Line: 814

    INSERT INTO mtl_transactions_interface
       (last_updated_by,
        last_update_date,
        last_update_login,
        created_by,
        creation_date,
        transaction_header_id,
        source_code,
        completion_transaction_id,
        inventory_item_id,
        subinventory_code,
        locator_id,
        transaction_quantity,
        transaction_uom,
        primary_quantity,
        transaction_date,
        organization_id,
        transaction_source_id,
        transaction_source_type_id,
        transaction_type_id,
        wip_entity_type,
        operation_seq_num,
        revision,
        transaction_mode,
        process_flag,
        source_header_id,
        source_line_id,
        transaction_interface_id,
        reason_id, -- swai: bug 6841113
        final_completion_flag
        )
        Values
        (
            l_transactions_interface_rec.last_updated_by,
            l_transactions_interface_rec.last_update_date,
            l_transactions_interface_rec.last_update_login,
            l_transactions_interface_rec.created_by,
            l_transactions_interface_rec.creation_date, -- sysdate,
            l_transactions_interface_rec.transaction_header_id,
            l_transactions_interface_rec.source_code, -- 'WIP Issue',
            l_transactions_interface_rec.completion_transaction_id,
            l_transactions_interface_rec.inventory_item_id, --8229,
            l_transactions_interface_rec.subinventory_code,
            l_transactions_interface_rec.locator_id,
            l_transactions_interface_rec.transaction_quantity, -- 1,
            l_transactions_interface_rec.transaction_uom, --'Ea',
            l_transactions_interface_rec.primary_quantity, -- 1,
            l_transactions_interface_rec.transaction_date, -- sysdate,
            l_transactions_interface_rec.organization_id, --207,
            l_transactions_interface_rec.transaction_source_id, --124743,
            l_transactions_interface_rec.transaction_source_type_id, -- 5,
            l_transactions_interface_rec.transaction_type_id, -- 35,
            l_transactions_interface_rec.wip_entity_type, -- 3,
            l_transactions_interface_rec.operation_seq_num,
            l_transactions_interface_rec.revision, --null, -- ,
            l_transactions_interface_rec.transaction_mode,
            l_transactions_interface_rec.process_flag,
            l_transactions_interface_rec.source_header_id, -- 124743, -- ,
            l_transactions_interface_rec.source_line_id, -- -1, --10,
            l_transactions_interface_rec.transaction_interface_id, -- null, -- mtl_material_transactions_s.nextval, --l_transaction_interface_id,
            l_transactions_interface_rec.reason_id, -- swai: bug 6841113
            l_transactions_interface_rec.final_completion_flag ); -- 'N' ) ;
Line: 881

         FND_MESSAGE.SET_NAME('CSD','CSD_TXNS_HEADER_INSERT_ERR');
Line: 893

                  'Leaving procedure insert_transactions_header');
Line: 897

END insert_transactions_header;
Line: 900

PROCEDURE update_transactions_header
(
      p_transactions_interface_rec  IN          mtl_transactions_interface%ROWTYPE,
      x_return_status               OUT   NOCOPY   VARCHAR2
)
IS



      -- constant used for FND_LOG debug messages

      lc_mod_name    CONSTANT                 VARCHAR2(2000) := 'csd.plsql.csd_hv_wip_job_pvt.update_transactions_header.';
Line: 922

                  'Entering procedure update_transactions_header' );
Line: 935

    UPDATE mtl_transactions_interface
     SET
        subinventory_code = p_transactions_interface_rec.subinventory_code,
        locator_id = p_transactions_interface_rec.locator_id,
        revision = p_transactions_interface_rec.revision,
        reason_id = p_transactions_interface_rec.reason_id  -- swai: bug 6841113
     where
        transaction_interface_id = p_transactions_interface_rec.transaction_interface_id;
Line: 948

         FND_MESSAGE.SET_NAME('CSD','CSD_TXNS_HEADER_UPDATE_ERR');
Line: 959

                  'Leaving procedure update_transactions_header');
Line: 963

END update_transactions_header;
Line: 966

PROCEDURE insert_transaction_lots
(
      p_txn_lots_interface_rec            IN          mtl_transaction_lots_interface%ROWTYPE,
      x_return_status               OUT   NOCOPY   VARCHAR2
)
IS


      -- constant used for FND_LOG debug messages

      lc_mod_name    CONSTANT                 VARCHAR2(2000) := 'csd.plsql.csd_hv_wip_job_pvt.insert_transaction_lots';
Line: 980

      l_last_update_date DATE;
Line: 982

      l_last_updated_by NUMBER;
Line: 983

         l_last_updated_by_name VARCHAR2(100);
Line: 984

      l_last_update_login NUMBER;
Line: 992

                  'Entering procedure insert_transaction_lots' );
Line: 1001

      l_last_update_date := SYSDATE;
Line: 1003

      l_last_updated_by := fnd_global.user_id;
Line: 1004

      l_last_update_login := fnd_global.login_id;
Line: 1010

    INSERT INTO mtl_transaction_lots_interface
       (last_updated_by,
        last_update_date,
        last_update_login,
        created_by,
        creation_date,
        transaction_interface_id,
        lot_number,
        transaction_quantity,
        serial_transaction_temp_id
        )
        Values
        (
            l_last_updated_by,
            l_last_update_date,
            l_last_update_login,
            l_created_by,
            l_creation_date, -- sysdate,
            p_txn_lots_interface_rec.transaction_interface_id,
            p_txn_lots_interface_rec.lot_number,
            p_txn_lots_interface_rec.transaction_quantity,
            p_txn_lots_interface_rec.serial_transaction_temp_id
            ); -- 'N' ) ;
Line: 1037

         FND_MESSAGE.SET_NAME('CSD','CSD_TXN_LOTS_INSERT_ERR');
Line: 1048

                  'Leaving procedure insert_transaction_lots');
Line: 1052

END insert_transaction_lots;
Line: 1055

PROCEDURE insert_upd_serial_numbers
(
      p_srl_nmbrs_interface_rec           IN          mtl_serial_numbers_interface%ROWTYPE,
      x_return_status               OUT   NOCOPY   VARCHAR2
)
IS


      -- constant used for FND_LOG debug messages

      lc_mod_name    CONSTANT                 VARCHAR2(2000) := 'csd.plsql.csd_hv_wip_job_pvt.insert_upd_serial_numbers.';
Line: 1069

      l_last_update_date DATE;
Line: 1071

      l_last_updated_by NUMBER;
Line: 1072

         l_last_updated_by_name VARCHAR2(100);
Line: 1073

      l_last_update_login NUMBER;
Line: 1082

                  'Entering procedure insert_upd_serial_numbers' );
Line: 1087

        Select count(*) into l_row_exists from mtl_serial_numbers_interface
            where transaction_interface_id =
                p_srl_nmbrs_interface_rec.transaction_interface_id;
Line: 1095

            UPDATE mtl_serial_numbers_interface
            SET
                fm_serial_number = p_srl_nmbrs_interface_rec.fm_serial_number
            where transaction_interface_id =
                p_srl_nmbrs_interface_rec.transaction_interface_id;
Line: 1103

              FND_MESSAGE.SET_NAME('CSD','CSD_SRL_NMBRS_UPDATE_ERR');
Line: 1114

         l_last_update_date := SYSDATE;
Line: 1116

         l_last_updated_by := fnd_global.user_id;
Line: 1117

         l_last_update_login := fnd_global.login_id;
Line: 1123

                INSERT INTO mtl_serial_numbers_interface
                (   last_updated_by,
                    last_update_date,
                    last_update_login,
                    created_by,
                    creation_date,
                    transaction_interface_id,
                    fm_serial_number
                )
                Values
                (
                    l_last_updated_by,
                    l_last_update_date,
                    l_last_update_login,
                    l_created_by,
                    l_creation_date, -- sysdate,
                    p_srl_nmbrs_interface_rec.transaction_interface_id,
                    p_srl_nmbrs_interface_rec.fm_serial_number
                    ); -- 'N' ) ;
Line: 1146

                        FND_MESSAGE.SET_NAME('CSD','CSD_SRL_NMBRS_INSERT_ERR');
Line: 1157

                  'Leaving procedure insert_upd_serial_numbers');
Line: 1161

END insert_upd_serial_numbers;
Line: 1164

PROCEDURE insert_wip_cost_txn
(
      p_wip_cost_txn_interface_rec           IN          wip_cost_txn_interface%ROWTYPE,
      x_return_status               OUT   NOCOPY   VARCHAR2
)
IS



      -- constant used for FND_LOG debug messages

      lc_mod_name    CONSTANT                 VARCHAR2(2000) := 'csd.plsql.csd_hv_wip_job_pvt.insert_transactions_header.';
Line: 1189

      l_last_update_date DATE;
Line: 1191

      l_last_updated_by NUMBER;
Line: 1192

         l_last_updated_by_name VARCHAR2(100);
Line: 1193

      l_last_update_login NUMBER;
Line: 1206

                  'Entering procedure insert_wip_cost_txn' );
Line: 1222

      l_last_update_date := SYSDATE;
Line: 1224

      l_last_updated_by := fnd_global.user_id;
Line: 1225

      l_last_updated_by_name := fnd_global.user_name;
Line: 1226

      l_last_update_login := fnd_global.login_id;
Line: 1232

    INSERT INTO wip_cost_txn_interface
       (last_updated_by_name,
        last_updated_by,
        last_update_date,
        last_update_login,
        created_by_name,
        creation_date,
        operation_seq_num,
        organization_id,
        organization_code,
        process_phase,
        process_status,
        resource_seq_num,
        transaction_date,
        transaction_quantity,
        transaction_type,
        transaction_uom,
        wip_entity_name,
        wip_entity_id,
        employee_id,
        employee_num,
        entity_type
        )
        Values
        (
            l_last_updated_by_name,
            l_last_updated_by,
            l_last_update_date,
            l_last_update_login,
            l_created_by_name,
            l_creation_date, -- sysdate,
            p_wip_cost_txn_interface_rec.operation_seq_num,
            p_wip_cost_txn_interface_rec.organization_id,
            p_wip_cost_txn_interface_rec.organization_code,
            l_process_phase,
            l_process_status,
            p_wip_cost_txn_interface_rec.resource_seq_num,
            p_wip_cost_txn_interface_rec.transaction_date,
            p_wip_cost_txn_interface_rec.transaction_quantity,
            p_wip_cost_txn_interface_rec.transaction_type,
            p_wip_cost_txn_interface_rec.transaction_uom,
            p_wip_cost_txn_interface_rec.wip_entity_name,
            p_wip_cost_txn_interface_rec.wip_entity_id,
            p_wip_cost_txn_interface_rec.employee_id,
            p_wip_cost_txn_interface_rec.employee_num,
            l_entity_type
             ) ;
Line: 1283

         FND_MESSAGE.SET_NAME('CSD','CSD_WIP_COST_TXN_INSERT_ERR');
Line: 1294

                  'Leaving procedure insert_transactions_header');
Line: 1298

END insert_wip_cost_txn;
Line: 1301

PROCEDURE insert_wip_move_txn
(
      p_wip_move_txn_interface_rec           IN          wip_move_txn_interface%ROWTYPE,
      x_return_status               OUT   NOCOPY   VARCHAR2
)
IS



      -- constant used for FND_LOG debug messages

      lc_mod_name    CONSTANT                 VARCHAR2(2000) := 'csd.plsql.csd_hv_wip_job_pvt.insert_wip_move_txn';
Line: 1324

      l_last_update_date DATE;
Line: 1326

      l_last_updated_by NUMBER;
Line: 1327

         l_last_updated_by_name VARCHAR2(100);
Line: 1329

      l_last_update_login NUMBER;
Line: 1341

                  'Entering procedure insert_wip_move_txn' );
Line: 1356

      l_last_update_date := SYSDATE;
Line: 1359

      l_last_updated_by := fnd_global.user_id;
Line: 1360

      l_last_updated_by_name := fnd_global.user_name;
Line: 1361

      l_last_update_login := fnd_global.login_id;
Line: 1367

    insert into wip_move_txn_interface(
        transaction_id,
        last_update_date,
        last_updated_by,
        last_updated_by_name,
        creation_date,
        created_by,
        created_by_name,
        group_id,
        process_phase,
        process_status,
        organization_id,
        wip_entity_name,
        transaction_date,
        fm_operation_seq_num,
        fm_intraoperation_step_type,
        to_operation_seq_num,
        to_intraoperation_step_type,
        transaction_quantity,
        transaction_uom
    ) values (
        p_wip_move_txn_interface_rec.transaction_id,
        l_last_update_date,       /* last_update_date */
        l_last_updated_by,        /* last_updated_by */
        l_last_updated_by_name,   /* last_updated_by_name */
        l_creation_date,          /* creation_date */
        l_created_by,             /* created_by */
        l_created_by_name,        /* created_by_name */
        p_wip_move_txn_interface_rec.group_id,      /* group_id */
        l_process_phase,             /* process phase */
        l_process_status,          /* process status */
        p_wip_move_txn_interface_rec.organization_id,
        p_wip_move_txn_interface_rec.wip_entity_name,
        p_wip_move_txn_interface_rec.transaction_date,
        p_wip_move_txn_interface_rec.fm_operation_seq_num,
        p_wip_move_txn_interface_rec.fm_intraoperation_step_type,
        p_wip_move_txn_interface_rec.to_operation_seq_num,
        p_wip_move_txn_interface_rec.to_intraoperation_step_type,
        p_wip_move_txn_interface_rec.transaction_quantity,
        p_wip_move_txn_interface_rec.transaction_uom
        );
Line: 1412

         FND_MESSAGE.SET_NAME('CSD','CSD_WIP_MOVE_TXN_INSERT_ERR');
Line: 1423

                  'Leaving procedure insert_wip_move_txn');
Line: 1427

END insert_wip_move_txn;
Line: 1432

PROCEDURE insert_cst_interface(p_wip_entity_id 		IN NUMBER,
					 		   p_interface_id		IN NUMBER
					 		  )
IS
BEGIN
	INSERT INTO cst_comp_snap_interface
		( created_by,
		  creation_date,
		  last_update_date,
		  last_update_login,
		  last_updated_by,
		  OPERATION_SEQ_NUM,
		  quantity_completed,
		  transaction_interface_id,
		  wip_entity_id,
		  primary_quantity
		)
	SELECT
		 fnd_global.user_id,
		 SYSDATE,
		 SYSDATE,
		 fnd_global.login_id,
		 fnd_global.user_id,
		 operation_seq_num,
		 quantity_completed,
		 p_interface_id,
		 p_wip_entity_id,
		 quantity_completed
	FROM wip_operations wo
	WHERE wo.wip_entity_id = p_wip_entity_id;
Line: 1463

END insert_cst_interface;
Line: 1491

        INSERT INTO csd_wip_transaction_details
        (wip_transaction_detail_id,inventory_item_id,
        wip_entity_id,operation_seq_num,
        object_version_number,
        last_update_login,created_by,
        creation_date,last_updated_by,
        last_update_date)
        SELECT csd_wip_transaction_details_s1.nextval,t.*
        FROM (
        SELECT
        wro.inventory_item_id,
        wro.wip_entity_id,
        wro.operation_seq_num,
        to_number('1'),
        fnd_global.login_id,
        fnd_global.user_id created_by,
        sysdate creation_date,
        fnd_global.user_id last_updated_by,
        sysdate last_update_date
        FROM csd_repair_job_xref crj,wip_requirement_operations wro
        WHERE crj.wip_entity_id = wro.wip_entity_id
        AND crj.repair_line_id = p_repair_line_id
        AND NOT EXISTS (SELECT 'exists'
                        FROM csd_wip_transaction_details cwt
                        WHERE cwt.wip_entity_id = wro.wip_entity_id
                        AND cwt.operation_seq_num = wro.operation_seq_num
                        AND cwt.inventory_item_id = wro.inventory_item_id
                       )
        )t;
Line: 1526

        INSERT INTO csd_wip_transaction_details
        (wip_transaction_detail_id,inventory_item_id,
        wip_entity_id,operation_seq_num,
        object_version_number,
        last_update_login,created_by,
        creation_date,last_updated_by,
        last_update_date)
        SELECT csd_wip_transaction_details_s1.nextval,t.*
        FROM (
        SELECT wro.inventory_item_id,
        wro.wip_entity_id,
        wro.operation_seq_num,
        to_number('1'),
        fnd_global.login_id,
        fnd_global.user_id created_by,
        sysdate creation_date,
        fnd_global.user_id last_updated_by,
        sysdate last_update_date
        FROM wip_requirement_operations wro
        WHERE wro.wip_entity_id = p_wip_entity_id
        AND NOT EXISTS (SELECT 'exists'
                        FROM csd_wip_transaction_details cwt
                        WHERE cwt.wip_entity_id = wro.wip_entity_id
                        AND cwt.operation_seq_num = wro.operation_seq_num
                        AND cwt.inventory_item_id = wro.inventory_item_id
                       )
        ) t;
Line: 1556

        INSERT INTO csd_wip_transaction_details
        (wip_transaction_detail_id,inventory_item_id,
        wip_entity_id,operation_seq_num,
        object_version_number,
        last_update_login,created_by,
        creation_date,last_updated_by,
        last_update_date)
        SELECT csd_wip_transaction_details_s1.nextval,t.*
        FROM (
        SELECT wro.inventory_item_id,
        wro.wip_entity_id,
        wro.operation_seq_num,
        to_number('1'),
        fnd_global.login_id,
        fnd_global.user_id created_by,
        sysdate creation_date,
        fnd_global.user_id last_updated_by,
        sysdate last_update_date
        FROM wip_requirement_operations wro,csd_repair_job_xref crj
        WHERE crj.wip_entity_id = wro.wip_entity_id
        AND NOT EXISTS (SELECT 'exists'
                        FROM csd_wip_transaction_details cwt
                        WHERE cwt.wip_entity_id = wro.wip_entity_id
                        AND cwt.operation_seq_num = wro.operation_seq_num
                        AND cwt.inventory_item_id = wro.inventory_item_id
                       )
        ) t;
Line: 1643

               lc_mod_name||'beforecallinsertjobcomptxn',
               'Just before calling insert_job_comp_txn');
Line: 1646

   insert_job_comp_txn (
       p_api_version_number       => lc_api_version_number,
       p_init_msg_list            => fnd_api.g_false ,
       p_commit                   => fnd_api.g_false,
       p_validation_level         => p_validation_level,
       x_return_status            => x_return_status,
       x_msg_count                => x_msg_count,
       x_msg_data                 => x_msg_data,
       p_comp_job_dtls_rec        => p_comp_job_dtls_rec,
       x_need_details_flag        => l_need_details_flag,
       x_transaction_header_id    => l_transaction_header_id
    );
Line: 1759

PROCEDURE insert_job_comp_txn
(
    p_api_version_number                  IN          NUMBER,
    p_init_msg_list                       IN          VARCHAR2 ,
    p_commit                              IN          VARCHAR2 ,
    p_validation_level                    IN          NUMBER,
    x_return_status                       OUT NOCOPY  VARCHAR2,
    x_msg_count                           OUT NOCOPY  NUMBER,
    x_msg_data                            OUT NOCOPY  VARCHAR2,
    p_comp_job_dtls_rec                   IN          JOB_DTLS_REC_TYPE,
    x_need_details_flag                   OUT NOCOPY  VARCHAR2,
    x_transaction_header_id               OUT NOCOPY  NUMBER
)
IS

     lc_api_name                CONSTANT VARCHAR2(30) := 'INSERT_JOB_COMP_TXN';
Line: 1778

     lc_mod_name                      VARCHAR2(2000) := 'csd.plsql.csd_hv_wip_job_pvt.insert_job_comp_txn';
Line: 1817

     SELECT wdj.organization_id, wdj.primary_item_id,
      (wdj.start_quantity - wdj.quantity_completed - wdj.quantity_scrapped)
      transaction_quantity,
      wdj.completion_subinventory, wdj.completion_locator_id,
      msi.primary_uom_code, msi.revision_qty_control_code,
      msi.SERIAL_NUMBER_CONTROL_CODE, msi.LOT_CONTROL_CODE
      from wip_discrete_jobs wdj, mtl_system_items_kfv msi
      where wdj.wip_entity_id = p_comp_job_dtls_rec.wip_entity_id and
            wdj.primary_item_id = msi.inventory_item_id and
            wdj.organization_id = msi.organization_id;
Line: 1829

         SELECT mtl_material_transactions_s.nextval from dual;
Line: 1832

         SELECT
           wo.quantity_waiting_to_move,
           'Y' allow_moves
          FROM
                 wip_operations wo
          WHERE  wo.operation_seq_num =
                   (select max(operation_seq_num)
                    from   wip_operations wo1
                    where  wo1.organization_id = wo.organization_id
                    and    wo1.wip_entity_id = wo.wip_entity_id
                    and    wo1.repetitive_schedule_id is NULL)
          AND    wo.organization_id = c_org_id
          AND    wo.wip_entity_id = p_comp_job_dtls_rec.wip_entity_id
          AND    wo.repetitive_schedule_id is NULL
          AND    not exists
                (select 'No move status exists'
                 from   wip_shop_floor_statuses ws,
                        wip_shop_floor_status_codes wsc
                 where  wsc.organization_id = wo.organization_id
                 and    ws.organization_id = wo.organization_id
                 and    ws.wip_entity_id = wo.wip_entity_id
                 and    ws.line_id is NULL
                 and    ws.operation_seq_num = wo.operation_seq_num
                 and    ws.intraoperation_step_type = 3
                 and    ws.shop_floor_status_code = wsc.shop_floor_status_code
                 and    wsc.status_move_flag = 2
                 and    nvl(wsc.disable_date, SYSDATE + 1) > SYSDATE)
          UNION
         SELECT
              wo.quantity_waiting_to_move,
              'N' allow_moves
         FROM
              wip_operations wo
         WHERE  wo.operation_seq_num =
                (select max(operation_seq_num)
                 from   wip_operations wo1
                 where  wo1.organization_id = wo.organization_id
                 and    wo1.wip_entity_id = wo.wip_entity_id
                 and    wo1.repetitive_schedule_id is NULL)
         AND    wo.organization_id = c_org_id
         AND    wo.wip_entity_id = p_comp_job_dtls_rec.wip_entity_id
         AND    wo.repetitive_schedule_id is NULL
         AND    exists
             (select 'Move status exists'
              from   wip_shop_floor_statuses ws,
                     wip_shop_floor_status_codes wsc
              where  wsc.organization_id = wo.organization_id
              and    ws.organization_id = wo.organization_id
              and    ws.wip_entity_id = wo.wip_entity_id
              and    ws.line_id is NULL
              and    ws.operation_seq_num = wo.operation_seq_num
              and    ws.intraoperation_step_type = 3
              and    ws.shop_floor_status_code = wsc.shop_floor_status_code
              and    wsc.status_move_flag = 2
              and    nvl(wsc.disable_date, SYSDATE + 1) > SYSDATE);
Line: 1890

         SELECT stock_locator_control_code
         from mtl_parameters
         where organization_id = p_organization_id;
Line: 1896

        SELECT locator_type
        from mtl_secondary_inventories
        where
            organization_id = p_organization_id and
            secondary_inventory_name = p_secondary_inventory_name;
Line: 1904

        SELECT location_control_code
        from mtl_system_items_b
        where
           organization_id = p_organization_id and
           inventory_item_id = p_inventory_item_id;
Line: 1914

               'Entering private API insert_job_comp_txn' );
Line: 1917

   SAVEPOINT INSERT_JOB_COMP_TXN_PVT;
Line: 2075

               lc_mod_name||'beforecallinserttxnshdr',
               'Just before calling insert_transactions_header');
Line: 2083

                SELECT primary_cost_method,decode(auto_compute_final_completion,1,'Y','N')
                INTO l_costing_method,lc_n_final_completion_flag
                FROM mtl_parameters mp,wip_parameters wp
                WHERE mp.organization_id = l_transactions_interface_rec.organization_id
                  AND wp.organization_id = l_transactions_interface_rec.organization_id;
Line: 2092

            insert_transactions_header(   p_transactions_interface_rec  =>    l_transactions_interface_rec,
                x_return_status  =>    x_return_status );
Line: 2099

				insert_cst_interface(p_wip_entity_id => p_comp_job_dtls_rec.wip_entity_id,
									 p_interface_id	 => l_transactions_interface_rec.transaction_interface_id
									);
Line: 2119

            lc_mod_name||'beforecallinserttxnshdr',
            'Just before calling insert_transactions_header');
Line: 2128

             SELECT primary_cost_method,decode(auto_compute_final_completion,1,'Y','N')
             INTO l_costing_method,lc_n_final_completion_flag
             FROM mtl_parameters mp,wip_parameters wp
             WHERE mp.organization_id = l_transactions_interface_rec.organization_id
               AND wp.organization_id = l_transactions_interface_rec.organization_id;
Line: 2136

         insert_transactions_header(p_transactions_interface_rec  =>    l_transactions_interface_rec,
                                    x_return_status  =>    x_return_status );
Line: 2143

			 insert_cst_interface(p_wip_entity_id => p_comp_job_dtls_rec.wip_entity_id,
								  p_interface_id	 => l_transactions_interface_rec.transaction_interface_id
 								  );
Line: 2162

            lc_mod_name||'beforecallinserttxnshdr',
            'Just before calling insert_transactions_header');
Line: 2171

          SELECT primary_cost_method,decode(auto_compute_final_completion,1,'Y','N')
          INTO l_costing_method,lc_n_final_completion_flag
          FROM mtl_parameters mp,wip_parameters wp
          WHERE mp.organization_id = l_transactions_interface_rec.organization_id
            AND wp.organization_id = l_transactions_interface_rec.organization_id;
Line: 2179

      insert_transactions_header(p_transactions_interface_rec  =>    l_transactions_interface_rec,
                                 x_return_status  =>    x_return_status );
Line: 2186

		  insert_cst_interface(p_wip_entity_id => p_comp_job_dtls_rec.wip_entity_id,
							   p_interface_id	 => l_transactions_interface_rec.transaction_interface_id
							   );
Line: 2207

         ROLLBACK to INSERT_JOB_COMP_TXN_PVT ;
Line: 2222

         ROLLBACK to INSERT_JOB_COMP_TXN_PVT  ;
Line: 2237

         ROLLBACK to INSERT_JOB_COMP_TXN_PVT  ;
Line: 2258

END insert_job_comp_txn;
Line: 2311

   SELECT DISTINCT transaction_source_id
   BULK COLLECT INTO l_wip_entity_ids
   FROM mtl_transactions_interface
   WHERE transaction_header_id = p_txn_header_id;
Line: 2347

							   'delete from mtl_transactions_interface');
Line: 2356

				delete from mtl_transactions_interface where transaction_header_id = p_txn_header_id;
Line: 2372

       update_mat_issue_quantities
        (
            p_api_version_number                      => 1.0 ,
            p_init_msg_list                           => fnd_api.g_false ,
            p_commit                                  => fnd_api.g_false ,
            p_validation_level                        => fnd_api.g_valid_level_none,
            x_return_status                           => x_return_status,
            x_msg_count                               => x_msg_count,
            x_msg_data                                => x_msg_data,
            p_repair_line_id                          => NULL,
            p_wip_entity_id                           => l_wip_entity_ids(i),
            p_wip_transaction_detail_id               => NULL,
            p_transaction_type_id                     => NULL,
            p_quantity                                => NULL,
            p_exclude_closed_jobs                     => 'Y',
            p_transaction_date_start                  => NULL,
            p_transaction_date_end                    => NULL
        );
Line: 2508

            SELECT wip_transactions_s.nextval from dual;
Line: 2512

            select wip.wip_entity_name, mv.fm_operation_seq_num
            from wip_move_txn_interface mv, wip_entities wip
            where mv.group_id = c_group_id
            and mv.process_status = lc_error_process_status
            and mv.wip_entity_id = wip.wip_entity_id;
Line: 2522

        select *
        from
            (select operation_seq_num,
                    quantity_in_queue,
                    quantity_waiting_to_move
               from wip_operations
              where wip_entity_id = c_wip_entity_id
                and operation_seq_num < c_op_seq_num
                and quantity_in_queue + quantity_waiting_to_move > 0
             order by operation_seq_num desc)
        where rownum=1;
Line: 2536

            SELECT mtl_material_transactions_s.nextval from dual;  */
Line: 2653

               lc_mod_name||'beforecallinsertwipmvtxn',
               'Just before calling insert_wip_move_txn');
Line: 2657

           insert_wip_move_txn(     p_wip_move_txn_interface_rec  =>    l_wip_move_txn_interface_rec,
                                  x_return_status  =>    x_return_status );
Line: 2844

      lc_non_std_update_load_type      CONSTANT NUMBER := 3;
Line: 2876

      l_last_update_date DATE;
Line: 2877

      l_last_updated_by NUMBER;
Line: 2878

      l_last_update_login NUMBER;
Line: 2882

      l_wip_update_needed  VARCHAR2(1) := 'F';
Line: 2899

            SELECT mtl_material_transactions_s.nextval from dual;
Line: 2902

            SELECT stock_locator_control_code from mtl_parameters
            where organization_id = p_organization_id;
Line: 2907

           SELECT locator_type from mtl_secondary_inventories where
               organization_id = p_organization_id and
               secondary_inventory_name = p_secondary_inventory_name;
Line: 2913

        select location_control_code from mtl_system_items_b where
        organization_id = p_organization_id and
        inventory_item_id = p_inventory_item_id;
Line: 2961

      l_last_update_date := SYSDATE;
Line: 2962

      l_last_updated_by := fnd_global.user_id;
Line: 2963

      l_last_update_login := fnd_global.login_id;
Line: 2985

        l_job_header_rec.load_type := lc_non_std_update_load_type;
Line: 2998

       SELECT wip_job_schedule_interface_s.NEXTVAL INTO l_job_header_rec.group_id FROM dual;
Line: 3210

                                    lc_mod_name||'beforecallinserttxnshdr',
                                    'Just before calling insert_transactions_header');
Line: 3218

                                    insert_transactions_header(   p_transactions_interface_rec  =>    l_transactions_interface_rec,
                                           x_return_status  =>    x_return_status );
Line: 3251

                                        lc_mod_name||'beforecallinsertsrlnmbrs',
                                        'Just before calling insert_upd_serial_numbers');
Line: 3256

                                        insert_upd_serial_numbers(   p_srl_nmbrs_interface_rec  =>    l_srl_nmbrs_interface_rec,
                                           x_return_status  =>    x_return_status );
Line: 3284

                                    lc_mod_name||'beforecallinserttxnshdr',
                                    'Just before calling insert_transactions_header');
Line: 3290

                                    insert_transactions_header(   p_transactions_interface_rec  =>    l_transactions_interface_rec,
                                           x_return_status  =>    x_return_status );
Line: 3317

                                lc_mod_name||'beforecallinserttxnshdr',
                                'Just before calling insert_transactions_header');
Line: 3322

                                insert_transactions_header(    p_transactions_interface_rec  =>    l_transactions_interface_rec,
                                           x_return_status  =>    x_return_status );
Line: 3358

                        l_wip_update_needed := 'T' ;
Line: 3363

                   SELECT wip_job_schedule_interface_s.NEXTVAL INTO l_job_header_rec.header_id FROM dual;
Line: 3395

                        lc_mod_name||'beforecallinsertjob',
                        'Just before calling insert_job_header');
Line: 3400

                        insert_job_header(   p_job_header_rec  =>    l_job_header_rec,
                               x_return_status  =>    x_return_status );
Line: 3411

                        lc_mod_name||'beforecallinsertjobdtls',
                        'Just before calling insert_job_details');
Line: 3421

                        insert_job_details(     p_job_details_rec    =>    l_job_details_rec,
                                  x_return_status  =>    x_return_status );
Line: 3438

                            lc_mod_name||'beforecallupdaterow',
                            'Just before calling CSD_WIP_TRANSACTION_DTLS_PKG.Update_Row');
Line: 3447

                    CSD_WIP_TRANSACTION_DTLS_PKG.Update_Row(
                         p_WIP_TRANSACTION_DETAIL_ID  => p_mtl_txn_dtls_tbl(mtl_ctr).WIP_TRANSACTION_DETAIL_ID
                        ,p_CREATED_BY                 => null
                        ,p_CREATION_DATE              => null
                        ,p_LAST_UPDATED_BY            => l_last_updated_by
                        ,p_LAST_UPDATE_DATE           => l_last_update_date
                        ,p_LAST_UPDATE_LOGIN          => l_last_update_login
                        ,p_INVENTORY_ITEM_ID          => null
                        ,p_WIP_ENTITY_ID              => null
                        ,p_OPERATION_SEQ_NUM          => null
                        ,p_RESOURCE_SEQ_NUM           => null
                        ,p_employee_id                => null
                        ,p_TRANSACTION_QUANTITY       => FND_API.G_MISS_NUM
                        ,p_TRANSACTION_UOM            => FND_API.G_MISS_CHAR
                        ,p_SERIAL_NUMBER              => FND_API.G_MISS_CHAR
                        ,p_REVISION                   => FND_API.G_MISS_CHAR
                        ,p_REASON_ID                  => FND_API.G_MISS_NUM
                        ,p_BACKFLUSH_FLAG             => null
                        ,p_COUNT_POINT_TYPE           => null
                        ,p_DEPARTMENT_ID              => null
                        ,p_DESCRIPTION                => null
                        ,p_FIRST_UNIT_COMPLETION_DATE => null
                        ,p_FIRST_UNIT_START_DATE      => null
                        ,p_LAST_UNIT_COMPLETION_DATE  => null
                        ,p_LAST_UNIT_START_DATE       => null
                        ,p_MINIMUM_TRANSFER_QUANTITY  => null
                        ,p_STANDARD_OPERATION_ID      => null
                        ,p_OBJECT_VERSION_NUMBER      => p_mtl_txn_dtls_tbl(mtl_ctr).object_version_number
                        ,p_CREATE_RO_FLAG             => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).CREATE_RO_FLAG, FND_API.G_MISS_CHAR) -- bug#13698799 auto create ro, parent ro
                        );
Line: 3478

                        CSD_WIP_TRANSACTION_DTLS_PKG.Delete_Row(
                        p_WIP_TRANSACTION_DETAIL_ID  => p_mtl_txn_dtls_tbl(mtl_ctr).WIP_TRANSACTION_DETAIL_ID );
Line: 3551

        IF l_wip_update_needed = 'T' THEN

          --   dbms_output.put_line('before WIP Update Call');
Line: 3586

						WIP_MASS_LOAD_PROCESSOR.Delete_Completed_Records(l_job_header_rec.group_id);
Line: 3644

                update_mat_issue_quantities
                (
                    p_api_version_number                      => 1.0 ,
                    p_init_msg_list                           => fnd_api.g_false ,
                    p_commit                                  => fnd_api.g_false ,
                    p_validation_level                        => fnd_api.g_valid_level_none,
                    x_return_status                           => x_return_status,
                    x_msg_count                               => x_msg_count,
                    x_msg_data                                => x_msg_data,
                    p_repair_line_id                          => NULL,
                    p_wip_entity_id                           => l_counter,
                    p_wip_transaction_detail_id               => NULL,
                    p_transaction_type_id                     => NULL,
                    p_quantity                                => NULL,
                    p_exclude_closed_jobs                     => 'Y',
                    p_transaction_date_start                  => NULL,
                    p_transaction_date_end                    => NULL
                );
Line: 3669

                update_mat_issue_quantities
                (
                    p_api_version_number                      => 1.0 ,
                    p_init_msg_list                           => fnd_api.g_false ,
                    p_commit                                  => fnd_api.g_false ,
                    p_validation_level                        => fnd_api.g_valid_level_none,
                    x_return_status                           => x_return_status,
                    x_msg_count                               => x_msg_count,
                    x_msg_data                                => x_msg_data,
                    p_repair_line_id                          => NULL,
                    p_wip_entity_id                           => NULL,
                    p_wip_transaction_detail_id               => p_mtl_txn_dtls_tbl(i).wip_transaction_detail_id,
                    p_transaction_type_id                     => (CASE WHEN p_mtl_txn_dtls_tbl(i).transaction_quantity > 0 THEN 35 ELSE 43 END),
                    p_quantity                                => p_mtl_txn_dtls_tbl(i).transaction_quantity*-1,
                    p_exclude_closed_jobs                     => 'Y',
                    p_transaction_date_start                  => NULL,
                    p_transaction_date_end                    => NULL
                );
Line: 3809

               lc_mod_name||'beforecallinsertjobcomptxn',
               'Just before calling insert_job_comp_txn');
Line: 3812

   update_mtl_txns_lot_srl (
       p_api_version_number       => lc_api_version_number,
       p_init_msg_list            => fnd_api.g_false ,
       p_commit                   => fnd_api.g_false,
       p_validation_level         => p_validation_level,
       x_return_status            => x_return_status,
       x_msg_count                => x_msg_count,
       x_msg_data                 => x_msg_data,
       p_mtl_txn_dtls_tbl         => p_mtl_txn_dtls_tbl,
       p_transaction_header_id    => p_transaction_header_id
   );
Line: 3912

PROCEDURE update_mtl_txns_lot_srl
(
    p_api_version_number                      IN         NUMBER,
    p_init_msg_list                           IN         VARCHAR2,
    p_commit                                  IN         VARCHAR2,
    p_validation_level                        IN         NUMBER,
    x_return_status                           OUT NOCOPY VARCHAR2,
    x_msg_count                               OUT NOCOPY NUMBER,
    x_msg_data                                OUT NOCOPY VARCHAR2,
    p_mtl_txn_dtls_tbl                        IN         MTL_TXN_DTLS_TBL_TYPE,
    p_transaction_header_id                   IN         NUMBER
)
IS
   lc_api_name                CONSTANT VARCHAR2(30) := 'UPDATE_MTL_TXNS_LOT_SRL';
Line: 3929

   lc_mod_name                      VARCHAR2(2000) := 'csd.plsql.csd_hv_wip_job_pvt.update_mtl_txns_lot_srl';
Line: 3942

      SELECT mtl_material_transactions_s.nextval from dual;
Line: 3949

                     'Entering private API update_mtl_txns_lot_srl' );
Line: 3952

   SAVEPOINT UPDATE_MTL_TXNS_LOT_SRL_PVT;
Line: 3982

         'Just before calling update_transactions_header');
Line: 3985

      update_transactions_header(p_transactions_interface_rec  =>    l_transactions_interface_rec,
                                x_return_status  =>    x_return_status );
Line: 4009

                              lc_mod_name||'beforecallinsertsrlnmbrs',
                              'Just before calling insert_upd_serial_numbers');
Line: 4013

            insert_upd_serial_numbers(p_srl_nmbrs_interface_rec => l_srl_nmbrs_interface_rec,
                                      x_return_status           =>  x_return_status);
Line: 4023

                           lc_mod_name||'beforecallinserttxnslots',
                           'Just before calling insert_transaction_lots');
Line: 4027

         insert_transaction_lots(p_txn_lots_interface_rec  =>    l_txn_lots_interface_rec,
                                 x_return_status           =>    x_return_status );
Line: 4040

                              lc_mod_name||'beforecallinsertsrlnbrs',
                              'Just before calling insert_upd_serial_numbers');
Line: 4044

            insert_upd_serial_numbers(p_srl_nmbrs_interface_rec => l_srl_nmbrs_interface_rec,
                                      x_return_status           => x_return_status );
Line: 4062

      ROLLBACK to UPDATE_MTL_TXNS_LOT_SRL_PVT ;
Line: 4076

      ROLLBACK to UPDATE_MTL_TXNS_LOT_SRL_PVT ;
Line: 4090

      ROLLBACK to UPDATE_MTL_TXNS_LOT_SRL_PVT ;
Line: 4109

END update_mtl_txns_lot_srl;
Line: 4137

      lc_non_std_update_load_type      CONSTANT NUMBER := 3;
Line: 4155

      l_last_update_date DATE;
Line: 4156

      l_last_updated_by NUMBER;
Line: 4157

      l_last_update_login NUMBER;
Line: 4161

      l_wip_update_needed  VARCHAR2(1) := 'F';
Line: 4200

      l_last_update_date := SYSDATE;
Line: 4201

      l_last_updated_by := fnd_global.user_id;
Line: 4202

      l_last_update_login := fnd_global.login_id;
Line: 4207

        l_job_header_rec.load_type := lc_non_std_update_load_type;
Line: 4267

       SELECT wip_job_schedule_interface_s.NEXTVAL INTO l_job_header_rec.group_id FROM dual;
Line: 4305

                        lc_mod_name||'beforecallinsertwipcosttxn',
                        'Just before calling insert_wip_cost_txn');
Line: 4329

                    insert_wip_cost_txn(     p_wip_cost_txn_interface_rec  =>    l_wip_cost_txn_interface_rec,
                                           x_return_status  =>    x_return_status );
Line: 4358

                        l_wip_update_needed := 'T' ;
Line: 4366

       SELECT wip_job_schedule_interface_s.NEXTVAL INTO l_job_header_rec.header_id FROM dual;
Line: 4398

                        lc_mod_name||'beforecallinsertjob',
                        'Just before calling insert_job_header');
Line: 4403

                    insert_job_header(    p_job_header_rec  =>    l_job_header_rec,
                               x_return_status  =>    x_return_status );
Line: 4414

                        lc_mod_name||'beforecallinsertjobdtls',
                        'Just before calling insert_job_details');
Line: 4419

                    insert_job_details(   p_job_details_rec    =>    l_job_details_rec,
                               x_return_status  =>    x_return_status );
Line: 4435

                            lc_mod_name||'beforecallupdaterow',
                            'Just before calling CSD_WIP_TRANSACTION_DTLS_PKG.Delete_Row');
Line: 4444

                    CSD_WIP_TRANSACTION_DTLS_PKG.Update_Row(
                         p_WIP_TRANSACTION_DETAIL_ID  => p_res_txn_dtls_tbl(res_ctr).WIP_TRANSACTION_DETAIL_ID
                        ,p_CREATED_BY                 => null
                        ,p_CREATION_DATE              => null
                        ,p_LAST_UPDATED_BY            => l_last_updated_by
                        ,p_LAST_UPDATE_DATE           => l_last_update_date
                        ,p_LAST_UPDATE_LOGIN          => l_last_update_login
                        ,p_INVENTORY_ITEM_ID          => null
                        ,p_WIP_ENTITY_ID              => null
                        ,p_OPERATION_SEQ_NUM          => null
                        ,p_RESOURCE_SEQ_NUM           => null
                        ,p_employee_id                => null
                        ,p_TRANSACTION_QUANTITY       => FND_API.G_MISS_NUM
                        ,p_TRANSACTION_UOM            => FND_API.G_MISS_CHAR
                        ,p_SERIAL_NUMBER              => null
                        ,p_REVISION                   => null
                        ,p_REASON_ID                  => null
                        ,p_BACKFLUSH_FLAG             => null
                        ,p_COUNT_POINT_TYPE           => null
                        ,p_DEPARTMENT_ID              => null
                        ,p_DESCRIPTION                => null
                        ,p_FIRST_UNIT_COMPLETION_DATE => null
                        ,p_FIRST_UNIT_START_DATE      => null
                        ,p_LAST_UNIT_COMPLETION_DATE  => null
                        ,p_LAST_UNIT_START_DATE       => null
                        ,p_MINIMUM_TRANSFER_QUANTITY  => null
                        ,p_STANDARD_OPERATION_ID      => null
                        ,p_OBJECT_VERSION_NUMBER      => p_res_txn_dtls_tbl(res_ctr).object_version_number
                        ,p_CREATE_RO_FLAG             => null
                        );
Line: 4476

                        CSD_WIP_TRANSACTION_DTLS_PKG.Delete_Row(
                        p_WIP_TRANSACTION_DETAIL_ID  => p_res_txn_dtls_tbl(res_ctr).WIP_TRANSACTION_DETAIL_ID );
Line: 4488

     IF l_wip_update_needed = 'T' THEN

     BEGIN

       WIP_MASSLOAD_PUB.massLoadJobs(p_groupID   => l_job_header_rec.group_id,
                         p_validationLevel       => p_validation_level,
                         p_commitFlag            => 1, -- make it 0 later, once WIP works
                         x_returnStatus          => x_return_status,
                         x_errorMsg              => x_msg_data );
Line: 4517

						WIP_MASS_LOAD_PROCESSOR.Delete_Completed_Records(l_job_header_rec.group_id);
Line: 4656

      lc_non_std_update_load_type      CONSTANT NUMBER := 3;
Line: 4662

      lc_substitution_change_type CONSTANT                  NUMBER := 3;  -- yvchen: bug 12933419 allow update of wip mat reqs
Line: 4675

      l_last_update_date DATE;
Line: 4678

      l_last_updated_by NUMBER;
Line: 4679

      l_last_updated_by_name VARCHAR2(100);
Line: 4680

      l_last_update_login NUMBER;
Line: 4685

      l_quantity_issued NUMBER :=0;  -- yvchen: bug 12933419 reinstated for update mtl reqs
Line: 4696

         SELECT start_quantity from wip_discrete_jobs where
         wip_entity_id = p_wip_entity_id ;
Line: 4700

         SELECT 'exists'
         from wip_operations
         where wip_entity_id = p_wip_entity_id
           and rownum = 1;
Line: 4724

      select location_control_code from mtl_system_items_b where
      organization_id = p_organization_id and
      inventory_item_id = p_inventory_item_id;
Line: 4731

      SELECT locator_type from mtl_secondary_inventories where
      organization_id = p_organization_id and
      secondary_inventory_name = p_secondary_inventory_name;
Line: 4738

      select wip_supply_type, wip_supply_subinventory, wip_supply_locator_id
      from mtl_system_items_b where
      organization_id = p_organization_id and
      inventory_item_id = p_inventory_item_id;
Line: 4749

      SELECT nvl(quantity_issued, 0)
      from wip_requirement_operations
      where inventory_item_id = p_inventory_item_id
        and operation_seq_num = p_operation_seq_num
        and wip_entity_id = p_wip_entity_id
        and organization_id = p_organization_id;
Line: 4787

      l_job_header_rec.load_type := lc_non_std_update_load_type;
Line: 4808

      l_last_update_date := SYSDATE;
Line: 4810

      l_last_updated_by := fnd_global.user_id;
Line: 4811

      l_last_update_login := fnd_global.login_id;
Line: 4884

              SELECT wip_job_schedule_interface_s.NEXTVAL INTO l_job_header_rec.group_id FROM dual;
Line: 4985

                        lc_mod_name||'beforecallinsertjob',
                        'Just before calling insert_job_header');
Line: 4990

                    insert_job_header(    p_job_header_rec  =>    l_job_header_rec,
                               x_return_status  =>    x_return_status );
Line: 5001

                        lc_mod_name||'beforecallinsertjobdtls',
                        'Just before calling insert_job_details');
Line: 5006

                    insert_job_details(   p_job_details_rec    =>    l_job_details_rec,
                               x_return_status  =>    x_return_status );
Line: 5048

						WIP_MASS_LOAD_PROCESSOR.Delete_Completed_Records(l_job_header_rec.group_id);
Line: 5075

                /* yvchen: bug 12933419 allow update of wip material requirements
                -- for now, only allow update of quantity.
                -- subinventory and locator update not supported right now. */

                else --  p_mtl_txn_dtls_tbl(mtl_ctr).new_row <> 'Y'

                    IF ( FND_LOG.LEVEL_EVENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
                       FND_LOG.STRING(    FND_LOG.LEVEL_EVENT,
                        lc_mod_name,
                        'Updating material requirements');
Line: 5091

                    SELECT wip_job_schedule_interface_s.NEXTVAL INTO l_job_header_rec.group_id FROM dual;
Line: 5098

                    l_job_details_rec.parent_header_id := l_job_header_rec.group_id; -- must be null since only detail recs updated
Line: 5139

                       FND_LOG.STRING(    FND_LOG.LEVEL_EVENT, lc_mod_name||'beforecallinsertjob',
                        'Just before calling insert_job_header');
Line: 5171

                    insert_job_header(    p_job_header_rec  =>    l_job_header_rec,
                               x_return_status  =>    x_return_status );
Line: 5181

                        lc_mod_name||'beforecallinsertjobdtls',
                        'Just before calling insert_job_details');
Line: 5185

                    insert_job_details(   p_job_details_rec    =>    l_job_details_rec,
                               x_return_status  =>    x_return_status );
Line: 5227

							WIP_MASS_LOAD_PROCESSOR.Delete_Completed_Records(l_job_header_rec.group_id);
Line: 5254

                        lc_mod_name||'beforecallinsertrow',
                        'Just before calling CSD_WIP_TRANSACTION_DTLS_PKG.Insert_Row');
Line: 5260

                    CSD_WIP_TRANSACTION_DTLS_PKG.Insert_Row(
                        px_WIP_TRANSACTION_DETAIL_ID  => l_WIP_TRANSACTION_DETAIL_ID
                        ,p_CREATED_BY                 => l_created_by
                        ,p_CREATION_DATE              => l_creation_date
                        ,p_LAST_UPDATED_BY            => l_last_updated_by
                        ,p_LAST_UPDATE_DATE           => l_last_update_date
                        ,p_LAST_UPDATE_LOGIN          => l_last_update_login
                        ,p_INVENTORY_ITEM_ID          => p_mtl_txn_dtls_tbl(mtl_ctr).INVENTORY_ITEM_ID
                        ,p_WIP_ENTITY_ID              => p_mtl_txn_dtls_tbl(mtl_ctr).WIP_ENTITY_ID
                        ,p_OPERATION_SEQ_NUM          => l_op_seq_num -- p_mtl_txn_dtls_tbl(mtl_ctr).OPERATION_SEQ_NUM
                        ,p_RESOURCE_SEQ_NUM           => null
                        ,p_employee_id                => null
                        ,p_TRANSACTION_QUANTITY       => p_mtl_txn_dtls_tbl(mtl_ctr).TRANSACTION_QUANTITY
                        ,p_TRANSACTION_UOM            => p_mtl_txn_dtls_tbl(mtl_ctr).TRANSACTION_UOM
                        ,p_SERIAL_NUMBER              => p_mtl_txn_dtls_tbl(mtl_ctr).SERIAL_NUMBER
                        ,p_REVISION                   => p_mtl_txn_dtls_tbl(mtl_ctr).REVISION -- swai: bug 6995498/7182047
                        ,p_REASON_ID                  => p_mtl_txn_dtls_tbl(mtl_ctr).REASON_ID  -- swai bug 6841113
                        ,p_BACKFLUSH_FLAG             => null
                        ,p_COUNT_POINT_TYPE           => null
                        ,p_DEPARTMENT_ID              => null
                        ,p_DESCRIPTION                => null
                        ,p_FIRST_UNIT_COMPLETION_DATE => null
                        ,p_FIRST_UNIT_START_DATE      => null
                        ,p_LAST_UNIT_COMPLETION_DATE  => null
                        ,p_LAST_UNIT_START_DATE       => null
                        ,p_MINIMUM_TRANSFER_QUANTITY  => null
                        ,p_STANDARD_OPERATION_ID      => null
                         -- yvchen: bug 13258460 - 12.1.3+ add DFF attributes
                        ,p_ATTRIBUTE_CATEGORY         => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE_CATEGORY
                        ,p_ATTRIBUTE1                 => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE1
                        ,p_ATTRIBUTE2                 => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE2
                        ,p_ATTRIBUTE3                 => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE3
                        ,p_ATTRIBUTE4                 => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE4
                        ,p_ATTRIBUTE5                 => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE5
                        ,p_ATTRIBUTE6                 => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE6
                        ,p_ATTRIBUTE7                 => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE7
                        ,p_ATTRIBUTE8                 => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE8
                        ,p_ATTRIBUTE9                 => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE9
                        ,p_ATTRIBUTE10                => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE10
                        ,p_ATTRIBUTE11                => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE11
                        ,p_ATTRIBUTE12                => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE12
                        ,p_ATTRIBUTE13                => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE13
                        ,p_ATTRIBUTE14                => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE14
                        ,p_ATTRIBUTE15                => p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE15
                        ,p_CREATE_RO_FLAG             => p_mtl_txn_dtls_tbl(mtl_ctr).CREATE_RO_FLAG -- bug#13698799 auto create ro, parent ro
                        );
Line: 5311

                        lc_mod_name||'beforecallupdaterow',
                        'Just before calling CSD_WIP_TRANSACTION_DTLS_PKG.Update_Row');
Line: 5315

                    CSD_WIP_TRANSACTION_DTLS_PKG.Update_Row(
                        p_WIP_TRANSACTION_DETAIL_ID  => p_mtl_txn_dtls_tbl(mtl_ctr).WIP_TRANSACTION_DETAIL_ID
                        ,p_CREATED_BY                 => null
                        ,p_CREATION_DATE              => null
                        ,p_LAST_UPDATED_BY            => l_last_updated_by
                        ,p_LAST_UPDATE_DATE           => l_last_update_date
                        ,p_LAST_UPDATE_LOGIN          => l_last_update_login
                        ,p_INVENTORY_ITEM_ID          => null
                        ,p_WIP_ENTITY_ID              => null
                        ,p_OPERATION_SEQ_NUM          => null
                        ,p_RESOURCE_SEQ_NUM           => null
                        ,p_employee_id              => null
                        ,p_TRANSACTION_QUANTITY       => p_mtl_txn_dtls_tbl(mtl_ctr).TRANSACTION_QUANTITY
                        ,p_TRANSACTION_UOM            => p_mtl_txn_dtls_tbl(mtl_ctr).TRANSACTION_UOM
                        ,p_SERIAL_NUMBER              => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).SERIAL_NUMBER, FND_API.G_MISS_CHAR)
                        ,p_REVISION                   => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).REVISION, FND_API.G_MISS_CHAR) -- swai: bug 6995498/7182047
                        ,p_REASON_ID                  => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).REASON_ID, FND_API.G_MISS_NUM)-- swai bug 6841113
                        ,p_BACKFLUSH_FLAG             => null
                        ,p_COUNT_POINT_TYPE           => null
                        ,p_DEPARTMENT_ID              => null
                        ,p_DESCRIPTION                => null
                        ,p_FIRST_UNIT_COMPLETION_DATE => null
                        ,p_FIRST_UNIT_START_DATE      => null
                        ,p_LAST_UNIT_COMPLETION_DATE  => null
                        ,p_LAST_UNIT_START_DATE       => null
                        ,p_MINIMUM_TRANSFER_QUANTITY  => null
                        ,p_STANDARD_OPERATION_ID      => null
                        ,p_OBJECT_VERSION_NUMBER      => p_mtl_txn_dtls_tbl(mtl_ctr).object_version_number
                         -- yvchen: bug 13258460 - 12.1.3+ add DFF attributes
                        ,p_ATTRIBUTE_CATEGORY         => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE_CATEGORY, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE1                 => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE1, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE2                 => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE2, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE3                 => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE3, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE4                 => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE4, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE5                 => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE5, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE6                 => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE6, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE7                 => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE7, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE8                 => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE8, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE9                 => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE9, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE10                => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE10, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE11                => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE11, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE12                => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE12, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE13                => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE13, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE14                => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE14, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE15                => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).ATTRIBUTE15, FND_API.G_MISS_CHAR)
                        ,p_CREATE_RO_FLAG             => nvl(p_mtl_txn_dtls_tbl(mtl_ctr).CREATE_RO_FLAG, FND_API.G_MISS_CHAR) -- bug#13698799 auto create ro, parent ro
                        );
Line: 5451

      lc_mod_name                 CONSTANT VARCHAR2(2000) := 'csd.plsql.csd_wip_job_pvt.insert_job_header.';
Line: 5458

      lc_non_std_update_load_type      CONSTANT NUMBER := 3;
Line: 5478

      l_last_update_date DATE;
Line: 5481

      l_last_updated_by NUMBER;
Line: 5482

         l_last_updated_by_name VARCHAR2(100);
Line: 5483

      l_last_update_login NUMBER;
Line: 5495

            SELECT start_quantity from wip_discrete_jobs where
            wip_entity_id = p_wip_entity_id ;
Line: 5501

                select nvl(MAX(RESOURCE_SEQ_NUM),0)+ 10 from
                wip_operation_resources where wip_entity_id
                = p_wip_entity_id and operation_seq_num =
                p_operation_seq_num;
Line: 5541

      l_job_header_rec.load_type := lc_non_std_update_load_type;
Line: 5559

      l_last_update_date := SYSDATE;
Line: 5561

      l_last_updated_by := fnd_global.user_id;
Line: 5562

      l_last_update_login := fnd_global.login_id;
Line: 5575

                  SELECT wip_job_schedule_interface_s.NEXTVAL INTO l_job_header_rec.group_id FROM dual;
Line: 5621

                        lc_mod_name||'beforecallinsertjob',
                        'Just before calling insert_job_header');
Line: 5626

                    insert_job_header(    p_job_header_rec  =>    l_job_header_rec,
                               x_return_status  =>    x_return_status );
Line: 5637

                        lc_mod_name||'beforecallinsertjobdtls',
                        'Just before calling insert_job_details');
Line: 5642

                    insert_job_details(   p_job_details_rec    =>    l_job_details_rec,
                               x_return_status  =>    x_return_status );
Line: 5685

						WIP_MASS_LOAD_PROCESSOR.Delete_Completed_Records(l_job_header_rec.group_id);
Line: 5718

                        lc_mod_name||'beforecallinsertrow',
                        'Just before calling CSD_WIP_TRANSACTION_DTLS_PKG.Insert_Row');
Line: 5724

                    CSD_WIP_TRANSACTION_DTLS_PKG.Insert_Row(
                        px_WIP_TRANSACTION_DETAIL_ID  => l_WIP_TRANSACTION_DETAIL_ID
                        ,p_CREATED_BY                 => l_created_by
                        ,p_CREATION_DATE              => l_creation_date
                        ,p_LAST_UPDATED_BY            => l_last_updated_by
                        ,p_LAST_UPDATE_DATE           => l_last_update_date
                        ,p_LAST_UPDATE_LOGIN          => l_last_update_login
                        ,p_INVENTORY_ITEM_ID          => null
                        ,p_WIP_ENTITY_ID              => p_res_txn_dtls_tbl(res_ctr).WIP_ENTITY_ID
                        ,p_OPERATION_SEQ_NUM          => p_res_txn_dtls_tbl(res_ctr).OPERATION_SEQ_NUM
                        ,p_RESOURCE_SEQ_NUM           => l_RESOURCE_SEQ_NUM
                        ,p_employee_id                => p_res_txn_dtls_tbl(res_ctr).employee_id
                        ,p_TRANSACTION_QUANTITY       => p_res_txn_dtls_tbl(res_ctr).TRANSACTION_QUANTITY
                        ,p_TRANSACTION_UOM            => p_res_txn_dtls_tbl(res_ctr).TRANSACTION_UOM
                        ,p_SERIAL_NUMBER              => NULL
                        ,p_REVISION                   => NULL -- swai: bug 6995498/7182047
                        ,p_REASON_ID                  => null  -- swai bug 6841113
                        ,p_BACKFLUSH_FLAG             => null
                        ,p_COUNT_POINT_TYPE           => null
                        ,p_DEPARTMENT_ID              => null
                        ,p_DESCRIPTION                => null
                        ,p_FIRST_UNIT_COMPLETION_DATE => null
                        ,p_FIRST_UNIT_START_DATE      => null
                        ,p_LAST_UNIT_COMPLETION_DATE  => null
                        ,p_LAST_UNIT_START_DATE       => null
                        ,p_MINIMUM_TRANSFER_QUANTITY  => null
                        ,p_STANDARD_OPERATION_ID      => null
                         -- swai: bug 15955754, FP of bug 14823164  - 12.1.3+ add DFF attributes
                        ,p_ATTRIBUTE_CATEGORY         => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE_CATEGORY
                        ,p_ATTRIBUTE1                 => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE1
                        ,p_ATTRIBUTE2                 => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE2
                        ,p_ATTRIBUTE3                 => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE3
                        ,p_ATTRIBUTE4                 => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE4
                        ,p_ATTRIBUTE5                 => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE5
                        ,p_ATTRIBUTE6                 => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE6
                        ,p_ATTRIBUTE7                 => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE7
                        ,p_ATTRIBUTE8                 => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE8
                        ,p_ATTRIBUTE9                 => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE9
                        ,p_ATTRIBUTE10                => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE10
                        ,p_ATTRIBUTE11                => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE11
                        ,p_ATTRIBUTE12                => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE12
                        ,p_ATTRIBUTE13                => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE13
                        ,p_ATTRIBUTE14                => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE14
                        ,p_ATTRIBUTE15                => p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE15
                        ,p_CREATE_RO_FLAG             => null -- bug#13698799 auto create ro, parent ro
                    );
Line: 5774

                        lc_mod_name||'beforecallupdaterow',
                        'Just before calling CSD_WIP_TRANSACTION_DTLS_PKG.Update_Row');
Line: 5779

                    CSD_WIP_TRANSACTION_DTLS_PKG.Update_Row(
                        p_WIP_TRANSACTION_DETAIL_ID  => p_res_txn_dtls_tbl(res_ctr).WIP_TRANSACTION_DETAIL_ID
                        ,p_CREATED_BY                 => null
                        ,p_CREATION_DATE              => null
                        ,p_LAST_UPDATED_BY            => l_last_updated_by
                        ,p_LAST_UPDATE_DATE           => l_last_update_date
                        ,p_LAST_UPDATE_LOGIN          => l_last_update_login
                        ,p_INVENTORY_ITEM_ID          => null
                        ,p_WIP_ENTITY_ID              => null
                        ,p_OPERATION_SEQ_NUM          => null
                        ,p_RESOURCE_SEQ_NUM           => null
                        ,p_employee_id                => nvl(p_res_txn_dtls_tbl(res_ctr).employee_id, FND_API.G_MISS_NUM)
                        ,p_TRANSACTION_QUANTITY       => p_res_txn_dtls_tbl(res_ctr).TRANSACTION_QUANTITY
                        ,p_TRANSACTION_UOM            => p_res_txn_dtls_tbl(res_ctr).TRANSACTION_UOM
                        ,p_SERIAL_NUMBER              => null
                        ,p_REVISION                   => null  -- swai: bug 6995498/7182047
                        ,p_REASON_ID                  => null  -- swai bug 6841113
                        ,p_BACKFLUSH_FLAG             => null
                        ,p_COUNT_POINT_TYPE           => null
                        ,p_DEPARTMENT_ID              => null
                        ,p_DESCRIPTION                => null
                        ,p_FIRST_UNIT_COMPLETION_DATE => null
                        ,p_FIRST_UNIT_START_DATE      => null
                        ,p_LAST_UNIT_COMPLETION_DATE  => null
                        ,p_LAST_UNIT_START_DATE       => null
                        ,p_MINIMUM_TRANSFER_QUANTITY  => null
                        ,p_STANDARD_OPERATION_ID      => null
                        ,p_OBJECT_VERSION_NUMBER      => p_res_txn_dtls_tbl(res_ctr).object_version_number
                         -- swai: bug 15955754, FP of bug 14823164  - 12.1.3+ add DFF attributes
                        ,p_ATTRIBUTE_CATEGORY         => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE_CATEGORY, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE1                 => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE1, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE2                 => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE2, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE3                 => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE3, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE4                 => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE4, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE5                 => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE5, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE6                 => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE6, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE7                 => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE7, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE8                 => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE8, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE9                 => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE9, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE10                => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE10, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE11                => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE11, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE12                => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE12, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE13                => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE13, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE14                => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE14, FND_API.G_MISS_CHAR)
                        ,p_ATTRIBUTE15                => nvl(p_res_txn_dtls_tbl(res_ctr).ATTRIBUTE15, FND_API.G_MISS_CHAR)
                        ,p_CREATE_RO_FLAG             => null --bug#13698799 auto create ro, parent ro
                    );
Line: 5915

   lc_non_std_update_load_type   CONSTANT NUMBER := 3;  -- load type for update non standard discrete job
Line: 5919

   lc_substitution_add_type      CONSTANT NUMBER := 2;  -- indicates add record (vs. change=3 or delete=1)
Line: 5920

   lc_substitution_change_type   CONSTANT NUMBER := 3;  -- indicates change record (vs. add=2 or delete=1)
Line: 5930

   l_last_update_date  DATE;
Line: 5932

   l_last_updated_by   NUMBER;
Line: 5933

   l_last_update_login NUMBER;
Line: 5968

   l_job_header_rec.load_type          := lc_non_std_update_load_type;
Line: 5976

   l_last_update_date   := SYSDATE;
Line: 5978

   l_last_updated_by    := fnd_global.user_id;
Line: 5979

   l_last_update_login  := fnd_global.login_id;
Line: 5988

         SELECT wip_job_schedule_interface_s.NEXTVAL INTO l_job_header_rec.group_id FROM dual;
Line: 6028

            lc_mod_name||'beforecallinsertjob',
            'Just before calling insert_job_header');
Line: 6032

         insert_job_header( p_job_header_rec =>    l_job_header_rec,
                            x_return_status  =>    x_return_status );
Line: 6041

            lc_mod_name||'beforecallinsertjobdtls',
            'Just before calling insert_job_details');
Line: 6045

         insert_job_details(  p_job_details_rec =>    l_job_details_rec,
                              x_return_status   =>    x_return_status );
Line: 6085

				WIP_MASS_LOAD_PROCESSOR.Delete_Completed_Records(l_job_header_rec.group_id);
Line: 6118

               lc_mod_name||'beforecallinsertrow',
               'Just before calling CSD_WIP_TRANSACTION_DTLS_PKG.Insert_Row');
Line: 6124

         CSD_WIP_TRANSACTION_DTLS_PKG.Insert_Row(
            px_WIP_TRANSACTION_DETAIL_ID  => l_WIP_TRANSACTION_DETAIL_ID
            ,p_CREATED_BY                 => l_created_by
            ,p_CREATION_DATE              => l_creation_date
            ,p_LAST_UPDATED_BY            => l_last_updated_by
            ,p_LAST_UPDATE_DATE           => l_last_update_date
            ,p_LAST_UPDATE_LOGIN          => l_last_update_login
            ,p_INVENTORY_ITEM_ID          => null
            ,p_WIP_ENTITY_ID              => p_op_dtls_tbl(op_ctr).WIP_ENTITY_ID
            ,p_OPERATION_SEQ_NUM          => p_op_dtls_tbl(op_ctr).OPERATION_SEQ_NUM
            ,p_RESOURCE_SEQ_NUM           => null
            ,p_employee_id                => null
            ,p_TRANSACTION_QUANTITY       => null
            ,p_TRANSACTION_UOM            => null
            ,p_SERIAL_NUMBER              => NULL
            ,p_REVISION                   => NULL -- swai: bug 6995498/7182047
            ,p_REASON_ID                  => null  -- swai bug 6841113
            ,p_BACKFLUSH_FLAG             => p_op_dtls_tbl(op_ctr).BACKFLUSH_FLAG
            ,p_COUNT_POINT_TYPE           => p_op_dtls_tbl(op_ctr).COUNT_POINT_TYPE
            ,p_DEPARTMENT_ID              => p_op_dtls_tbl(op_ctr).DEPARTMENT_ID
            ,p_DESCRIPTION                => p_op_dtls_tbl(op_ctr).DESCRIPTION
            ,p_FIRST_UNIT_COMPLETION_DATE => p_op_dtls_tbl(op_ctr).FIRST_UNIT_COMPLETION_DATE
            ,p_FIRST_UNIT_START_DATE      => p_op_dtls_tbl(op_ctr).FIRST_UNIT_START_DATE
            ,p_LAST_UNIT_COMPLETION_DATE  => p_op_dtls_tbl(op_ctr).LAST_UNIT_COMPLETION_DATE
            ,p_LAST_UNIT_START_DATE       => p_op_dtls_tbl(op_ctr).LAST_UNIT_START_DATE
            ,p_MINIMUM_TRANSFER_QUANTITY  => p_op_dtls_tbl(op_ctr).MINIMUM_TRANSFER_QUANTITY
            ,p_STANDARD_OPERATION_ID      => p_op_dtls_tbl(op_ctr).STANDARD_OPERATION_ID
            -- yvchen: bug 13258460 - 12.1.3+ add DFF attributes
            ,p_ATTRIBUTE_CATEGORY         => p_op_dtls_tbl(op_ctr).ATTRIBUTE_CATEGORY
            ,p_ATTRIBUTE1                 => p_op_dtls_tbl(op_ctr).ATTRIBUTE1
            ,p_ATTRIBUTE2                 => p_op_dtls_tbl(op_ctr).ATTRIBUTE2
            ,p_ATTRIBUTE3                 => p_op_dtls_tbl(op_ctr).ATTRIBUTE3
            ,p_ATTRIBUTE4                 => p_op_dtls_tbl(op_ctr).ATTRIBUTE4
            ,p_ATTRIBUTE5                 => p_op_dtls_tbl(op_ctr).ATTRIBUTE5
            ,p_ATTRIBUTE6                 => p_op_dtls_tbl(op_ctr).ATTRIBUTE6
            ,p_ATTRIBUTE7                 => p_op_dtls_tbl(op_ctr).ATTRIBUTE7
            ,p_ATTRIBUTE8                 => p_op_dtls_tbl(op_ctr).ATTRIBUTE8
            ,p_ATTRIBUTE9                 => p_op_dtls_tbl(op_ctr).ATTRIBUTE9
            ,p_ATTRIBUTE10                => p_op_dtls_tbl(op_ctr).ATTRIBUTE10
            ,p_ATTRIBUTE11                => p_op_dtls_tbl(op_ctr).ATTRIBUTE11
            ,p_ATTRIBUTE12                => p_op_dtls_tbl(op_ctr).ATTRIBUTE12
            ,p_ATTRIBUTE13                => p_op_dtls_tbl(op_ctr).ATTRIBUTE13
            ,p_ATTRIBUTE14                => p_op_dtls_tbl(op_ctr).ATTRIBUTE14
            ,p_ATTRIBUTE15                => p_op_dtls_tbl(op_ctr).ATTRIBUTE15
            ,p_CREATE_RO_FLAG             => NULL -- bug#13698799 auto create ro, parent ro
         );
Line: 6174

            lc_mod_name||'beforecallupdaterow',
            'Just before calling CSD_WIP_TRANSACTION_DTLS_PKG.Update_Row');
Line: 6178

         CSD_WIP_TRANSACTION_DTLS_PKG.Update_Row(
            p_WIP_TRANSACTION_DETAIL_ID  => p_op_dtls_tbl(op_ctr).WIP_TRANSACTION_DETAIL_ID
            ,p_CREATED_BY                 => null
            ,p_CREATION_DATE              => null
            ,p_LAST_UPDATED_BY            => l_last_updated_by
            ,p_LAST_UPDATE_DATE           => l_last_update_date
            ,p_LAST_UPDATE_LOGIN          => l_last_update_login
            ,p_INVENTORY_ITEM_ID          => null
            ,p_WIP_ENTITY_ID              => null
            ,p_OPERATION_SEQ_NUM          => null
            ,p_RESOURCE_SEQ_NUM           => null
            ,p_employee_id                => null
            ,p_TRANSACTION_QUANTITY       => null
            ,p_TRANSACTION_UOM            => null
            ,p_SERIAL_NUMBER              => null
            ,p_REVISION                   => null -- swai: bug 6995498/7182047
            ,p_REASON_ID                  => null  -- swai bug 6841113
            ,p_BACKFLUSH_FLAG             => p_op_dtls_tbl(op_ctr).BACKFLUSH_FLAG
            ,p_COUNT_POINT_TYPE           => p_op_dtls_tbl(op_ctr).COUNT_POINT_TYPE
            ,p_DEPARTMENT_ID              => p_op_dtls_tbl(op_ctr).DEPARTMENT_ID
            ,p_DESCRIPTION                => p_op_dtls_tbl(op_ctr).DESCRIPTION
            ,p_FIRST_UNIT_COMPLETION_DATE => p_op_dtls_tbl(op_ctr).FIRST_UNIT_COMPLETION_DATE
            ,p_FIRST_UNIT_START_DATE      => p_op_dtls_tbl(op_ctr).FIRST_UNIT_START_DATE
            ,p_LAST_UNIT_COMPLETION_DATE  => p_op_dtls_tbl(op_ctr).LAST_UNIT_COMPLETION_DATE
            ,p_LAST_UNIT_START_DATE       => p_op_dtls_tbl(op_ctr).LAST_UNIT_START_DATE
            ,p_MINIMUM_TRANSFER_QUANTITY  => p_op_dtls_tbl(op_ctr).MINIMUM_TRANSFER_QUANTITY
            ,p_STANDARD_OPERATION_ID      => p_op_dtls_tbl(op_ctr).STANDARD_OPERATION_ID
            ,p_OBJECT_VERSION_NUMBER      => p_op_dtls_tbl(op_ctr).object_version_number
            -- yvchen: bug 13258460 - 12.1.3+ add DFF attributes
            ,p_ATTRIBUTE_CATEGORY         => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE_CATEGORY, FND_API.G_MISS_CHAR)
            ,p_ATTRIBUTE1                 => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE1, FND_API.G_MISS_CHAR)
            ,p_ATTRIBUTE2                 => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE2, FND_API.G_MISS_CHAR)
            ,p_ATTRIBUTE3                 => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE3, FND_API.G_MISS_CHAR)
            ,p_ATTRIBUTE4                 => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE4, FND_API.G_MISS_CHAR)
            ,p_ATTRIBUTE5                 => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE5, FND_API.G_MISS_CHAR)
            ,p_ATTRIBUTE6                 => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE6, FND_API.G_MISS_CHAR)
            ,p_ATTRIBUTE7                 => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE7, FND_API.G_MISS_CHAR)
            ,p_ATTRIBUTE8                 => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE8, FND_API.G_MISS_CHAR)
            ,p_ATTRIBUTE9                 => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE9, FND_API.G_MISS_CHAR)
            ,p_ATTRIBUTE10                => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE10, FND_API.G_MISS_CHAR)
            ,p_ATTRIBUTE11                => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE11, FND_API.G_MISS_CHAR)
            ,p_ATTRIBUTE12                => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE12, FND_API.G_MISS_CHAR)
            ,p_ATTRIBUTE13                => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE13, FND_API.G_MISS_CHAR)
            ,p_ATTRIBUTE14                => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE14, FND_API.G_MISS_CHAR)
            ,p_ATTRIBUTE15                => nvl(p_op_dtls_tbl(op_ctr).ATTRIBUTE15, FND_API.G_MISS_CHAR)
            ,p_CREATE_RO_FLAG             => NULL --bug#13698799 auto create ro, parent ro
         );
Line: 6347

    select inventory_item_id, unit_of_measure, quantity, serial_number
    -- , inventory_org_id -- swai: bug 9954780
    from csd_repairs
    where repair_line_id = p_repair_line_id;
Line: 6354

    select project_id, task_id, unit_number
    from csd_repairs
    where repair_line_id = p_repair_line_id;
Line: 6362

    select 'X'
    from wip_requirement_operations_v
    where wip_entity_id = p_wip_entity_id
    and inventory_item_id = l_inventory_item_id
    and rownum = 1;
Line: 6376

     SELECT serial_number_control_code
       FROM mtl_system_items
      WHERE organization_id = p_org_id AND inventory_item_id = p_item_id;
Line: 6382

    select current_status, current_subinventory_code from mtl_serial_numbers
    where inventory_item_id = p_item_id and serial_number = p_serial_number and current_organization_id = p_org_id;
Line: 6529

         SELECT wip_job_schedule_interface_s.NEXTVAL INTO l_job_header_rec.group_id FROM dual;
Line: 6534

         SELECT wip_interface_s.NEXTVAL INTO l_job_header_rec.interface_id FROM dual;
Line: 6547

                        lc_mod_name||'beforecallinsert',
                        'Just before calling insert_job_header');
Line: 6556

            insert_job_header(   p_job_header_rec     =>
                                              l_job_header_rec,
                                    x_return_status      =>
                                             x_return_status );
Line: 6614

					CSD_WIP_JOB_PVT.Delete_Completed_Wip_Records(l_job_header_rec.interface_id);
Line: 6645

                    select count(*)
                      into l_num_other_jobs
                      from csd_repair_job_xref crj,
                           wip_entities we
                     where crj.job_name        = we.wip_entity_name
                       and crj.organization_id = we.organization_id
                       and crj.repair_line_id = p_repair_line_id
                       and we.wip_entity_id <> l_wip_entity_id;
Line: 6700

                            l_mtl_txn_dtls_tbl.delete;
Line: 6838

                    p_last_updated_by => l_user_id,
                    p_last_update_date => SYSDATE,
                    p_last_update_login => l_user_id,
                    p_repair_line_id => p_repair_line_id,
                    p_wip_entity_id => l_wip_entity_id,
                    p_group_id => l_job_header_rec.group_id,
                    p_organization_id => l_job_header_rec.organization_id,
                    p_quantity => p_repair_quantity,
                    p_INVENTORY_ITEM_ID => l_job_header_rec.primary_item_id,
                    p_ITEM_REVISION =>  null,
                    p_OBJECT_VERSION_NUMBER => NULL,
                    p_attribute_category => NULL,
                    p_attribute1 => NULL,
                    p_attribute2 => NULL,
                    p_attribute3 => NULL,
                    p_attribute4 => NULL,
                    p_attribute5 => NULL,
                    p_attribute6 => NULL,
                    p_attribute7 => NULL,
                    p_attribute8 => NULL,
                    p_attribute9 => NULL,
                    p_attribute10 => NULL,
                    p_attribute11 => NULL,
                    p_attribute12 => NULL,
                    p_attribute13 => NULL,
                    p_attribute14 => NULL,
                    p_attribute15 => NULL,
                    p_quantity_completed => NULL,
                    p_job_name  =>  l_job_header_rec.job_name,
                    p_source_type_code  =>  'MANUAL',  -- bug fix 5763350
                    p_source_id1  =>  NULL,
                    p_ro_service_code_id  =>  NULL,
                    x_return_status => x_return_status,
                    x_msg_count => x_msg_count,
                    x_msg_data => x_msg_data);
Line: 6908

                    p_program_update_date => NULL,
                    p_created_by =>  l_user_id,
                    p_creation_date => SYSDATE,
                    p_last_updated_by => l_user_id,
                    p_last_update_date => SYSDATE,
                    p_repair_line_id => p_repair_line_id,
                    p_event_code => 'JS',
                    p_event_date => SYSDATE,
                    p_quantity => p_repair_quantity,
                    p_paramn1 => l_wip_entity_id,
                    p_paramn2 => l_job_header_rec.organization_id,
                    p_paramn3 => NULL,
                    p_paramn4 => NULL,
                    p_paramn5 => p_repair_quantity,
                    p_paramn6 => NULL,
                    p_paramn8 => NULL,
                    p_paramn9 => NULL,
                    p_paramn10 => NULL,
                    p_paramc1 => l_job_header_rec.job_name,
                    p_paramc2 => NULL,
                    p_paramc3 => NULL,
                    p_paramc4 => NULL,
                    p_paramc5 => NULL,
                    p_paramc6 => NULL,
                    p_paramc7 => NULL,
                    p_paramc8 => NULL,
                    p_paramc9 => NULL,
                    p_paramc10 => NULL,
                    p_paramd1 => NULL ,
                    p_paramd2 => NULL ,
                    p_paramd3 => NULL ,
                    p_paramd4 => NULL ,
                    p_paramd5 => SYSDATE,
                    p_paramd6 => NULL ,
                    p_paramd7 => NULL ,
                    p_paramd8 => NULL ,
                    p_paramd9 => NULL ,
                    p_paramd10 => NULL ,
                    p_attribute_category => NULL ,
                    p_attribute1 => NULL ,
                    p_attribute2 => NULL ,
                    p_attribute3 => NULL ,
                    p_attribute4 => NULL ,
                    p_attribute5 => NULL ,
                    p_attribute6 => NULL ,
                    p_attribute7 => NULL ,
                    p_attribute8 => NULL ,
                    p_attribute9 => NULL ,
                    p_attribute10 => NULL ,
                    p_attribute11 => NULL ,
                    p_attribute12 => NULL ,
                    p_attribute13 => NULL ,
                    p_attribute14 => NULL ,
                    p_attribute15 => NULL ,
                    p_last_update_login  => l_user_id,
                    x_return_status => x_return_status,
                    x_msg_count => x_msg_count,
                    x_msg_data => x_msg_data);
Line: 7107

	    select inventory_item_id,
	           organization_id,
	           operation_seq_num,
	           required_quantity,
	           item_primary_uom_code,
	           supply_subinventory
	    from wip_requirement_operations_v
	    where wip_entity_id = p_wip_entity_id;
Line: 7123

         SELECT bom.assembly_item_id bom_reference_id,
             bom.alternate_bom_designator,
             bor.assembly_item_id routing_reference_id,
             bor.alternate_routing_designator,
             bor.completion_subinventory,
             bor. completion_locator_id
         FROM   csd_sc_work_entities cscwe,
             bom_bill_of_materials bom , bom_operational_routings bor
         WHERE  cscwe.service_code_id = c_p_service_code_id
               And    cscwe.work_entity_type_code = 'BOM'
               and    cscwe.work_entity_id3 = c_p_organization_id
               and    cscwe.work_entity_id1 = bom.bill_sequence_id (+)
               and    cscwe.work_entity_id2 = bor.routing_sequence_id (+);
Line: 7141

         SELECT service_code
         FROM csd_service_codes_b
         WHERE service_code_id = c_p_service_code_id;
Line: 7157

    select inventory_item_id, unit_of_measure, quantity, serial_number
    --, inventory_org_id -- swai: bug 10137471
    from csd_repairs
    where repair_line_id = p_repair_line_id;
Line: 7164

    select project_id, task_id, unit_number
    from csd_repairs
    where repair_line_id = p_repair_line_id;
Line: 7172

    select 'X'
    from wip_requirement_operations_v
    where wip_entity_id = p_wip_entity_id
    and inventory_item_id = l_inventory_item_id
    and rownum = 1;
Line: 7186

     SELECT serial_number_control_code
       FROM mtl_system_items
      WHERE organization_id = p_org_id AND inventory_item_id = p_item_id;
Line: 7192

    select current_status, current_subinventory_code from mtl_serial_numbers
    where inventory_item_id = p_item_id and serial_number = p_serial_number and current_organization_id = p_org_id;
Line: 7197

    select min(operation_seq_num) from wip_operations_v where wip_entity_id = p_wip_entity_id;
Line: 7333

               SELECT wip_job_schedule_interface_s.NEXTVAL INTO l_job_header_rec.group_id FROM dual;
Line: 7338

               SELECT wip_interface_s.NEXTVAL INTO l_job_header_rec.interface_id FROM dual;
Line: 7357

                        lc_mod_name||'beforecallinsert',
                        'Just before calling insert_job_header');
Line: 7364

               insert_job_header(   p_job_header_rec     => l_job_header_rec,
                                    x_return_status      => x_return_status );
Line: 7419

				CSD_WIP_JOB_PVT.Delete_Completed_Wip_Records(l_job_header_rec.interface_id);
Line: 7445

	       l_mtl_txn_dtls_tbl.delete;   --clear the table first
Line: 7447

	       -- for each material requirement, update it
	       FOR mtl_req in c_wip_mtl_requirements(l_wip_entity_id)
	       LOOP
	           l_mtl_txn_dtls_tbl(i).INVENTORY_ITEM_ID          := mtl_req.inventory_item_id;
Line: 7528

                    select count(*)
                      into l_num_other_jobs
                      from csd_repair_job_xref crj,
                           wip_entities we
                     where crj.job_name        = we.wip_entity_name
                       and crj.organization_id = we.organization_id
                       and crj.repair_line_id = p_repair_line_id
                       and we.wip_entity_id <> l_wip_entity_id;
Line: 7707

                    p_last_updated_by => l_user_id,
                    p_last_update_date => SYSDATE,
                    p_last_update_login => l_user_id,
                    p_repair_line_id => p_repair_line_id,
                    p_wip_entity_id => l_wip_entity_id,
                    p_group_id => l_job_header_rec.group_id,
                    p_organization_id => l_job_header_rec.organization_id,
                    p_quantity => p_repair_quantity,
                    p_INVENTORY_ITEM_ID => l_job_header_rec.primary_item_id,
                    p_ITEM_REVISION =>  null,
                    p_OBJECT_VERSION_NUMBER => NULL,
                    p_attribute_category => NULL,
                    p_attribute1 => NULL,
                    p_attribute2 => NULL,
                    p_attribute3 => NULL,
                    p_attribute4 => NULL,
                    p_attribute5 => NULL,
                    p_attribute6 => NULL,
                    p_attribute7 => NULL,
                    p_attribute8 => NULL,
                    p_attribute9 => NULL,
                    p_attribute10 => NULL,
                    p_attribute11 => NULL,
                    p_attribute12 => NULL,
                    p_attribute13 => NULL,
                    p_attribute14 => NULL,
                    p_attribute15 => NULL,
                    p_quantity_completed => NULL,
                    p_job_name  =>  l_job_header_rec.job_name,
                    p_source_type_code  =>  lc_service_code,
                    p_source_id1  =>  p_service_code_tbl(sc_ctr).service_code_id,
                    p_ro_service_code_id  =>  p_service_code_tbl(sc_ctr).ro_service_code_id,
                    x_return_status => x_return_status,
                    x_msg_count => x_msg_count,
                    x_msg_data => x_msg_data);
Line: 7773

                    p_program_update_date => NULL,
                    p_created_by =>  l_user_id,
                    p_creation_date => SYSDATE,
                    p_last_updated_by => l_user_id,
                    p_last_update_date => SYSDATE,
                    p_repair_line_id => p_repair_line_id,
                    p_event_code => 'JS',
                    p_event_date => SYSDATE,
                    p_quantity => p_repair_quantity,
                    p_paramn1 => l_wip_entity_id,
                    p_paramn2 => l_job_header_rec.organization_id,
                    p_paramn3 => NULL,
                    p_paramn4 => NULL,
                    p_paramn5 => p_repair_quantity,
                    p_paramn6 => NULL,
                    p_paramn8 => NULL,
                    p_paramn9 => NULL,
                    p_paramn10 => NULL,
                    p_paramc1 => l_job_header_rec.job_name,
                    p_paramc2 => NULL,
                    p_paramc3 => NULL,
                    p_paramc4 => NULL,
                    p_paramc5 => NULL,
                    p_paramc6 => NULL,
                    p_paramc7 => NULL,
                    p_paramc8 => NULL,
                    p_paramc9 => NULL,
                    p_paramc10 => NULL,
                    p_paramd1 => NULL ,
                    p_paramd2 => NULL ,
                    p_paramd3 => NULL ,
                    p_paramd4 => NULL ,
                    p_paramd5 => SYSDATE,
                    p_paramd6 => NULL ,
                    p_paramd7 => NULL ,
                    p_paramd8 => NULL ,
                    p_paramd9 => NULL ,
                    p_paramd10 => NULL ,
                    p_attribute_category => NULL ,
                    p_attribute1 => NULL ,
                    p_attribute2 => NULL ,
                    p_attribute3 => NULL ,
                    p_attribute4 => NULL ,
                    p_attribute5 => NULL ,
                    p_attribute6 => NULL ,
                    p_attribute7 => NULL ,
                    p_attribute8 => NULL ,
                    p_attribute9 => NULL ,
                    p_attribute10 => NULL ,
                    p_attribute11 => NULL ,
                    p_attribute12 => NULL ,
                    p_attribute13 => NULL ,
                    p_attribute14 => NULL ,
                    p_attribute15 => NULL ,
                    p_last_update_login  => l_user_id,
                    x_return_status => x_return_status,
                    x_msg_count => x_msg_count,
                    x_msg_data => x_msg_data);
Line: 7868

                     lc_mod_name||'beforecallupdatesc',
                     'Just before calling CSD_RO_SERVICE_CODES_PVT.Update_RO_Service_Code');
Line: 7874

          CSD_RO_SERVICE_CODES_PVT.Update_RO_Service_Code(
              p_api_version      => lc_api_version_number,
              p_commit     => FND_API.G_FALSE,
              p_init_msg_list    => FND_API.G_FALSE,
              p_validation_level => 100,
              p_ro_service_code_rec => l_ro_service_code_rec,
              x_obj_ver_number   => l_object_version_number,
              x_return_status    => x_return_status,
              x_msg_count     => x_msg_count,
              x_msg_data      => x_msg_data ) ;
Line: 8004

    SELECT * FROM
    ( SELECT
          CWTD.WIP_TRANSACTION_DETAIL_ID,                -- wip_transaction_detail_id
          WRO.REQUIRED_QUANTITY,                         -- required_quantity
          DECODE(WRO.QUANTITY_ISSUED, 0, to_number(NULL),
               WRO.QUANTITY_ISSUED )   QUANTITY_ISSUED,  -- issued_quantity
          wdj.start_quantity,                            -- job_quantity
          null OP_SCHEDULED_QUANTITY,                    -- op_scheduled_quantity
          WRO.INVENTORY_ITEM_ID,  -- inventory_item_id
          WRO.WIP_ENTITY_ID,      -- wip_entity_id
          WRO.ORGANIZATION_ID,    -- organization_id
          WRO.OPERATION_SEQ_NUM,  -- operation_seq_num

          nvl( CWTD.TRANSACTION_QUANTITY,
               (WRO.REQUIRED_QUANTITY  -  WRO.QUANTITY_ISSUED )
                )    TRANSACTION_QUANTITY,               -- transaction_quantity
          decode ( CWTD.TRANSACTION_QUANTITY, null, MSIK.PRIMARY_UOM_CODE,
               nvl ( CWTD.TRANSACTION_UOM ,  MSIK.PRIMARY_UOM_CODE) ) TRANSACTION_UOM, -- transaction_uom
          MSIK.PRIMARY_UOM_CODE ITEM_PRIMARY_UOM_CODE,   -- uom_code
          CWTD.SERIAL_NUMBER,              -- serial_number
          null,                            -- lot number
          CWTD.REVISION revision,          -- revision
          MSIK.REVISION_QTY_CONTROL_CODE,  -- revision_qty_control_code
          MSIK.SERIAL_NUMBER_CONTROL_CODE, -- serial_number_control_code
          MSIK.LOT_CONTROL_CODE,           -- lot_control_code
          nvl ( WRO.supply_subinventory,
             decode ( fnd_profile.value('CSD_DEF_REP_INV_ORG') ,  WRO.ORGANIZATION_ID ,
                    fnd_profile.value('CSD_DEF_HV_SUBINV') , null ) )
             subinventory_code,             -- supply_subinventory
          WRO.supply_locator_id locator_id, -- supply_locator_id
          null transaction_interface_id,    -- transaction_interface_id
          null object_version_number,       -- object_version_number
          'N' new_row,                      -- new_row
          CWTD.reason_id                    -- reason_id
          -- yvchen: bug 13258460 - 12.1.3+ add DFF attributes
          , CWTD.attribute_category
          , CWTD.attribute1
          , CWTD.attribute2
          , CWTD.attribute3
          , CWTD.attribute4
          , CWTD.attribute5
          , CWTD.attribute6
          , CWTD.attribute7
          , CWTD.attribute8
          , CWTD.attribute9
          , CWTD.attribute10
          , CWTD.attribute11
          , CWTD.attribute12
          , CWTD.attribute13
          , CWTD.attribute14
          , CWTD.attribute15
          , CWTD.create_ro_flag --bug#13698799 auto create ro, parent ro
        FROM
          CSD_REPAIR_JOB_XREF  CRJX,
          WIP_REQUIREMENT_OPERATIONS WRO,
          MTL_SYSTEM_ITEMS_KFV MSIK,
          WIP_ENTITIES  WE,
          CSD_WIP_TRANSACTION_DETAILS CWTD,
          WIP_DISCRETE_JOBS WDJ,
          WIP_OPERATIONS WO,
          MTL_SERIAL_NUMBERS MSN,
          MTL_TRANSACTION_REASONS MTR
        WHERE
          CRJX.wip_entity_id = p_wip_entity_id
          AND WO.operation_seq_num = p_operation_seq_num
          AND CRJX.wip_entity_id = WRO.wip_entity_id
          AND WRO.INVENTORY_ITEM_ID =  MSIK.INVENTORY_ITEM_ID
          AND WRO.ORGANIZATION_ID = MSIK.ORGANIZATION_ID
          AND WRO.WIP_ENTITY_ID  =  WE.WIP_ENTITY_ID
          AND WRO.WIP_ENTITY_ID  =  WDJ.WIP_ENTITY_ID
          AND WDJ.STATUS_TYPE <> 12
          AND CWTD.INVENTORY_ITEM_ID(+) = WRO.INVENTORY_ITEM_ID
          AND CWTD.WIP_ENTITY_ID(+) = WRO.WIP_ENTITY_ID
          AND CWTD.OPERATION_SEQ_NUM(+) = WRO.OPERATION_SEQ_NUM
          AND WRO.WIP_ENTITY_ID  = WO.WIP_ENTITY_ID
          AND WRO.ORGANIZATION_ID  = WO.ORGANIZATION_ID
          AND WRO.OPERATION_SEQ_NUM  = WO.OPERATION_SEQ_NUM
          AND CWTD.SERIAL_NUMBER = MSN.SERIAL_NUMBER (+)
          AND CWTD.INVENTORY_ITEM_ID = MSN.INVENTORY_ITEM_ID (+)
          AND CWTD.REASON_ID = MTR.REASON_ID (+)
    )
    WHERE transaction_quantity <> 0;
Line: 8223

    SELECT * FROM
    ( SELECT
        WTD.WIP_TRANSACTION_DETAIL_ID,
        ROUND(WOR.USAGE_RATE_OR_AMOUNT * DECODE(WOR.BASIS_TYPE,1, WO.SCHEDULED_QUANTITY,1), 6) required_quantity,
        decode (( WOR.APPLIED_RESOURCE_UNITS
                  + csd_hv_wip_job_pvt.get_pending_quantity ( wor.wip_entity_id, wor.operation_seq_num, wor.resource_seq_num, WOR.UOM_CODE )
                ) , 0 , to_number(null) ,
                ( WOR.APPLIED_RESOURCE_UNITS
                  +  csd_hv_wip_job_pvt.get_pending_quantity ( wor.wip_entity_id, wor.operation_seq_num, wor.resource_seq_num, WOR.UOM_CODE )
                ) ) QUANTITY_APPLIED,
        null pending_quantity,
        wdj.start_quantity,
        wo.scheduled_quantity op_scheduled_quantity,
        wor.basis_type basis_type,
        wor.resource_id,
        WOR.RESOURCE_SEQ_NUM,
        WOR.WIP_ENTITY_ID,
        WOR.ORGANIZATION_ID,
        mp.organization_code,
        WOR.OPERATION_SEQ_NUM,
        nvl( WTD.TRANSACTION_QUANTITY,
                       decode ( sign (( WOR.USAGE_RATE_OR_AMOUNT * DECODE(WOR.BASIS_TYPE,1, WO.SCHEDULED_QUANTITY,1) )
                                      - WOR.APPLIED_RESOURCE_UNITS
                                      - csd_hv_wip_job_pvt.get_pending_quantity ( wor.wip_entity_id, wor.operation_seq_num, wor.resource_seq_num, WOR.UOM_CODE )
                                     ) ,  1 ,
                                round ((( WOR.USAGE_RATE_OR_AMOUNT * DECODE(WOR.BASIS_TYPE,1, WO.SCHEDULED_QUANTITY,1) )
                                      -  WOR.APPLIED_RESOURCE_UNITS
                                      -  csd_hv_wip_job_pvt.get_pending_quantity ( wor.wip_entity_id, wor.operation_seq_num, wor.resource_seq_num, WOR.UOM_CODE )
                                       ), 6 ), 0 )
            ) TRANSACTION_QUANTITY,
        nvl ( WTD.TRANSACTION_UOM ,  WOR.UOM_CODE) transaction_uom,  -- transaction uom
        WOR.UOM_CODE,
        WE.WIP_ENTITY_NAME,
        wtd.employee_id,
        papf.employee_number employee_num,
        wtd.object_version_number,
        'N' new_row,
        -- swai: bug 15955754 , FP of bug 14823164 - 12.1.3+ add DFF attributes
          WTD.attribute_category
        , WTD.attribute1
        , WTD.attribute2
        , WTD.attribute3
        , WTD.attribute4
        , WTD.attribute5
        , WTD.attribute6
        , WTD.attribute7
        , WTD.attribute8
        , WTD.attribute9
        , WTD.attribute10
        , WTD.attribute11
        , WTD.attribute12
        , WTD.attribute13
        , WTD.attribute14
        , WTD.attribute15
    FROM CSD_REPAIR_JOB_XREF  CRJX,
         WIP_OPERATION_RESOURCES WOR,
         WIP_ENTITIES  WE,
         CSD_WIP_TRANSACTION_DETAILS  WTD,
         BOM_RESOURCES BR,
         wip_operations wo,
         WIP_DISCRETE_JOBS wdj,
         per_all_people_f papf,
          MTL_PARAMETERS MP
    WHERE   CRJX.wip_entity_id = p_wip_entity_id
        AND WO.operation_seq_num = p_operation_seq_num
        AND CRJX.wip_entity_id = WOR.wip_entity_id
        AND WOR.WIP_ENTITY_ID  =  WE.WIP_ENTITY_ID
        AND WOR.WIP_ENTITY_ID  =  WDJ.WIP_ENTITY_ID
        AND WOR.RESOURCE_ID = BR.RESOURCE_ID
        AND WOR. WIP_ENTITY_ID =  WTD. WIP_ENTITY_ID(+)
        AND WOR. OPERATION_SEQ_NUM = WTD. OPERATION_SEQ_NUM(+)
                        AND   WOR.RESOURCE_SEQ_NUM
                = WTD. RESOURCE_SEQ_NUM(+)
        AND wtd.employee_id = papf.person_id(+)
        AND trunc(sysdate) between nvl( papf.effective_start_date, sysdate-1)
                            and nvl(papf.effective_end_date, sysdate)
        AND wor.organization_id = MP.ORGANIZATION_ID
        AND wdj.status_type <> 12
        AND WOR.WIP_ENTITY_ID = WO.WIP_ENTITY_ID
        AND WOR.OPERATION_SEQ_NUM = WO.OPERATION_SEQ_NUM
        AND WOR.ORGANIZATION_ID = WO.ORGANIZATION_ID
        AND NVL(WOR.REPETITIVE_SCHEDULE_ID,-1)=NVL(WO.REPETITIVE_SCHEDULE_ID,-1)
    )
    WHERE transaction_quantity <> 0;
Line: 8446

    SELECT
         we.wip_entity_name,
         crjx.organization_id,
         wo.operation_seq_num,
         wo.next_operation_seq_num,
         wo.quantity_in_queue,   -- transaction_quantity
         msik.primary_uom_code,  -- transaction_uom
         crjx.wip_entity_id
    FROM CSD_REPAIR_JOB_XREF  CRJX,
         WIP_OPERATIONS WO,
         BOM_DEPARTMENTS BD,
         wip_discrete_jobs wdj,
         wip_entities we,
         mfg_lookups ml,
         mtl_system_items_kfv msik,
         csd_service_codes_vl cscv,
         csd_wip_transaction_details WTD,
         bom_standard_operations bso
    WHERE
         CRJX.wip_entity_id = p_wip_entity_id AND
         WO.operation_seq_num = p_operation_seq_num AND
         CRJX.wip_entity_id = WO.wip_entity_id(+) AND
         crjx.wip_entity_id = we.wip_entity_id AND
         crjx.wip_entity_id = wdj.wip_entity_id AND
         wdj.status_type = ml.lookup_code AND
         ml.lookup_type = 'WIP_JOB_STATUS' AND
         crjx.inventory_item_id = msik.inventory_item_id AND
         crjx.organization_id = msik.organization_id AND
         crjx.source_id1 = cscv.service_code_id (+) AND
         WO.DEPARTMENT_ID = BD.DEPARTMENT_ID(+) AND
         wdj.status_type <> 12 AND
         WO.wip_entity_id = WTD.WIP_ENTITY_ID(+) AND
         WO.operation_seq_num = WTD.operation_seq_num(+) AND
         WO.department_id = wtd.department_id(+) AND
         wo.standard_operation_id = bso.standard_operation_id(+) AND
         wo.quantity_completed <> wo.scheduled_quantity; -- only uncompleted operationss
Line: 8620

        select wip_entity_id,
               operation_seq_num,
               employee_id,
               resource_id,
               clock_in_time,
               clock_out_time
        from   csd_time_clock_entries
        where  time_clock_entry_id = p_time_clock_entry_id;
Line: 8630

        select employee_num
        from   mtl_employees_current_view
        where  organization_id = p_organization_id
          and  employee_id = p_employee_id;
Line: 8640

        SELECT
          'exists'
        FROM
          cst_activities cst,
          mtl_uom_conversions muc,
          bom_resources res,
          bom_department_resources bdr,
          bom_departments bd,
          mfg_lookups lup ,
          wip_operations wo
        WHERE nvl(res.disable_date, sysdate + 2) > sysdate
          and res.resource_id = bdr.resource_id
          and res.default_activity_id = cst.activity_id (+)
          and nvl(cst.organization_id(+), res.organization_id) = res.organization_id
          and nvl(cst.disable_date (+), sysdate + 2) > sysdate
          and res.unit_of_measure = muc.uom_code
          and muc.inventory_item_id = 0
          and lookup_type = 'BOM_AUTOCHARGE_TYPE'
          and lookup_code=nvl(res.autocharge_type,1)
          and bdr.department_id = bd.department_id
          and wo.department_id = bdr.department_id
          and res.organization_id = wo.organization_id
          and wo.wip_entity_id = p_wip_entity_id
          and wo.operation_seq_num = p_operation_seq_num
          and res.resource_id = p_resource_id
          and rownum = 1;
Line: 8670

        SELECT
            WTD.WIP_TRANSACTION_DETAIL_ID,
            wor.resource_id,
            WOR.RESOURCE_SEQ_NUM,
            WOR.WIP_ENTITY_ID,
            WE.WIP_ENTITY_NAME,
            WOR.ORGANIZATION_ID,
            MP.ORGANIZATION_CODE,
            WOR.OPERATION_SEQ_NUM,
            WDJ.START_QUANTITY job_quantity,
            ROUND(WOR.USAGE_RATE_OR_AMOUNT * DECODE(WOR.BASIS_TYPE,1, WO.SCHEDULED_QUANTITY,1), 6) required_quantity,
            WO.SCHEDULED_QUANTITY op_scheduled_quantity,
            ROUND(   decode (
                          ( WOR.APPLIED_RESOURCE_UNITS
                   +  csd_hv_wip_job_pvt.get_pending_quantity ( wor.wip_entity_id,
                wor.operation_seq_num,
                wor.resource_seq_num,
                WOR.UOM_CODE ) ) , 0 ,
                                       to_number(null) ,
                                     ( WOR.APPLIED_RESOURCE_UNITS
                   +  csd_hv_wip_job_pvt.get_pending_quantity ( wor.wip_entity_id,
                wor.operation_seq_num,
                wor.resource_seq_num,
                WOR.UOM_CODE ) )
                                ), 2
            )    APPLIED_QUANTITY,    -- quantity applied
            NVL( WTD.TRANSACTION_QUANTITY,
                           decode ( sign (( WOR.USAGE_RATE_OR_AMOUNT * DECODE(WOR.BASIS_TYPE,1, WO.SCHEDULED_QUANTITY,1) )
                                          - WOR.APPLIED_RESOURCE_UNITS
                                          - csd_hv_wip_job_pvt.get_pending_quantity ( wor.wip_entity_id, wor.operation_seq_num, wor.resource_seq_num, WOR.UOM_CODE )
                                         ) ,  1 ,
                                    round ((( WOR.USAGE_RATE_OR_AMOUNT * DECODE(WOR.BASIS_TYPE,1, WO.SCHEDULED_QUANTITY,1) )
                                          -  WOR.APPLIED_RESOURCE_UNITS
                                          -  csd_hv_wip_job_pvt.get_pending_quantity ( wor.wip_entity_id, wor.operation_seq_num, wor.resource_seq_num, WOR.UOM_CODE )
                                           ), 6 ), 0 )
                ) TRANSACTION_QUANTITY,
            nvl ( WTD.TRANSACTION_UOM ,  WOR.UOM_CODE) transaction_uom,  -- transaction uom
            WOR.UOM_CODE,
            wtd.employee_id,
            papf.employee_number employee_num,
            wor.basis_type basis_type,
            wtd.object_version_number,
            'N' new_row
        FROM CSD_REPAIR_JOB_XREF  CRJX,
             WIP_OPERATION_RESOURCES WOR,
             WIP_ENTITIES  WE,
             CSD_WIP_TRANSACTION_DETAILS  WTD,
             BOM_RESOURCES BR,
             wip_operations wo,
             WIP_DISCRETE_JOBS wdj,
             per_all_people_f papf,
             MTL_PARAMETERS MP
        WHERE   CRJX.wip_entity_id = p_wip_entity_id
            AND WO.operation_seq_num = p_operation_seq_num
            AND WOR.RESOURCE_ID = p_resource_id
            AND CRJX.wip_entity_id = WOR.wip_entity_id
            AND WOR.WIP_ENTITY_ID  =  WE.WIP_ENTITY_ID
            AND WOR.WIP_ENTITY_ID  =  WDJ.WIP_ENTITY_ID
            AND WOR.RESOURCE_ID = BR.RESOURCE_ID
            AND WOR. WIP_ENTITY_ID =  WTD. WIP_ENTITY_ID(+)
            AND WOR. OPERATION_SEQ_NUM = WTD. OPERATION_SEQ_NUM(+)
                            AND   WOR.RESOURCE_SEQ_NUM
                    = WTD. RESOURCE_SEQ_NUM(+)
            AND wtd.employee_id = papf.person_id(+)
            AND trunc(sysdate) between nvl( papf.effective_start_date, sysdate-1)
                                and nvl(papf.effective_end_date, sysdate)
            AND wor.organization_id = MP.ORGANIZATION_ID
            AND wdj.status_type <> 12
            AND WOR.WIP_ENTITY_ID = WO.WIP_ENTITY_ID
            AND WOR.OPERATION_SEQ_NUM = WO.OPERATION_SEQ_NUM
            AND WOR.ORGANIZATION_ID = WO.ORGANIZATION_ID
            AND NVL(WOR.REPETITIVE_SCHEDULE_ID,-1)=NVL(WO.REPETITIVE_SCHEDULE_ID,-1);
Line: 8991

    select repair_type_id, flow_status_id, object_version_number
    from csd_repairs
    where repair_line_id = p_repair_line_id;
Line: 8996

    select flow_status_id
    from csd_flow_statuses_b
    where flow_status_code = fnd_profile.value('CSD_COMPLETE_WORK_RO_STATUS');
Line: 9001

    select flb.flow_status_code, dra.status
    from csd_repairs dra, csd_flow_statuses_b flb
    where dra.repair_line_id = p_repair_line_id
    and dra.flow_status_id = flb.flow_status_id;
Line: 9051

    csd_repairs_pvt.update_flow_status
    (
        p_api_version           => p_api_version_number,
        p_commit                => p_commit,
        p_init_msg_list         => p_init_msg_list,
        p_validation_level      => p_validation_level,
        x_return_status         => x_return_status,
        x_msg_count             => x_msg_count,
        x_msg_data              => x_msg_data,
        p_repair_line_id        => p_repair_line_id,
        p_repair_type_id        => l_repair_type_id,
        p_from_flow_status_id   => l_fm_flow_status_id,
        p_to_flow_status_id     => l_to_flow_status_id,
        p_reason_code           => null,
        p_comments              => null,
        p_check_access_flag     => 'Y',
        p_object_version_number => l_obj_ver_num,
        x_object_version_number => lx_obj_ver_num
    );
Line: 9140

 * Deletes a saved material requirement that has not been transacted yet.
 * The following fields in p_mtl_txn_dtls are expected to be filled out:
 *    wip_entity_id
 *    organization_id
 *    inventory_item_id
 *    operation_seq_num
 *    wip_transaction_detail_id (optional)
 */
PROCEDURE process_delete_mtl_txn_dtl
(
    p_api_version_number                      IN           NUMBER,
    p_init_msg_list                           IN           VARCHAR2 ,
    p_commit                                  IN           VARCHAR2 ,
    p_validation_level                        IN           NUMBER ,
    x_return_status                           OUT  NOCOPY  VARCHAR2,
    x_msg_count                               OUT  NOCOPY  NUMBER,
    x_msg_data                                OUT  NOCOPY  VARCHAR2,
    p_mtl_txn_dtls                            IN           MTL_TXN_DTLS_REC_TYPE
)
IS
      lc_api_name                CONSTANT VARCHAR2(30) := 'PROCESS_DELETE_MTL_TXN_DTL';
Line: 9164

      lc_mod_name                 CONSTANT VARCHAR2(2000) := 'csd.plsql.csd_hv_wip_job_pvt.process_delete_mtl_txn_dtl';
Line: 9170

      lc_non_std_update_load_type      CONSTANT NUMBER := 3; -- update non-standard job
Line: 9174

      lc_substitution_del_type CONSTANT      NUMBER  := 1; -- delete
Line: 9185

          select wip_transaction_detail_id
          from csd_wip_transaction_details
          where wip_entity_id = p_mtl_txn_dtls.wip_entity_id
          and inventory_item_id = p_mtl_txn_dtls.inventory_item_id
          and operation_seq_num = p_mtl_txn_dtls.operation_seq_num;
Line: 9196

                  'Entering private API process_delete_mtl_txn_dtl' );
Line: 9200

      SAVEPOINT PROCESS_DELETE_MTL_TXN_DTL_PVT;
Line: 9223

      SELECT wip_job_schedule_interface_s.NEXTVAL INTO l_job_header_rec.group_id FROM dual;
Line: 9224

      l_job_header_rec.load_type := lc_non_std_update_load_type;
Line: 9245

            lc_mod_name||'beforecallinsertjob',
            'Just before calling insert_job_header');
Line: 9250

      insert_job_header( p_job_header_rec  =>    l_job_header_rec,
                         x_return_status   =>    x_return_status );
Line: 9261

            lc_mod_name||'beforecallinsertjobdtls',
            'Just before calling insert_job_details');
Line: 9266

      insert_job_details( p_job_details_rec  =>    l_job_details_rec,
                          x_return_status    =>    x_return_status );
Line: 9308

			WIP_MASS_LOAD_PROCESSOR.Delete_Completed_Records(l_job_header_rec.group_id);
Line: 9347

                lc_mod_name||'beforecallinsertrow',
                'Just before calling CSD_WIP_TRANSACTION_DTLS_PKG.Delete_Row');
Line: 9351

            CSD_WIP_TRANSACTION_DTLS_PKG.Delete_Row(
                p_WIP_TRANSACTION_DETAIL_ID  => l_WIP_TRANSACTION_DETAIL_ID);
Line: 9363

         ROLLBACK to PROCESS_DELETE_MTL_TXN_DTL_PVT ;
Line: 9378

         ROLLBACK to PROCESS_DELETE_MTL_TXN_DTL_PVT ;
Line: 9393

         ROLLBACK to PROCESS_DELETE_MTL_TXN_DTL_PVT ;
Line: 9415

END PROCESS_DELETE_MTL_TXN_DTL;
Line: 9427

FUNCTION is_delete_wip_op_valid
(
    p_organization_id        IN   NUMBER,
    p_wip_entity_id          IN   NUMBER,
    p_operation_seq_num      IN   NUMBER
) RETURN VARCHAR2
IS
   cursor c_get_ro_status is
   select csd.status
     from csd_repair_job_xref xref, csd_repairs csd
    where xref.wip_entity_id = p_wip_entity_id
      and xref.repair_line_id = csd.repair_line_id;
Line: 9441

   select 'exists' from csd_time_clock_entries
    where wip_entity_id = p_wip_entity_id
     and operation_seq_num = p_operation_seq_num
     and rownum = 1;
Line: 9447

   select 'exists'
     from WIP_REQUIREMENT_OPERATIONS wip
    where wip.wip_entity_id = p_wip_entity_id
      and wip.operation_seq_num = p_operation_seq_num
      and wip.quantity_issued > 0
      and rownum = 1;
Line: 9455

   lc_mod_name    CONSTANT                 VARCHAR2(2000) := 'csd.plsql.csd_hv_wip_job_pvt.is_delete_wip_op_valid';
Line: 9482

              'Entering procedure is_delete_wip_op_valid' );
Line: 9485

    WIP_OPERATIONS_PKG.Valid_Op_Delete(p_organization_id => p_organization_id,
                             p_wip_entity_id => p_wip_entity_id,
                             p_operation_seq_num => p_operation_seq_num,
                             x_return_status => l_return_status,
                             x_error_message => l_error_message);
Line: 9495

                  'WIP_OPERATIONS_PKG.Valid_Op_Delete returned success.' );
Line: 9539

              'WIP_OPERATIONS_PKG.Valid_Op_Delete returned non-success value: ' || l_return_status );
Line: 9542

              'WIP_OPERATIONS_PKG.Valid_Op_Delete returned error message: ' || l_error_message );
Line: 9551

                      'WIP_OPERATIONS_PKG.Valid_Op_Delete threw exception');
Line: 9556

END is_delete_wip_op_valid;
Line: 9559

 * Delete an existing operation and its associated requirements.
 * The following fields in p_op_dtls are expected to be filled out:
 *    wip_entity_id
 *    organization_id
 *    operation_seq_num
 */
PROCEDURE process_delete_op_dtl
(
    p_api_version_number                      IN           NUMBER,
    p_init_msg_list                           IN           VARCHAR2 ,
    p_commit                                  IN           VARCHAR2 ,
    p_validation_level                        IN           NUMBER ,
    x_return_status                           OUT  NOCOPY  VARCHAR2,
    x_msg_count                               OUT  NOCOPY  NUMBER,
    x_msg_data                                OUT  NOCOPY  VARCHAR2,
    p_op_dtls                                 IN           OP_DTLS_REC_TYPE
)
IS
      lc_api_name                CONSTANT VARCHAR2(30) := 'PROCESS_DELETE_OP_DTL';
Line: 9581

      lc_mod_name                 CONSTANT VARCHAR2(2000) := 'csd.plsql.csd_hv_wip_job_pvt.process_delete_op_dtl';
Line: 9593

          select wip_transaction_detail_id, inventory_item_id, resource_seq_num
          from csd_wip_transaction_details
          where wip_entity_id = p_op_dtls.wip_entity_id
          and operation_seq_num = p_op_dtls.operation_seq_num;
Line: 9600

          select csd.wip_transaction_detail_id,
                 csd.object_version_number,
                 wip.required_quantity,
                 nvl(wip.quantity_issued, 0)
          from WIP_REQUIREMENT_OPERATIONS wip,
               CSD_WIP_TRANSACTION_DETAILS csd
          where wip.wip_entity_id = p_op_dtls.wip_entity_id
            and wip.operation_seq_num = p_operation_seq_num
            and wip.inventory_item_id = p_inventory_item_id
            and wip.wip_entity_id = csd.wip_entity_id
            and wip.operation_seq_num = csd.operation_seq_num
            and wip.inventory_item_id = csd.inventory_item_id;
Line: 9614

          select min(operation_seq_num)
          from wip_operations
          where wip_entity_id =  p_op_dtls.wip_entity_id;
Line: 9623

                  'Entering private API process_delete_op_dtl' );
Line: 9627

      SAVEPOINT PROCESS_DELETE_op_dtl_PVT;
Line: 9649

            lc_mod_name||'beforecallinsertjobdtls',
            'Just before calling WIP_OPERATIONS_PKG.Delete_Operation');
Line: 9654

      WIP_OPERATIONS_PKG.Delete_Operation(p_organization_id => p_op_dtls.organization_id,
                             p_wip_entity_id => p_op_dtls.wip_entity_id,
                             p_operation_seq_num => p_op_dtls.operation_seq_num,
                             x_return_status => l_return_status,
                             x_error_message => l_error_message);
Line: 9664

                    'Error during WIP_OPERATIONS_PKG.Delete_Operation: ' || l_error_message);
Line: 9680

       *  Now we need to delete any associated rows in csd_wip_transaction_details
       **/

      -- Get the first operation seq number for the job, just in case we need it
      -- during looping through the wip txn details.
      l_first_operation := null;
Line: 9719

                                            'Just before calling CSD_WIP_TRANSACTION_DTLS_PKG.Update_Row');
Line: 9723

                       CSD_WIP_TRANSACTION_DTLS_PKG.Update_Row (
                        p_WIP_TRANSACTION_DETAIL_ID  => l_txn_detail_id
                        ,p_CREATED_BY                 => null
                        ,p_CREATION_DATE              => null
                        ,p_LAST_UPDATED_BY            => fnd_global.user_id
                        ,p_LAST_UPDATE_DATE           => sysdate
                        ,p_LAST_UPDATE_LOGIN          => fnd_global.login_id
                        ,p_INVENTORY_ITEM_ID          => null
                        ,p_WIP_ENTITY_ID              => null
                        ,p_OPERATION_SEQ_NUM          => null
                        ,p_RESOURCE_SEQ_NUM           => null
                        ,p_employee_id                => null
                        ,p_TRANSACTION_QUANTITY       => l_required_quantity - l_quantity_issued
                        ,p_TRANSACTION_UOM            => null
                        ,p_SERIAL_NUMBER              => null
                        ,p_REVISION                   => null
                        ,p_REASON_ID                  => null
                        ,p_BACKFLUSH_FLAG             => null
                        ,p_COUNT_POINT_TYPE           => null
                        ,p_DEPARTMENT_ID              => null
                        ,p_DESCRIPTION                => null
                        ,p_FIRST_UNIT_COMPLETION_DATE => null
                        ,p_FIRST_UNIT_START_DATE      => null
                        ,p_LAST_UNIT_COMPLETION_DATE  => null
                        ,p_LAST_UNIT_START_DATE       => null
                        ,p_MINIMUM_TRANSFER_QUANTITY  => null
                        ,p_STANDARD_OPERATION_ID      => null
                        ,p_OBJECT_VERSION_NUMBER      => l_obj_ver_num + 1
                        ,p_ATTRIBUTE_CATEGORY         => null
                        ,p_ATTRIBUTE1                 => null
                        ,p_ATTRIBUTE2                 => null
                        ,p_ATTRIBUTE3                 => null
                        ,p_ATTRIBUTE4                 => null
                        ,p_ATTRIBUTE5                 => null
                        ,p_ATTRIBUTE6                 => null
                        ,p_ATTRIBUTE7                 => null
                        ,p_ATTRIBUTE8                 => null
                        ,p_ATTRIBUTE9                 => null
                        ,p_ATTRIBUTE10                => null
                        ,p_ATTRIBUTE11                => null
                        ,p_ATTRIBUTE12                => null
                        ,p_ATTRIBUTE13                => null
                        ,p_ATTRIBUTE14                => null
                        ,p_ATTRIBUTE15                => null
                        ,p_CREATE_RO_FLAG             => null -- bug#13657187 auto create ro, parent ro
                       );
Line: 9773

            /** DELETE CSD_WIP_TRANSACTION_DETAILS ROW for the deleted operation **/
            IF ( FND_LOG.LEVEL_EVENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
               FND_LOG.STRING(    FND_LOG.LEVEL_EVENT,
                lc_mod_name,
                'Just before calling CSD_WIP_TRANSACTION_DTLS_PKG.Delete_Row');
Line: 9781

            CSD_WIP_TRANSACTION_DTLS_PKG.Delete_Row(
                p_WIP_TRANSACTION_DETAIL_ID  => wip_txn_detail_rec.WIP_TRANSACTION_DETAIL_ID);
Line: 9793

         ROLLBACK to PROCESS_DELETE_OP_DTL_PVT ;
Line: 9808

         ROLLBACK to PROCESS_DELETE_op_dtl_PVT ;
Line: 9823

         ROLLBACK to PROCESS_DELETE_op_dtl_PVT ;
Line: 9845

END PROCESS_DELETE_OP_DTL;
Line: 9848

PROCEDURE update_mat_issue_quantities
(
    p_api_version_number                      IN           NUMBER,
    p_init_msg_list                           IN           VARCHAR2 ,
    p_commit                                  IN           VARCHAR2 ,
    p_validation_level                        IN           NUMBER ,
    x_return_status                           OUT  NOCOPY  VARCHAR2,
    x_msg_count                               OUT  NOCOPY  NUMBER,
    x_msg_data                                OUT  NOCOPY  VARCHAR2,
    p_repair_line_id                          IN           NUMBER DEFAULT NULL,
    p_wip_entity_id                           IN           NUMBER DEFAULT NULL,
    p_wip_transaction_detail_id               IN           NUMBER DEFAULT NULL,
    p_transaction_type_id                     IN           NUMBER DEFAULT NULL,
    p_quantity                                IN           NUMBER DEFAULT NULL,
    p_exclude_closed_jobs                     IN           VARCHAR2 DEFAULT 'Y',
    p_transaction_date_start                  IN           DATE DEFAULT NULL,
    p_transaction_date_end                    IN           DATE DEFAULT NULL
)
IS
    lc_api_name                CONSTANT VARCHAR2(30) := 'PROCESS_DELETE_OP_DTL';
Line: 9869

    lc_mod_name                CONSTANT VARCHAR2(60) := 'csd.plsql.csd_hv_wip_job_pvt.update_mat_issue_quantities';
Line: 9930

                UPDATE csd_wip_transaction_details SET quantity_issued = (NVL(quantity_issued,0) + p_quantity)
                    WHERE wip_transaction_detail_id = p_wip_transaction_detail_id;
Line: 9935

                UPDATE csd_wip_transaction_details SET quantity_recovered = (NVL(quantity_recovered,0) + p_quantity)
                    WHERE wip_transaction_detail_id = p_wip_transaction_detail_id;
Line: 9941

                UPDATE csd_wip_transaction_details cwt SET cwt.quantity_issued = (NVL(cwt.quantity_issued,0) + p_quantity)
                    WHERE cwt.wip_transaction_detail_id = p_wip_transaction_detail_id
                    AND EXISTS (SELECT SUM(transaction_quantity)
                                FROM mtl_material_transactions mmt,wip_requirement_operations wro
                                WHERE mmt.inventory_item_id = cwt.inventory_item_id
                                   AND wro.wip_entity_id = cwt.wip_entity_id
                                   AND wro.inventory_item_id = cwt.inventory_item_id
                                   AND wro.organization_id = mmt.organization_id
                                   AND mmt.transaction_source_id = wro.wip_entity_id
                                   AND mmt.operation_seq_num = wro.operation_seq_num
                                GROUP BY wro.inventory_item_id
                                HAVING SUM(transaction_quantity) >= NVL(cwt.quantity_issued,0)+ p_quantity
                                );
Line: 9958

                UPDATE csd_wip_transaction_details cwt SET cwt.quantity_recovered = (NVL(cwt.quantity_recovered,0) + p_quantity)
                    WHERE wip_transaction_detail_id = p_wip_transaction_detail_id
                    AND EXISTS (SELECT SUM(transaction_quantity)
                                FROM mtl_material_transactions mmt,wip_requirement_operations wro
                                WHERE mmt.inventory_item_id = cwt.inventory_item_id
                                   AND wro.wip_entity_id = cwt.wip_entity_id
                                   AND wro.inventory_item_id = cwt.inventory_item_id
                                   AND wro.organization_id = mmt.organization_id
                                   AND mmt.transaction_source_id = wro.wip_entity_id
                                   AND mmt.operation_seq_num = wro.operation_seq_num
                                GROUP BY wro.inventory_item_id
                                HAVING SUM(transaction_quantity) >= NVL(cwt.quantity_recovered,0)+ p_quantity
                                );
Line: 9988

        SELECT cwt.wip_transaction_detail_id,mmt.transaction_type_id,sum(mmt.transaction_quantity)
        BULK COLLECT INTO l_wip_transaction_detail_ids,l_transaction_type_ids,l_transaction_quantities
        FROM mtl_material_transactions mmt, wip_requirement_operations wro,
             csd_wip_transaction_details cwt
        WHERE cwt.wip_entity_id = p_wip_entity_id
          AND cwt.wip_entity_id = wro.wip_entity_id
          AND cwt.inventory_item_id = wro.inventory_item_id
          AND cwt.operation_seq_num = wro.operation_seq_num
          AND wro.inventory_item_id = mmt.inventory_item_id
          AND mmt.organization_id = mmt.organization_id
          AND mmt.transaction_source_id = wro.wip_entity_id
          AND mmt.operation_seq_num = wro.operation_seq_num
        GROUP BY cwt.wip_transaction_detail_id,mmt.transaction_type_id;
Line: 10007

                UPDATE csd_wip_transaction_details SET quantity_issued = l_transaction_quantities(i)
                    WHERE wip_transaction_detail_id = l_wip_transaction_detail_ids(i);
Line: 10012

                UPDATE csd_wip_transaction_details SET quantity_recovered = l_transaction_quantities(i)
                    WHERE wip_transaction_detail_id = l_wip_transaction_detail_ids(i);
Line: 10025

            SELECT cwt.wip_transaction_detail_id,mmt.transaction_type_id,sum(mmt.transaction_quantity)
            BULK COLLECT INTO l_wip_transaction_detail_ids,l_transaction_type_ids,l_transaction_quantities
            FROM mtl_material_transactions mmt, wip_requirement_operations wro,
                 csd_wip_transaction_details cwt,csd_repair_job_xref crj
            WHERE crj.repair_line_id = p_repair_line_id
              AND cwt.wip_entity_id = crj.wip_entity_id
              AND cwt.wip_entity_id = wro.wip_entity_id
              AND cwt.inventory_item_id = wro.inventory_item_id
              AND cwt.operation_seq_num = wro.operation_seq_num
              AND wro.inventory_item_id = mmt.inventory_item_id
              AND wro.organization_id = mmt.organization_id
              AND mmt.transaction_source_id = wro.wip_entity_id
              AND mmt.operation_seq_num = wro.operation_seq_num
            GROUP BY cwt.wip_transaction_detail_id,mmt.transaction_type_id;
Line: 10044

                    UPDATE csd_wip_transaction_details SET quantity_issued =  l_transaction_quantities(i)
                        WHERE wip_transaction_detail_id = l_wip_transaction_detail_ids(i);
Line: 10049

                    UPDATE csd_wip_transaction_details SET quantity_recovered = l_transaction_quantities(i)
                        WHERE wip_transaction_detail_id = l_wip_transaction_detail_ids(i);
Line: 10058

            SELECT cwt.wip_transaction_detail_id,mmt.transaction_type_id,sum(mmt.transaction_quantity)
            BULK COLLECT INTO l_wip_transaction_detail_ids,l_transaction_type_ids,l_transaction_quantities
            from mtl_material_transactions mmt, wip_requirement_operations wro,
                 csd_wip_transaction_details cwt,csd_repair_job_xref crj,wip_discrete_jobs wdj
            WHERE crj.repair_line_id = p_repair_line_id
              AND cwt.wip_entity_id = crj.wip_entity_id
              AND cwt.wip_entity_id = wro.wip_entity_id
              AND cwt.inventory_item_id = wro.inventory_item_id
              AND cwt.operation_seq_num = wro.operation_seq_num
              AND wro.inventory_item_id = mmt.inventory_item_id
              AND wro.organization_id = mmt.organization_id
              AND mmt.transaction_source_id = wro.wip_entity_id
              AND mmt.operation_seq_num = wro.operation_seq_num
              AND cwt.wip_entity_id = wdj.wip_entity_id
              AND wdj.status_type NOT IN (12,4,5)
            GROUP BY cwt.wip_transaction_detail_id,mmt.transaction_type_id;
Line: 10079

                    UPDATE csd_wip_transaction_details SET quantity_issued = l_transaction_quantities(i)
                        WHERE wip_transaction_detail_id = l_wip_transaction_detail_ids(i);
Line: 10084

                    UPDATE csd_wip_transaction_details SET quantity_recovered = l_transaction_quantities(i)
                        WHERE wip_transaction_detail_id = l_wip_transaction_detail_ids(i);
Line: 10101

                    SELECT cwt.wip_transaction_detail_id,mmt.transaction_type_id,sum(mmt.transaction_quantity)
                    FROM mtl_material_transactions mmt, wip_requirement_operations wro,
                         csd_wip_transaction_details cwt
                    WHERE cwt.wip_entity_id = wro.wip_entity_id
                      AND cwt.inventory_item_id = wro.inventory_item_id
                      AND cwt.operation_seq_num = wro.operation_seq_num
                      AND wro.inventory_item_id = mmt.inventory_item_id
                      AND wro.organization_id = mmt.organization_id
                      AND mmt.transaction_source_id = wro.wip_entity_id
                      AND mmt.operation_seq_num = wro.operation_seq_num
                    GROUP BY cwt.wip_transaction_detail_id,mmt.transaction_type_id;
Line: 10118

                            UPDATE csd_wip_transaction_details SET quantity_issued = l_transaction_quantities(i)
                                WHERE wip_transaction_detail_id = l_wip_transaction_detail_ids(i);
Line: 10123

                            UPDATE csd_wip_transaction_details SET quantity_recovered = l_transaction_quantities(i)
                                WHERE wip_transaction_detail_id = l_wip_transaction_detail_ids(i);
Line: 10132

                    SELECT cwt.wip_transaction_detail_id,mmt.transaction_type_id,sum(mmt.transaction_quantity)
                    FROM mtl_material_transactions mmt, wip_requirement_operations wro,
                         csd_wip_transaction_details cwt,wip_discrete_jobs wdj
                    WHERE cwt.wip_entity_id = wro.wip_entity_id
                      AND cwt.inventory_item_id = wro.inventory_item_id
                      AND cwt.operation_seq_num = wro.operation_seq_num
                      AND wro.inventory_item_id = mmt.inventory_item_id
                      AND wro.organization_id = mmt.organization_id
                      AND mmt.transaction_source_id = wro.wip_entity_id
                      AND mmt.operation_seq_num = wro.operation_seq_num
                      AND cwt.wip_entity_id = wdj.wip_entity_id
                      AND wdj.status_type NOT IN (12,4,5)
                    GROUP BY cwt.wip_transaction_detail_id,mmt.transaction_type_id;
Line: 10151

                            UPDATE csd_wip_transaction_details SET quantity_issued = l_transaction_quantities(i)
                                WHERE wip_transaction_detail_id = l_wip_transaction_detail_ids(i);
Line: 10156

                            UPDATE csd_wip_transaction_details SET quantity_recovered = l_transaction_quantities(i)
                                WHERE wip_transaction_detail_id = l_wip_transaction_detail_ids(i);
Line: 10169

                    SELECT cwt.wip_transaction_detail_id,mmt.transaction_type_id,sum(mmt.transaction_quantity)
                    FROM mtl_material_transactions mmt, wip_requirement_operations wro,
                         csd_wip_transaction_details cwt,wip_discrete_jobs wdj
                    WHERE cwt.wip_entity_id = wro.wip_entity_id
                      AND cwt.inventory_item_id = wro.inventory_item_id
                      AND cwt.operation_seq_num = wro.operation_seq_num
                      AND wro.inventory_item_id = mmt.inventory_item_id
                      AND mmt.organization_id = mmt.organization_id
                      AND mmt.transaction_source_id = wro.wip_entity_id
                      AND cwt.wip_entity_id = wdj.wip_entity_id
                      AND mmt.operation_seq_num = wro.operation_seq_num
                      AND TRUNC(mmt.transaction_date) BETWEEN trunc(p_transaction_date_start) AND trunc(NVL(p_transaction_date_end,SYSDATE))
                    GROUP BY cwt.wip_transaction_detail_id,mmt.transaction_type_id;
Line: 10188

                            UPDATE csd_wip_transaction_details SET quantity_issued = l_transaction_quantities(i)
                                WHERE wip_transaction_detail_id = l_wip_transaction_detail_ids(i);
Line: 10193

                            UPDATE csd_wip_transaction_details SET quantity_recovered = l_transaction_quantities(i)
                                WHERE wip_transaction_detail_id = l_wip_transaction_detail_ids(i);
Line: 10203

                    SELECT cwt.wip_transaction_detail_id,mmt.transaction_type_id,sum(mmt.transaction_quantity)
                    FROM mtl_material_transactions mmt, wip_requirement_operations wro,
                         csd_wip_transaction_details cwt,wip_discrete_jobs wdj
                    WHERE cwt.wip_entity_id = wro.wip_entity_id
                      AND cwt.inventory_item_id = wro.inventory_item_id
                      AND cwt.operation_seq_num = wro.operation_seq_num
                      AND wro.inventory_item_id = mmt.inventory_item_id
                      AND wro.organization_id = mmt.organization_id
                      AND mmt.transaction_source_id = wro.wip_entity_id
                      AND mmt.operation_seq_num = wro.operation_seq_num
                      AND cwt.wip_entity_id = wdj.wip_entity_id
                      AND wdj.status_type NOT IN (12,4,5)
                      AND TRUNC(mmt.transaction_date) BETWEEN trunc(p_transaction_date_start) AND trunc(NVL(p_transaction_date_end,SYSDATE))
                    GROUP BY cwt.wip_transaction_detail_id,mmt.transaction_type_id;
Line: 10223

                            UPDATE csd_wip_transaction_details SET quantity_issued = l_transaction_quantities(i)
                                WHERE wip_transaction_detail_id = l_wip_transaction_detail_ids(i);
Line: 10228

                            UPDATE csd_wip_transaction_details SET quantity_recovered = l_transaction_quantities(i)
                                WHERE wip_transaction_detail_id = l_wip_transaction_detail_ids(i);
Line: 10239

END update_mat_issue_quantities;
Line: 10242

PROCEDURE update_mat_issue_quantities_cp
(
    retcode                                   OUT NOCOPY   VARCHAR2,
    errbuf                                    OUT NOCOPY   VARCHAR2,
    p_repair_line_id                          IN           NUMBER DEFAULT NULL,
    p_wip_entity_id                           IN           NUMBER DEFAULT NULL,
    p_exclude_closed_jobs                     IN           VARCHAR2 DEFAULT 'Y',
    p_transaction_date_start                  IN           VARCHAR2 DEFAULT NULL,
    p_transaction_date_end                    IN           VARCHAR2 DEFAULT NULL
)
IS
x_return_status     VARCHAR2(1);
Line: 10271

   update_mat_issue_quantities
    (
        p_api_version_number                      => 1.0 ,
        p_init_msg_list                           => fnd_api.g_false ,
        p_commit                                  => fnd_api.g_false ,
        p_validation_level                        => fnd_api.g_valid_level_none,
        x_return_status                           => x_return_status,
        x_msg_count                               => x_msg_count,
        x_msg_data                                => x_msg_data,
        p_repair_line_id                          => p_repair_line_id,
        p_wip_entity_id                           => p_wip_entity_id,
        p_wip_transaction_detail_id               => NULL,
        p_transaction_type_id                     => NULL,
        p_quantity                                => NULL,
        p_exclude_closed_jobs                     => p_exclude_closed_jobs,
        p_transaction_date_start                  => l_txn_start_date,
        p_transaction_date_end                    => l_txn_end_date
    );
Line: 10295

END update_mat_issue_quantities_cp;
Line: 10384

    select dra.repair_type_id,
           rt.business_process_id,
           dra.currency_code,
           dra.incident_id
      into l_repair_type_id,
           l_business_process_id,
           l_currency_code,
           l_incident_id
      from csd_repairs dra, csd_repair_types_b rt
     where rt.repair_type_id = dra.repair_type_id
       and repair_line_id = p_repair_line_id;