DBA Data[Home] [Help]

APPS.EAM_WO_COMP_UTILITY_PVT SQL Statements

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

Line: 42

		Insert_Row
		(  p_eam_wo_comp_rec    => p_eam_wo_comp_rec
		 , x_mesg_token_Tbl     => l_mesg_token_tbl
		 , x_return_Status      => l_return_status
		 );
Line: 58

PROCEDURE insert_row
   (
	p_eam_wo_comp_rec     IN  EAM_PROCESS_WO_PUB.eam_wo_comp_rec_type
	, x_return_status     OUT NOCOPY  VARCHAR2
	, x_mesg_token_tbl    OUT NOCOPY EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type
   )
   IS
    l_Mesg_Token_tbl        EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type;
Line: 69

	IF EAM_PROCESS_WO_PVT.Get_Debug = 'Y' THEN EAM_ERROR_MESSAGE_PVT.Write_Debug('Work Order Completeion processing insert row'); END IF;
Line: 72

		INSERT INTO EAM_JOB_COMPLETION_TXNS (
				       transaction_id,
                                       transaction_date,
                                       transaction_type,
                                       wip_entity_id,
                                       organization_id,
                                       parent_wip_entity_id,
                                       reference,
                                       reconciliation_code,
                                       acct_period_id,
                                       qa_collection_id,
                                       actual_start_date,
                                       actual_end_date,
                                       actual_duration,
                                       created_by,
                                       creation_date,
                                       last_updated_by,
                                       last_update_date,
                                       last_update_login,
                                       request_id,
                                       program_application_id,
                                       program_id,
                                       program_update_date,
                                       completion_subinventory,
                                       completion_locator_id,
                                       lot_number,
                                       attribute_category,
                                       attribute1,
                                       attribute2,
                                       attribute3,
                                       attribute4,
                                       attribute5,
                                       attribute6,
                                       attribute7,
                                       attribute8,
                                       attribute9,
                                       attribute10,
                                       attribute11,
                                       attribute12,
                                       attribute13,
                                       attribute14,
                                       attribute15
                                       )
                               VALUES (
				       p_eam_wo_comp_rec.transaction_id,
                                       p_eam_wo_comp_rec.transaction_date,
                                       decode(p_eam_wo_comp_rec.transaction_type,EAM_PROCESS_WO_PVT.G_OPR_COMPLETE,1,EAM_PROCESS_WO_PVT.G_OPR_UNCOMPLETE,2),
                                       p_eam_wo_comp_rec.wip_entity_id,
                                       p_eam_wo_comp_rec.organization_id,
                                       p_eam_wo_comp_rec.parent_wip_entity_id,
                                       p_eam_wo_comp_rec.reference,
                                       p_eam_wo_comp_rec.reconciliation_code,
                                       p_eam_wo_comp_rec.acct_period_id,
                                       p_eam_wo_comp_rec.qa_collection_id,
                                       p_eam_wo_comp_rec.actual_start_date,
                                       p_eam_wo_comp_rec.actual_end_date,
                                       p_eam_wo_comp_rec.actual_duration,
                                       FND_GLOBAL.user_id,
                                       sysdate,
                                       FND_GLOBAL.user_id,
                                       sysdate,
                                       FND_GLOBAL.login_id,
                                       p_eam_wo_comp_rec.request_id,
                                       p_eam_wo_comp_rec.program_application_id,
                                       p_eam_wo_comp_rec.program_id,
                                       p_eam_wo_comp_rec.program_update_date,
                                       p_eam_wo_comp_rec.completion_subinventory,
                                       p_eam_wo_comp_rec.completion_locator_id,
                                       p_eam_wo_comp_rec.lot_number,
                                       p_eam_wo_comp_rec.attribute_category,
                                       p_eam_wo_comp_rec.attribute1,
                                       p_eam_wo_comp_rec.attribute2,
                                       p_eam_wo_comp_rec.attribute3,
                                       p_eam_wo_comp_rec.attribute4,
                                       p_eam_wo_comp_rec.attribute5,
                                       p_eam_wo_comp_rec.attribute6,
                                       p_eam_wo_comp_rec.attribute7,
                                       p_eam_wo_comp_rec.attribute8,
                                       p_eam_wo_comp_rec.attribute9,
                                       p_eam_wo_comp_rec.attribute10,
                                       p_eam_wo_comp_rec.attribute11,
                                       p_eam_wo_comp_rec.attribute12,
                                       p_eam_wo_comp_rec.attribute13,
                                       p_eam_wo_comp_rec.attribute14,
                                       p_eam_wo_comp_rec.attribute15
                                       );
