DBA Data[Home] [Help]

PACKAGE BODY: APPS.FA_TRANSACTION_HEADERS_PKG

Source


1 PACKAGE BODY FA_TRANSACTION_HEADERS_PKG as
2 /* $Header: faxithb.pls 120.5 2005/07/25 10:00:39 yyoon ship $ */
3 
4   PROCEDURE Insert_Row(X_Rowid                   IN OUT NOCOPY VARCHAR2,
5                        X_Transaction_Header_Id          IN OUT NOCOPY NUMBER,
6                        X_Book_Type_Code                 VARCHAR2,
7                        X_Asset_Id                       NUMBER,
8                        X_Transaction_Type_Code          VARCHAR2,
9                        X_Transaction_Date_Entered       DATE,
10                        X_Date_Effective                 DATE,
11                        X_Last_Update_Date               DATE,
12                        X_Last_Updated_By                NUMBER,
13                        X_Transaction_Name               VARCHAR2 DEFAULT NULL,
14                        X_Invoice_Transaction_Id         NUMBER DEFAULT NULL,
15                        X_Source_Transaction_Header_Id   NUMBER DEFAULT NULL,
16                        X_Mass_Reference_Id              NUMBER DEFAULT NULL,
17                        X_Last_Update_Login              NUMBER DEFAULT NULL,
18                        X_Transaction_Subtype            VARCHAR2 DEFAULT NULL,
19                        X_Attribute1                     VARCHAR2 DEFAULT NULL,
20                        X_Attribute2                     VARCHAR2 DEFAULT NULL,
21                        X_Attribute3                     VARCHAR2 DEFAULT NULL,
22                        X_Attribute4                     VARCHAR2 DEFAULT NULL,
23                        X_Attribute5                     VARCHAR2 DEFAULT NULL,
24                        X_Attribute6                     VARCHAR2 DEFAULT NULL,
25                        X_Attribute7                     VARCHAR2 DEFAULT NULL,
26                        X_Attribute8                     VARCHAR2 DEFAULT NULL,
27                        X_Attribute9                     VARCHAR2 DEFAULT NULL,
28                        X_Attribute10                    VARCHAR2 DEFAULT NULL,
29                        X_Attribute11                    VARCHAR2 DEFAULT NULL,
30                        X_Attribute12                    VARCHAR2 DEFAULT NULL,
31                        X_Attribute13                    VARCHAR2 DEFAULT NULL,
32                        X_Attribute14                    VARCHAR2 DEFAULT NULL,
33                        X_Attribute15                    VARCHAR2 DEFAULT NULL,
34                        X_Attribute_Category_Code        VARCHAR2 DEFAULT NULL,
35                        X_Transaction_Key                VARCHAR2 DEFAULT NULL,
36                        X_Amortization_Start_Date        DATE     DEFAULT NULL,
37                        X_Calling_Interface              VARCHAR2 DEFAULT NULL,
38                        X_Mass_Transaction_ID            NUMBER   DEFAULT NULL,
39                        X_Member_Transaction_Header_Id   NUMBER   DEFAULT NULL,
40                        X_Trx_Reference_Id               NUMBER   DEFAULT NULL,
41                        X_Event_Id                       NUMBER   DEFAULT NULL,
42 		       X_Return_Status		 OUT NOCOPY BOOLEAN,
43 		         X_Calling_Fn			VARCHAR2,
44 			p_log_level_rec              IN FA_API_TYPES.log_level_rec_type default null) IS
45 
46     CURSOR C IS SELECT rowid FROM fa_transaction_headers
47                  WHERE transaction_header_id = X_Transaction_Header_Id;
48 
49     CURSOR C2 IS SELECT fa_transaction_headers_s.nextval FROM dual;
50 
51   BEGIN
52       if (X_Transaction_Header_Id is NULL) then
53         OPEN C2;
54         FETCH C2 INTO X_Transaction_Header_Id;
55         CLOSE C2;
56       end if;
57 
58       INSERT INTO fa_transaction_headers(
59               transaction_header_id,
60               book_type_code,
61               asset_id,
62               transaction_type_code,
63               transaction_date_entered,
64               date_effective,
65               last_update_date,
66               last_updated_by,
67               transaction_name,
68               invoice_transaction_id,
69               source_transaction_header_id,
70               mass_reference_id,
71               last_update_login,
72               transaction_subtype,
73               attribute1,
74               attribute2,
75               attribute3,
76               attribute4,
77               attribute5,
78               attribute6,
79               attribute7,
80               attribute8,
81               attribute9,
82               attribute10,
83               attribute11,
84               attribute12,
85               attribute13,
86               attribute14,
87               attribute15,
88               attribute_category_code,
89               transaction_key,
90               amortization_start_date,
91               calling_interface,
92               mass_transaction_id,
93               member_transaction_header_id,
94               trx_reference_id,
95               event_id
96       ) VALUES (
97               X_Transaction_Header_Id,
98               X_Book_Type_Code,
99               X_Asset_Id,
100               X_Transaction_Type_Code,
101               X_Transaction_Date_Entered,
102               X_Date_Effective,
103               X_Last_Update_Date,
104               X_Last_Updated_By,
105               X_Transaction_Name,
106               X_Invoice_Transaction_Id,
107               X_Source_Transaction_Header_Id,
108               X_Mass_Reference_Id,
109               X_Last_Update_Login,
110               X_Transaction_Subtype,
111               X_Attribute1,
112               X_Attribute2,
113               X_Attribute3,
114               X_Attribute4,
115               X_Attribute5,
116               X_Attribute6,
117               X_Attribute7,
118               X_Attribute8,
119               X_Attribute9,
120               X_Attribute10,
121               X_Attribute11,
122               X_Attribute12,
123               X_Attribute13,
124               X_Attribute14,
125               X_Attribute15,
126               X_Attribute_Category_Code,
127               X_Transaction_Key,
128               X_Amortization_Start_Date,
129               X_Calling_Interface,
130               X_Mass_Transaction_ID,
131               X_Member_Transaction_Header_Id,
132               X_Trx_Reference_Id,
133               X_Event_Id
134       );
135 
136     OPEN C;
137     FETCH C INTO X_Rowid;
138     if (C%NOTFOUND) then
139       CLOSE C;
140       Raise NO_DATA_FOUND;
141     end if;
142     CLOSE C;
143 
144     X_Return_Status := TRUE;
145 
146   exception
147     when others then
148       if (X_Calling_Fn = 'fa_unp_dep_pkg.on_insert') then
149         -- Unplanned depreciation is called from form, not from
150         -- transaction engine.
151         FA_STANDARD_PKG.RAISE_ERROR(
152 		CALLED_FN => 'fa_transaction_headers_pkg.insert_row',
153 		CALLING_FN => X_Calling_Fn
154 		,p_log_level_rec => p_log_level_rec);
155 	X_Return_Status := FALSE;
156       else
157 	FA_SRVR_MSG.Add_SQL_Error(
158 		CALLING_FN => 'FA_TRANSACTION_HEADERS_PKG.Insert_Row'
159 		,p_log_level_rec => p_log_level_rec);
160 	X_Return_Status := FALSE;
161         raise; -- BUG# 2020254
162       end if;
163   END Insert_Row;
164 
165 
166   PROCEDURE Lock_Row(X_Rowid                            VARCHAR2,
167 
168                      X_Transaction_Header_Id            NUMBER,
169                      X_Book_Type_Code                   VARCHAR2,
170                      X_Asset_Id                         NUMBER,
171                      X_Transaction_Type_Code            VARCHAR2,
172                      X_Transaction_Date_Entered         DATE,
173                      X_Date_Effective                   DATE,
174                      X_Transaction_Name                 VARCHAR2 DEFAULT NULL,
175                      X_Invoice_Transaction_Id           NUMBER DEFAULT NULL,
176                      X_Source_Transaction_Header_Id     NUMBER DEFAULT NULL,
177                      X_Mass_Reference_Id                NUMBER DEFAULT NULL,
178                      X_Transaction_Subtype              VARCHAR2 DEFAULT NULL,
179                      X_Attribute1                       VARCHAR2 DEFAULT NULL,
180                      X_Attribute2                       VARCHAR2 DEFAULT NULL,
181                      X_Attribute3                       VARCHAR2 DEFAULT NULL,
182                      X_Attribute4                       VARCHAR2 DEFAULT NULL,
183                      X_Attribute5                       VARCHAR2 DEFAULT NULL,
184                      X_Attribute6                       VARCHAR2 DEFAULT NULL,
185                      X_Attribute7                       VARCHAR2 DEFAULT NULL,
186                      X_Attribute8                       VARCHAR2 DEFAULT NULL,
187                      X_Attribute9                       VARCHAR2 DEFAULT NULL,
188                      X_Attribute10                      VARCHAR2 DEFAULT NULL,
189                      X_Attribute11                      VARCHAR2 DEFAULT NULL,
190                      X_Attribute12                      VARCHAR2 DEFAULT NULL,
191                      X_Attribute13                      VARCHAR2 DEFAULT NULL,
192                      X_Attribute14                      VARCHAR2 DEFAULT NULL,
193                      X_Attribute15                      VARCHAR2 DEFAULT NULL,
194                      X_Attribute_Category_Code          VARCHAR2 DEFAULT NULL,
195                      X_Transaction_Key                  VARCHAR2 DEFAULT NULL,
196                      X_Amortization_Start_Date          DATE     DEFAULT NULL,
197                      X_Calling_Interface                VARCHAR2 DEFAULT NULL,
198                      X_Mass_Transaction_ID              NUMBER   DEFAULT NULL,
199                      X_Member_Transaction_Header_Id     NUMBER   DEFAULT NULL,
200                      X_Trx_Reference_Id                 NUMBER   DEFAULT NULL,
201                      X_Event_Id                         NUMBER   DEFAULT NULL,
202 		     X_Calling_Fn			VARCHAR2,
203 		     p_log_level_rec                 IN FA_API_TYPES.log_level_rec_type default null) IS
204     CURSOR C IS
205         SELECT	transaction_header_id,
206 		book_type_code,
207 		asset_id,
208 		transaction_type_code,
209 		transaction_date_entered,
210 		date_effective,
211 		last_update_date,
212 		last_updated_by,
213 		transaction_name,
214 		invoice_transaction_id,
215 		source_transaction_header_id,
216 		mass_reference_id,
217 		last_update_login,
218 		transaction_subtype,
219 		attribute1,
220 		attribute2,
221 		attribute3,
222 		attribute4,
223 		attribute5,
224 		attribute6,
225 		attribute7,
226 		attribute8,
227 		attribute9,
228 		attribute10,
229 		attribute11,
230 		attribute12,
231 		attribute13,
232 		attribute14,
233 		attribute15,
234 		attribute_category_code,
235 		transaction_key,
236                 amortization_start_date,
237                 calling_interface,
238                 mass_transaction_id,
239                 member_transaction_header_id,
240                 trx_reference_id,
241                 event_id
242         FROM   fa_transaction_headers
243         WHERE  rowid = X_Rowid
244         FOR UPDATE of Transaction_Header_Id NOWAIT;
245     Recinfo C%ROWTYPE;
246 
247 
248   BEGIN
249     OPEN C;
250     FETCH C INTO Recinfo;
251     if (C%NOTFOUND) then
252       CLOSE C;
253       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
254       APP_EXCEPTION.Raise_Exception;
255     end if;
256     CLOSE C;
257     if (
258 
259                (Recinfo.transaction_header_id =  X_Transaction_Header_Id)
260            AND (Recinfo.book_type_code =  X_Book_Type_Code)
261            AND (Recinfo.asset_id =  X_Asset_Id)
262            AND (Recinfo.transaction_type_code =  X_Transaction_Type_Code)
263            AND (Recinfo.transaction_date_entered =  X_Transaction_Date_Entered)
264            AND (Recinfo.date_effective =  X_Date_Effective)
265            AND (   (Recinfo.transaction_name =  X_Transaction_Name)
266                 OR (    (Recinfo.transaction_name IS NULL)
267                     AND (X_Transaction_Name IS NULL)))
268            AND (   (Recinfo.invoice_transaction_id =  X_Invoice_Transaction_Id)
269                 OR (    (Recinfo.invoice_transaction_id IS NULL)
270                     AND (X_Invoice_Transaction_Id IS NULL)))
271            AND (   (Recinfo.source_transaction_header_id =
272 					X_Source_Transaction_Header_Id)
273                 OR (    (Recinfo.source_transaction_header_id IS NULL)
274                     AND (X_Source_Transaction_Header_Id IS NULL)))
275            AND (   (Recinfo.mass_reference_id =  X_Mass_Reference_Id)
276                 OR (    (Recinfo.mass_reference_id IS NULL)
277                     AND (X_Mass_Reference_Id IS NULL)))
278            AND (   (Recinfo.transaction_subtype =  X_Transaction_Subtype)
279                 OR (    (Recinfo.transaction_subtype IS NULL)
280                     AND (X_Transaction_Subtype IS NULL)))
281            AND (   (Recinfo.attribute1 =  X_Attribute1)
282                 OR (    (Recinfo.attribute1 IS NULL)
283                     AND (X_Attribute1 IS NULL)))
284            AND (   (Recinfo.attribute2 =  X_Attribute2)
285                 OR (    (Recinfo.attribute2 IS NULL)
286                     AND (X_Attribute2 IS NULL)))
287            AND (   (Recinfo.attribute3 =  X_Attribute3)
288                 OR (    (Recinfo.attribute3 IS NULL)
289                     AND (X_Attribute3 IS NULL)))
290            AND (   (Recinfo.attribute4 =  X_Attribute4)
291                 OR (    (Recinfo.attribute4 IS NULL)
292                     AND (X_Attribute4 IS NULL)))
293            AND (   (Recinfo.attribute5 =  X_Attribute5)
294                 OR (    (Recinfo.attribute5 IS NULL)
295                     AND (X_Attribute5 IS NULL)))
296            AND (   (Recinfo.attribute6 =  X_Attribute6)
297                 OR (    (Recinfo.attribute6 IS NULL)
298                     AND (X_Attribute6 IS NULL)))
299            AND (   (Recinfo.attribute7 =  X_Attribute7)
300                 OR (    (Recinfo.attribute7 IS NULL)
301                     AND (X_Attribute7 IS NULL)))
302            AND (   (Recinfo.attribute8 =  X_Attribute8)
303                 OR (    (Recinfo.attribute8 IS NULL)
304                     AND (X_Attribute8 IS NULL)))
305            AND (   (Recinfo.attribute9 =  X_Attribute9)
306                 OR (    (Recinfo.attribute9 IS NULL)
307                     AND (X_Attribute9 IS NULL)))
308            AND (   (Recinfo.attribute10 =  X_Attribute10)
309                 OR (    (Recinfo.attribute10 IS NULL)
310                     AND (X_Attribute10 IS NULL)))
311            AND (   (Recinfo.attribute11 =  X_Attribute11)
312                 OR (    (Recinfo.attribute11 IS NULL)
313                     AND (X_Attribute11 IS NULL)))
314            AND (   (Recinfo.attribute12 =  X_Attribute12)
315                 OR (    (Recinfo.attribute12 IS NULL)
316                     AND (X_Attribute12 IS NULL)))
317            AND (   (Recinfo.attribute13 =  X_Attribute13)
318                 OR (    (Recinfo.attribute13 IS NULL)
319                     AND (X_Attribute13 IS NULL)))
320            AND (   (Recinfo.attribute14 =  X_Attribute14)
321                 OR (    (Recinfo.attribute14 IS NULL)
322                     AND (X_Attribute14 IS NULL)))
323            AND (   (Recinfo.attribute15 =  X_Attribute15)
324                 OR (    (Recinfo.attribute15 IS NULL)
325                     AND (X_Attribute15 IS NULL)))
326            AND (   (Recinfo.attribute_category_code = X_Attribute_Category_Code)
327                 OR (    (Recinfo.attribute_category_code IS NULL)
328                     AND (X_Attribute_Category_Code IS NULL)))
329            AND (   (Recinfo.transaction_key =  X_Transaction_Key)
330                 OR (    (Recinfo.transaction_key IS NULL)
331                     AND (X_Transaction_Key IS NULL)))
332            AND (   (Recinfo.amortization_start_date = X_Amortization_Start_Date)
333                 OR (    (Recinfo.amortization_start_date IS NULL)
334                     AND (X_Amortization_Start_Date IS NULL)))
335            AND (   (Recinfo.calling_interface =  X_Calling_Interface)
336                 OR (    (Recinfo.calling_interface IS NULL)
337                     AND (X_Calling_Interface IS NULL)))
338            AND (   (Recinfo.mass_transaction_id =  X_mass_transaction_id)
339                 OR (    (Recinfo.mass_transaction_id IS NULL)
340                     AND(x_mass_transaction_id IS NULL)))
341            AND (   (Recinfo.member_transaction_header_id =  X_Member_Transaction_Header_Id)
342                 OR (    (Recinfo.member_transaction_header_id IS NULL)
343                     AND(X_Member_Transaction_Header_Id IS NULL)))
344            AND (   (Recinfo.trx_reference_id =  X_Trx_Reference_Id)
345                 OR (    (Recinfo.trx_reference_id IS NULL)
346                     AND(X_Trx_Reference_Id IS NULL)))
347            AND (   (Recinfo.event_id =  X_Event_Id)
348                 OR (    (Recinfo.event_id IS NULL)
349                     AND(X_Event_Id IS NULL)))) then
350       return;
351     else
352       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
353       APP_EXCEPTION.Raise_Exception;
354     end if;
355   END Lock_Row;
356 
357 
358 
359   PROCEDURE Update_Row(
360           X_Rowid                          VARCHAR2,
361           X_Transaction_Header_Id          NUMBER   DEFAULT NULL,
362           X_Book_Type_Code                 VARCHAR2 DEFAULT NULL,
363           X_Asset_Id                       NUMBER   DEFAULT NULL,
364           X_Transaction_Type_Code          VARCHAR2 DEFAULT NULL,
365           X_Transaction_Date_Entered       DATE     DEFAULT NULL,
366           X_Date_Effective                 DATE     DEFAULT NULL,
367           X_Last_Update_Date               DATE     DEFAULT NULL,
368           X_Last_Updated_By                NUMBER   DEFAULT NULL,
369           X_Transaction_Name               VARCHAR2 DEFAULT NULL,
370           X_Invoice_Transaction_Id         NUMBER   DEFAULT NULL,
371           X_Source_Transaction_Header_Id   NUMBER   DEFAULT NULL,
372           X_Mass_Reference_Id              NUMBER   DEFAULT NULL,
373           X_Last_Update_Login              NUMBER   DEFAULT NULL,
374           X_Transaction_Subtype            VARCHAR2 DEFAULT NULL,
375           X_Attribute1                     VARCHAR2 DEFAULT NULL,
376           X_Attribute2                     VARCHAR2 DEFAULT NULL,
377           X_Attribute3                     VARCHAR2 DEFAULT NULL,
378           X_Attribute4                     VARCHAR2 DEFAULT NULL,
379           X_Attribute5                     VARCHAR2 DEFAULT NULL,
380           X_Attribute6                     VARCHAR2 DEFAULT NULL,
381           X_Attribute7                     VARCHAR2 DEFAULT NULL,
382           X_Attribute8                     VARCHAR2 DEFAULT NULL,
383           X_Attribute9                     VARCHAR2 DEFAULT NULL,
384           X_Attribute10                    VARCHAR2 DEFAULT NULL,
385           X_Attribute11                    VARCHAR2 DEFAULT NULL,
386           X_Attribute12                    VARCHAR2 DEFAULT NULL,
387           X_Attribute13                    VARCHAR2 DEFAULT NULL,
388           X_Attribute14                    VARCHAR2 DEFAULT NULL,
389           X_Attribute15                    VARCHAR2 DEFAULT NULL,
390           X_Attribute_Category_Code        VARCHAR2 DEFAULT NULL,
391           X_Transaction_Key                VARCHAR2 DEFAULT NULL,
392           X_Amortization_Start_Date        DATE     DEFAULT NULL,
393           X_Calling_Interface              VARCHAR2 DEFAULT NULL,
394           X_Mass_Transaction_Id            NUMBER   DEFAULT NULL,
395           X_Member_Transaction_Header_Id   NUMBER   DEFAULT NULL,
396           X_Trx_Reference_Id               NUMBER   DEFAULT NULL,
397           X_Event_id                       NUMBER   DEFAULT NULL,
398           X_Calling_Fn                     VARCHAR2,
399 	  p_log_level_rec               IN FA_API_TYPES.log_level_rec_type default null) IS
400   BEGIN
401     UPDATE fa_transaction_headers
402     SET
403     transaction_header_id
404                       = decode(X_Transaction_Header_Id,
405                                NULL, transaction_header_id,
406                                FND_API.G_MISS_NUM, null,
407                                X_Transaction_Header_Id),
408     book_type_code    = decode(X_Book_Type_Code,
409                                NULL, book_type_code,
410                                FND_API.G_MISS_CHAR, null,
411                                X_Book_Type_Code),
412     asset_id          = decode(X_Asset_Id,
413                                NULL, asset_id,
414                                FND_API.G_MISS_NUM, null,
415                                X_Asset_Id),
416     transaction_type_code
417                       = decode(X_Transaction_Type_Code,
418                                NULL, transaction_type_code,
419                                FND_API.G_MISS_CHAR, null,
420                                X_Transaction_Type_Code),
421     transaction_date_entered
422                       = decode(X_Transaction_Date_Entered,
423                                NULL, transaction_date_entered,
424                                X_Transaction_Date_Entered),
425     date_effective    = decode(X_Date_Effective,
426                                NULL, date_effective,
427                                X_Date_Effective),
428     last_update_date  = decode(X_Last_Update_Date,
429                                NULL, last_update_date,
430                                X_Last_Update_Date),
431     last_updated_by   = decode(X_Last_Updated_By,
432                                NULL, last_updated_by,
433                                FND_API.G_MISS_NUM, null,
434                                X_Last_Updated_By),
435     transaction_name  = decode(X_Transaction_Name,
436                                NULL, transaction_name,
437                                FND_API.G_MISS_CHAR, null,
438                                X_Transaction_Name),
439     invoice_transaction_id
440                       = decode(X_Invoice_Transaction_Id,
441                                NULL, invoice_transaction_id,
442                                FND_API.G_MISS_NUM, null,
443                                X_Invoice_Transaction_Id),
444     source_transaction_header_id
445                       = decode(X_Source_Transaction_Header_Id,
446                                NULL, source_transaction_header_id,
447                                FND_API.G_MISS_NUM, null,
448                                X_Source_Transaction_Header_Id),
449     mass_reference_id = decode(X_Mass_Reference_Id,
450                                NULL, mass_reference_id,
451                                FND_API.G_MISS_NUM, null,
452                                X_Mass_Reference_Id),
453     last_update_login = decode(X_Last_Update_Login,
454                                NULL, last_update_login,
455                                FND_API.G_MISS_NUM, null,
456                                X_Last_Update_Login),
457     transaction_subtype
458                       = decode(X_Transaction_Subtype,
459                                NULL, transaction_subtype,
460                                FND_API.G_MISS_CHAR, null,
461                                X_Transaction_Subtype),
462     attribute1        = decode(X_Attribute1,
463                                NULL, attribute1,
464                                FND_API.G_MISS_CHAR, null,
465                                X_Attribute1),
466     attribute2        = decode(X_Attribute2,
467                                NULL, attribute2,
468                                FND_API.G_MISS_CHAR, null,
469                                X_Attribute2),
470     attribute3        = decode(X_Attribute3,
471                                NULL, attribute3,
472                                FND_API.G_MISS_CHAR, null,
473                                X_Attribute3),
474     attribute4        = decode(X_Attribute4,
475                                NULL, attribute4,
476                                FND_API.G_MISS_CHAR, null,
477                                X_Attribute4),
478     attribute5        = decode(X_Attribute5,
479                                NULL, attribute5,
480                                FND_API.G_MISS_CHAR, null,
481                                X_Attribute5),
482     attribute6        = decode(X_Attribute6,
483                                NULL, attribute6,
484                                FND_API.G_MISS_CHAR, null,
485                                X_Attribute6),
486     attribute7        = decode(X_Attribute7,
487                                NULL, attribute7,
488                                FND_API.G_MISS_CHAR, null,
489                                X_Attribute7),
490     attribute8        = decode(X_Attribute8,
491                                NULL, attribute8,
492                                FND_API.G_MISS_CHAR, null,
493                                X_Attribute8),
494     attribute9        = decode(X_Attribute9,
495                                NULL, attribute9,
496                                FND_API.G_MISS_CHAR, null,
497                                X_Attribute9),
498     attribute10       = decode(X_Attribute10,
499                                NULL, attribute10,
500                                FND_API.G_MISS_CHAR, null,
501                                X_Attribute10),
502     attribute11       = decode(X_Attribute11,
503                                NULL, attribute11,
504                                FND_API.G_MISS_CHAR, null,
505                                X_Attribute11),
506     attribute12       = decode(X_Attribute12,
507                                NULL, attribute12,
508                                FND_API.G_MISS_CHAR, null,
509                                X_Attribute12),
510     attribute13       = decode(X_Attribute13,
511                                NULL, attribute13,
512                                FND_API.G_MISS_CHAR, null,
513                                X_Attribute13),
514     attribute14       = decode(X_Attribute14,
515                                NULL, attribute14,
516                                FND_API.G_MISS_CHAR, null,
517                                X_Attribute14),
518     attribute15       = decode(X_Attribute15,
519                                NULL, attribute15,
520                                FND_API.G_MISS_CHAR, null,
521                                X_Attribute15),
522     attribute_category_code
523                       = decode(X_Attribute_Category_Code,
524                                NULL, attribute_category_code,
525                                FND_API.G_MISS_CHAR, null,
526                                X_Attribute_Category_Code),
527     transaction_key   = decode(X_Transaction_Key,
528                                NULL, transaction_key,
529                                FND_API.G_MISS_CHAR, null,
530                                X_Transaction_Key),
531     amortization_start_date
532                       = decode(X_Amortization_Start_Date,
533                                NULL, amortization_start_date,
534                                X_Amortization_Start_Date),
535     calling_interface = decode(X_Calling_Interface,
536                                NULL, calling_interface,
537                                FND_API.G_MISS_CHAR, null,
538                                X_Calling_Interface),
539     mass_transaction_id = decode(X_mass_transaction_id,
540                                NULL, mass_transaction_id,
541                                FND_API.G_MISS_NUM, null,
542                                X_Mass_transaction_id),
543     member_transaction_header_id = decode(X_Member_Transaction_Header_Id,
544                                NULL, member_transaction_header_id,
545                                FND_API.G_MISS_NUM, null,
546                                X_Member_Transaction_Header_Id),
547     trx_reference_id = decode(X_Trx_Reference_Id,
548                                NULL, trx_reference_id,
549                                FND_API.G_MISS_NUM, null,
550                                X_Trx_Reference_Id),
551     event_id = decode(X_event_id,
552                               NULL, event_id,
553                               FND_API.G_MISS_NUM, null,
554                               X_event_id)
555     WHERE rowid = X_Rowid;
556 
557     if (SQL%NOTFOUND) then
558       Raise NO_DATA_FOUND;
559     end if;
560 
561   exception
562     when others then
563       FA_STANDARD_PKG.RAISE_ERROR(
564 		CALLED_FN => 'fa_transaction_headers_pkg.update_row',
565 		CALLING_FN => X_Calling_Fn
566 		,p_log_level_rec => p_log_level_rec);
567   END Update_Row;
568 
569   -- syoung: added x_return_status.
570   PROCEDURE Update_Trx_Type(X_Book_Type_Code		VARCHAR2,
571 			X_Asset_Id			NUMBER,
572 			X_Transaction_Type_Code		VARCHAR2,
573 			X_New_Transaction_Type		VARCHAR2,
574 			X_Return_Status		 OUT NOCOPY BOOLEAN,
575 		         X_Calling_Fn			VARCHAR2,
576 			p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type default null) IS
577   BEGIN
578 	Update fa_transaction_headers
579 	set transaction_type_code = X_New_Transaction_Type
580 	where asset_id = X_Asset_Id
581 	and book_type_code = X_Book_Type_Code
582 	and transaction_type_code = X_Transaction_Type_Code;
583     X_Return_Status := TRUE;
584   exception
585     when others then
586       FA_SRVR_MSG.Add_SQL_Error(
587 		CALLING_FN => 'FA_TRANSACTION_HEADERS_PKG.Update_Trx_Type'
588 		,p_log_level_rec => p_log_level_rec);
589 --      FA_STANDARD_PKG.RAISE_ERROR(
590 --		CALLED_FN => 'fa_transaction_headers_pkg.update_trx_type',
591 --		CALLING_FN => X_Calling_Fn);
592     X_Return_Status := FALSE;
593   END Update_Trx_Type;
594   --
595   PROCEDURE Delete_Row(X_Rowid 			VARCHAR2 DEFAULT NULL,
596 			X_Transaction_Header_Id NUMBER DEFAULT NULL,
597 			X_Asset_Id		NUMBER DEFAULT NULL,
598 			X_Transaction_Type_Code VARCHAR2 DEFAULT NULL,
599 		         X_Calling_Fn			VARCHAR2,
600 			p_log_level_rec      IN FA_API_TYPES.log_level_rec_type default null) IS
601   BEGIN
602     if X_Rowid is not null then
603     	DELETE FROM fa_transaction_headers
604     	WHERE rowid = X_Rowid;
605     elsif X_Transaction_Header_Id is not null then
606 	DELETE FROM fa_transaction_headers
607     	WHERE transaction_header_id = X_Transaction_Header_Id;
608     elsif X_Asset_Id is not null then
609 	DELETE FROM fa_transaction_headers
610 	WHERE asset_id = X_Asset_Id
611 	and transaction_type_code =
612 		nvl(X_Transaction_Type_Code, transaction_type_code);
613     else
614 	-- error message if inadequate parameters sent
615 	null;
616     end if;
617     if (SQL%NOTFOUND) then
618       Raise NO_DATA_FOUND;
619     end if;
620 
621   exception
622     when others then
623       FA_STANDARD_PKG.RAISE_ERROR(
624 		CALLED_FN => 'fa_transaction_headers_pkg.delete_row',
625 		CALLING_FN => X_Calling_Fn
626 		,p_log_level_rec => p_log_level_rec);
627   END Delete_Row;
628 
629 
630 END FA_TRANSACTION_HEADERS_PKG;