1 PACKAGE BODY FA_TRANS_API_PVT AS
2 /* $Header: FAVTAPIB.pls 120.8 2006/07/06 14:55:24 vtandon noship $ */
3
4 FUNCTION set_asset_fin_rec (
5 p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
6 p_asset_fin_rec IN FA_API_TYPES.asset_fin_rec_type,
7 x_asset_fin_rec_new OUT NOCOPY FA_API_TYPES.asset_fin_rec_type,
8 p_mrc_sob_type_code IN VARCHAR2,
9 p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) RETURN BOOLEAN IS
10
11 l_asset_fin_rec_old fa_api_types.asset_fin_rec_type;
12
13 fin_err exception;
14
15 BEGIN
16
17 if (NOT fa_util_pvt.get_asset_fin_rec (
18 p_asset_hdr_rec => p_asset_hdr_rec,
19 px_asset_fin_rec => l_asset_fin_rec_old,
20 p_mrc_sob_type_code => p_mrc_sob_type_code,
21 p_log_level_rec => p_log_level_rec)) then
22 raise fin_err;
23 end if;
24
25 x_asset_fin_rec_new := p_asset_fin_rec;
26
27 if ((p_asset_fin_rec.reval_ceiling is NULL) and
28 (l_asset_fin_rec_old.reval_ceiling is NOT NULL)) then
29 x_asset_fin_rec_new.reval_ceiling := FND_API.G_MISS_NUM;
30 else
31 x_asset_fin_rec_new.reval_ceiling := p_asset_fin_rec.reval_ceiling;
32 end if;
33
34 if ((p_asset_fin_rec.salvage_value is NULL) and
35 (l_asset_fin_rec_old.salvage_value is NOT NULL)) then
36 x_asset_fin_rec_new.salvage_value := FND_API.G_MISS_NUM;
37 else
38 x_asset_fin_rec_new.salvage_value := p_asset_fin_rec.salvage_value;
39 end if;
40
41 if ((p_asset_fin_rec.itc_amount_id is NULL) and
42 (l_asset_fin_rec_old.itc_amount_id is NOT NULL)) then
43 x_asset_fin_rec_new.itc_amount_id := FND_API.G_MISS_NUM;
44 else
45 x_asset_fin_rec_new.itc_amount_id := p_asset_fin_rec.itc_amount_id;
46 end if;
47
48 if ((p_asset_fin_rec.ceiling_name is NULL) and
49 (l_asset_fin_rec_old.ceiling_name is NOT NULL)) then
50 x_asset_fin_rec_new.ceiling_name := FND_API.G_MISS_CHAR;
51 else
52 x_asset_fin_rec_new.ceiling_name := p_asset_fin_rec.ceiling_name;
53 end if;
54
55 /*
56 if ((p_asset_fin_rec.conversion_date is NULL) and
57 (l_asset_fin_rec_old.conversion_date is NOT NULL)) then
58 x_asset_fin_rec_new.conversion_date := FND_API.G_MISS_DATE;
59 else
60 x_asset_fin_rec_new.conversion_date := p_asset_fin_rec.conversion_date;
61 end if;
62
63 if ((p_asset_fin_rec.orig_deprn_start_date is NULL) and
64 (l_asset_fin_rec_old.orig_deprn_start_date is NOT NULL)) then
65 x_asset_fin_rec_new.orig_deprn_start_date := FND_API.G_MISS_DATE;
66 else
67 x_asset_fin_rec_new.orig_deprn_start_date :=
68 p_asset_fin_rec.orig_deprn_start_date;
69 end if;
70 */
71 if ((p_asset_fin_rec.group_asset_id is NULL) and
72 (l_asset_fin_rec_old.group_asset_id is NOT NULL)) then
73 x_asset_fin_rec_new.group_asset_id := FND_API.G_MISS_NUM;
74 else
75 x_asset_fin_rec_new.group_asset_id := p_asset_fin_rec.group_asset_id;
76 end if;
77
78 if ((p_asset_fin_rec.global_attribute1 is NULL) and
79 (l_asset_fin_rec_old.global_attribute1 is NOT NULL)) then
80 x_asset_fin_rec_new.global_attribute1 := FND_API.G_MISS_CHAR;
81 else
82 x_asset_fin_rec_new.global_attribute1 :=
83 p_asset_fin_rec.global_attribute1;
84 end if;
85
86 if ((p_asset_fin_rec.global_attribute2 is NULL) and
87 (l_asset_fin_rec_old.global_attribute2 is NOT NULL)) then
88 x_asset_fin_rec_new.global_attribute2 := FND_API.G_MISS_CHAR;
89 else
90 x_asset_fin_rec_new.global_attribute2 :=
91 p_asset_fin_rec.global_attribute2;
92 end if;
93
94 if ((p_asset_fin_rec.global_attribute3 is NULL) and
95 (l_asset_fin_rec_old.global_attribute3 is NOT NULL)) then
96 x_asset_fin_rec_new.global_attribute3 := FND_API.G_MISS_CHAR;
97 else
98 x_asset_fin_rec_new.global_attribute3 :=
99 p_asset_fin_rec.global_attribute3;
100 end if;
101
102 if ((p_asset_fin_rec.global_attribute4 is NULL) and
103 (l_asset_fin_rec_old.global_attribute4 is NOT NULL)) then
104 x_asset_fin_rec_new.global_attribute4 := FND_API.G_MISS_CHAR;
105 else
106 x_asset_fin_rec_new.global_attribute4 :=
107 p_asset_fin_rec.global_attribute4;
108 end if;
109
110 if ((p_asset_fin_rec.global_attribute5 is NULL) and
111 (l_asset_fin_rec_old.global_attribute5 is NOT NULL)) then
112 x_asset_fin_rec_new.global_attribute5 := FND_API.G_MISS_CHAR;
113 else
114 x_asset_fin_rec_new.global_attribute5 :=
115 p_asset_fin_rec.global_attribute5;
116 end if;
117
118 if ((p_asset_fin_rec.global_attribute6 is NULL) and
119 (l_asset_fin_rec_old.global_attribute6 is NOT NULL)) then
120 x_asset_fin_rec_new.global_attribute6 := FND_API.G_MISS_CHAR;
121 else
122 x_asset_fin_rec_new.global_attribute6 :=
123 p_asset_fin_rec.global_attribute6;
124 end if;
125
126 if ((p_asset_fin_rec.global_attribute7 is NULL) and
127 (l_asset_fin_rec_old.global_attribute7 is NOT NULL)) then
128 x_asset_fin_rec_new.global_attribute7 := FND_API.G_MISS_CHAR;
129 else
130 x_asset_fin_rec_new.global_attribute7 :=
131 p_asset_fin_rec.global_attribute7;
132 end if;
133
134 if ((p_asset_fin_rec.global_attribute8 is NULL) and
135 (l_asset_fin_rec_old.global_attribute8 is NOT NULL)) then
136 x_asset_fin_rec_new.global_attribute8 := FND_API.G_MISS_CHAR;
137 else
138 x_asset_fin_rec_new.global_attribute8 :=
139 p_asset_fin_rec.global_attribute8;
140 end if;
141
142 if ((p_asset_fin_rec.global_attribute9 is NULL) and
143 (l_asset_fin_rec_old.global_attribute9 is NOT NULL)) then
144 x_asset_fin_rec_new.global_attribute9 := FND_API.G_MISS_CHAR;
145 else
146 x_asset_fin_rec_new.global_attribute9 :=
147 p_asset_fin_rec.global_attribute9;
148 end if;
149
150 if ((p_asset_fin_rec.global_attribute10 is NULL) and
151 (l_asset_fin_rec_old.global_attribute10 is NOT NULL)) then
152 x_asset_fin_rec_new.global_attribute10 := FND_API.G_MISS_CHAR;
153 else
154 x_asset_fin_rec_new.global_attribute10 :=
155 p_asset_fin_rec.global_attribute10;
156 end if;
157
158 if ((p_asset_fin_rec.global_attribute11 is NULL) and
159 (l_asset_fin_rec_old.global_attribute11 is NOT NULL)) then
160 x_asset_fin_rec_new.global_attribute11 := FND_API.G_MISS_CHAR;
161 else
162 x_asset_fin_rec_new.global_attribute11 :=
163 p_asset_fin_rec.global_attribute11;
164 end if;
165
166 if ((p_asset_fin_rec.global_attribute12 is NULL) and
167 (l_asset_fin_rec_old.global_attribute12 is NOT NULL)) then
168 x_asset_fin_rec_new.global_attribute12 := FND_API.G_MISS_CHAR;
169 else
170 x_asset_fin_rec_new.global_attribute12 :=
171 p_asset_fin_rec.global_attribute12;
172 end if;
173
174 if ((p_asset_fin_rec.global_attribute13 is NULL) and
175 (l_asset_fin_rec_old.global_attribute13 is NOT NULL)) then
176 x_asset_fin_rec_new.global_attribute13 := FND_API.G_MISS_CHAR;
177 else
178 x_asset_fin_rec_new.global_attribute13 :=
179 p_asset_fin_rec.global_attribute13;
180 end if;
181
182 if ((p_asset_fin_rec.global_attribute14 is NULL) and
183 (l_asset_fin_rec_old.global_attribute14 is NOT NULL)) then
184 x_asset_fin_rec_new.global_attribute14 := FND_API.G_MISS_CHAR;
185 else
186 x_asset_fin_rec_new.global_attribute14 :=
187 p_asset_fin_rec.global_attribute14;
188 end if;
189
190 if ((p_asset_fin_rec.global_attribute15 is NULL) and
191 (l_asset_fin_rec_old.global_attribute15 is NOT NULL)) then
192 x_asset_fin_rec_new.global_attribute15 := FND_API.G_MISS_CHAR;
193 else
194 x_asset_fin_rec_new.global_attribute15 :=
195 p_asset_fin_rec.global_attribute15;
196 end if;
197
198 if ((p_asset_fin_rec.global_attribute16 is NULL) and
199 (l_asset_fin_rec_old.global_attribute16 is NOT NULL)) then
200 x_asset_fin_rec_new.global_attribute16 := FND_API.G_MISS_CHAR;
201 else
202 x_asset_fin_rec_new.global_attribute16 :=
203 p_asset_fin_rec.global_attribute16;
204 end if;
205
206 if ((p_asset_fin_rec.global_attribute17 is NULL) and
207 (l_asset_fin_rec_old.global_attribute17 is NOT NULL)) then
208 x_asset_fin_rec_new.global_attribute17 := FND_API.G_MISS_CHAR;
209 else
210 x_asset_fin_rec_new.global_attribute17 :=
211 p_asset_fin_rec.global_attribute17;
212 end if;
213
214 if ((p_asset_fin_rec.global_attribute18 is NULL) and
215 (l_asset_fin_rec_old.global_attribute18 is NOT NULL)) then
216 x_asset_fin_rec_new.global_attribute18 := FND_API.G_MISS_CHAR;
217 else
218 x_asset_fin_rec_new.global_attribute18 :=
219 p_asset_fin_rec.global_attribute18;
220 end if;
221
222 if ((p_asset_fin_rec.global_attribute19 is NULL) and
223 (l_asset_fin_rec_old.global_attribute19 is NOT NULL)) then
224 x_asset_fin_rec_new.global_attribute19 := FND_API.G_MISS_CHAR;
225 else
226 x_asset_fin_rec_new.global_attribute19 :=
227 p_asset_fin_rec.global_attribute19;
228 end if;
229
230 if ((p_asset_fin_rec.global_attribute20 is NULL) and
231 (l_asset_fin_rec_old.global_attribute20 is NOT NULL)) then
232 x_asset_fin_rec_new.global_attribute20 := FND_API.G_MISS_CHAR;
233 else
234 x_asset_fin_rec_new.global_attribute20 :=
235 p_asset_fin_rec.global_attribute20;
236 end if;
237
238 if ((p_asset_fin_rec.global_attribute_category is NULL) and
239 (l_asset_fin_rec_old.global_attribute_category is NOT NULL)) then
240 x_asset_fin_rec_new.global_attribute_category := FND_API.G_MISS_CHAR;
241 else
242 x_asset_fin_rec_new.global_attribute_category :=
243 p_asset_fin_rec.global_attribute_category;
244 end if;
245
246 return TRUE;
247
248 EXCEPTION
249 when fin_err then
250 fa_srvr_msg.add_sql_error(calling_fn => 'fa_trans_api_pvt.set_fin_rec'
251 ,p_log_level_rec => p_log_level_rec);
252 return FALSE;
253
254 when others then
255 fa_srvr_msg.add_sql_error(calling_fn => 'fa_trans_api_pvt.set_fin_rec'
256 ,p_log_level_rec => p_log_level_rec);
257 return FALSE;
258
259 END set_asset_fin_rec;
260
261 FUNCTION set_asset_deprn_rec (
262 p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
263 p_asset_deprn_rec IN FA_API_TYPES.asset_deprn_rec_type,
264 x_asset_deprn_rec_new OUT NOCOPY FA_API_TYPES.asset_deprn_rec_type,
265 p_mrc_sob_type_code IN VARCHAR2,
266 p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) RETURN BOOLEAN IS
267
268 l_asset_deprn_rec_old fa_api_types.asset_deprn_rec_type;
269
270 deprn_err exception;
271
272 BEGIN
273
274 -- Need to call the cache for book
275 if (NOT fa_cache_pkg.fazcbc (
276 X_book => p_asset_hdr_rec.book_type_code,
277 p_log_level_rec => p_log_level_rec)) then
278 raise deprn_err;
279 end if;
280
281 if (NOT fa_util_pvt.get_asset_deprn_rec (
282 p_asset_hdr_rec => p_asset_hdr_rec,
283 px_asset_deprn_rec => l_asset_deprn_rec_old,
284 p_mrc_sob_type_code => p_mrc_sob_type_code,
285 p_log_level_rec => p_log_level_rec)) then
286 raise deprn_err;
287 end if;
288
289 x_asset_deprn_rec_new := p_asset_deprn_rec;
290
291 if ((p_asset_deprn_rec.deprn_reserve is NULL) and
292 (l_asset_deprn_rec_old.deprn_reserve is NOT NULL)) then
293 x_asset_deprn_rec_new.deprn_reserve := FND_API.G_MISS_NUM;
294 else
295 x_asset_deprn_rec_new.deprn_reserve := p_asset_deprn_rec.deprn_reserve;
296 end if;
297
298 if ((p_asset_deprn_rec.ytd_deprn is NULL) and
299 (l_asset_deprn_rec_old.ytd_deprn is NOT NULL)) then
300 x_asset_deprn_rec_new.ytd_deprn := FND_API.G_MISS_NUM;
301 else
302 x_asset_deprn_rec_new.ytd_deprn := p_asset_deprn_rec.ytd_deprn;
303 end if;
304
305 if ((p_asset_deprn_rec.reval_deprn_reserve is NULL) and
306 (l_asset_deprn_rec_old.reval_deprn_reserve is NOT NULL)) then
307 x_asset_deprn_rec_new.reval_deprn_reserve := FND_API.G_MISS_NUM;
308 else
309 x_asset_deprn_rec_new.reval_deprn_reserve :=
310 p_asset_deprn_rec.reval_deprn_reserve;
311 end if;
312
313 return TRUE;
314
315 EXCEPTION
316 when deprn_err then
317 fa_srvr_msg.add_message(calling_fn => 'fa_trans_api_pvt.set_deprn_rec',
318 p_log_level_rec => p_log_level_rec);
319 return FALSE;
320
321 when others then
322 fa_srvr_msg.add_sql_error(calling_fn => 'fa_trans_api_pvt.set_deprn_rec'
323 ,p_log_level_rec => p_log_level_rec);
324 return FALSE;
325
326 END set_asset_deprn_rec;
327
328 FUNCTION set_asset_desc_rec (
329 p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
330 p_asset_desc_rec IN FA_API_TYPES.asset_desc_rec_type,
331 x_asset_desc_rec_new OUT NOCOPY FA_API_TYPES.asset_desc_rec_type,
332 p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) RETURN BOOLEAN IS
333
334 l_asset_desc_rec_old fa_api_types.asset_desc_rec_type;
335
336 desc_err exception;
337
338 BEGIN
339
340 if (NOT fa_util_pvt.get_asset_desc_rec (
341 p_asset_hdr_rec => p_asset_hdr_rec,
342 px_asset_desc_rec => l_asset_desc_rec_old,
343 p_log_level_rec => p_log_level_rec)) then
344 raise desc_err;
345 end if;
346
347 x_asset_desc_rec_new := p_asset_desc_rec;
348
349 if ((p_asset_desc_rec.asset_number is NULL) and
350 (l_asset_desc_rec_old.asset_number is NOT NULL)) then
351 x_asset_desc_rec_new.asset_number := FND_API.G_MISS_CHAR;
352 else
353 x_asset_desc_rec_new.asset_number := p_asset_desc_rec.asset_number;
354 end if;
355
356 if ((p_asset_desc_rec.description is NULL) and
357 (l_asset_desc_rec_old.description is NOT NULL)) then
358 x_asset_desc_rec_new.description := FND_API.G_MISS_CHAR;
359 else
360 x_asset_desc_rec_new.description := p_asset_desc_rec.description;
361 end if;
362
363 if ((p_asset_desc_rec.tag_number is NULL) and
364 (l_asset_desc_rec_old.tag_number is NOT NULL)) then
365 x_asset_desc_rec_new.tag_number := FND_API.G_MISS_CHAR;
366 else
367 x_asset_desc_rec_new.tag_number := p_asset_desc_rec.tag_number;
368 end if;
369
370 if ((p_asset_desc_rec.serial_number is NULL) and
371 (l_asset_desc_rec_old.serial_number is NOT NULL)) then
372 x_asset_desc_rec_new.serial_number := FND_API.G_MISS_CHAR;
373 else
374 x_asset_desc_rec_new.serial_number := p_asset_desc_rec.serial_number;
375 end if;
376
377 if ((p_asset_desc_rec.asset_key_ccid is NULL) and
378 (l_asset_desc_rec_old.asset_key_ccid is NOT NULL)) then
379 x_asset_desc_rec_new.asset_key_ccid := FND_API.G_MISS_NUM;
380 else
381 x_asset_desc_rec_new.asset_key_ccid := p_asset_desc_rec.asset_key_ccid;
382 end if;
383
384 if ((p_asset_desc_rec.parent_asset_id is NULL) and
385 (l_asset_desc_rec_old.parent_asset_id is NOT NULL)) then
386 x_asset_desc_rec_new.parent_asset_id := FND_API.G_MISS_NUM;
387 else
388 x_asset_desc_rec_new.parent_asset_id := p_asset_desc_rec.parent_asset_id;
389 end if;
390
391 if ((p_asset_desc_rec.manufacturer_name is NULL) and
392 (l_asset_desc_rec_old.manufacturer_name is NOT NULL)) then
393 x_asset_desc_rec_new.manufacturer_name := FND_API.G_MISS_CHAR;
394 else
395 x_asset_desc_rec_new.manufacturer_name :=
396 p_asset_desc_rec.manufacturer_name;
397 end if;
398
399 if ((p_asset_desc_rec.model_number is NULL) and
400 (l_asset_desc_rec_old.model_number is NOT NULL)) then
401 x_asset_desc_rec_new.model_number := FND_API.G_MISS_CHAR;
402 else
403 x_asset_desc_rec_new.model_number := p_asset_desc_rec.model_number;
404 end if;
405
406 if ((p_asset_desc_rec.warranty_id is NULL) and
407 (l_asset_desc_rec_old.warranty_id is NOT NULL)) then
408 x_asset_desc_rec_new.warranty_id := FND_API.G_MISS_NUM;
409 else
410 x_asset_desc_rec_new.warranty_id := p_asset_desc_rec.warranty_id;
411 end if;
412
413 if ((p_asset_desc_rec.lease_id is NULL) and
414 (l_asset_desc_rec_old.lease_id is NOT NULL)) then
415 x_asset_desc_rec_new.lease_id := FND_API.G_MISS_NUM;
416 else
417 x_asset_desc_rec_new.lease_id := p_asset_desc_rec.lease_id;
418 end if;
419
420 if ((p_asset_desc_rec.in_use_flag is NULL) and
421 (l_asset_desc_rec_old.in_use_flag is NOT NULL)) then
422 x_asset_desc_rec_new.in_use_flag := FND_API.G_MISS_CHAR;
423 else
424 x_asset_desc_rec_new.in_use_flag := p_asset_desc_rec.in_use_flag;
425 end if;
426
427 if ((p_asset_desc_rec.inventorial is NULL) and
428 (l_asset_desc_rec_old.inventorial is NOT NULL)) then
429 x_asset_desc_rec_new.inventorial := FND_API.G_MISS_CHAR;
430 else
431 x_asset_desc_rec_new.inventorial := p_asset_desc_rec.inventorial;
432 end if;
433
434 if ((p_asset_desc_rec.property_type_code is NULL) and
435 (l_asset_desc_rec_old.property_type_code is NOT NULL)) then
436 x_asset_desc_rec_new.property_type_code := FND_API.G_MISS_CHAR;
437 else
438 x_asset_desc_rec_new.property_type_code :=
439 p_asset_desc_rec.property_type_code;
440 end if;
441
442 if ((p_asset_desc_rec.property_1245_1250_code is NULL) and
443 (l_asset_desc_rec_old.property_1245_1250_code is NOT NULL)) then
444 x_asset_desc_rec_new.property_1245_1250_code := FND_API.G_MISS_CHAR;
445 else
446 x_asset_desc_rec_new.property_1245_1250_code :=
447 p_asset_desc_rec.property_1245_1250_code;
448 end if;
449
450 if ((p_asset_desc_rec.owned_leased is NULL) and
451 (l_asset_desc_rec_old.owned_leased is NOT NULL)) then
452 x_asset_desc_rec_new.owned_leased := FND_API.G_MISS_CHAR;
453 else
454 x_asset_desc_rec_new.owned_leased := p_asset_desc_rec.owned_leased;
455 end if;
456
457 if ((p_asset_desc_rec.new_used is NULL) and
458 (l_asset_desc_rec_old.new_used is NOT NULL)) then
459 x_asset_desc_rec_new.new_used := FND_API.G_MISS_CHAR;
460 else
461 x_asset_desc_rec_new.new_used := p_asset_desc_rec.new_used;
462 end if;
463
464 if ((p_asset_desc_rec.current_units is NULL) and
465 (l_asset_desc_rec_old.current_units is NOT NULL)) then
466 x_asset_desc_rec_new.current_units := FND_API.G_MISS_NUM;
467 else
468 x_asset_desc_rec_new.current_units := p_asset_desc_rec.current_units;
469 end if;
470
471 if ((p_asset_desc_rec.status is NULL) and
472 (l_asset_desc_rec_old.status is NOT NULL)) then
473 x_asset_desc_rec_new.status := FND_API.G_MISS_CHAR;
474 else
475 x_asset_desc_rec_new.status := p_asset_desc_rec.status;
476 end if;
477
478 -- Bug:5372429
479 if ((p_asset_desc_rec.commitment is NULL) and
480 (l_asset_desc_rec_old.commitment is NOT NULL)) then
481 x_asset_desc_rec_new.commitment := FND_API.G_MISS_CHAR;
482 else
483 x_asset_desc_rec_new.commitment := p_asset_desc_rec.commitment;
484 end if;
485
486 -- Bug:5372429
487 if ((p_asset_desc_rec.investment_law is NULL) and
488 (l_asset_desc_rec_old.investment_law is NOT NULL)) then
489 x_asset_desc_rec_new.investment_law := FND_API.G_MISS_CHAR;
490 else
491 x_asset_desc_rec_new.investment_law := p_asset_desc_rec.investment_law;
492 end if;
493
494 if ((p_asset_desc_rec.lease_desc_flex.attribute1 is NULL) and
495 (l_asset_desc_rec_old.lease_desc_flex.attribute1 is NOT NULL)) then
496 x_asset_desc_rec_new.lease_desc_flex.attribute1 := FND_API.G_MISS_CHAR;
497 else
498 x_asset_desc_rec_new.lease_desc_flex.attribute1 :=
499 p_asset_desc_rec.lease_desc_flex.attribute1;
500 end if;
501
502 if ((p_asset_desc_rec.lease_desc_flex.attribute2 is NULL) and
503 (l_asset_desc_rec_old.lease_desc_flex.attribute2 is NOT NULL)) then
504 x_asset_desc_rec_new.lease_desc_flex.attribute2 := FND_API.G_MISS_CHAR;
505 else
506 x_asset_desc_rec_new.lease_desc_flex.attribute2 :=
507 p_asset_desc_rec.lease_desc_flex.attribute2;
508 end if;
509
510 if ((p_asset_desc_rec.lease_desc_flex.attribute3 is NULL) and
511 (l_asset_desc_rec_old.lease_desc_flex.attribute3 is NOT NULL)) then
512 x_asset_desc_rec_new.lease_desc_flex.attribute3 := FND_API.G_MISS_CHAR;
513 else
514 x_asset_desc_rec_new.lease_desc_flex.attribute3 :=
515 p_asset_desc_rec.lease_desc_flex.attribute3;
516 end if;
517
518 if ((p_asset_desc_rec.lease_desc_flex.attribute4 is NULL) and
519 (l_asset_desc_rec_old.lease_desc_flex.attribute4 is NOT NULL)) then
520 x_asset_desc_rec_new.lease_desc_flex.attribute4 := FND_API.G_MISS_CHAR;
521 else
522 x_asset_desc_rec_new.lease_desc_flex.attribute4 :=
523 p_asset_desc_rec.lease_desc_flex.attribute4;
524 end if;
525
526 if ((p_asset_desc_rec.lease_desc_flex.attribute5 is NULL) and
527 (l_asset_desc_rec_old.lease_desc_flex.attribute5 is NOT NULL)) then
528 x_asset_desc_rec_new.lease_desc_flex.attribute5 := FND_API.G_MISS_CHAR;
529 else
530 x_asset_desc_rec_new.lease_desc_flex.attribute5 :=
531 p_asset_desc_rec.lease_desc_flex.attribute5;
532 end if;
533
534 if ((p_asset_desc_rec.lease_desc_flex.attribute6 is NULL) and
535 (l_asset_desc_rec_old.lease_desc_flex.attribute6 is NOT NULL)) then
536 x_asset_desc_rec_new.lease_desc_flex.attribute6 := FND_API.G_MISS_CHAR;
537 else
538 x_asset_desc_rec_new.lease_desc_flex.attribute6 :=
539 p_asset_desc_rec.lease_desc_flex.attribute6;
540 end if;
541
542 if ((p_asset_desc_rec.lease_desc_flex.attribute7 is NULL) and
543 (l_asset_desc_rec_old.lease_desc_flex.attribute7 is NOT NULL)) then
544 x_asset_desc_rec_new.lease_desc_flex.attribute7 := FND_API.G_MISS_CHAR;
545 else
546 x_asset_desc_rec_new.lease_desc_flex.attribute7 :=
547 p_asset_desc_rec.lease_desc_flex.attribute7;
548 end if;
549
550 if ((p_asset_desc_rec.lease_desc_flex.attribute8 is NULL) and
551 (l_asset_desc_rec_old.lease_desc_flex.attribute8 is NOT NULL)) then
552 x_asset_desc_rec_new.lease_desc_flex.attribute8 := FND_API.G_MISS_CHAR;
553 else
554 x_asset_desc_rec_new.lease_desc_flex.attribute8 :=
555 p_asset_desc_rec.lease_desc_flex.attribute8;
556 end if;
557
558 if ((p_asset_desc_rec.lease_desc_flex.attribute9 is NULL) and
559 (l_asset_desc_rec_old.lease_desc_flex.attribute9 is NOT NULL)) then
560 x_asset_desc_rec_new.lease_desc_flex.attribute9 := FND_API.G_MISS_CHAR;
561 else
562 x_asset_desc_rec_new.lease_desc_flex.attribute9 :=
563 p_asset_desc_rec.lease_desc_flex.attribute9;
564 end if;
565
566 if ((p_asset_desc_rec.lease_desc_flex.attribute10 is NULL) and
567 (l_asset_desc_rec_old.lease_desc_flex.attribute10 is NOT NULL)) then
568 x_asset_desc_rec_new.lease_desc_flex.attribute10 := FND_API.G_MISS_CHAR;
569 else
570 x_asset_desc_rec_new.lease_desc_flex.attribute10 :=
571 p_asset_desc_rec.lease_desc_flex.attribute10;
572 end if;
573
574 if ((p_asset_desc_rec.lease_desc_flex.attribute11 is NULL) and
575 (l_asset_desc_rec_old.lease_desc_flex.attribute11 is NOT NULL)) then
576 x_asset_desc_rec_new.lease_desc_flex.attribute11 := FND_API.G_MISS_CHAR;
577 else
578 x_asset_desc_rec_new.lease_desc_flex.attribute11 :=
579 p_asset_desc_rec.lease_desc_flex.attribute11;
580 end if;
581
582 if ((p_asset_desc_rec.lease_desc_flex.attribute12 is NULL) and
583 (l_asset_desc_rec_old.lease_desc_flex.attribute12 is NOT NULL)) then
584 x_asset_desc_rec_new.lease_desc_flex.attribute12 := FND_API.G_MISS_CHAR;
585 else
586 x_asset_desc_rec_new.lease_desc_flex.attribute12 :=
587 p_asset_desc_rec.lease_desc_flex.attribute12;
588 end if;
589
590 if ((p_asset_desc_rec.lease_desc_flex.attribute13 is NULL) and
591 (l_asset_desc_rec_old.lease_desc_flex.attribute13 is NOT NULL)) then
592 x_asset_desc_rec_new.lease_desc_flex.attribute13 := FND_API.G_MISS_CHAR;
593 else
594 x_asset_desc_rec_new.lease_desc_flex.attribute13 :=
595 p_asset_desc_rec.lease_desc_flex.attribute13;
596 end if;
597
598 if ((p_asset_desc_rec.lease_desc_flex.attribute14 is NULL) and
599 (l_asset_desc_rec_old.lease_desc_flex.attribute14 is NOT NULL)) then
600 x_asset_desc_rec_new.lease_desc_flex.attribute14 := FND_API.G_MISS_CHAR;
601 else
602 x_asset_desc_rec_new.lease_desc_flex.attribute14 :=
603 p_asset_desc_rec.lease_desc_flex.attribute14;
604 end if;
605
606 if ((p_asset_desc_rec.lease_desc_flex.attribute15 is NULL) and
607 (l_asset_desc_rec_old.lease_desc_flex.attribute15 is NOT NULL)) then
608 x_asset_desc_rec_new.lease_desc_flex.attribute15 := FND_API.G_MISS_CHAR;
609 else
610 x_asset_desc_rec_new.lease_desc_flex.attribute15 :=
611 p_asset_desc_rec.lease_desc_flex.attribute15;
612 end if;
613
614 if ((p_asset_desc_rec.lease_desc_flex.attribute_category_code is NULL) and
615 (l_asset_desc_rec_old.lease_desc_flex.attribute_category_code is
616 NOT NULL)) then
617 x_asset_desc_rec_new.lease_desc_flex.attribute_category_code :=
618 FND_API.G_MISS_CHAR;
619 else
620 x_asset_desc_rec_new.lease_desc_flex.attribute_category_code :=
621 p_asset_desc_rec.lease_desc_flex.attribute_category_code;
622 end if;
623
624 if ((p_asset_desc_rec.global_desc_flex.attribute1 is NULL) and
625 (l_asset_desc_rec_old.global_desc_flex.attribute1 is NOT NULL)) then
626 x_asset_desc_rec_new.global_desc_flex.attribute1 := FND_API.G_MISS_CHAR;
627 else
628 x_asset_desc_rec_new.global_desc_flex.attribute1 :=
629 p_asset_desc_rec.global_desc_flex.attribute1;
630 end if;
631
632 if ((p_asset_desc_rec.global_desc_flex.attribute2 is NULL) and
633 (l_asset_desc_rec_old.global_desc_flex.attribute2 is NOT NULL)) then
634 x_asset_desc_rec_new.global_desc_flex.attribute2 := FND_API.G_MISS_CHAR;
635 else
636 x_asset_desc_rec_new.global_desc_flex.attribute2 :=
637 p_asset_desc_rec.global_desc_flex.attribute2;
638 end if;
639
640 if ((p_asset_desc_rec.global_desc_flex.attribute3 is NULL) and
641 (l_asset_desc_rec_old.global_desc_flex.attribute3 is NOT NULL)) then
642 x_asset_desc_rec_new.global_desc_flex.attribute3 := FND_API.G_MISS_CHAR;
643 else
644 x_asset_desc_rec_new.global_desc_flex.attribute3 :=
645 p_asset_desc_rec.global_desc_flex.attribute3;
646 end if;
647
648 if ((p_asset_desc_rec.global_desc_flex.attribute4 is NULL) and
649 (l_asset_desc_rec_old.global_desc_flex.attribute4 is NOT NULL)) then
650 x_asset_desc_rec_new.global_desc_flex.attribute4 := FND_API.G_MISS_CHAR;
651 else
652 x_asset_desc_rec_new.global_desc_flex.attribute4 :=
653 p_asset_desc_rec.global_desc_flex.attribute4;
654 end if;
655
656 if ((p_asset_desc_rec.global_desc_flex.attribute5 is NULL) and
657 (l_asset_desc_rec_old.global_desc_flex.attribute5 is NOT NULL)) then
658 x_asset_desc_rec_new.global_desc_flex.attribute5 := FND_API.G_MISS_CHAR;
659 else
660 x_asset_desc_rec_new.global_desc_flex.attribute5 :=
661 p_asset_desc_rec.global_desc_flex.attribute5;
662 end if;
663
664 if ((p_asset_desc_rec.global_desc_flex.attribute6 is NULL) and
665 (l_asset_desc_rec_old.global_desc_flex.attribute6 is NOT NULL)) then
666 x_asset_desc_rec_new.global_desc_flex.attribute6 := FND_API.G_MISS_CHAR;
667 else
668 x_asset_desc_rec_new.global_desc_flex.attribute6 :=
669 p_asset_desc_rec.global_desc_flex.attribute6;
670 end if;
671
672 if ((p_asset_desc_rec.global_desc_flex.attribute7 is NULL) and
673 (l_asset_desc_rec_old.global_desc_flex.attribute7 is NOT NULL)) then
674 x_asset_desc_rec_new.global_desc_flex.attribute7 := FND_API.G_MISS_CHAR;
675 else
676 x_asset_desc_rec_new.global_desc_flex.attribute7 :=
677 p_asset_desc_rec.global_desc_flex.attribute7;
678 end if;
679
680 if ((p_asset_desc_rec.global_desc_flex.attribute8 is NULL) and
681 (l_asset_desc_rec_old.global_desc_flex.attribute8 is NOT NULL)) then
682 x_asset_desc_rec_new.global_desc_flex.attribute8 := FND_API.G_MISS_CHAR;
683 else
684 x_asset_desc_rec_new.global_desc_flex.attribute8 :=
685 p_asset_desc_rec.global_desc_flex.attribute8;
686 end if;
687
688 if ((p_asset_desc_rec.global_desc_flex.attribute9 is NULL) and
689 (l_asset_desc_rec_old.global_desc_flex.attribute9 is NOT NULL)) then
690 x_asset_desc_rec_new.global_desc_flex.attribute9 := FND_API.G_MISS_CHAR;
691 else
692 x_asset_desc_rec_new.global_desc_flex.attribute9 :=
693 p_asset_desc_rec.global_desc_flex.attribute9;
694 end if;
695
696 if ((p_asset_desc_rec.global_desc_flex.attribute10 is NULL) and
697 (l_asset_desc_rec_old.global_desc_flex.attribute10 is NOT NULL)) then
698 x_asset_desc_rec_new.global_desc_flex.attribute10 := FND_API.G_MISS_CHAR;
699 else
700 x_asset_desc_rec_new.global_desc_flex.attribute10 :=
701 p_asset_desc_rec.global_desc_flex.attribute10;
702 end if;
703
704 if ((p_asset_desc_rec.global_desc_flex.attribute11 is NULL) and
705 (l_asset_desc_rec_old.global_desc_flex.attribute11 is NOT NULL)) then
706 x_asset_desc_rec_new.global_desc_flex.attribute11 := FND_API.G_MISS_CHAR;
707 else
708 x_asset_desc_rec_new.global_desc_flex.attribute11 :=
709 p_asset_desc_rec.global_desc_flex.attribute11;
710 end if;
711
712 if ((p_asset_desc_rec.global_desc_flex.attribute12 is NULL) and
713 (l_asset_desc_rec_old.global_desc_flex.attribute12 is NOT NULL)) then
714 x_asset_desc_rec_new.global_desc_flex.attribute12 := FND_API.G_MISS_CHAR;
715 else
716 x_asset_desc_rec_new.global_desc_flex.attribute12 :=
717 p_asset_desc_rec.global_desc_flex.attribute12;
718 end if;
719
720 if ((p_asset_desc_rec.global_desc_flex.attribute13 is NULL) and
721 (l_asset_desc_rec_old.global_desc_flex.attribute13 is NOT NULL)) then
722 x_asset_desc_rec_new.global_desc_flex.attribute13 := FND_API.G_MISS_CHAR;
723 else
724 x_asset_desc_rec_new.global_desc_flex.attribute13 :=
725 p_asset_desc_rec.global_desc_flex.attribute13;
726 end if;
727
728 if ((p_asset_desc_rec.global_desc_flex.attribute14 is NULL) and
729 (l_asset_desc_rec_old.global_desc_flex.attribute14 is NOT NULL)) then
730 x_asset_desc_rec_new.global_desc_flex.attribute14 := FND_API.G_MISS_CHAR;
731 else
732 x_asset_desc_rec_new.global_desc_flex.attribute14 :=
733 p_asset_desc_rec.global_desc_flex.attribute14;
734 end if;
735
736 if ((p_asset_desc_rec.global_desc_flex.attribute15 is NULL) and
737 (l_asset_desc_rec_old.global_desc_flex.attribute15 is NOT NULL)) then
738 x_asset_desc_rec_new.global_desc_flex.attribute15 := FND_API.G_MISS_CHAR;
739 else
740 x_asset_desc_rec_new.global_desc_flex.attribute15 :=
741 p_asset_desc_rec.global_desc_flex.attribute15;
742 end if;
743
744 if ((p_asset_desc_rec.global_desc_flex.attribute16 is NULL) and
745 (l_asset_desc_rec_old.global_desc_flex.attribute16 is NOT NULL)) then
746 x_asset_desc_rec_new.global_desc_flex.attribute16 := FND_API.G_MISS_CHAR;
747 else
748 x_asset_desc_rec_new.global_desc_flex.attribute16 :=
749 p_asset_desc_rec.global_desc_flex.attribute16;
750 end if;
751
752 if ((p_asset_desc_rec.global_desc_flex.attribute17 is NULL) and
753 (l_asset_desc_rec_old.global_desc_flex.attribute17 is NOT NULL)) then
754 x_asset_desc_rec_new.global_desc_flex.attribute17 := FND_API.G_MISS_CHAR;
755 else
756 x_asset_desc_rec_new.global_desc_flex.attribute17 :=
757 p_asset_desc_rec.global_desc_flex.attribute17;
758 end if;
759
760 if ((p_asset_desc_rec.global_desc_flex.attribute18 is NULL) and
761 (l_asset_desc_rec_old.global_desc_flex.attribute18 is NOT NULL)) then
762 x_asset_desc_rec_new.global_desc_flex.attribute18 := FND_API.G_MISS_CHAR;
763 else
764 x_asset_desc_rec_new.global_desc_flex.attribute18 :=
765 p_asset_desc_rec.global_desc_flex.attribute18;
766 end if;
767
768 if ((p_asset_desc_rec.global_desc_flex.attribute19 is NULL) and
769 (l_asset_desc_rec_old.global_desc_flex.attribute19 is NOT NULL)) then
770 x_asset_desc_rec_new.global_desc_flex.attribute19 := FND_API.G_MISS_CHAR;
771 else
772 x_asset_desc_rec_new.global_desc_flex.attribute19 :=
773 p_asset_desc_rec.global_desc_flex.attribute19;
774 end if;
775
776 if ((p_asset_desc_rec.global_desc_flex.attribute20 is NULL) and
777 (l_asset_desc_rec_old.global_desc_flex.attribute20 is NOT NULL)) then
778 x_asset_desc_rec_new.global_desc_flex.attribute20 := FND_API.G_MISS_CHAR;
779 else
780 x_asset_desc_rec_new.global_desc_flex.attribute20 :=
781 p_asset_desc_rec.global_desc_flex.attribute20;
782 end if;
783
784 if ((p_asset_desc_rec.global_desc_flex.attribute_category_code is NULL) and
785 (l_asset_desc_rec_old.global_desc_flex.attribute_category_code is
786 NOT NULL)) then
787 x_asset_desc_rec_new.global_desc_flex.attribute_category_code :=
788 FND_API.G_MISS_CHAR;
789 else
790 x_asset_desc_rec_new.global_desc_flex.attribute_category_code :=
791 p_asset_desc_rec.global_desc_flex.attribute_category_code;
792 end if;
793
794 return TRUE;
795
796 EXCEPTION
797 when desc_err then
798 fa_srvr_msg.add_message(calling_fn => 'fa_trans_api_pvt.set_desc_rec',
799 p_log_level_rec => p_log_level_rec);
800 return FALSE;
801
802 when others then
803 fa_srvr_msg.add_sql_error(calling_fn => 'fa_trans_api_pvt.set_desc_rec'
804 ,p_log_level_rec => p_log_level_rec);
805 return FALSE;
806
807 END set_asset_desc_rec;
808
809 FUNCTION set_asset_cat_rec (
810 p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
811 p_asset_cat_rec IN FA_API_TYPES.asset_cat_rec_type,
812 x_asset_cat_rec_new OUT NOCOPY FA_API_TYPES.asset_cat_rec_type,
813 p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) RETURN BOOLEAN IS
814
815 l_asset_cat_rec_old fa_api_types.asset_cat_rec_type;
816
817 cat_err exception;
818
819 BEGIN
820
821 l_asset_cat_rec_old.category_id := p_asset_cat_rec.category_id;
822
823 if (NOT fa_util_pvt.get_asset_cat_rec (
824 p_asset_hdr_rec => p_asset_hdr_rec,
825 px_asset_cat_rec => l_asset_cat_rec_old,
826 p_log_level_rec => p_log_level_rec)) then
827 raise cat_err;
828 end if;
829
830 x_asset_cat_rec_new := p_asset_cat_rec;
831
832 if ((p_asset_cat_rec.desc_flex.attribute1 is NULL) and
833 (l_asset_cat_rec_old.desc_flex.attribute1 is NOT NULL)) then
834 x_asset_cat_rec_new.desc_flex.attribute1 := FND_API.G_MISS_CHAR;
835 end if;
836
837 if ((p_asset_cat_rec.desc_flex.attribute2 is NULL) and
838 (l_asset_cat_rec_old.desc_flex.attribute2 is NOT NULL)) then
839 x_asset_cat_rec_new.desc_flex.attribute2 := FND_API.G_MISS_CHAR;
840 end if;
841
842 if ((p_asset_cat_rec.desc_flex.attribute3 is NULL) and
843 (l_asset_cat_rec_old.desc_flex.attribute3 is NOT NULL)) then
844 x_asset_cat_rec_new.desc_flex.attribute3 := FND_API.G_MISS_CHAR;
845 end if;
846
847 if ((p_asset_cat_rec.desc_flex.attribute4 is NULL) and
848 (l_asset_cat_rec_old.desc_flex.attribute4 is NOT NULL)) then
849 x_asset_cat_rec_new.desc_flex.attribute4 := FND_API.G_MISS_CHAR;
850 end if;
851
852 if ((p_asset_cat_rec.desc_flex.attribute5 is NULL) and
853 (l_asset_cat_rec_old.desc_flex.attribute5 is NOT NULL)) then
854 x_asset_cat_rec_new.desc_flex.attribute5 := FND_API.G_MISS_CHAR;
855 end if;
856
857 if ((p_asset_cat_rec.desc_flex.attribute6 is NULL) and
858 (l_asset_cat_rec_old.desc_flex.attribute6 is NOT NULL)) then
859 x_asset_cat_rec_new.desc_flex.attribute6 := FND_API.G_MISS_CHAR;
860 end if;
861
862 if ((p_asset_cat_rec.desc_flex.attribute7 is NULL) and
863 (l_asset_cat_rec_old.desc_flex.attribute7 is NOT NULL)) then
864 x_asset_cat_rec_new.desc_flex.attribute7 := FND_API.G_MISS_CHAR;
865 end if;
866
867 if ((p_asset_cat_rec.desc_flex.attribute8 is NULL) and
868 (l_asset_cat_rec_old.desc_flex.attribute8 is NOT NULL)) then
869 x_asset_cat_rec_new.desc_flex.attribute8 := FND_API.G_MISS_CHAR;
870 end if;
871
872 if ((p_asset_cat_rec.desc_flex.attribute9 is NULL) and
873 (l_asset_cat_rec_old.desc_flex.attribute9 is NOT NULL)) then
874 x_asset_cat_rec_new.desc_flex.attribute9 := FND_API.G_MISS_CHAR;
875 end if;
876
877 if ((p_asset_cat_rec.desc_flex.attribute10 is NULL) and
878 (l_asset_cat_rec_old.desc_flex.attribute10 is NOT NULL)) then
879 x_asset_cat_rec_new.desc_flex.attribute10 := FND_API.G_MISS_CHAR;
880 end if;
881
882 if ((p_asset_cat_rec.desc_flex.attribute11 is NULL) and
883 (l_asset_cat_rec_old.desc_flex.attribute11 is NOT NULL)) then
884 x_asset_cat_rec_new.desc_flex.attribute11 := FND_API.G_MISS_CHAR;
885 end if;
886
887 if ((p_asset_cat_rec.desc_flex.attribute12 is NULL) and
888 (l_asset_cat_rec_old.desc_flex.attribute12 is NOT NULL)) then
889 x_asset_cat_rec_new.desc_flex.attribute12 := FND_API.G_MISS_CHAR;
890 end if;
891
892 if ((p_asset_cat_rec.desc_flex.attribute13 is NULL) and
893 (l_asset_cat_rec_old.desc_flex.attribute13 is NOT NULL)) then
894 x_asset_cat_rec_new.desc_flex.attribute13 := FND_API.G_MISS_CHAR;
895 end if;
896
897 if ((p_asset_cat_rec.desc_flex.attribute14 is NULL) and
898 (l_asset_cat_rec_old.desc_flex.attribute14 is NOT NULL)) then
899 x_asset_cat_rec_new.desc_flex.attribute14 := FND_API.G_MISS_CHAR;
900 end if;
901
902 if ((p_asset_cat_rec.desc_flex.attribute15 is NULL) and
903 (l_asset_cat_rec_old.desc_flex.attribute15 is NOT NULL)) then
904 x_asset_cat_rec_new.desc_flex.attribute15 := FND_API.G_MISS_CHAR;
905 end if;
906
907 if ((p_asset_cat_rec.desc_flex.attribute16 is NULL) and
908 (l_asset_cat_rec_old.desc_flex.attribute16 is NOT NULL)) then
909 x_asset_cat_rec_new.desc_flex.attribute16 := FND_API.G_MISS_CHAR;
910 end if;
911
912 if ((p_asset_cat_rec.desc_flex.attribute17 is NULL) and
913 (l_asset_cat_rec_old.desc_flex.attribute17 is NOT NULL)) then
914 x_asset_cat_rec_new.desc_flex.attribute17 := FND_API.G_MISS_CHAR;
915 end if;
916
917 if ((p_asset_cat_rec.desc_flex.attribute18 is NULL) and
918 (l_asset_cat_rec_old.desc_flex.attribute18 is NOT NULL)) then
919 x_asset_cat_rec_new.desc_flex.attribute18 := FND_API.G_MISS_CHAR;
920 end if;
921
922 if ((p_asset_cat_rec.desc_flex.attribute19 is NULL) and
923 (l_asset_cat_rec_old.desc_flex.attribute19 is NOT NULL)) then
924 x_asset_cat_rec_new.desc_flex.attribute19 := FND_API.G_MISS_CHAR;
925 end if;
926
927 if ((p_asset_cat_rec.desc_flex.attribute20 is NULL) and
928 (l_asset_cat_rec_old.desc_flex.attribute20 is NOT NULL)) then
929 x_asset_cat_rec_new.desc_flex.attribute20 := FND_API.G_MISS_CHAR;
930 end if;
931
932 if ((p_asset_cat_rec.desc_flex.attribute21 is NULL) and
933 (l_asset_cat_rec_old.desc_flex.attribute21 is NOT NULL)) then
934 x_asset_cat_rec_new.desc_flex.attribute21 := FND_API.G_MISS_CHAR;
935 end if;
936
937 if ((p_asset_cat_rec.desc_flex.attribute22 is NULL) and
938 (l_asset_cat_rec_old.desc_flex.attribute22 is NOT NULL)) then
939 x_asset_cat_rec_new.desc_flex.attribute22 := FND_API.G_MISS_CHAR;
940 end if;
941
942 if ((p_asset_cat_rec.desc_flex.attribute23 is NULL) and
943 (l_asset_cat_rec_old.desc_flex.attribute23 is NOT NULL)) then
944 x_asset_cat_rec_new.desc_flex.attribute23 := FND_API.G_MISS_CHAR;
945 end if;
946
947 if ((p_asset_cat_rec.desc_flex.attribute24 is NULL) and
948 (l_asset_cat_rec_old.desc_flex.attribute24 is NOT NULL)) then
949 x_asset_cat_rec_new.desc_flex.attribute24 := FND_API.G_MISS_CHAR;
950 end if;
951
952 if ((p_asset_cat_rec.desc_flex.attribute25 is NULL) and
953 (l_asset_cat_rec_old.desc_flex.attribute25 is NOT NULL)) then
954 x_asset_cat_rec_new.desc_flex.attribute25 := FND_API.G_MISS_CHAR;
955 end if;
956
957 if ((p_asset_cat_rec.desc_flex.attribute26 is NULL) and
958 (l_asset_cat_rec_old.desc_flex.attribute26 is NOT NULL)) then
959 x_asset_cat_rec_new.desc_flex.attribute26 := FND_API.G_MISS_CHAR;
960 end if;
961
962 if ((p_asset_cat_rec.desc_flex.attribute27 is NULL) and
963 (l_asset_cat_rec_old.desc_flex.attribute27 is NOT NULL)) then
964 x_asset_cat_rec_new.desc_flex.attribute27 := FND_API.G_MISS_CHAR;
965 end if;
966
967 if ((p_asset_cat_rec.desc_flex.attribute28 is NULL) and
968 (l_asset_cat_rec_old.desc_flex.attribute28 is NOT NULL)) then
969 x_asset_cat_rec_new.desc_flex.attribute28 := FND_API.G_MISS_CHAR;
970 end if;
971
972 if ((p_asset_cat_rec.desc_flex.attribute29 is NULL) and
973 (l_asset_cat_rec_old.desc_flex.attribute29 is NOT NULL)) then
974 x_asset_cat_rec_new.desc_flex.attribute29 := FND_API.G_MISS_CHAR;
975 end if;
976
977 if ((p_asset_cat_rec.desc_flex.attribute30 is NULL) and
978 (l_asset_cat_rec_old.desc_flex.attribute30 is NOT NULL)) then
979 x_asset_cat_rec_new.desc_flex.attribute30 := FND_API.G_MISS_CHAR;
980 end if;
981
982 if ((p_asset_cat_rec.desc_flex.attribute_category_code is NULL) and
983 (l_asset_cat_rec_old.desc_flex.attribute_category_code is NOT NULL)) then
984 x_asset_cat_rec_new.desc_flex.attribute_category_code :=
985 FND_API.G_MISS_CHAR;
986 end if;
987
988 if ((p_asset_cat_rec.desc_flex.context is NULL) and
989 (l_asset_cat_rec_old.desc_flex.context is NOT NULL)) then
990 x_asset_cat_rec_new.desc_flex.context := FND_API.G_MISS_CHAR;
991 end if;
992
993 return TRUE;
994
995 EXCEPTION
996 when cat_err then
997 fa_srvr_msg.add_message(calling_fn => 'fa_trans_api_pvt.set_cat_rec',
998 p_log_level_rec => p_log_level_rec);
999 return FALSE;
1000
1001 when others then
1002 fa_srvr_msg.add_sql_error(calling_fn => 'fa_trans_api_pvt.set_cat_rec'
1003 ,p_log_level_rec => p_log_level_rec);
1004 return FALSE;
1005
1006 END set_asset_cat_rec;
1007
1008 FUNCTION set_asset_retire_rec (
1009 p_asset_retire_rec IN FA_API_TYPES.asset_retire_rec_type,
1010 x_asset_retire_rec_new OUT NOCOPY FA_API_TYPES.asset_retire_rec_type,
1011 p_mrc_sob_type_code IN VARCHAR2,
1012 p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) RETURN BOOLEAN IS
1013
1014 l_asset_retire_rec_old fa_api_types.asset_retire_rec_type;
1015
1016 retire_err exception;
1017
1018 BEGIN
1019
1020 l_asset_retire_rec_old.retirement_id := p_asset_retire_rec.retirement_id;
1021
1022 if (NOT fa_util_pvt.get_asset_retire_rec (
1023 px_asset_retire_rec => l_asset_retire_rec_old,
1024 p_mrc_sob_type_code => p_mrc_sob_type_code,
1025 p_log_level_rec => p_log_level_rec)) then
1026 raise retire_err;
1027 end if;
1028
1029 x_asset_retire_rec_new := p_asset_retire_rec;
1030
1031 if ((p_asset_retire_rec.units_retired is NULL) and
1032 (l_asset_retire_rec_old.units_retired is NOT NULL)) then
1033 x_asset_retire_rec_new.units_retired := FND_API.G_MISS_NUM;
1034 end if;
1035
1036 if ((p_asset_retire_rec.cost_retired is NULL) and
1037 (l_asset_retire_rec_old.cost_retired is NOT NULL)) then
1038 x_asset_retire_rec_new.cost_retired := FND_API.G_MISS_NUM;
1039 end if;
1040
1041 if ((p_asset_retire_rec.proceeds_of_sale is NULL) and
1042 (l_asset_retire_rec_old.proceeds_of_sale is NOT NULL)) then
1043 x_asset_retire_rec_new.proceeds_of_sale := FND_API.G_MISS_NUM;
1044 end if;
1045
1046 if ((p_asset_retire_rec.cost_of_removal is NULL) and
1047 (l_asset_retire_rec_old.cost_of_removal is NOT NULL)) then
1048 x_asset_retire_rec_new.cost_of_removal := FND_API.G_MISS_NUM;
1049 end if;
1050
1051 if ((p_asset_retire_rec.retirement_type_code is NULL) and
1052 (l_asset_retire_rec_old.retirement_type_code is NOT NULL)) then
1053 x_asset_retire_rec_new.retirement_type_code := FND_API.G_MISS_CHAR;
1054 end if;
1055
1056 if ((p_asset_retire_rec.retirement_prorate_convention is NULL) and
1057 (l_asset_retire_rec_old.retirement_prorate_convention is NOT NULL)) then
1058 x_asset_retire_rec_new.retirement_prorate_convention := FND_API.G_MISS_CHAR;
1059 end if;
1060
1061 if ((p_asset_retire_rec.sold_to is NULL) and
1062 (l_asset_retire_rec_old.sold_to is NOT NULL)) then
1063 x_asset_retire_rec_new.sold_to := FND_API.G_MISS_CHAR;
1064 end if;
1065
1066 if ((p_asset_retire_rec.trade_in_asset_id is NULL) and
1067 (l_asset_retire_rec_old.trade_in_asset_id is NOT NULL)) then
1068 x_asset_retire_rec_new.trade_in_asset_id := FND_API.G_MISS_NUM;
1069 end if;
1070
1071 if ((p_asset_retire_rec.status is NULL) and
1072 (l_asset_retire_rec_old.status is NOT NULL)) then
1073 x_asset_retire_rec_new.status := FND_API.G_MISS_CHAR;
1074 end if;
1075
1076 if ((p_asset_retire_rec.reference_num is NULL) and
1077 (l_asset_retire_rec_old.reference_num is NOT NULL)) then
1078 x_asset_retire_rec_new.reference_num := FND_API.G_MISS_CHAR;
1079 end if;
1080
1081 if ((p_asset_retire_rec.desc_flex.attribute1 is NULL) and
1082 (l_asset_retire_rec_old.desc_flex.attribute1 is NOT NULL)) then
1083 x_asset_retire_rec_new.desc_flex.attribute1 := FND_API.G_MISS_CHAR;
1084 end if;
1085
1086 if ((p_asset_retire_rec.desc_flex.attribute2 is NULL) and
1087 (l_asset_retire_rec_old.desc_flex.attribute2 is NOT NULL)) then
1088 x_asset_retire_rec_new.desc_flex.attribute2 := FND_API.G_MISS_CHAR;
1089 end if;
1090
1091 if ((p_asset_retire_rec.desc_flex.attribute3 is NULL) and
1092 (l_asset_retire_rec_old.desc_flex.attribute3 is NOT NULL)) then
1093 x_asset_retire_rec_new.desc_flex.attribute3 := FND_API.G_MISS_CHAR;
1094 end if;
1095
1096 if ((p_asset_retire_rec.desc_flex.attribute4 is NULL) and
1097 (l_asset_retire_rec_old.desc_flex.attribute4 is NOT NULL)) then
1098 x_asset_retire_rec_new.desc_flex.attribute4 := FND_API.G_MISS_CHAR;
1099 end if;
1100
1101 if ((p_asset_retire_rec.desc_flex.attribute5 is NULL) and
1102 (l_asset_retire_rec_old.desc_flex.attribute5 is NOT NULL)) then
1103 x_asset_retire_rec_new.desc_flex.attribute5 := FND_API.G_MISS_CHAR;
1104 end if;
1105
1106 if ((p_asset_retire_rec.desc_flex.attribute6 is NULL) and
1107 (l_asset_retire_rec_old.desc_flex.attribute6 is NOT NULL)) then
1108 x_asset_retire_rec_new.desc_flex.attribute6 := FND_API.G_MISS_CHAR;
1109 end if;
1110
1111 if ((p_asset_retire_rec.desc_flex.attribute7 is NULL) and
1112 (l_asset_retire_rec_old.desc_flex.attribute7 is NOT NULL)) then
1113 x_asset_retire_rec_new.desc_flex.attribute7 := FND_API.G_MISS_CHAR;
1114 end if;
1115
1116 if ((p_asset_retire_rec.desc_flex.attribute8 is NULL) and
1117 (l_asset_retire_rec_old.desc_flex.attribute8 is NOT NULL)) then
1118 x_asset_retire_rec_new.desc_flex.attribute8 := FND_API.G_MISS_CHAR;
1119 end if;
1120
1121 if ((p_asset_retire_rec.desc_flex.attribute9 is NULL) and
1122 (l_asset_retire_rec_old.desc_flex.attribute9 is NOT NULL)) then
1123 x_asset_retire_rec_new.desc_flex.attribute9 := FND_API.G_MISS_CHAR;
1124 end if;
1125
1126 if ((p_asset_retire_rec.desc_flex.attribute10 is NULL) and
1127 (l_asset_retire_rec_old.desc_flex.attribute10 is NOT NULL)) then
1128 x_asset_retire_rec_new.desc_flex.attribute10 := FND_API.G_MISS_CHAR;
1129 end if;
1130
1131 if ((p_asset_retire_rec.desc_flex.attribute11 is NULL) and
1132 (l_asset_retire_rec_old.desc_flex.attribute11 is NOT NULL)) then
1133 x_asset_retire_rec_new.desc_flex.attribute11 := FND_API.G_MISS_CHAR;
1134 end if;
1135
1136 if ((p_asset_retire_rec.desc_flex.attribute12 is NULL) and
1137 (l_asset_retire_rec_old.desc_flex.attribute12 is NOT NULL)) then
1138 x_asset_retire_rec_new.desc_flex.attribute12 := FND_API.G_MISS_CHAR;
1139 end if;
1140
1141 if ((p_asset_retire_rec.desc_flex.attribute13 is NULL) and
1142 (l_asset_retire_rec_old.desc_flex.attribute13 is NOT NULL)) then
1143 x_asset_retire_rec_new.desc_flex.attribute13 := FND_API.G_MISS_CHAR;
1144 end if;
1145
1146 if ((p_asset_retire_rec.desc_flex.attribute14 is NULL) and
1147 (l_asset_retire_rec_old.desc_flex.attribute14 is NOT NULL)) then
1148 x_asset_retire_rec_new.desc_flex.attribute14 := FND_API.G_MISS_CHAR;
1149 end if;
1150
1151 if ((p_asset_retire_rec.desc_flex.attribute15 is NULL) and
1152 (l_asset_retire_rec_old.desc_flex.attribute15 is NOT NULL)) then
1153 x_asset_retire_rec_new.desc_flex.attribute15 := FND_API.G_MISS_CHAR;
1154 end if;
1155
1156 if ((p_asset_retire_rec.desc_flex.attribute_category_code is NULL) and
1157 (l_asset_retire_rec_old.desc_flex.attribute_category_code is
1158 NOT NULL)) then
1159 x_asset_retire_rec_new.desc_flex.attribute_category_code :=
1160 FND_API.G_MISS_CHAR;
1161 end if;
1162
1163 return TRUE;
1164
1165 EXCEPTION
1166 when retire_err then
1167 fa_srvr_msg.add_message(calling_fn => 'fa_trans_api_pvt.set_ret_rec',
1168 p_log_level_rec => p_log_level_rec);
1169 return FALSE;
1170
1171 when others then
1172 fa_srvr_msg.add_sql_error(calling_fn => 'fa_trans_api_pvt.set_ret_rec'
1173 ,p_log_level_rec => p_log_level_rec);
1174 return FALSE;
1175
1176 END set_asset_retire_rec;
1177
1178 FUNCTION set_inv_rec (
1179 p_inv_rec IN FA_API_TYPES.inv_rec_type,
1180 x_inv_rec_new OUT NOCOPY FA_API_TYPES.inv_rec_type,
1181 p_mrc_sob_type_code IN VARCHAR2,
1182 p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) RETURN BOOLEAN IS
1183
1184 l_inv_rec_old fa_api_types.inv_rec_type;
1185
1186 inv_err exception;
1187
1188 BEGIN
1189
1190 l_inv_rec_old.source_line_id := p_inv_rec.source_line_id;
1191
1192 if (NOT fa_util_pvt.get_inv_rec (
1193 px_inv_rec => l_inv_rec_old,
1194 p_mrc_sob_type_code => p_mrc_sob_type_code,
1195 p_log_level_rec => p_log_level_rec)) then
1196 raise inv_err;
1197 end if;
1198
1199 x_inv_rec_new := p_inv_rec;
1200
1201 if ((p_inv_rec.invoice_number is NULL) and
1202 (l_inv_rec_old.invoice_number is NOT NULL)) then
1203 x_inv_rec_new.invoice_number := FND_API.G_MISS_CHAR;
1204 end if;
1205
1206 if ((p_inv_rec.invoice_line_number is NULL) and
1207 (l_inv_rec_old.invoice_line_number is NOT NULL)) then
1208 x_inv_rec_new.invoice_line_number := FND_API.G_MISS_NUM;
1209 end if;
1210
1211 if ((p_inv_rec.invoice_distribution_id is NULL) and
1212 (l_inv_rec_old.invoice_distribution_id is NOT NULL)) then
1213 x_inv_rec_new.invoice_distribution_id := FND_API.G_MISS_NUM;
1214 end if;
1215
1216 if ((p_inv_rec.po_distribution_id is NULL) and
1217 (l_inv_rec_old.po_distribution_id is NOT NULL)) then
1218 x_inv_rec_new.po_distribution_id := FND_API.G_MISS_NUM;
1219 end if;
1220
1221 if ((p_inv_rec.ap_distribution_line_number is NULL) and
1222 (l_inv_rec_old.ap_distribution_line_number is NOT NULL)) then
1223 x_inv_rec_new.ap_distribution_line_number := FND_API.G_MISS_NUM;
1224 end if;
1225
1226 if ((p_inv_rec.description is NULL) and
1227 (l_inv_rec_old.description is NOT NULL)) then
1228 x_inv_rec_new.description := FND_API.G_MISS_CHAR;
1229 end if;
1230
1231 if ((p_inv_rec.deleted_flag is NULL) and
1232 (l_inv_rec_old.deleted_flag is NOT NULL)) then
1233 x_inv_rec_new.deleted_flag := FND_API.G_MISS_CHAR;
1234 end if;
1235
1236 if ((p_inv_rec.po_vendor_id is NULL) and
1237 (l_inv_rec_old.po_vendor_id is NOT NULL)) then
1238 x_inv_rec_new.po_vendor_id := FND_API.G_MISS_NUM;
1239 end if;
1240
1241 if ((p_inv_rec.po_number is NULL) and
1242 (l_inv_rec_old.po_number is NOT NULL)) then
1243 x_inv_rec_new.po_number := FND_API.G_MISS_CHAR;
1244 end if;
1245
1246 if ((p_inv_rec.payables_batch_name is NULL) and
1247 (l_inv_rec_old.payables_batch_name is NOT NULL)) then
1248 x_inv_rec_new.payables_batch_name := FND_API.G_MISS_CHAR;
1249 end if;
1250
1251 if ((p_inv_rec.project_asset_line_id is NULL) and
1252 (l_inv_rec_old.project_asset_line_id is NOT NULL)) then
1253 x_inv_rec_new.project_asset_line_id := FND_API.G_MISS_NUM;
1254 end if;
1255
1256 if ((p_inv_rec.project_id is NULL) and
1257 (l_inv_rec_old.project_id is NOT NULL)) then
1258 x_inv_rec_new.project_id := FND_API.G_MISS_NUM;
1259 end if;
1260
1261 if ((p_inv_rec.task_id is NULL) and
1262 (l_inv_rec_old.task_id is NOT NULL)) then
1263 x_inv_rec_new.task_id := FND_API.G_MISS_NUM;
1264 end if;
1265
1266 if ((p_inv_rec.material_indicator_flag is NULL) and
1267 (l_inv_rec_old.material_indicator_flag is NOT NULL)) then
1268 x_inv_rec_new.material_indicator_flag := FND_API.G_MISS_CHAR;
1269 end if;
1270
1271 if ((p_inv_rec.attribute1 is NULL) and
1272 (l_inv_rec_old.attribute1 is NOT NULL)) then
1273 x_inv_rec_new.attribute1 := FND_API.G_MISS_CHAR;
1274 end if;
1275
1276 if ((p_inv_rec.attribute2 is NULL) and
1277 (l_inv_rec_old.attribute2 is NOT NULL)) then
1278 x_inv_rec_new.attribute2 := FND_API.G_MISS_CHAR;
1279 end if;
1280
1281 if ((p_inv_rec.attribute3 is NULL) and
1282 (l_inv_rec_old.attribute3 is NOT NULL)) then
1283 x_inv_rec_new.attribute3 := FND_API.G_MISS_CHAR;
1284 end if;
1285
1286 if ((p_inv_rec.attribute4 is NULL) and
1287 (l_inv_rec_old.attribute4 is NOT NULL)) then
1288 x_inv_rec_new.attribute4 := FND_API.G_MISS_CHAR;
1289 end if;
1290
1291 if ((p_inv_rec.attribute5 is NULL) and
1292 (l_inv_rec_old.attribute5 is NOT NULL)) then
1293 x_inv_rec_new.attribute5 := FND_API.G_MISS_CHAR;
1294 end if;
1295
1296 if ((p_inv_rec.attribute6 is NULL) and
1297 (l_inv_rec_old.attribute6 is NOT NULL)) then
1298 x_inv_rec_new.attribute6 := FND_API.G_MISS_CHAR;
1299 end if;
1300
1301 if ((p_inv_rec.attribute7 is NULL) and
1302 (l_inv_rec_old.attribute7 is NOT NULL)) then
1303 x_inv_rec_new.attribute7 := FND_API.G_MISS_CHAR;
1304 end if;
1305
1306 if ((p_inv_rec.attribute8 is NULL) and
1307 (l_inv_rec_old.attribute8 is NOT NULL)) then
1308 x_inv_rec_new.attribute8 := FND_API.G_MISS_CHAR;
1309 end if;
1310
1311 if ((p_inv_rec.attribute9 is NULL) and
1312 (l_inv_rec_old.attribute9 is NOT NULL)) then
1313 x_inv_rec_new.attribute9 := FND_API.G_MISS_CHAR;
1314 end if;
1315
1316 if ((p_inv_rec.attribute10 is NULL) and
1317 (l_inv_rec_old.attribute10 is NOT NULL)) then
1318 x_inv_rec_new.attribute10 := FND_API.G_MISS_CHAR;
1319 end if;
1320
1321 if ((p_inv_rec.attribute11 is NULL) and
1322 (l_inv_rec_old.attribute11 is NOT NULL)) then
1323 x_inv_rec_new.attribute11 := FND_API.G_MISS_CHAR;
1324 end if;
1325
1326 if ((p_inv_rec.attribute12 is NULL) and
1327 (l_inv_rec_old.attribute12 is NOT NULL)) then
1328 x_inv_rec_new.attribute12 := FND_API.G_MISS_CHAR;
1329 end if;
1330
1331 if ((p_inv_rec.attribute13 is NULL) and
1332 (l_inv_rec_old.attribute13 is NOT NULL)) then
1333 x_inv_rec_new.attribute13 := FND_API.G_MISS_CHAR;
1334 end if;
1335
1336 if ((p_inv_rec.attribute14 is NULL) and
1337 (l_inv_rec_old.attribute14 is NOT NULL)) then
1338 x_inv_rec_new.attribute14 := FND_API.G_MISS_CHAR;
1339 end if;
1340
1341 if ((p_inv_rec.attribute15 is NULL) and
1342 (l_inv_rec_old.attribute15 is NOT NULL)) then
1343 x_inv_rec_new.attribute15 := FND_API.G_MISS_CHAR;
1344 end if;
1345
1346 if ((p_inv_rec.attribute_category_code is NULL) and
1347 (l_inv_rec_old.attribute_category_code is NOT NULL)) then
1348 x_inv_rec_new.attribute_category_code := FND_API.G_MISS_CHAR;
1349 end if;
1350
1351 return TRUE;
1352
1353 EXCEPTION
1354 when inv_err then
1355 fa_srvr_msg.add_message(calling_fn => 'fa_trans_api_pvt.set_inv_rec',
1356 p_log_level_rec => p_log_level_rec);
1357 return FALSE;
1358
1359 when others then
1360 fa_srvr_msg.add_sql_error(calling_fn => 'fa_trans_api_pvt.set_inv_rec'
1361 ,p_log_level_rec => p_log_level_rec);
1362 return FALSE;
1363
1364 END set_inv_rec;
1365
1366 END FA_TRANS_API_PVT;