Line: 159

	      EAM_ERROR_MESSAGE_PVT.Write_Debug('Work Order Completeion completed insert row');
Line: 169

		       EAM_ERROR_MESSAGE_PVT.Write_Debug('Work Order Completeion : insert row : inside exception : ' || SQLERRM);
Line: 174

                         , p_message_text       => G_PKG_NAME ||' :Inserting Record ' || SQLERRM
                         , x_mesg_token_Tbl     => x_mesg_token_tbl
                        );
Line: 179

END insert_row;
Line: 199

	SELECT eam_asset_status_history_s.nextval
	  INTO i_asset_status_id
	  FROM dual;
Line: 204

	  UPDATE eam_asset_status_history
	     SET enable_flag = 'N'
	       , last_update_date  = SYSDATE
	       , last_updated_by   = FND_GLOBAL.user_id
	       , last_update_login = FND_GLOBAL.login_id
	   WHERE organization_id = s_organization_id
	     AND wip_entity_id = s_wip_entity_id
	     AND operation_seq_num IS NULL
	     AND (enable_flag is NULL OR enable_flag = 'Y')
	     AND maintenance_object_type = s_maintenance_object_type
	     AND maintenance_object_id = s_maintenance_object_id;
Line: 216

	INSERT INTO eam_asset_status_history
				      (asset_status_id,
                                       organization_id,
                                       asset_group_id,
                                       asset_number,
                                       start_date,
                                       end_date,
				       wip_entity_id,             -- Fix for Bug 3448770
                                       maintenance_object_type,
                                       maintenance_object_id,
                                       created_by,
                                       creation_date,
                                       last_updated_by,
                                       last_update_date,
				       enable_flag)   -- Enhancement Bug 3852846
                               VALUES (i_asset_status_id,
                                       s_organization_id,
                                       s_asset_group_id,
                                       s_asset_number,
                                       s_start_date,
                                       s_end_date,
				       s_wip_entity_id,            -- Fix for Bug 3448770
                                       s_maintenance_object_type,
                                       s_maintenance_object_id,
                                       s_user_id,
                                       sysdate,
                                       s_user_id,
                                       sysdate,
				       'Y');   -- Enhancement Bug 3852846
Line: 295

  select mtl_material_transactions_s.nextval into i_transaction_header_id
  from   dual;
Line: 309

      select nvl(revision_qty_control_code,1)
      into l_revision_control_code
      from mtl_system_items
      where inventory_item_id = s_rebuild_item_id
      and organization_id = s_org_id;
Line: 377

        EAM_ERROR_MESSAGE_PVT.Write_Debug('EAM_WO_COMP_UTILITY_PVT.process_lot_serial  : before inv_trx_util_pub.insert_line_trx');
Line: 383

   errCode := inv_trx_util_pub.insert_line_trx(
             p_trx_hdr_id      => i_transaction_header_id,
             p_item_id         => s_rebuild_item_id,
             p_revision        => i_revision,
             p_org_id          => s_org_id,
             p_trx_action_id   => i_transaction_action_id,
             p_subinv_code     => s_subinventory,
             p_locator_id      => s_locator_id,
             p_trx_type_id     => i_transaction_type_id,
             p_trx_src_type_id => i_transaction_source_type_id,
             p_trx_qty         => i_transaction_quantity,
             p_pri_qty         => i_primary_quantity,
             p_uom             => item.primaryUOMCode,
             p_date            => sysdate,
             p_user_id         => s_user_id,
             p_trx_src_id      => s_wip_entity_id,
             x_trx_tmp_id      => i_transaction_temp_id,
             x_proc_msg        => errMsg);
