DBA Data[Home] [Help]

PACKAGE BODY: APPS.IGS_FI_IMPCHGS_LINES_PKG

Source


1 PACKAGE BODY igs_fi_impchgs_lines_pkg AS
2 /* $Header: IGSSI85B.pls 115.11 2002/11/29 03:55:51 nsidana ship $ */
3 
4   l_rowid VARCHAR2(25);
5   old_references igs_fi_impchgs_lines%ROWTYPE;
6   new_references igs_fi_impchgs_lines%ROWTYPE;
7 
8   PROCEDURE set_column_values (
9     p_action                            IN     VARCHAR2  ,
10     x_rowid                             IN     VARCHAR2  ,
11     x_impchg_lines_id                   IN     NUMBER    ,
12     x_import_charges_id                 IN     NUMBER    ,
13     x_transaction_dt                    IN     DATE      ,
14     x_effective_dt                      IN     DATE      ,
15     x_transaction_amount                IN     NUMBER    ,
16     x_currency_cd                       IN     VARCHAR2  ,
17     x_exchange_rate                     IN     NUMBER    ,
18     x_comments                          IN     VARCHAR2  ,
19     x_ancillary_attribute1              IN     VARCHAR2    ,
20     x_ancillary_attribute2              IN     VARCHAR2    ,
21     x_ancillary_attribute3              IN     VARCHAR2    ,
22     x_ancillary_attribute4              IN     VARCHAR2    ,
23     x_ancillary_attribute5              IN     VARCHAR2    ,
24     x_ancillary_attribute6              IN     VARCHAR2    ,
25     x_ancillary_attribute7              IN     VARCHAR2    ,
26     x_ancillary_attribute8              IN     VARCHAR2    ,
27     x_ancillary_attribute9              IN     VARCHAR2    ,
28     x_ancillary_attribute10             IN     VARCHAR2    ,
29     x_ancillary_attribute11             IN     VARCHAR2    ,
30     x_ancillary_attribute12             IN     VARCHAR2    ,
31     x_ancillary_attribute13             IN     VARCHAR2    ,
32     x_ancillary_attribute14             IN     VARCHAR2    ,
33     x_ancillary_attribute15             IN     VARCHAR2    ,
34     x_attribute_category                IN     VARCHAR2    ,
35     x_attribute1                        IN     VARCHAR2    ,
36     x_attribute2                        IN     VARCHAR2    ,
37     x_attribute3                        IN     VARCHAR2    ,
38     x_attribute4                        IN     VARCHAR2    ,
39     x_attribute5                        IN     VARCHAR2    ,
40     x_attribute6                        IN     VARCHAR2    ,
41     x_attribute7                        IN     VARCHAR2    ,
42     x_attribute8                        IN     VARCHAR2    ,
43     x_attribute9                        IN     VARCHAR2    ,
44     x_attribute10                       IN     VARCHAR2    ,
45     x_attribute11                       IN     VARCHAR2    ,
46     x_attribute12                       IN     VARCHAR2    ,
47     x_attribute13                       IN     VARCHAR2    ,
48     x_attribute14                       IN     VARCHAR2    ,
49     x_attribute15                       IN     VARCHAR2    ,
50     x_attribute16                       IN     VARCHAR2    ,
51     x_attribute17                       IN     VARCHAR2    ,
52     x_attribute18                       IN     VARCHAR2    ,
53     x_attribute19                       IN     VARCHAR2    ,
54     x_attribute20                       IN     VARCHAR2    ,
55     x_creation_date                     IN     DATE        ,
56     x_created_by                        IN     NUMBER      ,
57     x_last_update_date                  IN     DATE        ,
58     x_last_updated_by                   IN     NUMBER      ,
59     x_last_update_login                 IN     NUMBER
60   ) AS
61   /*
62   ||  Created By : [email protected]
63   ||  Created On : 09-APR-2001
64   ||  Purpose : Initialises the Old and New references for the columns of the table.
65   ||  Known limitations, enhancements or remarks :
66   ||  Change History :
67   ||  Who             When            What
68   || smadathi   06-Nov-2002           Enh. Bug 2584986. Removed columns as mentioned
69   ||                                  in GL interface TD
70   ||  vvutukur        24-Jul-2002     Bug#2425767.Removed references to chg_rate,chg_elements.
71   ||  agairola        04-Jun-2002     For bug 2395663, added EXT_ columns for the DFF for External Charges
72   ||  (reverse chronological order - newest change first)
73   */
74 
75     CURSOR cur_old_ref_values IS
76       SELECT   *
77       FROM     IGS_FI_IMPCHGS_LINES
78       WHERE    rowid = x_rowid;
79 
80   BEGIN
81 
82     l_rowid := x_rowid;
83 
84     -- Code for setting the Old and New Reference Values.
85     -- Populate Old Values.
86     OPEN cur_old_ref_values;
87     FETCH cur_old_ref_values INTO old_references;
88     IF ((cur_old_ref_values%NOTFOUND) AND (p_action NOT IN ('INSERT', 'VALIDATE_INSERT'))) THEN
89       CLOSE cur_old_ref_values;
90       fnd_message.set_name ('FND', 'FORM_RECORD_DELETED');
91       igs_ge_msg_stack.add;
92       app_exception.raise_exception;
93       RETURN;
94     END IF;
95     CLOSE cur_old_ref_values;
96 
97     -- Populate New Values.
98     new_references.impchg_lines_id                   := x_impchg_lines_id;
99     new_references.import_charges_id                 := x_import_charges_id;
100     new_references.transaction_dt                    := x_transaction_dt;
101     new_references.effective_dt                      := x_effective_dt;
102     new_references.transaction_amount                := x_transaction_amount;
103     new_references.currency_cd                       := x_currency_cd;
104     new_references.exchange_rate                     := x_exchange_rate;
105     new_references.comments                          := x_comments;
106     new_references.ancillary_attribute1              := x_ancillary_attribute1;
107     new_references.ancillary_attribute2              := x_ancillary_attribute2;
108     new_references.ancillary_attribute3              := x_ancillary_attribute3;
109     new_references.ancillary_attribute4              := x_ancillary_attribute4;
110     new_references.ancillary_attribute5              := x_ancillary_attribute5;
111     new_references.ancillary_attribute6              := x_ancillary_attribute6;
112     new_references.ancillary_attribute7              := x_ancillary_attribute7;
113     new_references.ancillary_attribute8              := x_ancillary_attribute8;
114     new_references.ancillary_attribute9              := x_ancillary_attribute9;
115     new_references.ancillary_attribute10             := x_ancillary_attribute10;
116     new_references.ancillary_attribute11             := x_ancillary_attribute11;
117     new_references.ancillary_attribute12             := x_ancillary_attribute12;
118     new_references.ancillary_attribute13             := x_ancillary_attribute13;
119     new_references.ancillary_attribute14             := x_ancillary_attribute14;
120     new_references.ancillary_attribute15             := x_ancillary_attribute15;
121     new_references.attribute_category                := x_attribute_category;
122     new_references.attribute1                        := x_attribute1;
123     new_references.attribute2                        := x_attribute2;
124     new_references.attribute3                        := x_attribute3;
125     new_references.attribute4                        := x_attribute4;
126     new_references.attribute5                        := x_attribute5;
127     new_references.attribute6                        := x_attribute6;
128     new_references.attribute7                        := x_attribute7;
129     new_references.attribute8                        := x_attribute8;
130     new_references.attribute9                        := x_attribute9;
131     new_references.attribute10                       := x_attribute10;
132     new_references.attribute11                       := x_attribute11;
133     new_references.attribute12                       := x_attribute12;
134     new_references.attribute13                       := x_attribute13;
135     new_references.attribute14                       := x_attribute14;
136     new_references.attribute15                       := x_attribute15;
137     new_references.attribute16                       := x_attribute16;
138     new_references.attribute17                       := x_attribute17;
139     new_references.attribute18                       := x_attribute18;
140     new_references.attribute19                       := x_attribute19;
141     new_references.attribute20                       := x_attribute20;
142 
143     IF (p_action = 'UPDATE') THEN
144       new_references.creation_date                   := old_references.creation_date;
145       new_references.created_by                      := old_references.created_by;
146     ELSE
147       new_references.creation_date                   := x_creation_date;
148       new_references.created_by                      := x_created_by;
149     END IF;
150 
151     new_references.last_update_date                  := x_last_update_date;
152     new_references.last_updated_by                   := x_last_updated_by;
153     new_references.last_update_login                 := x_last_update_login;
154 
155   END set_column_values;
156 
157 
158   PROCEDURE check_parent_existance AS
159   /*
160   ||  Created By : [email protected]
161   ||  Created On : 09-APR-2001
162   ||  Purpose : Checks for the existance of Parent records.
163   ||  Known limitations, enhancements or remarks :
164   ||  Change History :
165   ||  Who             When            What
166   ||  (reverse chronological order - newest change first)
167   */
168   BEGIN
169 
170     IF (((old_references.import_charges_id = new_references.import_charges_id)) OR
171         ((new_references.import_charges_id IS NULL))) THEN
172       NULL;
173     ELSIF NOT igs_fi_imp_chgs_pkg.get_pk_for_validation (
174                 new_references.import_charges_id
175               ) THEN
176       fnd_message.set_name ('FND', 'FORM_RECORD_DELETED');
177       igs_ge_msg_stack.add;
178       app_exception.raise_exception;
179     END IF;
180 
181   END check_parent_existance;
182 
183 
184   FUNCTION get_pk_for_validation (
185     x_impchg_lines_id                   IN     NUMBER
186   ) RETURN BOOLEAN AS
187   /*
188   ||  Created By : [email protected]
189   ||  Created On : 09-APR-2001
190   ||  Purpose : Validates the Primary Key of the table.
191   ||  Known limitations, enhancements or remarks :
192   ||  Change History :
193   ||  Who             When            What
194   ||  (reverse chronological order - newest change first)
195   */
196     CURSOR cur_rowid IS
197       SELECT   rowid
198       FROM     igs_fi_impchgs_lines
199       WHERE    impchg_lines_id = x_impchg_lines_id
200       FOR UPDATE NOWAIT;
201 
202     lv_rowid cur_rowid%RowType;
203 
204   BEGIN
205 
206     OPEN cur_rowid;
207     FETCH cur_rowid INTO lv_rowid;
208     IF (cur_rowid%FOUND) THEN
209       CLOSE cur_rowid;
210       RETURN(TRUE);
211     ELSE
212       CLOSE cur_rowid;
213       RETURN(FALSE);
214     END IF;
215 
216   END get_pk_for_validation;
217 
218   PROCEDURE get_fk_igs_fi_imp_chgs_all (
219     x_import_charges_id                 IN     NUMBER
220   ) AS
221   /*
222   ||  Created By : [email protected]
223   ||  Created On : 09-APR-2001
224   ||  Purpose : Validates the Foreign Keys for the table.
225   ||  Known limitations, enhancements or remarks :
226   ||  Change History :
227   ||  Who             When            What
228   ||  (reverse chronological order - newest change first)
229   */
230     CURSOR cur_rowid IS
231       SELECT   rowid
232       FROM     igs_fi_impchgs_lines
233       WHERE   ((import_charges_id = x_import_charges_id));
234 
235     lv_rowid cur_rowid%RowType;
236 
237   BEGIN
238 
239     OPEN cur_rowid;
240     FETCH cur_rowid INTO lv_rowid;
241     IF (cur_rowid%FOUND) THEN
242       CLOSE cur_rowid;
243       fnd_message.set_name ('IGS', 'IGS_FI_FIML_FIMP_FK');
244       igs_ge_msg_stack.add;
245       app_exception.raise_exception;
246       RETURN;
247     END IF;
248     CLOSE cur_rowid;
249 
250   END get_fk_igs_fi_imp_chgs_all;
251 
252 
253   PROCEDURE before_dml (
254     p_action                            IN     VARCHAR2,
255     x_rowid                             IN     VARCHAR2    ,
256     x_impchg_lines_id                   IN     NUMBER      ,
257     x_import_charges_id                 IN     NUMBER      ,
258     x_transaction_dt                    IN     DATE        ,
259     x_effective_dt                      IN     DATE        ,
260     x_transaction_amount                IN     NUMBER      ,
261     x_currency_cd                       IN     VARCHAR2    ,
262     x_exchange_rate                     IN     NUMBER      ,
263     x_comments                          IN     VARCHAR2    ,
264     x_ancillary_attribute1              IN     VARCHAR2    ,
265     x_ancillary_attribute2              IN     VARCHAR2    ,
266     x_ancillary_attribute3              IN     VARCHAR2    ,
267     x_ancillary_attribute4              IN     VARCHAR2    ,
268     x_ancillary_attribute5              IN     VARCHAR2    ,
269     x_ancillary_attribute6              IN     VARCHAR2    ,
270     x_ancillary_attribute7              IN     VARCHAR2    ,
271     x_ancillary_attribute8              IN     VARCHAR2    ,
272     x_ancillary_attribute9              IN     VARCHAR2    ,
273     x_ancillary_attribute10             IN     VARCHAR2    ,
274     x_ancillary_attribute11             IN     VARCHAR2    ,
275     x_ancillary_attribute12             IN     VARCHAR2    ,
276     x_ancillary_attribute13             IN     VARCHAR2    ,
277     x_ancillary_attribute14             IN     VARCHAR2    ,
278     x_ancillary_attribute15             IN     VARCHAR2    ,
279     x_attribute_category                IN     VARCHAR2    ,
280     x_attribute1                        IN     VARCHAR2    ,
281     x_attribute2                        IN     VARCHAR2    ,
282     x_attribute3                        IN     VARCHAR2    ,
283     x_attribute4                        IN     VARCHAR2    ,
284     x_attribute5                        IN     VARCHAR2    ,
285     x_attribute6                        IN     VARCHAR2    ,
286     x_attribute7                        IN     VARCHAR2    ,
287     x_attribute8                        IN     VARCHAR2    ,
288     x_attribute9                        IN     VARCHAR2    ,
289     x_attribute10                       IN     VARCHAR2    ,
290     x_attribute11                       IN     VARCHAR2    ,
291     x_attribute12                       IN     VARCHAR2    ,
292     x_attribute13                       IN     VARCHAR2    ,
293     x_attribute14                       IN     VARCHAR2    ,
294     x_attribute15                       IN     VARCHAR2    ,
295     x_attribute16                       IN     VARCHAR2    ,
296     x_attribute17                       IN     VARCHAR2    ,
297     x_attribute18                       IN     VARCHAR2    ,
298     x_attribute19                       IN     VARCHAR2    ,
299     x_attribute20                       IN     VARCHAR2    ,
300     x_creation_date                     IN     DATE        ,
301     x_created_by                        IN     NUMBER      ,
305   ) AS
302     x_last_update_date                  IN     DATE        ,
303     x_last_updated_by                   IN     NUMBER      ,
304     x_last_update_login                 IN     NUMBER
306   /*
307   ||  Created By : [email protected]
308   ||  Created On : 09-APR-2001
309   ||  Purpose : Initialises the columns, Checks Constraints, Calls the
310   ||            Trigger Handlers for the table, before any DML operation.
311   ||  Known limitations, enhancements or remarks :
312   ||  Change History :
313   ||  Who             When            What
314   || smadathi   06-Nov-2002           Enh. Bug 2584986. Removed columns as mentioned
315   ||                                  in GL interface TD. removed DEFAULT clauses
316   ||  vvutukur        24-Jul-2002     Bug#2425767.Removed references to obsoleted columns chg_rate,chg_elements
317   ||                                  from call to set_column_values.
318   ||  agairola        04-Jun-2002     For bug 2395663, added EXT_ columns for the DFF for External Charges
319   ||  (reverse chronological order - newest change first)
320   */
321   BEGIN
322 
323     set_column_values (
324       p_action,
325       x_rowid,
326       x_impchg_lines_id,
327       x_import_charges_id,
328       x_transaction_dt,
329       x_effective_dt,
330       x_transaction_amount,
331       x_currency_cd,
332       x_exchange_rate,
333       x_comments,
334       x_ancillary_attribute1,
335       x_ancillary_attribute2,
336       x_ancillary_attribute3,
337       x_ancillary_attribute4,
338       x_ancillary_attribute5,
339       x_ancillary_attribute6,
340       x_ancillary_attribute7,
341       x_ancillary_attribute8,
342       x_ancillary_attribute9,
343       x_ancillary_attribute10,
344       x_ancillary_attribute11,
345       x_ancillary_attribute12,
346       x_ancillary_attribute13,
347       x_ancillary_attribute14,
348       x_ancillary_attribute15,
349       x_attribute_category,
350       x_attribute1,
351       x_attribute2,
352       x_attribute3,
353       x_attribute4,
354       x_attribute5,
355       x_attribute6,
356       x_attribute7,
357       x_attribute8,
358       x_attribute9,
359       x_attribute10,
360       x_attribute11,
361       x_attribute12,
362       x_attribute13,
363       x_attribute14,
364       x_attribute15,
365       x_attribute16,
366       x_attribute17,
367       x_attribute18,
368       x_attribute19,
369       x_attribute20,
370       x_creation_date,
371       x_created_by,
372       x_last_update_date,
373       x_last_updated_by,
374       x_last_update_login
375     );
376 
377     IF (p_action = 'INSERT') THEN
378       -- Call all the procedures related to Before Insert.
379       IF ( get_pk_for_validation(
380              new_references.impchg_lines_id
381            )
382          ) THEN
383         fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
384         igs_ge_msg_stack.add;
385         app_exception.raise_exception;
386       END IF;
387       check_parent_existance;
388     ELSIF (p_action = 'UPDATE') THEN
389       -- Call all the procedures related to Before Update.
390       check_parent_existance;
391     ELSIF (p_action = 'VALIDATE_INSERT') THEN
392       -- Call all the procedures related to Before Insert.
393       IF ( get_pk_for_validation (
394              new_references.impchg_lines_id
395            )
396          ) THEN
397         fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
398         igs_ge_msg_stack.add;
399         app_exception.raise_exception;
400       END IF;
401     END IF;
402 
403   END before_dml;
404 
405 
406   PROCEDURE insert_row (
407     x_rowid                             IN OUT NOCOPY VARCHAR2,
408     x_impchg_lines_id                   IN OUT NOCOPY NUMBER,
409     x_import_charges_id                 IN     NUMBER,
410     x_transaction_dt                    IN     DATE,
411     x_effective_dt                      IN     DATE,
412     x_transaction_amount                IN     NUMBER,
413     x_currency_cd                       IN     VARCHAR2,
417     x_ancillary_attribute2              IN     VARCHAR2,
414     x_exchange_rate                     IN     NUMBER,
415     x_comments                          IN     VARCHAR2,
416     x_ancillary_attribute1              IN     VARCHAR2,
418     x_ancillary_attribute3              IN     VARCHAR2,
419     x_ancillary_attribute4              IN     VARCHAR2,
420     x_ancillary_attribute5              IN     VARCHAR2,
421     x_ancillary_attribute6              IN     VARCHAR2,
422     x_ancillary_attribute7              IN     VARCHAR2,
423     x_ancillary_attribute8              IN     VARCHAR2,
424     x_ancillary_attribute9              IN     VARCHAR2,
425     x_ancillary_attribute10             IN     VARCHAR2,
426     x_ancillary_attribute11             IN     VARCHAR2,
427     x_ancillary_attribute12             IN     VARCHAR2,
428     x_ancillary_attribute13             IN     VARCHAR2,
429     x_ancillary_attribute14             IN     VARCHAR2,
430     x_ancillary_attribute15             IN     VARCHAR2,
431     x_attribute_category                IN     VARCHAR2,
432     x_attribute1                        IN     VARCHAR2,
433     x_attribute2                        IN     VARCHAR2,
434     x_attribute3                        IN     VARCHAR2,
435     x_attribute4                        IN     VARCHAR2,
436     x_attribute5                        IN     VARCHAR2,
437     x_attribute6                        IN     VARCHAR2,
438     x_attribute7                        IN     VARCHAR2,
439     x_attribute8                        IN     VARCHAR2,
440     x_attribute9                        IN     VARCHAR2,
441     x_attribute10                       IN     VARCHAR2,
442     x_attribute11                       IN     VARCHAR2,
443     x_attribute12                       IN     VARCHAR2,
444     x_attribute13                       IN     VARCHAR2,
445     x_attribute14                       IN     VARCHAR2,
446     x_attribute15                       IN     VARCHAR2,
447     x_attribute16                       IN     VARCHAR2,
448     x_attribute17                       IN     VARCHAR2,
449     x_attribute18                       IN     VARCHAR2,
450     x_attribute19                       IN     VARCHAR2,
451     x_attribute20                       IN     VARCHAR2,
452     x_mode                              IN     VARCHAR2
453   ) AS
454   /*
455   ||  Created By : [email protected]
456   ||  Created On : 09-APR-2001
457   ||  Purpose : Handles the INSERT DML logic for the table.
458   ||  Known limitations, enhancements or remarks :
459   ||  Change History :
460   ||  Who             When           What
461   || smadathi       06-Nov-2002      Enh. Bug 2584986. Removed columns as mentioned
462   ||                                 in GL interface TD
463   ||  vvutukur        24-Jul-2002   Bug#2425767.Removed references to obsoleted columns chg_rate,chg_elements
464   ||                                (from the call to before_dml and from insert statement).
465   ||  agairola        04-Jun-2002     For bug 2395663, added EXT_ columns for the DFF for External Charges
466   ||  (reverse chronological order - newest change first)
467   */
468     CURSOR c IS
469       SELECT   rowid
470       FROM     igs_fi_impchgs_lines
471       WHERE    impchg_lines_id                   = x_impchg_lines_id;
472 
473     x_last_update_date           DATE;
474     x_last_updated_by            NUMBER;
475     x_last_update_login          NUMBER;
476     x_request_id                 NUMBER;
477     x_program_id                 NUMBER;
478     x_program_application_id     NUMBER;
479     x_program_update_date        DATE;
480 
481   BEGIN
482 
483     x_last_update_date := SYSDATE;
484     IF (x_mode = 'I') THEN
485       x_last_updated_by := 1;
486       x_last_update_login := 0;
487     ELSIF (x_mode = 'R') THEN
488       x_last_updated_by := fnd_global.user_id;
489       IF (x_last_updated_by IS NULL) THEN
490         x_last_updated_by := -1;
491       END IF;
492       x_last_update_login := fnd_global.login_id;
493       IF (x_last_update_login IS NULL) THEN
494         x_last_update_login := -1;
495       END IF;
496       x_request_id             := fnd_global.conc_request_id;
497       x_program_id             := fnd_global.conc_program_id;
498       x_program_application_id := fnd_global.prog_appl_id;
499 
500       IF (x_request_id = -1) THEN
501         x_request_id             := NULL;
502         x_program_id             := NULL;
503         x_program_application_id := NULL;
504         x_program_update_date    := NULL;
505       ELSE
506         x_program_update_date    := SYSDATE;
507       END IF;
508     ELSE
509       fnd_message.set_name ('FND', 'SYSTEM-INVALID ARGS');
510       igs_ge_msg_stack.add;
511       app_exception.raise_exception;
512     END IF;
513 
514    SELECT igs_fi_impchgs_lines_s.NEXTVAL INTO x_impchg_lines_id FROM DUAL;
515     before_dml(
516       p_action                            => 'INSERT',
517       x_rowid                             => x_rowid,
518       x_impchg_lines_id                   => x_impchg_lines_id,
519       x_import_charges_id                 => x_import_charges_id,
520       x_transaction_dt                    => x_transaction_dt,
521       x_effective_dt                      => x_effective_dt,
522       x_transaction_amount                => x_transaction_amount,
523       x_currency_cd                       => x_currency_cd,
524       x_exchange_rate                     => x_exchange_rate,
525       x_comments                          => x_comments,
526       x_ancillary_attribute1              => x_ancillary_attribute1,
527       x_ancillary_attribute2              => x_ancillary_attribute2,
531       x_ancillary_attribute6              => x_ancillary_attribute6,
528       x_ancillary_attribute3              => x_ancillary_attribute3,
529       x_ancillary_attribute4              => x_ancillary_attribute4,
530       x_ancillary_attribute5              => x_ancillary_attribute5,
532       x_ancillary_attribute7              => x_ancillary_attribute7,
533       x_ancillary_attribute8              => x_ancillary_attribute8,
534       x_ancillary_attribute9              => x_ancillary_attribute9,
535       x_ancillary_attribute10             => x_ancillary_attribute10,
536       x_ancillary_attribute11             => x_ancillary_attribute11,
537       x_ancillary_attribute12             => x_ancillary_attribute12,
538       x_ancillary_attribute13             => x_ancillary_attribute13,
539       x_ancillary_attribute14             => x_ancillary_attribute14,
540       x_ancillary_attribute15             => x_ancillary_attribute15,
541       x_attribute_category                => x_attribute_category,
542       x_attribute1                        => x_attribute1,
543       x_attribute2                        => x_attribute2,
544       x_attribute3                        => x_attribute3,
545       x_attribute4                        => x_attribute4,
546       x_attribute5                        => x_attribute5,
547       x_attribute6                        => x_attribute6,
548       x_attribute7                        => x_attribute7,
549       x_attribute8                        => x_attribute8,
550       x_attribute9                        => x_attribute9,
551       x_attribute10                       => x_attribute10,
552       x_attribute11                       => x_attribute11,
553       x_attribute12                       => x_attribute12,
554       x_attribute13                       => x_attribute13,
555       x_attribute14                       => x_attribute14,
556       x_attribute15                       => x_attribute15,
557       x_attribute16                       => x_attribute16,
558       x_attribute17                       => x_attribute17,
559       x_attribute18                       => x_attribute18,
560       x_attribute19                       => x_attribute19,
561       x_attribute20                       => x_attribute20,
562       x_creation_date                     => x_last_update_date,
563       x_created_by                        => x_last_updated_by,
564       x_last_update_date                  => x_last_update_date,
565       x_last_updated_by                   => x_last_updated_by,
566       x_last_update_login                 => x_last_update_login
567     );
568 
569     INSERT INTO igs_fi_impchgs_lines (
570       impchg_lines_id,
571       import_charges_id,
572       transaction_dt,
573       effective_dt,
574       transaction_amount,
575       currency_cd,
576       exchange_rate,
577       comments,
578       ancillary_attribute1,
579       ancillary_attribute2,
580       ancillary_attribute3,
581       ancillary_attribute4,
582       ancillary_attribute5,
583       ancillary_attribute6,
584       ancillary_attribute7,
585       ancillary_attribute8,
586       ancillary_attribute9,
587       ancillary_attribute10,
588       ancillary_attribute11,
589       ancillary_attribute12,
590       ancillary_attribute13,
591       ancillary_attribute14,
592       ancillary_attribute15,
593       attribute_category,
594       attribute1,
595       attribute2,
596       attribute3,
597       attribute4,
598       attribute5,
599       attribute6,
600       attribute7,
601       attribute8,
602       attribute9,
603       attribute10,
604       attribute11,
605       attribute12,
606       attribute13,
607       attribute14,
608       attribute15,
609       attribute16,
610       attribute17,
611       attribute18,
612       attribute19,
613       attribute20,
614       creation_date,
615       created_by,
616       last_update_date,
617       last_updated_by,
618       last_update_login,
619       request_id,
620       program_id,
621       program_application_id,
622       program_update_date
623     ) VALUES (
624       new_references.impchg_lines_id,
625       new_references.import_charges_id,
626       new_references.transaction_dt,
627       new_references.effective_dt,
628       new_references.transaction_amount,
629       new_references.currency_cd,
630       new_references.exchange_rate,
631       new_references.comments,
632       new_references.ancillary_attribute1,
633       new_references.ancillary_attribute2,
634       new_references.ancillary_attribute3,
635       new_references.ancillary_attribute4,
636       new_references.ancillary_attribute5,
637       new_references.ancillary_attribute6,
638       new_references.ancillary_attribute7,
639       new_references.ancillary_attribute8,
640       new_references.ancillary_attribute9,
641       new_references.ancillary_attribute10,
642       new_references.ancillary_attribute11,
643       new_references.ancillary_attribute12,
644       new_references.ancillary_attribute13,
645       new_references.ancillary_attribute14,
646       new_references.ancillary_attribute15,
647       new_references.attribute_category,
648       new_references.attribute1,
649       new_references.attribute2,
650       new_references.attribute3,
651       new_references.attribute4,
652       new_references.attribute5,
656       new_references.attribute9,
653       new_references.attribute6,
654       new_references.attribute7,
655       new_references.attribute8,
657       new_references.attribute10,
658       new_references.attribute11,
659       new_references.attribute12,
660       new_references.attribute13,
661       new_references.attribute14,
662       new_references.attribute15,
663       new_references.attribute16,
664       new_references.attribute17,
665       new_references.attribute18,
666       new_references.attribute19,
667       new_references.attribute20,
668       x_last_update_date,
669       x_last_updated_by,
670       x_last_update_date,
671       x_last_updated_by,
672       x_last_update_login ,
673       x_request_id,
674       x_program_id,
675       x_program_application_id,
676       x_program_update_date
677     );
678 
679     OPEN c;
680     FETCH c INTO x_rowid;
681     IF (c%NOTFOUND) THEN
682       CLOSE c;
683       RAISE NO_DATA_FOUND;
684     END IF;
685     CLOSE c;
686 
687     l_rowid := NULL;
688 
689   END insert_row;
690 
691 
692   PROCEDURE lock_row (
693     x_rowid                             IN     VARCHAR2,
694     x_impchg_lines_id                   IN     NUMBER,
695     x_import_charges_id                 IN     NUMBER,
696     x_transaction_dt                    IN     DATE,
697     x_effective_dt                      IN     DATE,
698     x_transaction_amount                IN     NUMBER,
699     x_currency_cd                       IN     VARCHAR2,
700     x_exchange_rate                     IN     NUMBER,
701     x_comments                          IN     VARCHAR2,
702     x_ancillary_attribute1              IN     VARCHAR2,
703     x_ancillary_attribute2              IN     VARCHAR2,
704     x_ancillary_attribute3              IN     VARCHAR2,
705     x_ancillary_attribute4              IN     VARCHAR2,
706     x_ancillary_attribute5              IN     VARCHAR2,
707     x_ancillary_attribute6              IN     VARCHAR2,
708     x_ancillary_attribute7              IN     VARCHAR2,
709     x_ancillary_attribute8              IN     VARCHAR2,
710     x_ancillary_attribute9              IN     VARCHAR2,
711     x_ancillary_attribute10             IN     VARCHAR2,
712     x_ancillary_attribute11             IN     VARCHAR2,
713     x_ancillary_attribute12             IN     VARCHAR2,
714     x_ancillary_attribute13             IN     VARCHAR2,
715     x_ancillary_attribute14             IN     VARCHAR2,
716     x_ancillary_attribute15             IN     VARCHAR2,
717     x_attribute_category                IN     VARCHAR2,
718     x_attribute1                        IN     VARCHAR2,
719     x_attribute2                        IN     VARCHAR2,
720     x_attribute3                        IN     VARCHAR2,
721     x_attribute4                        IN     VARCHAR2,
722     x_attribute5                        IN     VARCHAR2,
723     x_attribute6                        IN     VARCHAR2,
724     x_attribute7                        IN     VARCHAR2,
725     x_attribute8                        IN     VARCHAR2,
726     x_attribute9                        IN     VARCHAR2,
727     x_attribute10                       IN     VARCHAR2,
728     x_attribute11                       IN     VARCHAR2,
729     x_attribute12                       IN     VARCHAR2,
730     x_attribute13                       IN     VARCHAR2,
731     x_attribute14                       IN     VARCHAR2,
732     x_attribute15                       IN     VARCHAR2,
733     x_attribute16                       IN     VARCHAR2,
734     x_attribute17                       IN     VARCHAR2,
735     x_attribute18                       IN     VARCHAR2,
736     x_attribute19                       IN     VARCHAR2,
737     x_attribute20                       IN     VARCHAR2
738   ) AS
739   /*
740   ||  Created By : [email protected]
741   ||  Created On : 09-APR-2001
742   ||  Purpose : Handles the LOCK mechanism for the table.
743   ||  Known limitations, enhancements or remarks :
744   ||  Change History :
745   ||  Who             When            What
746   ||  (reverse chronological order - newest change first)
747   || smadathi   06-Nov-2002  Enh. Bug 2584986. Removed columns as mentioned
748   ||                         in GL interface TD
749   ||  vvutukur        24-Jul-2002   Bug#2425767.Removed references to obsoleted columns chg_rate,chg_elements
750   ||                                (from cursor c1 and from if condition).
751   ||  agairola        04-Jun-2002     For bug 2395663, added EXT_ columns for the DFF for External Charges
752   */
753     CURSOR c1 IS
754       SELECT
755         import_charges_id,
756         transaction_dt,
757         effective_dt,
758         transaction_amount,
759         currency_cd,
760         exchange_rate,
761         comments,
762         ancillary_attribute1,
766         ancillary_attribute5,
763         ancillary_attribute2,
764         ancillary_attribute3,
765         ancillary_attribute4,
767         ancillary_attribute6,
768         ancillary_attribute7,
769         ancillary_attribute8,
770         ancillary_attribute9,
771         ancillary_attribute10,
772         ancillary_attribute11,
773         ancillary_attribute12,
774         ancillary_attribute13,
775         ancillary_attribute14,
776         ancillary_attribute15,
777         attribute_category,
778         attribute1,
779         attribute2,
780         attribute3,
781         attribute4,
782         attribute5,
783         attribute6,
784         attribute7,
785         attribute8,
786         attribute9,
787         attribute10,
788         attribute11,
789         attribute12,
790         attribute13,
791         attribute14,
792         attribute15,
793         attribute16,
794         attribute17,
795         attribute18,
796         attribute19,
797         attribute20
798       FROM  igs_fi_impchgs_lines
799       WHERE rowid = x_rowid
800       FOR UPDATE NOWAIT;
801 
802     tlinfo c1%ROWTYPE;
803 
804   BEGIN
805 
806     OPEN c1;
807     FETCH c1 INTO tlinfo;
808     IF (c1%notfound) THEN
809       fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
810       igs_ge_msg_stack.add;
811       CLOSE c1;
812       app_exception.raise_exception;
813       RETURN;
814     END IF;
815     CLOSE c1;
816 
817     IF (
818         (tlinfo.import_charges_id = x_import_charges_id)
819         AND (tlinfo.transaction_dt = x_transaction_dt)
820         AND ((tlinfo.effective_dt = x_effective_dt) OR ((tlinfo.effective_dt IS NULL) AND (X_effective_dt IS NULL)))
821         AND (tlinfo.transaction_amount = x_transaction_amount)
822         AND ((tlinfo.currency_cd = x_currency_cd) OR ((tlinfo.currency_cd IS NULL) AND (X_currency_cd IS NULL)))
823         AND ((tlinfo.exchange_rate = x_exchange_rate) OR ((tlinfo.exchange_rate IS NULL) AND (X_exchange_rate IS NULL)))
824         AND ((tlinfo.comments = x_comments) OR ((tlinfo.comments IS NULL) AND (X_comments IS NULL)))
825         AND ((tlinfo.ancillary_attribute1 = x_ancillary_attribute1) OR ((tlinfo.ancillary_attribute1 IS NULL) AND (X_ancillary_attribute1 IS NULL)))
826         AND ((tlinfo.ancillary_attribute2 = x_ancillary_attribute2) OR ((tlinfo.ancillary_attribute2 IS NULL) AND (X_ancillary_attribute2 IS NULL)))
827         AND ((tlinfo.ancillary_attribute3 = x_ancillary_attribute3) OR ((tlinfo.ancillary_attribute3 IS NULL) AND (X_ancillary_attribute3 IS NULL)))
828         AND ((tlinfo.ancillary_attribute4 = x_ancillary_attribute4) OR ((tlinfo.ancillary_attribute4 IS NULL) AND (X_ancillary_attribute4 IS NULL)))
829         AND ((tlinfo.ancillary_attribute5 = x_ancillary_attribute5) OR ((tlinfo.ancillary_attribute5 IS NULL) AND (X_ancillary_attribute5 IS NULL)))
830         AND ((tlinfo.ancillary_attribute6 = x_ancillary_attribute6) OR ((tlinfo.ancillary_attribute6 IS NULL) AND (X_ancillary_attribute6 IS NULL)))
831         AND ((tlinfo.ancillary_attribute7 = x_ancillary_attribute7) OR ((tlinfo.ancillary_attribute7 IS NULL) AND (X_ancillary_attribute7 IS NULL)))
832         AND ((tlinfo.ancillary_attribute8 = x_ancillary_attribute8) OR ((tlinfo.ancillary_attribute8 IS NULL) AND (X_ancillary_attribute8 IS NULL)))
833         AND ((tlinfo.ancillary_attribute9 = x_ancillary_attribute9) OR ((tlinfo.ancillary_attribute9 IS NULL) AND (X_ancillary_attribute9 IS NULL)))
834         AND ((tlinfo.ancillary_attribute10 = x_ancillary_attribute10) OR ((tlinfo.ancillary_attribute10 IS NULL) AND (X_ancillary_attribute10 IS NULL)))
835         AND ((tlinfo.ancillary_attribute11 = x_ancillary_attribute11) OR ((tlinfo.ancillary_attribute11 IS NULL) AND (X_ancillary_attribute11 IS NULL)))
836         AND ((tlinfo.ancillary_attribute12 = x_ancillary_attribute12) OR ((tlinfo.ancillary_attribute12 IS NULL) AND (X_ancillary_attribute12 IS NULL)))
837         AND ((tlinfo.ancillary_attribute13 = x_ancillary_attribute13) OR ((tlinfo.ancillary_attribute13 IS NULL) AND (X_ancillary_attribute13 IS NULL)))
838         AND ((tlinfo.ancillary_attribute14 = x_ancillary_attribute14) OR ((tlinfo.ancillary_attribute14 IS NULL) AND (X_ancillary_attribute14 IS NULL)))
839         AND ((tlinfo.ancillary_attribute15 = x_ancillary_attribute15) OR ((tlinfo.ancillary_attribute15 IS NULL) AND (X_ancillary_attribute15 IS NULL)))
840         AND ((tlinfo.attribute_category = x_attribute_category) OR ((tlinfo.attribute_category IS NULL) AND (X_attribute_category IS NULL)))
841         AND ((tlinfo.attribute1 = x_attribute1) OR ((tlinfo.attribute1 IS NULL) AND (X_attribute1 IS NULL)))
842         AND ((tlinfo.attribute2 = x_attribute2) OR ((tlinfo.attribute2 IS NULL) AND (X_attribute2 IS NULL)))
843         AND ((tlinfo.attribute3 = x_attribute3) OR ((tlinfo.attribute3 IS NULL) AND (X_attribute3 IS NULL)))
844         AND ((tlinfo.attribute4 = x_attribute4) OR ((tlinfo.attribute4 IS NULL) AND (X_attribute4 IS NULL)))
845         AND ((tlinfo.attribute5 = x_attribute5) OR ((tlinfo.attribute5 IS NULL) AND (X_attribute5 IS NULL)))
846         AND ((tlinfo.attribute6 = x_attribute6) OR ((tlinfo.attribute6 IS NULL) AND (X_attribute6 IS NULL)))
847         AND ((tlinfo.attribute7 = x_attribute7) OR ((tlinfo.attribute7 IS NULL) AND (X_attribute7 IS NULL)))
848         AND ((tlinfo.attribute8 = x_attribute8) OR ((tlinfo.attribute8 IS NULL) AND (X_attribute8 IS NULL)))
849         AND ((tlinfo.attribute9 = x_attribute9) OR ((tlinfo.attribute9 IS NULL) AND (X_attribute9 IS NULL)))
850         AND ((tlinfo.attribute10 = x_attribute10) OR ((tlinfo.attribute10 IS NULL) AND (X_attribute10 IS NULL)))
851         AND ((tlinfo.attribute11 = x_attribute11) OR ((tlinfo.attribute11 IS NULL) AND (X_attribute11 IS NULL)))
855         AND ((tlinfo.attribute15 = x_attribute15) OR ((tlinfo.attribute15 IS NULL) AND (X_attribute15 IS NULL)))
852         AND ((tlinfo.attribute12 = x_attribute12) OR ((tlinfo.attribute12 IS NULL) AND (X_attribute12 IS NULL)))
853         AND ((tlinfo.attribute13 = x_attribute13) OR ((tlinfo.attribute13 IS NULL) AND (X_attribute13 IS NULL)))
854         AND ((tlinfo.attribute14 = x_attribute14) OR ((tlinfo.attribute14 IS NULL) AND (X_attribute14 IS NULL)))
856         AND ((tlinfo.attribute16 = x_attribute16) OR ((tlinfo.attribute16 IS NULL) AND (X_attribute16 IS NULL)))
857         AND ((tlinfo.attribute17 = x_attribute17) OR ((tlinfo.attribute17 IS NULL) AND (X_attribute17 IS NULL)))
858         AND ((tlinfo.attribute18 = x_attribute18) OR ((tlinfo.attribute18 IS NULL) AND (X_attribute18 IS NULL)))
859         AND ((tlinfo.attribute19 = x_attribute19) OR ((tlinfo.attribute19 IS NULL) AND (X_attribute19 IS NULL)))
860         AND ((tlinfo.attribute20 = x_attribute20) OR ((tlinfo.attribute20 IS NULL) AND (X_attribute20 IS NULL)))
861        ) THEN
862       NULL;
863     ELSE
864       fnd_message.set_name('FND', 'FORM_RECORD_CHANGED');
865       igs_ge_msg_stack.add;
866       app_exception.raise_exception;
867     END IF;
868 
869     l_rowid := NULL;
870     RETURN;
871 
872   END lock_row;
873 
874 
875   PROCEDURE update_row (
876     x_rowid                             IN     VARCHAR2,
877     x_impchg_lines_id                   IN     NUMBER,
878     x_import_charges_id                 IN     NUMBER,
879     x_transaction_dt                    IN     DATE,
880     x_effective_dt                      IN     DATE,
881     x_transaction_amount                IN     NUMBER,
882     x_currency_cd                       IN     VARCHAR2,
883     x_exchange_rate                     IN     NUMBER,
884     x_comments                          IN     VARCHAR2,
885     x_ancillary_attribute1              IN     VARCHAR2,
886     x_ancillary_attribute2              IN     VARCHAR2,
887     x_ancillary_attribute3              IN     VARCHAR2,
888     x_ancillary_attribute4              IN     VARCHAR2,
889     x_ancillary_attribute5              IN     VARCHAR2,
890     x_ancillary_attribute6              IN     VARCHAR2,
891     x_ancillary_attribute7              IN     VARCHAR2,
892     x_ancillary_attribute8              IN     VARCHAR2,
893     x_ancillary_attribute9              IN     VARCHAR2,
894     x_ancillary_attribute10             IN     VARCHAR2,
895     x_ancillary_attribute11             IN     VARCHAR2,
896     x_ancillary_attribute12             IN     VARCHAR2,
897     x_ancillary_attribute13             IN     VARCHAR2,
898     x_ancillary_attribute14             IN     VARCHAR2,
899     x_ancillary_attribute15             IN     VARCHAR2,
900     x_attribute_category                IN     VARCHAR2,
901     x_attribute1                        IN     VARCHAR2,
902     x_attribute2                        IN     VARCHAR2,
903     x_attribute3                        IN     VARCHAR2,
904     x_attribute4                        IN     VARCHAR2,
905     x_attribute5                        IN     VARCHAR2,
906     x_attribute6                        IN     VARCHAR2,
907     x_attribute7                        IN     VARCHAR2,
908     x_attribute8                        IN     VARCHAR2,
909     x_attribute9                        IN     VARCHAR2,
910     x_attribute10                       IN     VARCHAR2,
911     x_attribute11                       IN     VARCHAR2,
912     x_attribute12                       IN     VARCHAR2,
913     x_attribute13                       IN     VARCHAR2,
914     x_attribute14                       IN     VARCHAR2,
915     x_attribute15                       IN     VARCHAR2,
916     x_attribute16                       IN     VARCHAR2,
917     x_attribute17                       IN     VARCHAR2,
918     x_attribute18                       IN     VARCHAR2,
919     x_attribute19                       IN     VARCHAR2,
920     x_attribute20                       IN     VARCHAR2,
921     x_mode                              IN     VARCHAR2
922   ) AS
923   /*
924   ||  Created By : [email protected]
925   ||  Created On : 09-APR-2001
926   ||  Purpose : Handles the UPDATE DML logic for the table.
927   ||  Known limitations, enhancements or remarks :
928   ||  Change History :
929   ||  Who             When            What
930   || smadathi   06-Nov-2002  Enh. Bug 2584986. Removed columns as mentioned
931   ||                         in GL interface TD
932   ||  vvutukur        24-Jul-2002   Bug#2425767.Removed references to obsoleted columns chg_rate,chg_elements
933   ||                                (from the call to before_dml and from update statement).
934   ||  agairola        04-Jun-2002     For bug 2395663, added EXT_ columns for the DFF for External Charges
935   ||  (reverse chronological order - newest change first)
936   */
937     x_last_update_date           DATE ;
938     x_last_updated_by            NUMBER;
939     x_last_update_login          NUMBER;
940     x_request_id                 NUMBER;
941     x_program_id                 NUMBER;
942     x_program_application_id     NUMBER;
943     x_program_update_date        DATE;
944 
945   BEGIN
946 
947     x_last_update_date := SYSDATE;
948     IF (X_MODE = 'I') THEN
949       x_last_updated_by := 1;
950       x_last_update_login := 0;
951     ELSIF (x_mode = 'R') THEN
952       x_last_updated_by := fnd_global.user_id;
953       IF x_last_updated_by IS NULL THEN
954         x_last_updated_by := -1;
958         x_last_update_login := -1;
955       END IF;
956       x_last_update_login := fnd_global.login_id;
957       IF (x_last_update_login IS NULL) THEN
959       END IF;
960     ELSE
961       fnd_message.set_name( 'FND', 'SYSTEM-INVALID ARGS');
962       igs_ge_msg_stack.add;
963       app_exception.raise_exception;
964     END IF;
965 
966     before_dml(
967       p_action                            => 'UPDATE',
968       x_rowid                             => x_rowid,
969       x_impchg_lines_id                   => x_impchg_lines_id,
970       x_import_charges_id                 => x_import_charges_id,
971       x_transaction_dt                    => x_transaction_dt,
972       x_effective_dt                      => x_effective_dt,
973       x_transaction_amount                => x_transaction_amount,
974       x_currency_cd                       => x_currency_cd,
975       x_exchange_rate                     => x_exchange_rate,
976       x_comments                          => x_comments,
977       x_ancillary_attribute1              => x_ancillary_attribute1,
978       x_ancillary_attribute2              => x_ancillary_attribute2,
979       x_ancillary_attribute3              => x_ancillary_attribute3,
980       x_ancillary_attribute4              => x_ancillary_attribute4,
981       x_ancillary_attribute5              => x_ancillary_attribute5,
982       x_ancillary_attribute6              => x_ancillary_attribute6,
983       x_ancillary_attribute7              => x_ancillary_attribute7,
984       x_ancillary_attribute8              => x_ancillary_attribute8,
985       x_ancillary_attribute9              => x_ancillary_attribute9,
986       x_ancillary_attribute10             => x_ancillary_attribute10,
987       x_ancillary_attribute11             => x_ancillary_attribute11,
988       x_ancillary_attribute12             => x_ancillary_attribute12,
989       x_ancillary_attribute13             => x_ancillary_attribute13,
990       x_ancillary_attribute14             => x_ancillary_attribute14,
991       x_ancillary_attribute15             => x_ancillary_attribute15,
992       x_attribute_category                => x_attribute_category,
993       x_attribute1                        => x_attribute1,
994       x_attribute2                        => x_attribute2,
995       x_attribute3                        => x_attribute3,
996       x_attribute4                        => x_attribute4,
997       x_attribute5                        => x_attribute5,
998       x_attribute6                        => x_attribute6,
999       x_attribute7                        => x_attribute7,
1000       x_attribute8                        => x_attribute8,
1001       x_attribute9                        => x_attribute9,
1002       x_attribute10                       => x_attribute10,
1003       x_attribute11                       => x_attribute11,
1004       x_attribute12                       => x_attribute12,
1005       x_attribute13                       => x_attribute13,
1006       x_attribute14                       => x_attribute14,
1007       x_attribute15                       => x_attribute15,
1008       x_attribute16                       => x_attribute16,
1009       x_attribute17                       => x_attribute17,
1010       x_attribute18                       => x_attribute18,
1011       x_attribute19                       => x_attribute19,
1012       x_attribute20                       => x_attribute20,
1013       x_creation_date                     => x_last_update_date,
1014       x_created_by                        => x_last_updated_by,
1015       x_last_update_date                  => x_last_update_date,
1016       x_last_updated_by                   => x_last_updated_by,
1017       x_last_update_login                 => x_last_update_login
1018     );
1019 
1020     IF (x_mode = 'R') THEN
1021       x_request_id := fnd_global.conc_request_id;
1022       x_program_id := fnd_global.conc_program_id;
1023       x_program_application_id := fnd_global.prog_appl_id;
1024       IF (x_request_id =  -1) THEN
1025         x_request_id := old_references.request_id;
1026         x_program_id := old_references.program_id;
1027         x_program_application_id := old_references.program_application_id;
1028         x_program_update_date := old_references.program_update_date;
1029       ELSE
1030         x_program_update_date := SYSDATE;
1031       END IF;
1032     END IF;
1033 
1034     UPDATE igs_fi_impchgs_lines
1035       SET
1036         import_charges_id                 = new_references.import_charges_id,
1037         transaction_dt                    = new_references.transaction_dt,
1038         effective_dt                      = new_references.effective_dt,
1039         transaction_amount                = new_references.transaction_amount,
1040         currency_cd                       = new_references.currency_cd,
1041         exchange_rate                     = new_references.exchange_rate,
1042         comments                          = new_references.comments,
1043         ancillary_attribute1              = new_references.ancillary_attribute1,
1044         ancillary_attribute2              = new_references.ancillary_attribute2,
1045         ancillary_attribute3              = new_references.ancillary_attribute3,
1046         ancillary_attribute4              = new_references.ancillary_attribute4,
1047         ancillary_attribute5              = new_references.ancillary_attribute5,
1048         ancillary_attribute6              = new_references.ancillary_attribute6,
1049         ancillary_attribute7              = new_references.ancillary_attribute7,
1050         ancillary_attribute8              = new_references.ancillary_attribute8,
1051         ancillary_attribute9              = new_references.ancillary_attribute9,
1055         ancillary_attribute13             = new_references.ancillary_attribute13,
1052         ancillary_attribute10             = new_references.ancillary_attribute10,
1053         ancillary_attribute11             = new_references.ancillary_attribute11,
1054         ancillary_attribute12             = new_references.ancillary_attribute12,
1056         ancillary_attribute14             = new_references.ancillary_attribute14,
1057         ancillary_attribute15             = new_references.ancillary_attribute15,
1058         attribute_category                = new_references.attribute_category,
1059         attribute1                        = new_references.attribute1,
1060         attribute2                        = new_references.attribute2,
1061         attribute3                        = new_references.attribute3,
1062         attribute4                        = new_references.attribute4,
1063         attribute5                        = new_references.attribute5,
1064         attribute6                        = new_references.attribute6,
1065         attribute7                        = new_references.attribute7,
1066         attribute8                        = new_references.attribute8,
1067         attribute9                        = new_references.attribute9,
1068         attribute10                       = new_references.attribute10,
1069         attribute11                       = new_references.attribute11,
1070         attribute12                       = new_references.attribute12,
1071         attribute13                       = new_references.attribute13,
1072         attribute14                       = new_references.attribute14,
1073         attribute15                       = new_references.attribute15,
1074         attribute16                       = new_references.attribute16,
1075         attribute17                       = new_references.attribute17,
1076         attribute18                       = new_references.attribute18,
1077         attribute19                       = new_references.attribute19,
1078         attribute20                       = new_references.attribute20,
1079         last_update_date                  = x_last_update_date,
1080         last_updated_by                   = x_last_updated_by,
1081         last_update_login                 = x_last_update_login ,
1082         request_id                        = x_request_id,
1083         program_id                        = x_program_id,
1084         program_application_id            = x_program_application_id,
1085         program_update_date               = x_program_update_date
1086       WHERE rowid = x_rowid;
1087 
1088     IF (SQL%NOTFOUND) THEN
1089       RAISE NO_DATA_FOUND;
1090     END IF;
1091 
1092     l_rowid := NULL;
1093 
1094   END update_row;
1095 
1096 
1097   PROCEDURE add_row (
1098     x_rowid                             IN OUT NOCOPY VARCHAR2,
1099     x_impchg_lines_id                   IN OUT NOCOPY NUMBER,
1100     x_import_charges_id                 IN     NUMBER,
1101     x_transaction_dt                    IN     DATE,
1102     x_effective_dt                      IN     DATE,
1103     x_transaction_amount                IN     NUMBER,
1104     x_currency_cd                       IN     VARCHAR2,
1105     x_exchange_rate                     IN     NUMBER,
1106     x_comments                          IN     VARCHAR2,
1107     x_ancillary_attribute1              IN     VARCHAR2,
1108     x_ancillary_attribute2              IN     VARCHAR2,
1109     x_ancillary_attribute3              IN     VARCHAR2,
1110     x_ancillary_attribute4              IN     VARCHAR2,
1111     x_ancillary_attribute5              IN     VARCHAR2,
1112     x_ancillary_attribute6              IN     VARCHAR2,
1113     x_ancillary_attribute7              IN     VARCHAR2,
1114     x_ancillary_attribute8              IN     VARCHAR2,
1115     x_ancillary_attribute9              IN     VARCHAR2,
1116     x_ancillary_attribute10             IN     VARCHAR2,
1117     x_ancillary_attribute11             IN     VARCHAR2,
1118     x_ancillary_attribute12             IN     VARCHAR2,
1119     x_ancillary_attribute13             IN     VARCHAR2,
1120     x_ancillary_attribute14             IN     VARCHAR2,
1121     x_ancillary_attribute15             IN     VARCHAR2,
1122     x_attribute_category                IN     VARCHAR2,
1123     x_attribute1                        IN     VARCHAR2,
1124     x_attribute2                        IN     VARCHAR2,
1125     x_attribute3                        IN     VARCHAR2,
1126     x_attribute4                        IN     VARCHAR2,
1127     x_attribute5                        IN     VARCHAR2,
1128     x_attribute6                        IN     VARCHAR2,
1129     x_attribute7                        IN     VARCHAR2,
1130     x_attribute8                        IN     VARCHAR2,
1131     x_attribute9                        IN     VARCHAR2,
1132     x_attribute10                       IN     VARCHAR2,
1133     x_attribute11                       IN     VARCHAR2,
1134     x_attribute12                       IN     VARCHAR2,
1135     x_attribute13                       IN     VARCHAR2,
1136     x_attribute14                       IN     VARCHAR2,
1137     x_attribute15                       IN     VARCHAR2,
1138     x_attribute16                       IN     VARCHAR2,
1139     x_attribute17                       IN     VARCHAR2,
1140     x_attribute18                       IN     VARCHAR2,
1141     x_attribute19                       IN     VARCHAR2,
1142     x_attribute20                       IN     VARCHAR2,
1143     x_mode                              IN     VARCHAR2
1144   ) AS
1145   /*
1146   ||  Created By : [email protected]
1147   ||  Created On : 09-APR-2001
1148   ||  Purpose : Adds a row if there is no existing row, otherwise updates existing row in the table.
1149   ||  Known limitations, enhancements or remarks :
1150   ||  Change History :
1151   ||  Who             When            What
1152   || smadathi   06-Nov-2002  Enh. Bug 2584986. Removed columns as mentioned
1153   ||                         in GL interface TD
1154   ||  vvutukur        24-Jul-2002   Bug#2425767.Removed references to obsoleted columns chg_rate,chg_elements
1155   ||                                (from the calls to insert_row and update_row procedures).
1156   ||  agairola        04-Jun-2002     For bug 2395663, added EXT_ columns for the DFF for External Charges
1157   ||  (reverse chronological order - newest change first)
1158   */
1159     CURSOR c1 IS
1160       SELECT   rowid
1161       FROM     igs_fi_impchgs_lines
1162       WHERE    impchg_lines_id                   = x_impchg_lines_id;
1163 
1164   BEGIN
1165 
1166     OPEN c1;
1167     FETCH c1 INTO x_rowid;
1168     IF (c1%NOTFOUND) THEN
1169       CLOSE c1;
1170 
1171       insert_row (
1172         x_rowid,
1173         x_impchg_lines_id,
1174         x_import_charges_id,
1175         x_transaction_dt,
1176         x_effective_dt,
1177         x_transaction_amount,
1178         x_currency_cd,
1179         x_exchange_rate,
1180         x_comments,
1181         x_ancillary_attribute1,
1182         x_ancillary_attribute2,
1183         x_ancillary_attribute3,
1184         x_ancillary_attribute4,
1185         x_ancillary_attribute5,
1186         x_ancillary_attribute6,
1187         x_ancillary_attribute7,
1188         x_ancillary_attribute8,
1189         x_ancillary_attribute9,
1190         x_ancillary_attribute10,
1191         x_ancillary_attribute11,
1192         x_ancillary_attribute12,
1193         x_ancillary_attribute13,
1194         x_ancillary_attribute14,
1195         x_ancillary_attribute15,
1196         x_attribute_category,
1197         x_attribute1,
1198         x_attribute2,
1199         x_attribute3,
1200         x_attribute4,
1201         x_attribute5,
1202         x_attribute6,
1203         x_attribute7,
1204         x_attribute8,
1205         x_attribute9,
1206         x_attribute10,
1207         x_attribute11,
1208         x_attribute12,
1209         x_attribute13,
1210         x_attribute14,
1211         x_attribute15,
1212         x_attribute16,
1213         x_attribute17,
1214         x_attribute18,
1215         x_attribute19,
1216         x_attribute20,
1217         x_mode
1218       );
1219       RETURN;
1220     END IF;
1221     CLOSE c1;
1222 
1223     update_row (
1224       x_rowid,
1225       x_impchg_lines_id,
1226       x_import_charges_id,
1227       x_transaction_dt,
1228       x_effective_dt,
1229       x_transaction_amount,
1230       x_currency_cd,
1231       x_exchange_rate,
1232       x_comments,
1233       x_ancillary_attribute1,
1234       x_ancillary_attribute2,
1235       x_ancillary_attribute3,
1236       x_ancillary_attribute4,
1237       x_ancillary_attribute5,
1238       x_ancillary_attribute6,
1239       x_ancillary_attribute7,
1240       x_ancillary_attribute8,
1241       x_ancillary_attribute9,
1242       x_ancillary_attribute10,
1243       x_ancillary_attribute11,
1244       x_ancillary_attribute12,
1245       x_ancillary_attribute13,
1246       x_ancillary_attribute14,
1247       x_ancillary_attribute15,
1248       x_attribute_category,
1249       x_attribute1,
1250       x_attribute2,
1251       x_attribute3,
1252       x_attribute4,
1253       x_attribute5,
1254       x_attribute6,
1255       x_attribute7,
1256       x_attribute8,
1257       x_attribute9,
1258       x_attribute10,
1259       x_attribute11,
1260       x_attribute12,
1261       x_attribute13,
1262       x_attribute14,
1263       x_attribute15,
1264       x_attribute16,
1265       x_attribute17,
1266       x_attribute18,
1267       x_attribute19,
1268       x_attribute20,
1269       x_mode
1270     );
1271 
1272     l_rowid := NULL;
1273 
1274   END add_row;
1275 
1276 
1277   PROCEDURE delete_row (
1278     x_rowid IN VARCHAR2
1279   ) AS
1280   /*
1281   ||  Created By : [email protected]
1282   ||  Created On : 09-APR-2001
1283   ||  Purpose : Handles the DELETE DML logic for the table.
1284   ||  Known limitations, enhancements or remarks :
1285   ||  Change History :
1286   ||  Who             When            What
1287   ||  (reverse chronological order - newest change first)
1288   */
1289   BEGIN
1290 
1291     before_dml (
1292       p_action => 'DELETE',
1293       x_rowid => x_rowid
1294     );
1295 
1296     DELETE FROM igs_fi_impchgs_lines
1297     WHERE rowid = x_rowid;
1298 
1299     IF (SQL%NOTFOUND) THEN
1300       RAISE NO_DATA_FOUND;
1301     END IF;
1302 
1303     l_rowid := NULL;
1304 
1305   END delete_row;
1306 
1307 
1308 END igs_fi_impchgs_lines_pkg;