DBA Data[Home] [Help]

PACKAGE BODY: APPS.EAM_REQUEST_UTILITY_PVT

Source


1 PACKAGE BODY EAM_REQUEST_UTILITY_PVT AS
2 /* $Header: EAMVRQUB.pls 120.0 2005/06/08 02:50:25 appldev noship $ */
3 /***************************************************************************
4 --
5 --  Copyright (c) 2002 Oracle Corporation, Redwood Shores, CA, USA
6 --  All rights reserved.
7 --
8 --  FILENAME
9 --
10 --      EAMVRQUB.pls
11 --
12 --  DESCRIPTION
13 --
14 --      Body of package EAM_REQUEST_UTILITY_PVT
15 --
16 --  NOTES
17 --
18 --  HISTORY
19 --
20 --  14-FEB-2005    mmaduska     Initial Creation
21 ***************************************************************************/
22 PROCEDURE INSERT_ROW
23 (  p_eam_request_rec         IN  EAM_PROCESS_WO_PUB.eam_request_rec_type
24    , x_return_status           OUT NOCOPY  VARCHAR2
25    , x_mesg_token_tbl          OUT NOCOPY EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type
26  )
27 IS
28 BEGIN
29 
30 	IF p_eam_request_rec.request_type = 1 THEN
31 	  UPDATE WIP_EAM_WORK_REQUESTS
32 	     SET
33 		 wip_entity_id            = p_eam_request_rec.wip_entity_id,
34 		 work_request_status_id   = 4,
35 		 last_update_date         = sysdate,
36 		 last_updated_by          = FND_GLOBAL.user_id,
37 		 last_update_login        = fnd_global.login_id
38 	   WHERE work_request_id	  = p_eam_request_rec.request_id
39 	     AND organization_id	  = p_eam_request_rec.organization_id;
40 
41 	END IF;
42 
43 	IF p_eam_request_rec.request_type = 2 THEN
44 
45 		INSERT INTO EAM_WO_SERVICE_ASSOCIATION
46 		    (   wo_service_entity_assoc_id,
47     			maintenance_organization_id,
48 		     	wip_entity_id,
49      			service_request_id,
50      			creation_date,
51      			created_by,
52      			last_update_login,
53      			program_id,
54      			attribute1,
55      			attribute2,
56      			attribute3,
57      			attribute4,
58      			attribute5,
59      			attribute6,
60      			attribute7,
61      			attribute8,
62      			attribute9,
63      			attribute10,
64      			attribute11,
65      			attribute12,
66      			attribute13,
67      			attribute14,
68      			attribute15,
69      			attribute_category,
70      			last_updated_by,
71      			last_update_date,
72 			enable_flag)		-- Fix for 3773450
73      		VALUES
74      		    (   p_eam_request_rec.SERVICE_ASSOC_ID,
75      			p_eam_request_rec.organization_id,
76      			p_eam_request_rec.wip_entity_id,
77      			p_eam_request_rec.request_id,
78      			sysdate,
79      			FND_GLOBAL.USER_ID,
80      			FND_GLOBAL.LOGIN_ID,
81      			null,--fnd_global.conc_program_id,
82      			null,
83      			null,
84      			null,
85      			null,
86      			null,
87      			null,
88      			null,
89      			null,
90      			null,
91      			null,
92      			null,
93      			null,
94      			null,
95      			null,
96      			null,
97      			null,
98      			fnd_global.user_id,
99      			sysdate,
100 			'Y');		-- Fix for 3773450
101 	END IF;
102 
103  END INSERT_ROW;
104 
105  PROCEDURE DELETE_ROW
106   (  p_eam_request_rec         IN  EAM_PROCESS_WO_PUB.eam_request_rec_type
107      , x_return_status         OUT NOCOPY  VARCHAR2
108      , x_mesg_token_tbl        OUT NOCOPY EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type
109   )
110   IS
111   BEGIN
112 
113 	IF p_eam_request_rec.request_type = 1 THEN
114 
115 		UPDATE 	WIP_EAM_WORK_REQUESTS
116 		SET 	wip_entity_id		=	null,
117 			work_request_status_id  = 	3,
118 			last_update_date	=	sysdate,
119 			last_updated_by		= 	FND_GLOBAL.user_id
120 	      WHERE 	work_request_id		=	p_eam_request_rec.request_id
121 	        AND 	organization_id		=	p_eam_request_rec.organization_id;
122 	END IF;
123 
124 	IF p_eam_request_rec.request_type = 2 THEN
125 
126 	       UPDATE EAM_WO_SERVICE_ASSOCIATION			-- Fix for 3773450
127 		  SET enable_flag = 'N',
128 		      last_update_date		  = sysdate,
129 		      last_updated_by		  = FND_GLOBAL.user_id,
130 		      last_update_login		  = FND_GLOBAL.login_id
131 		WHERE service_request_id	  = p_eam_request_rec.request_id
132 		  AND wip_entity_id		  = p_eam_request_rec.wip_entity_id
133 		  AND maintenance_organization_id = p_eam_request_rec.organization_id
134 		  AND (enable_flag IS NULL or enable_flag = 'Y');
135 
136 	END IF;
137 
138 
139   END DELETE_ROW;
140 
141 
142 END EAM_REQUEST_UTILITY_PVT;