Line: 404

        EAM_ERROR_MESSAGE_PVT.Write_Debug('EAM_WO_COMP_UTILITY_PVT.process_lot_serial : inv_trx_util_pub.insert_line_trx : ' || errMsg);
Line: 409

        EAM_ERROR_MESSAGE_PVT.Write_Debug('EAM_WO_COMP_UTILITY_PVT.process_lot_serial  : after inv_trx_util_pub.insert_line_trx');
Line: 425

        EAM_ERROR_MESSAGE_PVT.Write_Debug('EAM_WO_COMP_UTILITY_PVT.process_lot_serial  : before inv_trx_util_pub.insert_lot_trx');
Line: 432

    errCode := inv_trx_util_pub.insert_lot_trx(
               p_trx_tmp_id    => i_transaction_temp_id,
               p_user_id       => s_user_id,
               p_lot_number    => s_lot_serial_tbl(i).lot_number,
               p_trx_qty       => l_transaction_quantity,
               p_pri_qty       => l_transaction_quantity,
               x_ser_trx_id    => i_serial_transaction_temp_id,
               x_proc_msg      => errMsg);
Line: 446

        EAM_ERROR_MESSAGE_PVT.Write_Debug('EAM_WO_COMP_UTILITY_PVT.process_lot_serial  : after inv_trx_util_pub.insert_lot_trx');
Line: 468

        EAM_ERROR_MESSAGE_PVT.Write_Debug('EAM_WO_COMP_UTILITY_PVT.process_lot_serial  : before inv_trx_util_pub.insert_ser_trx');
Line: 473

    errCode := inv_trx_util_pub.insert_ser_trx(
               p_trx_tmp_id     => i_transaction_temp_id_s,
               p_user_id        => s_user_id,
               p_fm_ser_num     => s_lot_serial_tbl(i).serial_number,
               p_to_ser_num     => s_lot_serial_tbl(i).serial_number,
               x_proc_msg       => errMsg);
Line: 484

        EAM_ERROR_MESSAGE_PVT.Write_Debug('EAM_WO_COMP_UTILITY_PVT.process_lot_serial  : after inv_trx_util_pub.insert_ser_trx');
Line: 507

    FND_MSG_PUB.Delete_msg;
Line: 584

            l_lot_serial_tbl.DELETE;
Line: 602

PROCEDURE update_row (
	 p_eam_wo_comp_rec     IN  EAM_PROCESS_WO_PUB.eam_wo_comp_rec_type
        , x_return_status      OUT NOCOPY  VARCHAR2
	, x_mesg_token_tbl     OUT NOCOPY EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type
)
IS
	l_asset_group_id		NUMBER;
Line: 647

	IF EAM_PROCESS_WO_PVT.Get_Debug = 'Y' THEN EAM_ERROR_MESSAGE_PVT.Write_Debug('Work Order Completeion processing update_row'); END IF;
Line: 650

	  select parent_wip_entity_id,
		 asset_group_id,
		 asset_number,
		 primary_item_id,
		 manual_rebuild_flag,
		 rebuild_item_id,
		 rebuild_serial_number,
		 project_id,
		 task_id,
		 maintenance_object_source,   -- added as part of bug #2774571 to check whether the work order is of 'EAM' or 'CMRO'
		 maintenance_object_type,     -- Fix for Bug 3448770
		 maintenance_object_id
	    into i_parent_wip_entity_id,
		 i_asset_group_id,
		 i_asset_number,
		 i_asset_activity_id,
		 i_manual_rebuild_flag,
		 i_rebuild_item_id,
		 i_rebuild_serial_number,
		 i_project_id,
		 i_task_id,
		 i_maintenance_source_id,     -- added as part of bug #2774571 to check whether the work order is of 'EAM' or 'CMRO'
		 i_maintenance_object_type,   -- Fix for Bug 3448770
		 i_maintenance_object_id
	    from wip_discrete_jobs
	   where wip_entity_id = p_eam_wo_comp_rec.wip_entity_id;
