DBA Data[Home] [Help]

PACKAGE BODY: APPS.FA_TRANS_API_PVT

Source


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