1 PACKAGE BODY EAM_SUB_RESOURCE_DEFAULT_PVT AS
2 /* $Header: EAMVSRDB.pls 115.2 2003/05/15 23:16:51 baroy noship $ */
3 /***************************************************************************
4 --
5 -- Copyright (c) 2002 Oracle Corporation, Redwood Shores, CA, USA
6 -- All rights reserved.
7 --
8 -- FILENAME
9 --
10 -- EAMVSRDB.pls
11 --
12 -- DESCRIPTION
13 --
14 -- Spec of package EAM_SUB_RESOURCE_DEFAULT_PVT
15 --
16 -- NOTES
17 --
18 -- HISTORY
19 --
20 -- 30-JUN-2002 Kenichi Nagumo Initial Creation
21 ***************************************************************************/
22 G_PKG_NAME CONSTANT VARCHAR2(30) := 'EAM_SUB_RESOURCE_DEFAULT_PVT';
23
24
25 /********************************************************************
26 * Procedure : get_flex_eam_sub_res
27 **********************************************************************/
28
29
30 PROCEDURE get_flex_eam_sub_res
31 ( p_eam_sub_res_rec IN EAM_PROCESS_WO_PUB.eam_sub_res_rec_type
32 , x_eam_sub_res_rec OUT NOCOPY EAM_PROCESS_WO_PUB.eam_sub_res_rec_type
33 )
34 IS
35 BEGIN
36
37 -- In the future call Flex APIs for defaults
38 x_eam_sub_res_rec := p_eam_sub_res_rec;
39
40 IF p_eam_sub_res_rec.attribute_category =FND_API.G_MISS_CHAR THEN
41 x_eam_sub_res_rec.attribute_category := NULL;
42 END IF;
43
44 IF p_eam_sub_res_rec.attribute1 = FND_API.G_MISS_CHAR THEN
45 x_eam_sub_res_rec.attribute1 := NULL;
46 END IF;
47
48 IF p_eam_sub_res_rec.attribute2 = FND_API.G_MISS_CHAR THEN
49 x_eam_sub_res_rec.attribute2 := NULL;
50 END IF;
51
52 IF p_eam_sub_res_rec.attribute3 = FND_API.G_MISS_CHAR THEN
53 x_eam_sub_res_rec.attribute3 := NULL;
54 END IF;
55
56 IF p_eam_sub_res_rec.attribute4 = FND_API.G_MISS_CHAR THEN
57 x_eam_sub_res_rec.attribute4 := NULL;
58 END IF;
59
60 IF p_eam_sub_res_rec.attribute5 = FND_API.G_MISS_CHAR THEN
61 x_eam_sub_res_rec.attribute5 := NULL;
62 END IF;
63
64 IF p_eam_sub_res_rec.attribute6 = FND_API.G_MISS_CHAR THEN
65 x_eam_sub_res_rec.attribute6 := NULL;
66 END IF;
67
68 IF p_eam_sub_res_rec.attribute7 = FND_API.G_MISS_CHAR THEN
69 x_eam_sub_res_rec.attribute7 := NULL;
70 END IF;
71
72 IF p_eam_sub_res_rec.attribute8 = FND_API.G_MISS_CHAR THEN
73 x_eam_sub_res_rec.attribute8 := NULL;
74 END IF;
75
76 IF p_eam_sub_res_rec.attribute9 = FND_API.G_MISS_CHAR THEN
77 x_eam_sub_res_rec.attribute9 := NULL;
78 END IF;
79
80 IF p_eam_sub_res_rec.attribute10 = FND_API.G_MISS_CHAR THEN
81 x_eam_sub_res_rec.attribute10 := NULL;
82 END IF;
83
84 IF p_eam_sub_res_rec.attribute11 = FND_API.G_MISS_CHAR THEN
85 x_eam_sub_res_rec.attribute11 := NULL;
86 END IF;
87
88 IF p_eam_sub_res_rec.attribute12 = FND_API.G_MISS_CHAR THEN
89 x_eam_sub_res_rec.attribute12 := NULL;
90 END IF;
91
92 IF p_eam_sub_res_rec.attribute13 = FND_API.G_MISS_CHAR THEN
93 x_eam_sub_res_rec.attribute13 := NULL;
94 END IF;
95
96 IF p_eam_sub_res_rec.attribute14 = FND_API.G_MISS_CHAR THEN
97 x_eam_sub_res_rec.attribute14 := NULL;
98 END IF;
99
100 IF p_eam_sub_res_rec.attribute15 = FND_API.G_MISS_CHAR THEN
101 x_eam_sub_res_rec.attribute15 := NULL;
102 END IF;
103
104 END get_flex_eam_sub_res;
105
106
107 /*********************************************************************
108 * Procedure : Attribute_Defaulting
109 * Parameters IN : Resource exposed record
110 * Parameters OUT NOCOPY: Resource record after defaulting
111 * Mesg_Token_Table
112 * Return_Status
113 * Purpose : Attribute Defaulting will default the necessary null
114 * attribute with appropriate values.
115 **********************************************************************/
116
117 PROCEDURE Attribute_Defaulting
118 ( p_eam_sub_res_rec IN EAM_PROCESS_WO_PUB.eam_sub_res_rec_type
119 , x_eam_sub_res_rec OUT NOCOPY EAM_PROCESS_WO_PUB.eam_sub_res_rec_type
120 , x_mesg_token_tbl OUT NOCOPY EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type
121 , x_return_status OUT NOCOPY VARCHAR2
122 )
123 IS
124 l_eam_sub_res_rec EAM_PROCESS_WO_PUB.eam_sub_res_rec_type;
125 BEGIN
126
127 x_eam_sub_res_rec := p_eam_sub_res_rec;
128 -- x_eam_sub_res_rec := p_eam_sub_res_rec;
129 x_return_status := FND_API.G_RET_STS_SUCCESS;
130
131 l_eam_sub_res_rec := x_eam_sub_res_rec;
132
133 get_flex_eam_sub_res
134 ( p_eam_sub_res_rec => x_eam_sub_res_rec
135 , x_eam_sub_res_rec => l_eam_sub_res_rec
136 );
137
138 x_eam_sub_res_rec := l_eam_sub_res_rec;
139
140 END Attribute_Defaulting;
141
142
143 /******************************************************************
144 * Procedure : Populate_Null_Columns
145 * Parameters IN : Resource column record
146 * Old Resource Column Record
147 * Parameters OUT NOCOPY: Resource column record after populating
148 * Purpose : This procedure will look at the columns that the user
149 * has not filled in and will assign those columns a
150 * value from the old record.
151 * This procedure is not called for CREATE
152 ********************************************************************/
153 PROCEDURE Populate_Null_Columns
154 ( p_eam_sub_res_rec IN EAM_PROCESS_WO_PUB.eam_sub_res_rec_type
155 , p_old_eam_sub_res_rec IN EAM_PROCESS_WO_PUB.eam_sub_res_rec_type
156 , x_eam_sub_res_rec OUT NOCOPY EAM_PROCESS_WO_PUB.eam_sub_res_rec_type
157 )
158 IS
159 BEGIN
160 x_eam_sub_res_rec := p_eam_sub_res_rec;
161 x_eam_sub_res_rec := p_eam_sub_res_rec;
162
163 IF EAM_PROCESS_WO_PVT.Get_Debug = 'Y' THEN EAM_ERROR_MESSAGE_PVT.Write_Debug('Processing null columns prior update'); END IF;
164
165 IF p_eam_sub_res_rec.resource_id IS NULL OR
166 p_eam_sub_res_rec.resource_id = FND_API.G_MISS_NUM
167 THEN
168 x_eam_sub_res_rec.resource_id := p_old_eam_sub_res_rec.resource_id;
169 END IF;
170
171 IF p_eam_sub_res_rec.uom_code IS NULL OR
172 p_eam_sub_res_rec.uom_code = FND_API.G_MISS_CHAR
173 THEN
174 x_eam_sub_res_rec.uom_code := p_old_eam_sub_res_rec.uom_code;
175 END IF;
176
177 IF p_eam_sub_res_rec.basis_type IS NULL OR
178 p_eam_sub_res_rec.basis_type = FND_API.G_MISS_NUM
179 THEN
180 x_eam_sub_res_rec.basis_type := p_old_eam_sub_res_rec.basis_type;
181 END IF;
182
183 IF p_eam_sub_res_rec.usage_rate_or_amount IS NULL OR
184 p_eam_sub_res_rec.usage_rate_or_amount = FND_API.G_MISS_NUM
185 THEN
186 x_eam_sub_res_rec.usage_rate_or_amount := p_old_eam_sub_res_rec.usage_rate_or_amount;
187 END IF;
188
189 IF p_eam_sub_res_rec.activity_id IS NULL OR
190 p_eam_sub_res_rec.activity_id = FND_API.G_MISS_NUM
191 THEN
192 x_eam_sub_res_rec.activity_id := p_old_eam_sub_res_rec.activity_id;
193 END IF;
194
195 IF p_eam_sub_res_rec.scheduled_flag IS NULL OR
196 p_eam_sub_res_rec.scheduled_flag = FND_API.G_MISS_NUM
197 THEN
198 x_eam_sub_res_rec.scheduled_flag := p_old_eam_sub_res_rec.scheduled_flag;
199 END IF;
200
201 IF p_eam_sub_res_rec.assigned_units IS NULL OR
202 p_eam_sub_res_rec.assigned_units = FND_API.G_MISS_NUM
203 THEN
204 x_eam_sub_res_rec.assigned_units := p_old_eam_sub_res_rec.assigned_units;
205 END IF;
206
207 IF p_eam_sub_res_rec.autocharge_type IS NULL OR
208 p_eam_sub_res_rec.autocharge_type = FND_API.G_MISS_NUM
209 THEN
210 x_eam_sub_res_rec.autocharge_type := p_old_eam_sub_res_rec.autocharge_type;
211 END IF;
212
213 IF p_eam_sub_res_rec.standard_rate_flag IS NULL OR
214 p_eam_sub_res_rec.standard_rate_flag = FND_API.G_MISS_NUM
215 THEN
216 x_eam_sub_res_rec.standard_rate_flag := p_old_eam_sub_res_rec.standard_rate_flag;
217 END IF;
218
219 IF p_eam_sub_res_rec.applied_resource_units IS NULL OR
220 p_eam_sub_res_rec.applied_resource_units = FND_API.G_MISS_NUM
221 THEN
222 x_eam_sub_res_rec.applied_resource_units := p_old_eam_sub_res_rec.applied_resource_units;
223 END IF;
224
225 IF p_eam_sub_res_rec.applied_resource_value IS NULL OR
226 p_eam_sub_res_rec.applied_resource_value = FND_API.G_MISS_NUM
227 THEN
228 x_eam_sub_res_rec.applied_resource_value := p_old_eam_sub_res_rec.applied_resource_value;
229 END IF;
230
231 IF p_eam_sub_res_rec.start_date IS NULL OR
232 p_eam_sub_res_rec.start_date = FND_API.G_MISS_DATE
233 THEN
234 x_eam_sub_res_rec.start_date := p_old_eam_sub_res_rec.start_date;
235 END IF;
236
237 IF p_eam_sub_res_rec.completion_date IS NULL OR
238 p_eam_sub_res_rec.completion_date = FND_API.G_MISS_DATE
239 THEN
240 x_eam_sub_res_rec.completion_date := p_old_eam_sub_res_rec.completion_date;
241 END IF;
242
243 IF p_eam_sub_res_rec.schedule_seq_num IS NULL OR
244 p_eam_sub_res_rec.schedule_seq_num = FND_API.G_MISS_NUM
245 THEN
246 x_eam_sub_res_rec.schedule_seq_num := p_old_eam_sub_res_rec.schedule_seq_num;
247 END IF;
248
249 IF p_eam_sub_res_rec.substitute_group_num IS NULL OR
250 p_eam_sub_res_rec.substitute_group_num = FND_API.G_MISS_NUM
251 THEN
252 x_eam_sub_res_rec.substitute_group_num := p_old_eam_sub_res_rec.substitute_group_num;
253 END IF;
254
255 IF p_eam_sub_res_rec.replacement_group_num IS NULL OR
256 p_eam_sub_res_rec.replacement_group_num = FND_API.G_MISS_NUM
257 THEN
258 x_eam_sub_res_rec.replacement_group_num := p_old_eam_sub_res_rec.replacement_group_num;
259 END IF;
260
261 --
262 -- Populate Null or missng flex field columns
263 --
264 IF p_eam_sub_res_rec.attribute_category IS NULL OR
265 p_eam_sub_res_rec.attribute_category = FND_API.G_MISS_CHAR
266 THEN
267 x_eam_sub_res_rec.attribute_category := p_old_eam_sub_res_rec.attribute_category;
268
269 END IF;
270
271 IF p_eam_sub_res_rec.attribute1 = FND_API.G_MISS_CHAR OR
272 p_eam_sub_res_rec.attribute1 IS NULL
273 THEN
274 x_eam_sub_res_rec.attribute1 := p_old_eam_sub_res_rec.attribute1;
275 END IF;
276
277 IF p_eam_sub_res_rec.attribute2 = FND_API.G_MISS_CHAR OR
278 p_eam_sub_res_rec.attribute2 IS NULL
279 THEN
280 x_eam_sub_res_rec.attribute2 := p_old_eam_sub_res_rec.attribute2;
281 END IF;
282
283 IF p_eam_sub_res_rec.attribute3 = FND_API.G_MISS_CHAR OR
284 p_eam_sub_res_rec.attribute3 IS NULL
285 THEN
286 x_eam_sub_res_rec.attribute3 := p_old_eam_sub_res_rec.attribute3;
287 END IF;
288
289 IF p_eam_sub_res_rec.attribute4 = FND_API.G_MISS_CHAR OR
290 p_eam_sub_res_rec.attribute4 IS NULL
291 THEN
292 x_eam_sub_res_rec.attribute4 := p_old_eam_sub_res_rec.attribute4;
293 END IF;
294
295 IF p_eam_sub_res_rec.attribute5 = FND_API.G_MISS_CHAR OR
296 p_eam_sub_res_rec.attribute5 IS NULL
297 THEN
298 x_eam_sub_res_rec.attribute5 := p_old_eam_sub_res_rec.attribute5;
299 END IF;
300
301 IF p_eam_sub_res_rec.attribute6 = FND_API.G_MISS_CHAR OR
302 p_eam_sub_res_rec.attribute6 IS NULL
303 THEN
304 x_eam_sub_res_rec.attribute6 := p_old_eam_sub_res_rec.attribute6;
305 END IF;
306
307 IF p_eam_sub_res_rec.attribute7 = FND_API.G_MISS_CHAR OR
308 p_eam_sub_res_rec.attribute7 IS NULL
309 THEN
310 x_eam_sub_res_rec.attribute7 := p_old_eam_sub_res_rec.attribute7;
311 END IF;
312
313 IF p_eam_sub_res_rec.attribute8 = FND_API.G_MISS_CHAR OR
314 p_eam_sub_res_rec.attribute8 IS NULL
315 THEN
316 x_eam_sub_res_rec.attribute8 := p_old_eam_sub_res_rec.attribute8;
317 END IF;
318
319 IF p_eam_sub_res_rec.attribute9 = FND_API.G_MISS_CHAR OR
320 p_eam_sub_res_rec.attribute9 IS NULL
321 THEN
322 x_eam_sub_res_rec.attribute9 := p_old_eam_sub_res_rec.attribute9;
323 END IF;
324
325 IF p_eam_sub_res_rec.attribute10 = FND_API.G_MISS_CHAR OR
326 p_eam_sub_res_rec.attribute10 IS NULL
327 THEN
328 x_eam_sub_res_rec.attribute10 := p_old_eam_sub_res_rec.attribute10;
329 END IF;
330
331 IF p_eam_sub_res_rec.attribute11 = FND_API.G_MISS_CHAR OR
332 p_eam_sub_res_rec.attribute11 IS NULL
333 THEN
334 x_eam_sub_res_rec.attribute11 := p_old_eam_sub_res_rec.attribute11;
335 END IF;
336
337 IF p_eam_sub_res_rec.attribute12 = FND_API.G_MISS_CHAR OR
338 p_eam_sub_res_rec.attribute12 IS NULL
339 THEN
340 x_eam_sub_res_rec.attribute12 := p_old_eam_sub_res_rec.attribute12;
341 END IF;
342
343 IF p_eam_sub_res_rec.attribute13 = FND_API.G_MISS_CHAR OR
344 p_eam_sub_res_rec.attribute13 IS NULL
345 THEN
346 x_eam_sub_res_rec.attribute13 := p_old_eam_sub_res_rec.attribute13;
347 END IF;
348
349 IF p_eam_sub_res_rec.attribute14 = FND_API.G_MISS_CHAR OR
350 p_eam_sub_res_rec.attribute14 IS NULL
351 THEN
352 x_eam_sub_res_rec.attribute14 := p_old_eam_sub_res_rec.attribute14;
353 END IF;
354
355 IF p_eam_sub_res_rec.attribute15 = FND_API.G_MISS_CHAR OR
356 p_eam_sub_res_rec.attribute15 IS NULL
357 THEN
358 x_eam_sub_res_rec.attribute15 := p_old_eam_sub_res_rec.attribute15;
359 END IF;
360
361 IF p_eam_sub_res_rec.department_id = FND_API.G_MISS_NUM OR
362 p_eam_sub_res_rec.department_id IS NULL
363 THEN
364 x_eam_sub_res_rec.department_id := p_old_eam_sub_res_rec.department_id;
365 END IF;
366
367
368 IF EAM_PROCESS_WO_PVT.Get_Debug = 'Y' THEN EAM_ERROR_MESSAGE_PVT.Write_Debug('Done processing null columns prior update'); END IF;
369
370 END Populate_Null_Columns;
371
372 END EAM_SUB_RESOURCE_DEFAULT_PVT;