Line: 761

			select
			    completion_subinventory,
			    completion_locator_id,
			    lot_number
    			into l_cmpl_sub,
			     l_locator,
			     l_lot

			from EAM_JOB_COMPLETION_TXNS
			where wip_entity_id = p_eam_wo_comp_rec.wip_entity_id
			and transaction_type = 1
			and transaction_date = (select max(transaction_date) from EAM_JOB_COMPLETION_TXNS
						where wip_entity_id = p_eam_wo_comp_rec.wip_entity_id
						   and transaction_type =1);
Line: 834

                                EAM_ERROR_MESSAGE_PVT.Write_Debug('EAM_WO_COMP_UTILITY_PVT.update_row  : Exception1 : '|| errMsg);
Line: 842

	select system_status into i_status_type
	  from eam_wo_statuses_V
	 where status_id = p_eam_wo_comp_rec.user_status_id
	   and enabled_flag = 'Y';
Line: 856

	SELECT NVL(asset_group_id,rebuild_item_id),
	       NVL(asset_number,rebuild_serial_number),
	       maintenance_object_type,
	       maintenance_object_id
	  INTO l_asset_group_id ,
	       l_asset_number,
	       i_maintenance_object_type,
   	       i_maintenance_object_id
	  FROM WIP_DISCRETE_JOBS
	 WHERE wip_entity_id = p_eam_wo_comp_rec.wip_entity_id;
Line: 869

						      eam_meters_util.update_last_service_dates_wo(
									p_wip_entity_id => p_eam_wo_comp_rec.wip_entity_id,
									p_start_date => p_eam_wo_comp_rec.actual_start_date,
									p_end_date => p_eam_wo_comp_rec.actual_end_date,
									x_return_status => x_return_status,
									x_msg_count => l_msg_count,
									x_msg_data => l_msg_data);
Line: 885

									EAM_ERROR_MESSAGE_PVT.Write_Debug('EAM_WO_COMP_UTILITY_PVT.update_row  : Exception2 : '|| l_msg_data);
Line: 912

	UPDATE WIP_DISCRETE_JOBS
	    SET  last_update_date         = sysdate,
		 last_updated_by          = FND_GLOBAL.user_id,
		 last_update_login        = FND_GLOBAL.login_id,
		 status_type              = i_status_type,
		 date_completed           = i_completion_date,
		 request_id               = p_eam_wo_comp_rec.request_id,
		 program_application_id   = p_eam_wo_comp_rec.program_application_id,
		 program_id               = p_eam_wo_comp_rec.program_id,
		 program_update_date      = p_eam_wo_comp_rec.program_update_date
	  WHERE  wip_entity_id            = p_eam_wo_comp_rec.wip_entity_id
	    AND  organization_id	  = p_eam_wo_comp_rec.organization_id;
Line: 925

	    UPDATE EAM_WORK_ORDER_DETAILS
	       SET USER_DEFINED_STATUS_ID  = p_eam_wo_comp_rec.user_status_id
	     WHERE wip_entity_id           = p_eam_wo_comp_rec.wip_entity_id
	       AND organization_id	   = p_eam_wo_comp_rec.organization_id ;
Line: 930

	-- Update wip_eam_work_requests table
	UPDATE WIP_EAM_WORK_REQUESTS
	   SET work_request_status_id   = i_work_request_status,
	       last_update_date         = sysdate,
	       last_updated_by          = fnd_global.user_id,
	       last_update_login        = fnd_global.login_id
	 WHERE wip_entity_id            = p_eam_wo_comp_rec.wip_entity_id;
Line: 945

                         , p_message_text       => G_PKG_NAME ||' :Inserting Record ' || SQLERRM
                         , x_mesg_token_Tbl     => x_mesg_token_tbl
                        );
Line: 951

                            EAM_ERROR_MESSAGE_PVT.Write_Debug('EAM_WO_COMP_UTILITY_PVT.update_row  : Exception3 : '|| SQLERRM);
Line: 954

END update_row;