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.6 2009/03/27 09:00:26 bridgway 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) 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, p_log_level_rec => p_log_level_rec);
154 	X_Return_Status := FALSE;
155       else
156 	FA_SRVR_MSG.Add_SQL_Error(
157 		CALLING_FN => 'FA_TRANSACTION_HEADERS_PKG.Insert_Row', p_log_level_rec => p_log_level_rec);
158 	X_Return_Status := FALSE;
159         raise; -- BUG# 2020254
160       end if;
161   END Insert_Row;
162 
163 
164   PROCEDURE Lock_Row(X_Rowid                            VARCHAR2,
165 
166                      X_Transaction_Header_Id            NUMBER,
167                      X_Book_Type_Code                   VARCHAR2,
168                      X_Asset_Id                         NUMBER,
169                      X_Transaction_Type_Code            VARCHAR2,
170                      X_Transaction_Date_Entered         DATE,
171                      X_Date_Effective                   DATE,
172                      X_Transaction_Name                 VARCHAR2 DEFAULT NULL,
173                      X_Invoice_Transaction_Id           NUMBER DEFAULT NULL,
174                      X_Source_Transaction_Header_Id     NUMBER DEFAULT NULL,
175                      X_Mass_Reference_Id                NUMBER DEFAULT NULL,
176                      X_Transaction_Subtype              VARCHAR2 DEFAULT NULL,
177                      X_Attribute1                       VARCHAR2 DEFAULT NULL,
178                      X_Attribute2                       VARCHAR2 DEFAULT NULL,
179                      X_Attribute3                       VARCHAR2 DEFAULT NULL,
180                      X_Attribute4                       VARCHAR2 DEFAULT NULL,
181                      X_Attribute5                       VARCHAR2 DEFAULT NULL,
182                      X_Attribute6                       VARCHAR2 DEFAULT NULL,
183                      X_Attribute7                       VARCHAR2 DEFAULT NULL,
184                      X_Attribute8                       VARCHAR2 DEFAULT NULL,
185                      X_Attribute9                       VARCHAR2 DEFAULT NULL,
186                      X_Attribute10                      VARCHAR2 DEFAULT NULL,
187                      X_Attribute11                      VARCHAR2 DEFAULT NULL,
188                      X_Attribute12                      VARCHAR2 DEFAULT NULL,
189                      X_Attribute13                      VARCHAR2 DEFAULT NULL,
190                      X_Attribute14                      VARCHAR2 DEFAULT NULL,
191                      X_Attribute15                      VARCHAR2 DEFAULT NULL,
192                      X_Attribute_Category_Code          VARCHAR2 DEFAULT NULL,
193                      X_Transaction_Key                  VARCHAR2 DEFAULT NULL,
194                      X_Amortization_Start_Date          DATE     DEFAULT NULL,
195                      X_Calling_Interface                VARCHAR2 DEFAULT NULL,
196                      X_Mass_Transaction_ID              NUMBER   DEFAULT NULL,
197                      X_Member_Transaction_Header_Id     NUMBER   DEFAULT NULL,
198                      X_Trx_Reference_Id                 NUMBER   DEFAULT NULL,
199                        X_Event_Id                       NUMBER   DEFAULT NULL,
200 		         X_Calling_Fn			VARCHAR2
201   , p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type) IS
202     CURSOR C IS
203         SELECT	transaction_header_id,
204 		book_type_code,
205 		asset_id,
206 		transaction_type_code,
207 		transaction_date_entered,
208 		date_effective,
209 		last_update_date,
210 		last_updated_by,
211 		transaction_name,
212 		invoice_transaction_id,
213 		source_transaction_header_id,
214 		mass_reference_id,
215 		last_update_login,
216 		transaction_subtype,
217 		attribute1,
218 		attribute2,
219 		attribute3,
220 		attribute4,
221 		attribute5,
222 		attribute6,
223 		attribute7,
224 		attribute8,
225 		attribute9,
226 		attribute10,
227 		attribute11,
228 		attribute12,
229 		attribute13,
230 		attribute14,
231 		attribute15,
232 		attribute_category_code,
233 		transaction_key,
234                 amortization_start_date,
235                 calling_interface,
236                 mass_transaction_id,
237                 member_transaction_header_id,
238                 trx_reference_id,
239                 event_id
240         FROM   fa_transaction_headers
241         WHERE  rowid = X_Rowid
242         FOR UPDATE of Transaction_Header_Id NOWAIT;
243     Recinfo C%ROWTYPE;
244 
245 
246   BEGIN
247     OPEN C;
248     FETCH C INTO Recinfo;
249     if (C%NOTFOUND) then
250       CLOSE C;
251       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
252       APP_EXCEPTION.Raise_Exception;
253     end if;
254     CLOSE C;
255     if (
256 
257                (Recinfo.transaction_header_id =  X_Transaction_Header_Id)
258            AND (Recinfo.book_type_code =  X_Book_Type_Code)
259            AND (Recinfo.asset_id =  X_Asset_Id)
260            AND (Recinfo.transaction_type_code =  X_Transaction_Type_Code)
261            AND (Recinfo.transaction_date_entered =  X_Transaction_Date_Entered)
262            AND (Recinfo.date_effective =  X_Date_Effective)
263            AND (   (Recinfo.transaction_name =  X_Transaction_Name)
264                 OR (    (Recinfo.transaction_name IS NULL)
265                     AND (X_Transaction_Name IS NULL)))
266            AND (   (Recinfo.invoice_transaction_id =  X_Invoice_Transaction_Id)
267                 OR (    (Recinfo.invoice_transaction_id IS NULL)
268                     AND (X_Invoice_Transaction_Id IS NULL)))
269            AND (   (Recinfo.source_transaction_header_id =
270 					X_Source_Transaction_Header_Id)
271                 OR (    (Recinfo.source_transaction_header_id IS NULL)
272                     AND (X_Source_Transaction_Header_Id IS NULL)))
273            AND (   (Recinfo.mass_reference_id =  X_Mass_Reference_Id)
274                 OR (    (Recinfo.mass_reference_id IS NULL)
275                     AND (X_Mass_Reference_Id IS NULL)))
276            AND (   (Recinfo.transaction_subtype =  X_Transaction_Subtype)
277                 OR (    (Recinfo.transaction_subtype IS NULL)
278                     AND (X_Transaction_Subtype IS NULL)))
279            AND (   (Recinfo.attribute1 =  X_Attribute1)
280                 OR (    (Recinfo.attribute1 IS NULL)
281                     AND (X_Attribute1 IS NULL)))
282            AND (   (Recinfo.attribute2 =  X_Attribute2)
283                 OR (    (Recinfo.attribute2 IS NULL)
284                     AND (X_Attribute2 IS NULL)))
285            AND (   (Recinfo.attribute3 =  X_Attribute3)
286                 OR (    (Recinfo.attribute3 IS NULL)
287                     AND (X_Attribute3 IS NULL)))
288            AND (   (Recinfo.attribute4 =  X_Attribute4)
289                 OR (    (Recinfo.attribute4 IS NULL)
290                     AND (X_Attribute4 IS NULL)))
291            AND (   (Recinfo.attribute5 =  X_Attribute5)
292                 OR (    (Recinfo.attribute5 IS NULL)
293                     AND (X_Attribute5 IS NULL)))
294            AND (   (Recinfo.attribute6 =  X_Attribute6)
295                 OR (    (Recinfo.attribute6 IS NULL)
296                     AND (X_Attribute6 IS NULL)))
297            AND (   (Recinfo.attribute7 =  X_Attribute7)
298                 OR (    (Recinfo.attribute7 IS NULL)
299                     AND (X_Attribute7 IS NULL)))
300            AND (   (Recinfo.attribute8 =  X_Attribute8)
301                 OR (    (Recinfo.attribute8 IS NULL)
302                     AND (X_Attribute8 IS NULL)))
303            AND (   (Recinfo.attribute9 =  X_Attribute9)
304                 OR (    (Recinfo.attribute9 IS NULL)
305                     AND (X_Attribute9 IS NULL)))
306            AND (   (Recinfo.attribute10 =  X_Attribute10)
307                 OR (    (Recinfo.attribute10 IS NULL)
308                     AND (X_Attribute10 IS NULL)))
309            AND (   (Recinfo.attribute11 =  X_Attribute11)
310                 OR (    (Recinfo.attribute11 IS NULL)
311                     AND (X_Attribute11 IS NULL)))
312            AND (   (Recinfo.attribute12 =  X_Attribute12)
313                 OR (    (Recinfo.attribute12 IS NULL)
314                     AND (X_Attribute12 IS NULL)))
315            AND (   (Recinfo.attribute13 =  X_Attribute13)
316                 OR (    (Recinfo.attribute13 IS NULL)
317                     AND (X_Attribute13 IS NULL)))
318            AND (   (Recinfo.attribute14 =  X_Attribute14)
319                 OR (    (Recinfo.attribute14 IS NULL)
320                     AND (X_Attribute14 IS NULL)))
321            AND (   (Recinfo.attribute15 =  X_Attribute15)
322                 OR (    (Recinfo.attribute15 IS NULL)
323                     AND (X_Attribute15 IS NULL)))
324            AND (   (Recinfo.attribute_category_code = X_Attribute_Category_Code)
325                 OR (    (Recinfo.attribute_category_code IS NULL)
326                     AND (X_Attribute_Category_Code IS NULL)))
327            AND (   (Recinfo.transaction_key =  X_Transaction_Key)
328                 OR (    (Recinfo.transaction_key IS NULL)
329                     AND (X_Transaction_Key IS NULL)))
330            AND (   (Recinfo.amortization_start_date = X_Amortization_Start_Date)
331                 OR (    (Recinfo.amortization_start_date IS NULL)
332                     AND (X_Amortization_Start_Date IS NULL)))
333            AND (   (Recinfo.calling_interface =  X_Calling_Interface)
334                 OR (    (Recinfo.calling_interface IS NULL)
335                     AND (X_Calling_Interface IS NULL)))
336            AND (   (Recinfo.mass_transaction_id =  X_mass_transaction_id)
337                 OR (    (Recinfo.mass_transaction_id IS NULL)
338                     AND(x_mass_transaction_id IS NULL)))
339            AND (   (Recinfo.member_transaction_header_id =  X_Member_Transaction_Header_Id)
340                 OR (    (Recinfo.member_transaction_header_id IS NULL)
341                     AND(X_Member_Transaction_Header_Id IS NULL)))
342            AND (   (Recinfo.trx_reference_id =  X_Trx_Reference_Id)
343                 OR (    (Recinfo.trx_reference_id IS NULL)
344                     AND(X_Trx_Reference_Id IS NULL)))
345            AND (   (Recinfo.event_id =  X_Event_Id)
346                 OR (    (Recinfo.event_id IS NULL)
347                     AND(X_Event_Id IS NULL)))
348       ) then
349       return;
350     else
351       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
352       APP_EXCEPTION.Raise_Exception;
353     end if;
354   END Lock_Row;
355 
356 
357 
358   PROCEDURE Update_Row(
359           X_Rowid                          VARCHAR2,
360           X_Transaction_Header_Id          NUMBER   DEFAULT NULL,
361           X_Book_Type_Code                 VARCHAR2 DEFAULT NULL,
362           X_Asset_Id                       NUMBER   DEFAULT NULL,
363           X_Transaction_Type_Code          VARCHAR2 DEFAULT NULL,
364           X_Transaction_Date_Entered       DATE     DEFAULT NULL,
365           X_Date_Effective                 DATE     DEFAULT NULL,
366           X_Last_Update_Date               DATE     DEFAULT NULL,
367           X_Last_Updated_By                NUMBER   DEFAULT NULL,
368           X_Transaction_Name               VARCHAR2 DEFAULT NULL,
369           X_Invoice_Transaction_Id         NUMBER   DEFAULT NULL,
370           X_Source_Transaction_Header_Id   NUMBER   DEFAULT NULL,
371           X_Mass_Reference_Id              NUMBER   DEFAULT NULL,
372           X_Last_Update_Login              NUMBER   DEFAULT NULL,
373           X_Transaction_Subtype            VARCHAR2 DEFAULT NULL,
374           X_Attribute1                     VARCHAR2 DEFAULT NULL,
375           X_Attribute2                     VARCHAR2 DEFAULT NULL,
376           X_Attribute3                     VARCHAR2 DEFAULT NULL,
377           X_Attribute4                     VARCHAR2 DEFAULT NULL,
378           X_Attribute5                     VARCHAR2 DEFAULT NULL,
379           X_Attribute6                     VARCHAR2 DEFAULT NULL,
380           X_Attribute7                     VARCHAR2 DEFAULT NULL,
381           X_Attribute8                     VARCHAR2 DEFAULT NULL,
382           X_Attribute9                     VARCHAR2 DEFAULT NULL,
383           X_Attribute10                    VARCHAR2 DEFAULT NULL,
384           X_Attribute11                    VARCHAR2 DEFAULT NULL,
385           X_Attribute12                    VARCHAR2 DEFAULT NULL,
386           X_Attribute13                    VARCHAR2 DEFAULT NULL,
387           X_Attribute14                    VARCHAR2 DEFAULT NULL,
388           X_Attribute15                    VARCHAR2 DEFAULT NULL,
389           X_Attribute_Category_Code        VARCHAR2 DEFAULT NULL,
390           X_Transaction_Key                VARCHAR2 DEFAULT NULL,
391           X_Amortization_Start_Date        DATE     DEFAULT NULL,
392           X_Calling_Interface              VARCHAR2 DEFAULT NULL,
393           X_Mass_Transaction_Id            NUMBER   DEFAULT NULL,
394           X_Member_Transaction_Header_Id   NUMBER   DEFAULT NULL,
395           X_Trx_Reference_Id               NUMBER   DEFAULT NULL,
396           X_Event_Id                       NUMBER   DEFAULT NULL,
397           X_Calling_Fn                     VARCHAR2
398   , p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type) IS
399   BEGIN
400     UPDATE fa_transaction_headers
401     SET
402     transaction_header_id
403                       = decode(X_Transaction_Header_Id,
404                                NULL, transaction_header_id,
405                                FND_API.G_MISS_NUM, null,
406                                X_Transaction_Header_Id),
407     book_type_code    = decode(X_Book_Type_Code,
408                                NULL, book_type_code,
409                                FND_API.G_MISS_CHAR, null,
410                                X_Book_Type_Code),
411     asset_id          = decode(X_Asset_Id,
412                                NULL, asset_id,
413                                FND_API.G_MISS_NUM, null,
414                                X_Asset_Id),
415     transaction_type_code
416                       = decode(X_Transaction_Type_Code,
417                                NULL, transaction_type_code,
418                                FND_API.G_MISS_CHAR, null,
419                                X_Transaction_Type_Code),
420     transaction_date_entered
421                       = decode(X_Transaction_Date_Entered,
422                                NULL, transaction_date_entered,
423                                X_Transaction_Date_Entered),
424     date_effective    = decode(X_Date_Effective,
425                                NULL, date_effective,
426                                X_Date_Effective),
427     last_update_date  = decode(X_Last_Update_Date,
428                                NULL, last_update_date,
429                                X_Last_Update_Date),
430     last_updated_by   = decode(X_Last_Updated_By,
431                                NULL, last_updated_by,
432                                FND_API.G_MISS_NUM, null,
433                                X_Last_Updated_By),
434     transaction_name  = decode(X_Transaction_Name,
435                                NULL, transaction_name,
436                                FND_API.G_MISS_CHAR, null,
437                                X_Transaction_Name),
438     invoice_transaction_id
439                       = decode(X_Invoice_Transaction_Id,
440                                NULL, invoice_transaction_id,
441                                FND_API.G_MISS_NUM, null,
442                                X_Invoice_Transaction_Id),
443     source_transaction_header_id
444                       = decode(X_Source_Transaction_Header_Id,
445                                NULL, source_transaction_header_id,
446                                FND_API.G_MISS_NUM, null,
447                                X_Source_Transaction_Header_Id),
448     mass_reference_id = decode(X_Mass_Reference_Id,
449                                NULL, mass_reference_id,
450                                FND_API.G_MISS_NUM, null,
451                                X_Mass_Reference_Id),
452     last_update_login = decode(X_Last_Update_Login,
453                                NULL, last_update_login,
454                                FND_API.G_MISS_NUM, null,
455                                X_Last_Update_Login),
456     transaction_subtype
457                       = decode(X_Transaction_Subtype,
458                                NULL, transaction_subtype,
459                                FND_API.G_MISS_CHAR, null,
460                                X_Transaction_Subtype),
461     attribute1        = decode(X_Attribute1,
462                                NULL, attribute1,
463                                FND_API.G_MISS_CHAR, null,
464                                X_Attribute1),
465     attribute2        = decode(X_Attribute2,
466                                NULL, attribute2,
467                                FND_API.G_MISS_CHAR, null,
468                                X_Attribute2),
469     attribute3        = decode(X_Attribute3,
470                                NULL, attribute3,
471                                FND_API.G_MISS_CHAR, null,
472                                X_Attribute3),
473     attribute4        = decode(X_Attribute4,
474                                NULL, attribute4,
475                                FND_API.G_MISS_CHAR, null,
476                                X_Attribute4),
477     attribute5        = decode(X_Attribute5,
478                                NULL, attribute5,
479                                FND_API.G_MISS_CHAR, null,
480                                X_Attribute5),
481     attribute6        = decode(X_Attribute6,
482                                NULL, attribute6,
483                                FND_API.G_MISS_CHAR, null,
484                                X_Attribute6),
485     attribute7        = decode(X_Attribute7,
486                                NULL, attribute7,
487                                FND_API.G_MISS_CHAR, null,
488                                X_Attribute7),
489     attribute8        = decode(X_Attribute8,
490                                NULL, attribute8,
491                                FND_API.G_MISS_CHAR, null,
492                                X_Attribute8),
493     attribute9        = decode(X_Attribute9,
494                                NULL, attribute9,
495                                FND_API.G_MISS_CHAR, null,
496                                X_Attribute9),
497     attribute10       = decode(X_Attribute10,
498                                NULL, attribute10,
499                                FND_API.G_MISS_CHAR, null,
500                                X_Attribute10),
501     attribute11       = decode(X_Attribute11,
502                                NULL, attribute11,
503                                FND_API.G_MISS_CHAR, null,
504                                X_Attribute11),
505     attribute12       = decode(X_Attribute12,
506                                NULL, attribute12,
507                                FND_API.G_MISS_CHAR, null,
508                                X_Attribute12),
509     attribute13       = decode(X_Attribute13,
510                                NULL, attribute13,
511                                FND_API.G_MISS_CHAR, null,
512                                X_Attribute13),
513     attribute14       = decode(X_Attribute14,
514                                NULL, attribute14,
515                                FND_API.G_MISS_CHAR, null,
516                                X_Attribute14),
517     attribute15       = decode(X_Attribute15,
518                                NULL, attribute15,
519                                FND_API.G_MISS_CHAR, null,
520                                X_Attribute15),
521     attribute_category_code
522                       = decode(X_Attribute_Category_Code,
523                                NULL, attribute_category_code,
524                                FND_API.G_MISS_CHAR, null,
525                                X_Attribute_Category_Code),
526     transaction_key   = decode(X_Transaction_Key,
527                                NULL, transaction_key,
528                                FND_API.G_MISS_CHAR, null,
529                                X_Transaction_Key),
530     amortization_start_date
531                       = decode(X_Amortization_Start_Date,
532                                NULL, amortization_start_date,
533                                X_Amortization_Start_Date),
534     calling_interface = decode(X_Calling_Interface,
535                                NULL, calling_interface,
536                                FND_API.G_MISS_CHAR, null,
537                                X_Calling_Interface),
538     mass_transaction_id = decode(X_mass_transaction_id,
539                                NULL, mass_transaction_id,
540                                FND_API.G_MISS_NUM, null,
541                                X_Mass_transaction_id),
542     member_transaction_header_id = decode(X_Member_Transaction_Header_Id,
543                                NULL, member_transaction_header_id,
544                                FND_API.G_MISS_NUM, null,
545                                X_Member_Transaction_Header_Id),
546     trx_reference_id = decode(X_Trx_Reference_Id,
547                                NULL, trx_reference_id,
548                                FND_API.G_MISS_NUM, null,
549                                X_Trx_Reference_Id),
550     event_id = decode(X_event_id,
551                               NULL, event_id,
552                               FND_API.G_MISS_NUM, null,
553                               X_event_id)
554     WHERE rowid = X_Rowid;
555 
556     if (SQL%NOTFOUND) then
557       Raise NO_DATA_FOUND;
558     end if;
559 
560   exception
561     when others then
562       FA_STANDARD_PKG.RAISE_ERROR(
563 		CALLED_FN => 'fa_transaction_headers_pkg.update_row',
564 		CALLING_FN => X_Calling_Fn, p_log_level_rec => p_log_level_rec);
565   END Update_Row;
566 
567   -- syoung: added x_return_status.
568   PROCEDURE Update_Trx_Type(X_Book_Type_Code		VARCHAR2,
569 			X_Asset_Id			NUMBER,
570 			X_Transaction_Type_Code		VARCHAR2,
571 			X_New_Transaction_Type		VARCHAR2,
572 			X_Return_Status		 OUT NOCOPY BOOLEAN,
573 		         X_Calling_Fn			VARCHAR2, p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type) IS
574   BEGIN
575 	Update fa_transaction_headers
576 	set transaction_type_code = X_New_Transaction_Type
577 	where asset_id = X_Asset_Id
578 	and book_type_code = X_Book_Type_Code
579 	and transaction_type_code = X_Transaction_Type_Code;
580     X_Return_Status := TRUE;
581   exception
582     when others then
583       FA_SRVR_MSG.Add_SQL_Error(
584 		CALLING_FN => 'FA_TRANSACTION_HEADERS_PKG.Update_Trx_Type', p_log_level_rec => p_log_level_rec);
585 --      FA_STANDARD_PKG.RAISE_ERROR(
586 --		CALLED_FN => 'fa_transaction_headers_pkg.update_trx_type',
587 --		CALLING_FN => X_Calling_Fn, p_log_level_rec => p_log_level_rec);
588     X_Return_Status := FALSE;
589   END Update_Trx_Type;
590   --
591   PROCEDURE Delete_Row(X_Rowid 			VARCHAR2 DEFAULT NULL,
592 			X_Transaction_Header_Id NUMBER DEFAULT NULL,
593 			X_Asset_Id		NUMBER DEFAULT NULL,
594 			X_Transaction_Type_Code VARCHAR2 DEFAULT NULL,
595 		         X_Calling_Fn			VARCHAR2, p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type) IS
596   BEGIN
597     if X_Rowid is not null then
598     	DELETE FROM fa_transaction_headers
599     	WHERE rowid = X_Rowid;
600     elsif X_Transaction_Header_Id is not null then
601 	DELETE FROM fa_transaction_headers
602     	WHERE transaction_header_id = X_Transaction_Header_Id;
603     elsif X_Asset_Id is not null then
604 	DELETE FROM fa_transaction_headers
605 	WHERE asset_id = X_Asset_Id
606 	and transaction_type_code =
607 		nvl(X_Transaction_Type_Code, transaction_type_code);
608     else
609 	-- error message if inadequate parameters sent
610 	null;
611     end if;
612     if (SQL%NOTFOUND) then
613       Raise NO_DATA_FOUND;
614     end if;
615 
616   exception
617     when others then
618       FA_STANDARD_PKG.RAISE_ERROR(
619 		CALLED_FN => 'fa_transaction_headers_pkg.delete_row',
620 		CALLING_FN => X_Calling_Fn, p_log_level_rec => p_log_level_rec);
621   END Delete_Row;
622 
623 
624 END FA_TRANSACTION_HEADERS_PKG;