DBA Data[Home] [Help]

PACKAGE BODY: APPS.IGF_SL_CL_ORIG_ACK

Source


1 PACKAGE BODY igf_sl_cl_orig_ack  AS
2 /* $Header: IGFSL09B.pls 120.25 2006/08/23 11:45:09 bvisvana ship $ */
3 --
4 ---------------------------------------------------------------------------------
5 --
6 --    Created By       :    mesriniv
7 --    Date Created By  :    2000/12/07
8 --    Purpose          :    To Process Common Line Acknowledgement
9 --                          Data
10 --    Known Limitations,Enhancements or Remarks
11 --    Change History   :
12 ---------------------------------------------------------------------------------
13 --  Who         When            What
14 ---------------------------------------------------------------------------------
15 --  bvisvana    10-Apr-2006     FA 161 - Bug # 5006583 - CL4 Addendum
16 --                              Two new columns (borrower alien reg number and e-signature source type code) +
17 --                              validations based on fed appl form code + TBH impact
18 --  bvisvana    29-Jul-2005     Bug # 4120082 - Telphone Number not created - New function created : create_person_telephone_record
19 --  mnade       25-Jan-2005     Bug - 4139742 - Changes to allow Status override for Guarantor
20 --                              Lender Statuses
21 --  mnade       21-Jan-2005     Bug - 4136563 - Disbursement update problems.
22 --                              The disbursements in @8 will be updated based on the flag and
23 --                              award disbursement changes status.
24 --  mnade       21-Jan-2005     Bug - 4136168 - @4 Cosigner DOBs were containing 0s,
25 --                              Handled using REPLACE
26 --  mnade       19-Jan-2005     Bug - 4124893, 4127320, 4115326, 4130089
27 --                              SCR relation creation, CL5 Loan Aceptance, Change ACK Status Update
28 --                              Address creation and Person creation even for Staffor Loans.
29 --  mnade       13-Jan-2005     Bug - 4119363
30 --                              Termination status was missing for CL4 added the same in status copying area.
31 --  mnade       12-Jan-2005     Bug - 4108463
32 --                              The CL 4 Final Response Type was checked wrongly
33 --                              Added Lender Approved Amount in Event Notification and check on the same.
34 --  mnade       10-Jan-2005     Bug # 4101646
35 --                              Reinstatement data was not picked properly.
36 --  mnade       20-Dec-2004     Bug 4058180
37 --                              B and B both will be considered as approved responsed
38 --                              Log will contain both Student and Borrower Details
39 --                              Batch Id will still continue to come blank
40 --                              Correction for Interest Rate
41 --                              Record Type Indicator corrected
42 --  smadathi    29-oct-2004     Bug 3416936. Added new business logic as part of
43 --                              CL4 changes
44 --  veramach    July 2004       FA 151 HR Integration (bug#3709292)
45 --                              Impacts of obsoleting columns from igf_aw_awd_disb_all
46 ---------------------------------------------------------------------------------
47 --  sjadhav     21-Jan-2004     Bug 3387706. Lender should be updated by process
48 --                              Added logic to updat the Lender/Guarantor Info
49 --                              Added more log messages
50 ---------------------------------------------------------------------------------
51 --  veramach     11-Dec-2003    Bug # 3184891
52 --                              removed calls to igf_ap_gen.write_log and added common logging
53 --  veramach     04-Nov-03      FA 125 Multiple Distr methods - changed signature of igf_aw_awd_disb_pkg.update_row(added attendance_type_code) in procedure upd_disb_details
54 --  ugummall    21-OCT-2003     Bug 3102439. FA 126 - Multiple FA Offices.
55 --                              removed cur_school_id and l_school_id and their
56 --                              references. Removed the clause which meant for selection
57 --                              based on school_id from the cur_Hrecord cursor as the job
58 --                              always runs for one specific school.
59 --
60 --  bkkumar     08-oct-2003   Bug 3104228
61 --                             a) Impact of adding the relationship_cd
62 --                             in igf_sl_lor_all table and obsoleting
63 --                             BORW_LENDER_ID, DUNS_BORW_LENDER_ID,
64 --                             GUARANTOR_ID, DUNS_GUARNT_ID,
65 --                             LENDER_ID, DUNS_LENDER_ID
66 --                             LEND_NON_ED_BRC_ID, RECIPIENT_ID
67 --                             RECIPIENT_TYPE,DUNS_RECIP_ID
68 --                             RECIP_NON_ED_BRC_ID columns.
69 --                             b) The DUNS_BORW_LENDER_ID
70 --                             DUNS_GUARNT_ID
71 --                             DUNS_LENDER_ID
72 --                             DUNS_RECIP_ID columns are osboleted from the
73 --                             igf_sl_lor_loc_all table.
74 --                             c) Removed the hard coded strings from the cursors.
75 ---------------------------------------------------------------------------------
76 --  gmuralid   03-07-2003    Bug 2995944 - Legacy Part 3 - FFELP Import
77 --                           Added legacy record flag as parameter to
78 --                           igf_sl_loans_pkg
79 ---------------------------------------------------------------------------------
80 --    sjadhav     20-Jun-2003     Bug 2983181
81 --                                Added debug log messages
82 ---------------------------------------------------------------------------------
83 --    sjadhav     11-Apr-2003     Bug 2892963
84 --                                Print message IGF_SL_NO_LOAN_NUMBER when
85 --                                Loan Number does not exist in the system
86 ---------------------------------------------------------------------------------
87 --    sjadhav     27-Mar-2003     Bug 2863960
88 --                                Changed Disb Gross Amt to Disb Accepted Amt
89 --                                to insert into igf_sl_awd_disb table
90 ---------------------------------------------------------------------------------
91 --    agairola    15-Mar-2002     Modified the Update Row of
92 --                                IGF_SL_LOANS_PKG for Borrower's
93 --                                Determination as part of
94 --                                Refunds DLD 2144600
95 ---------------------------------------------------------------------------------
96 --    masehgal    17-Feb-2002     # 2216956   FACR007
97 --                                Added Elec_mpn_ind,Borrow_sign_ind in
98 --                                igf_sl_lor_pkg.update_row and igf_sl_cl_resp_r1
99 ---------------------------------------------------------------------------------
100 --    npalanis    11/jan/2002     The process Common Line Origination
101 --                                Process( procedure place_holds_disb )
102 --                                is modified to pick up disbursement
103 --                                records that are in planned state,
104 --                                insert records into IGF_DB_DISB_HOLDS
105 --                                table with hold 'EXTERNAL' and
106 --                                hold type 'SYSTEM' and also
107 --                                update manual_hold_ind flag in
108 --                                IGF_AW_AWD_DISB table to 'Y'.
109 --                                enh bug no-2154941.
110 ---------------------------------------------------------------------------------
111 --    ssawhney    2nd jan         TBH call of IGF_AW_AWD_DISB table
112 --                                changed in Stud Emp build
113 --                                en bug no 2161847
114 ---------------------------------------------------------------------------------
115 --    mesriniv    13/07/2001      Bug 1806850
116 --                                Modified the call to
117 --                                igf_aw_awd_disb_pkg.update_row since 9 columns
118 --                                were added to the table igf_aw_awd_disb_all.
119 ---------------------------------------------------------------------------------
120 --    ENH BUG NO: 1769051         ENH DESCRIPTION: Loan Processing -
121 --                                Nov 2001 DLD
122 ---------------------------------------------------------------------------------
123 --    mesriniv    13/05/2001      1.A new Procedure by Name
124 --                                insert_into_reps_r4 has been
125 --                                defined and called from
126 --                                procedure insert_into_resp_r1
127 --                                in order to insert @4 Records.
128 --
129 --                                2.A procedure show_alt_details
130 --                                has been defined and is called from
131 --                                update_lor procedure to display the Alt
132 --                                Loan Borrower details.
133 --
134 --                                3.Wherever Variables referred to
135 --                                viewname.field%TYPE has been changed
136 --                                to TableName.fieldname%TYPE
137 --
138 --                                4.A global Array title_array has been
139 --                                  defined to get the Lookup Descriptions
140 --                                5.Formatting of Output was enhanced
141 ---------------------------------------------------------------------------------
142 --
143 
144  --
145  -- variable to store debug messages
146  --
147 
148 gv_debug_str VARCHAR2(4000);
149 
150 g_loaded_file_ident_code           igf_sl_cl_batch_all.file_ident_code%TYPE;
151 g_loaded_recipient_id              igf_sl_cl_batch_all.recipient_id%TYPE;
152 g_loaded_recip_non_ed_brc_id       igf_sl_cl_batch_all.recip_non_ed_brc_id%TYPE;
153 g_file_source_id                   igf_sl_cl_batch_all.source_id%TYPE;
154 g_file_source_non_ed_brc_id        igf_sl_cl_batch_all.source_non_ed_brc_id%TYPE;
155 g_loaded_batch_id                  igf_sl_cl_batch_all.batch_id%TYPE;
156 g_c_update_disb_dtls               varchar2(10);
157 --
158 -- Added exceptions so that unhandled exception is not raised
159 -- for user defined exception
160 --
161 
162 batch_exceptions EXCEPTION;
163 
164 
165  -- Select the Records from Resp1 Table to process them
166 
167  CURSOR cur_resp1_records(p_cbth_id   igf_sl_cl_resp_r1.cbth_id%TYPE,
168                           p_rec_status igf_sl_cl_resp_r1.resp_record_status%TYPE )
169  IS
170         SELECT clrp1.* FROM igf_sl_cl_resp_r1 clrp1
171         WHERE  clrp1.cbth_id            = p_cbth_id
172         AND    clrp1.resp_record_status = p_rec_status
173         ORDER BY clrp1.clrp1_id
174         FOR UPDATE OF resp_record_status NOWAIT;
175 
176 
177  Format_1_rec           igf_sl_load_file_t%ROWTYPE;
178  Format_1_rec_temp      igf_sl_load_file_t%ROWTYPE;
179  loaded_1rec            cur_resp1_records%ROWTYPE;
180  g_cbth_id              igf_sl_cl_batch_all.cbth_id%TYPE;
181  l_loan_number          igf_sl_loans_all.loan_number%TYPE;
182  p_disb_title           VARCHAR2(1000);
183  p_disb_under_line      VARCHAR2(1000);
184 
185  TYPE tab_title IS TABLE OF VARCHAR2(1000) INDEX BY BINARY_INTEGER;
186 
187  TYPE awd_disb  IS TABLE OF VARCHAR2(2000) INDEX BY BINARY_INTEGER;
188  TYPE loc_disb  IS TABLE OF VARCHAR2(2000) INDEX BY BINARY_INTEGER;
189  awd_disb_array         awd_disb;
190  loc_disb_array         loc_disb;
191 
192  title_array            tab_title;
193  l_title_flag           VARCHAR2(1);
194  p_cl_file_type         igf_sl_cl_file_type.cl_file_type%TYPE;
195  g_v_cl_version         igf_sl_cl_setup_all.cl_version%TYPE;
196 
197 
198  --Procedure Declarations
199 
200 PROCEDURE insert_into_resp1(p_loan_number          igf_sl_loans_all.loan_number%TYPE,
201                             p_resp_record_status   igf_sl_cl_resp_r1_all.resp_record_status%TYPE,
202                             p_rec_type_ind         igf_sl_cl_resp_r1_all.rec_type_ind%TYPE);
203 
204 PROCEDURE process_1_records;
205 
206 PROCEDURE update_lor(p_clrp1_id     igf_sl_cl_resp_r1_all.clrp1_id%TYPE,
207                      p_loan_number  igf_sl_loans_all.loan_number%TYPE,
208                      p_rejected_rec BOOLEAN);
209 
210 PROCEDURE compare_disbursements(p_loan_number igf_sl_loans_all.loan_number%TYPE);
211 
212 --
213 -- Declaration of a Procedure for inserting the @4 Records as per New DLD
214 --
215 
216 PROCEDURE insert_into_resp_r4(p_clrp1_id       igf_sl_cl_resp_r1_all.clrp1_id%TYPE,
217                               p_r4_record      igf_sl_load_file_t.record_data%TYPE);
218 
219 --
220 -- Procedure to show the difference in information bet OFA and File Details
221 --
222 PROCEDURE show_alt_details(p_clrp1_id  igf_sl_cl_resp_r1_all.clrp1_id%TYPE,
223                            p_loan_id   igf_sl_loans_all.loan_id%TYPE);
224 
225 -- procedure for enabling statement level logging
226 PROCEDURE log_to_fnd ( p_v_module IN VARCHAR2,
227                        p_v_string IN VARCHAR2
228                      );
229 
230 PROCEDURE process_borrow_stud_rec (p_rec_resp_r1   IN  igf_sl_cl_resp_r1_all%ROWTYPE);
231 
232 PROCEDURE perform_ssn_match(p_rec_resp_r1     IN  igf_sl_cl_resp_r1_all%ROWTYPE,
233                             p_c_pers_typ_ind  IN  VARCHAR2,
234                             p_n_person_id     OUT NOCOPY hz_parties.party_id%TYPE,
235                             p_n_person_number OUT NOCOPY hz_parties.party_number%TYPE,
236                             p_c_pers_exists   OUT NOCOPY BOOLEAN
237                             ) ;
238 
239 FUNCTION create_person_record(p_rec_resp_r1     IN  igf_sl_cl_resp_r1_all%ROWTYPE,
240                               p_c_pers_typ_ind  IN  VARCHAR2,
241                               p_n_person_id     OUT NOCOPY hz_parties.party_id%TYPE,
242                               p_n_person_number OUT NOCOPY hz_parties.party_number%TYPE
243                               ) RETURN BOOLEAN ;
244 
245 FUNCTION create_person_addr_record(p_n_person_id     IN  hz_parties.party_id%TYPE,
246                                    p_v_person_number IN  hz_parties.party_number%TYPE,
247                                    p_rec_resp_r1     IN  igf_sl_cl_resp_r1_all%ROWTYPE
248                                   ) RETURN BOOLEAN ;
249 
250 -- bvisvana - Bug # 4120082 - Telphone Number not created
251 
252 FUNCTION create_person_telephone_record (p_n_person_id     IN  hz_parties.party_id%TYPE,
253                                          p_rec_resp_r1     IN  igf_sl_cl_resp_r1_all%ROWTYPE
254                                         ) RETURN BOOLEAN;
255 
256 FUNCTION create_borrow_stud_rel ( p_n_borrower_id     IN  hz_parties.party_id%TYPE,
257                                   p_v_borrower_number IN  hz_parties.party_number%TYPE,
258                                   p_n_student_id      IN  hz_parties.party_id%TYPE,
259                                   p_v_student_number  IN  hz_parties.party_number%TYPE
260                                  ) RETURN BOOLEAN;
261 
262 PROCEDURE raise_scr_event  ( p_rec_resp_r1        IN igf_sl_cl_resp_r1_all%ROWTYPE,
263                              p_c_borrow_created   IN VARCHAR2,
264                              p_c_student_created  IN VARCHAR2,
265                              p_c_rel_created      IN VARCHAR2
266                            );
267 
268 PROCEDURE raise_gamt_event  ( p_v_ci_alternate_code   IN igs_ca_inst_all.alternate_code%TYPE,
269                               p_d_ci_start_dt         IN igs_ca_inst_all.start_dt%TYPE,
270                               p_d_ci_end_dt           IN igs_ca_inst_all.end_dt%TYPE,
271                               p_v_person_number       IN hz_parties.party_number%TYPE,
272                               p_v_person_name         IN hz_parties.party_name%TYPE,
273                               p_v_ssn                 IN igf_ap_isir_ints_all.current_ssn_txt%TYPE,
274                               p_v_loan_number         IN igf_sl_loans_all.loan_number%TYPE,
275                               p_d_loan_per_begin_date IN igf_sl_loans_all.loan_per_begin_date%TYPE,
276                               p_d_loan_per_end_date   IN igf_sl_loans_all.loan_per_end_date%TYPE,
277                               p_v_loan_type           IN igf_aw_fund_cat_all.fed_fund_code%TYPE,
278                               p_n_award_accept_amt    IN igf_aw_award_all.accepted_amt%TYPE,
279                               p_n_guarantee_amt       IN igf_sl_cl_resp_r1_all.guarantee_amt%TYPE,
280                               p_n_approved_amt        IN igf_sl_cl_resp_r1_all.alt_approved_amt%TYPE
281                             );
282 
283 PROCEDURE insert_into_resp_r2(p_r2_record   IN     igf_sl_cl_resp_r2_dtls%ROWTYPE);
284 
285 PROCEDURE insert_into_resp_r3(p_r3_record   IN     igf_sl_cl_resp_r3_dtls%ROWTYPE);
286 
287 PROCEDURE insert_into_resp_r7(p_r7_record   IN     igf_sl_cl_resp_r7_dtls%ROWTYPE);
288 
289 PROCEDURE insert_into_resp_r6(p_r6_record   IN     igf_sl_clchrs_dtls%ROWTYPE);
290 
291 PROCEDURE process_change_records (p_n_clrp1_id     IN  igf_sl_cl_resp_r1_all.clrp1_id%TYPE,
292                                   p_v_loan_number  IN  igf_sl_loans_all.loan_number%TYPE);
293 
294 PROCEDURE log_parameters ( p_v_param_typ IN VARCHAR2,
295                            p_v_param_val IN VARCHAR2
296                          ) ;
297 
298 PROCEDURE cl_load_file
299 AS
300  /***************************************************************
301    Created By       :    mesriniv
302    Date Created By  :    2000/12/07
303    Purpose          :    To Load the File Data and Verify if
304                        Data Format is Supported
305    Known Limitations,Enhancements or Remarks
306    Change History   :
307    Bug Id           : 1720677 Desc : Mapping of school id in the CommonLine Setup
308                           to ope_id of  FinancialAid Office Setup.
309    Who              When            What
310    ugummall         21-OCT-2003     Removed one clause(selection based on school_id) from
311                                     cur_Hrecord cursor.
312    mesriniv         05-APR-2001    Changed the occurrences of field fao_id
313                          to ope_id
314  ***************************************************************/
315 
316 
317      l_row_id                           VARCHAR2(25);
318      Header_rec                         igf_sl_load_file_t%ROWTYPE;
319      l_trailer                          VARCHAR2(2);
320      l_log_msg                          VARCHAR2(100);
321      l_file_creation_date               DATE;
322      l_file_trans_date                  DATE;
323      l_batch_id                         igf_sl_cl_batch_all.batch_id%TYPE;
324      l_n_cbth_id                        NUMBER;
325 
326       -- To Fetch the Current School Id from Setup table
327 
328       -- cursor cur_school_id is removed from here as it selects ope_id from igf_ap_fa_setup table
329       -- which is being obsoleted.
330 
331      -- To Fetch the @H records from Load file Table
332 
333      CURSOR cur_Hrecord ( p_file_type  igf_sl_load_file_t.file_type%TYPE,
334                           p_record_data  igf_sl_load_file_t.record_data%TYPE)
335         IS
336         SELECT * FROM igf_sl_load_file_t
337         WHERE file_type                               = p_file_type
338         AND   LTRIM(RTRIM(SUBSTR(record_data,1,2)))   = p_record_data
339         AND   lort_id                                 = 1
340         ORDER By lort_id;
341 
342      -- To Fetch the Trailer Record from Load File Table
343 
344      CURSOR cur_Trecord ( p_file_type  igf_sl_load_file_t.file_type%TYPE,
345                           p_record_data  igf_sl_load_file_t.record_data%TYPE)
346       IS
347       SELECT 'x' FROM igf_sl_load_file_t
348       WHERE  lort_id = (SELECT MAX(lort_id) FROM igf_sl_load_file_t
349                            WHERE file_type = p_file_type)
350       AND   file_type                      = p_file_type
351       AND   SUBSTR(record_data,1,2)        = p_record_data ;
352 
353 
354      -- To Fetch the Batch Id Info from CL Batch Table
355 
356      CURSOR cur_batch( p_send_resp  igf_sl_cl_batch.send_resp%TYPE )IS
357      SELECT clbatch.*, clbatch.ROWID row_id
358      FROM  igf_sl_cl_batch_all clbatch
359      WHERE RTRIM(batch_id)                   = g_loaded_batch_id
360      AND   file_creation_date            = l_file_creation_date
361      AND   file_ident_code               = g_loaded_file_ident_code
362      AND   recipient_id                  = g_loaded_recipient_id
363      AND   NVL(recip_non_ed_brc_id,'*')  = NVL(g_loaded_recip_non_ed_brc_id,'*')
364      AND   source_id                     = g_file_source_id
365      AND   NVL(source_non_ed_brc_id,'*') = NVL(g_file_source_non_ed_brc_id,'*')
366      AND   send_resp                     = p_send_resp;
367 
368      rec_cur_batch  cur_batch%ROWTYPE;
369 BEGIN
370 
371      -- Fetch the Current School Id
372      gv_debug_str := 'CL_LOAD_FILE - 1' ||' ';
373 
374 
375      gv_debug_str := gv_debug_str || 'CL_LOAD_FILE - 2' ||' ';
376 
377      -- Check if the Header record is present.
378      OPEN cur_Hrecord('CL_ORIG_ACK','@H');
379      FETCH cur_Hrecord INTO Header_rec;
380      IF cur_Hrecord%NOTFOUND THEN
381            CLOSE cur_Hrecord;
382            fnd_message.set_name('IGF','IGF_SL_CL_INVALID_HEADER');
383 -- replace IGF_GE_INVALID_FILE with new one IGF_SL_CL_INVALID_HEADER
384            fnd_file.put_line(fnd_file.log,fnd_message.get);
385            fnd_file.new_line(fnd_file.log,1);
386            RAISE batch_exceptions;
387      END IF;
388      CLOSE cur_Hrecord;
389 
390      gv_debug_str := gv_debug_str || 'CL_LOAD_FILE - 3' ||' ';
391 
392      -- Check if the Trailer Record is present.
393      OPEN cur_Trecord('CL_ORIG_ACK','@T');
394      FETCH cur_Trecord INTO l_trailer;
395      IF cur_Trecord%NOTFOUND THEN
396            CLOSE cur_Trecord;
397            fnd_message.set_name('IGF','IGF_SL_CL_INVALID_TRAILER');
398 -- replace IGF_GE_FILE_NOT_COMPLETE with new one IGF_SL_CL_INVALID_TRAILER
399            fnd_file.put_line(fnd_file.log,fnd_message.get);
400            fnd_file.new_line(fnd_file.log,1);
401            RAISE batch_exceptions;
402      END IF;
403      CLOSE cur_Trecord;
404 
405      -- Check whether it is a Valid CommonLine Response File.
406      gv_debug_str := gv_debug_str || 'CL_LOAD_FILE - 4' ||' ';
407 
408      igf_sl_gen.get_cl_batch_details(
409                       LTRIM(RTRIM(SUBSTR(header_rec.record_data,70,5))) ,   -- File_Ident_Code
410                       LTRIM(RTRIM(SUBSTR(header_rec.record_data,51,19))),   -- File_Ident_Name
411                       g_v_cl_version, p_cl_file_type);
412 
413      gv_debug_str := gv_debug_str || 'CL_LOAD_FILE - 5' ||' ';
414 
415 
416      IF  p_cl_file_type  = 'CL_ORIG_ACK' THEN
417           NULL;
418      ELSE
419        gv_debug_str := gv_debug_str || 'CL_LOAD_FILE - 6' ||' ';
420        fnd_message.set_name('IGF','IGF_SL_CL_INVALID_FILE_TYPE');
421        fnd_file.put_line(fnd_file.log,fnd_message.get);
422        fnd_file.new_line(fnd_file.log,1);
423        RAISE batch_exceptions;
424      END IF;
425 
426      IF g_v_cl_version NOT IN ('RELEASE-5','RELEASE-4') THEN
427         fnd_message.set_name('IGF','IGF_SL_CL_INVALID_CL_VERSION');
428         fnd_message.set_token('RESP_VER',g_v_cl_version);
429         fnd_file.put_line(fnd_file.log, fnd_message.get);
430         RAISE batch_exceptions;
431      END IF;
432 
433 
434      fnd_message.set_name('IGF','IGF_SL_CL_ORIG_ACK');
435      fnd_file.put_line(fnd_file.log, fnd_message.get);
436 
437      g_loaded_batch_id            := LTRIM(RTRIM(SUBSTR(header_rec.record_data, 11,12)));
438      gv_debug_str := gv_debug_str || 'CL_LOAD_FILE - 7' ||' ';
439      l_file_creation_date         := fnd_date.string_to_date(LTRIM(RTRIM(SUBSTR(Header_rec.record_data,23,14))),'YYYYMMDDHH24MISS');
440      gv_debug_str := gv_debug_str || 'CL_LOAD_FILE - 8' ||' ';
441      l_file_trans_date            := fnd_date.string_to_date(LTRIM(RTRIM(SUBSTR(Header_rec.record_data,37,14))),'YYYYMMDDHH24MISS');
442      gv_debug_str := gv_debug_str || 'CL_LOAD_FILE - 8a' ||' ';
443      g_loaded_file_ident_code     := LTRIM(RTRIM(SUBSTR(Header_rec.record_data,70,5)));
444      g_loaded_recipient_id        := LTRIM(RTRIM(SUBSTR(header_rec.record_data,107,8)));
445      g_loaded_recip_non_ed_brc_id := LTRIM(RTRIM(SUBSTR(header_rec.record_data,117,4)));
446      g_file_source_id             := LTRIM(RTRIM(SUBSTR(header_rec.record_data,154,8)));
447      g_file_source_non_ed_brc_id  := LTRIM(RTRIM(SUBSTR(header_rec.record_data,164,4)));
448      gv_debug_str := gv_debug_str || 'CL_LOAD_FILE - 8b' ||' ';
449       -- To fetch the Batch Id satisfying the above values taken as substrings
450 
451      OPEN cur_batch('R');
452      FETCH cur_batch INTO rec_cur_batch;
453      IF cur_batch%NOTFOUND THEN
454      gv_debug_str := gv_debug_str || 'CL_LOAD_FILE - 9' ||' ';
455         l_row_id  := NULL;
456         igf_sl_cl_batch_pkg.insert_row (
457                      x_mode                              => 'R',
458                      x_rowid                             => l_row_id,
459                      x_cbth_id                           => g_cbth_id, -- generated by sequence
460                      x_batch_id                          => g_loaded_batch_id,
461                      x_file_creation_date                => l_file_creation_date,
462                      x_file_trans_date                   => l_file_trans_date,
463                      x_file_ident_code                   => g_loaded_file_ident_code,
464                      x_recipient_id                      => g_loaded_recipient_id,
465                      x_recip_non_ed_brc_id               => g_loaded_recip_non_ed_brc_id,
466                      x_source_id                         => g_file_source_id,
467                      x_source_non_ed_brc_id              => g_file_source_non_ed_brc_id,
468                      x_send_resp                         => 'R',
469                      x_record_count_num                  =>  NULL                          ,
470                      x_total_net_disb_amt                =>  NULL                          ,
471                      x_total_net_eft_amt                 =>  NULL                          ,
472                      x_total_net_non_eft_amt             =>  NULL                          ,
473                      x_total_reissue_amt                 =>  NULL                          ,
474                      x_total_cancel_amt                  =>  NULL                          ,
475                      x_total_deficit_amt                 =>  NULL                          ,
476                      x_total_net_cancel_amt              =>  NULL                          ,
477                      x_total_net_out_cancel_amt          =>  NULL
478                           );
479 
480      ELSE
481      gv_debug_str := gv_debug_str || 'CL_LOAD_FILE - 9 Upd' ||' ';
482      --
483      -- update the batch record with new information
484      --
485         l_n_cbth_id  := rec_cur_batch.cbth_id;
486         l_row_id     := rec_cur_batch.row_id ;
487         l_batch_id   := rec_cur_batch.batch_id;
488         g_cbth_id := l_n_cbth_id;
489         igf_sl_cl_batch_pkg.update_row (
490           x_mode                              =>  'R',
491           x_rowid                             =>  l_row_id,
492           x_cbth_id                           =>  l_n_cbth_id,
493           x_batch_id                          =>  g_loaded_batch_id,
494           x_file_creation_date                =>  l_file_creation_date,
495           x_file_trans_date                   =>  l_file_trans_date,
496           x_file_ident_code                   =>  g_loaded_file_ident_code,
497           x_recipient_id                      =>  g_loaded_recipient_id,
498           x_recip_non_ed_brc_id               =>  g_loaded_recip_non_ed_brc_id,
499           x_source_id                         =>  g_file_source_id,
500           x_source_non_ed_brc_id              =>  g_file_source_non_ed_brc_id,
501           x_send_resp                         =>  'R',
502           x_record_count_num                  =>  rec_cur_batch.record_count_num      ,
503           x_total_net_disb_amt                =>  rec_cur_batch.total_net_disb_amt    ,
504           x_total_net_eft_amt                 =>  rec_cur_batch.total_net_eft_amt     ,
505           x_total_net_non_eft_amt             =>  rec_cur_batch.total_net_non_eft_amt ,
506           x_total_reissue_amt                 =>  rec_cur_batch.total_reissue_amt     ,
507           x_total_cancel_amt                  =>  rec_cur_batch.total_cancel_amt      ,
508           x_total_deficit_amt                 =>  rec_cur_batch.total_deficit_amt     ,
509           x_total_net_cancel_amt              =>  rec_cur_batch.total_net_cancel_amt  ,
510           x_total_net_out_cancel_amt          =>  rec_cur_batch.total_net_out_cancel_amt
511         );
512 
513      END IF;
514      CLOSE cur_batch;
515 
516      fnd_file.new_line(fnd_file.log,1);
517 
518      -- Call Procedure to Process all the Transaction Records
519 
520      gv_debug_str := gv_debug_str || 'CL_LOAD_FILE - 10' ||' ';
521      IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
522        fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.cl_load_file.debug',gv_debug_str);
523      END IF;
524      gv_debug_str := '';
525      process_1_records;
526      gv_debug_str := gv_debug_str || 'CL_LOAD_FILE - 11' ||' ';
527 
528 
529 EXCEPTION
530 
531  WHEN batch_exceptions THEN
532       IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
533          fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.cl_load_file.debug',gv_debug_str);
534       END IF;
535       RAISE;
536  WHEN app_exception.record_lock_exception THEN
537      IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
538         fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.cl_load_file.debug',gv_debug_str || ' Lock ');
539      END IF;
540      RAISE;
541  WHEN OTHERS THEN
542 
543      fnd_message.set_name('IGF','IGF_GE_UNHANDLED_EXP');
544      fnd_message.set_token('NAME','IGF_SL_CL_ORIG_ACK.CL_LOAD_FILE');
545      IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
546        fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.cl_load_file.exception',gv_debug_str||' '|| SQLERRM);
547      END IF;
548      gv_debug_str := '';
549      igs_ge_msg_stack.add;
550      app_exception.raise_exception;
551 
552 END cl_load_file;
553 
554 
555 
556 PROCEDURE  process_1_records
557 AS
558 /***************************************************************
559    Created By       :    mesriniv
560    Date Created By  :    2000/12/07
561    Purpose          :    To Call Respective procedures which
562                     will insert the format file(@1 and @8) data into
563                     the tables IGF_SL_CL_RESP_R1 and IGF_SL_CL_RESP_R8
564                     tables correspondingly.
565    Known Limitations,Enhancements or Remarks
566    Change History   :
567    Who              When      What
568  ***************************************************************/
569 
570   l_loan_active                   igf_sl_loans_all.active%TYPE;
571   l_resp_record_status            igf_sl_cl_resp_r1_all.resp_record_status%TYPE;
572 
573   -- To select all the @1 Records from the Load Table
574   CURSOR cur_1records (p_file_type  igf_sl_load_file_t.file_type%TYPE,
575                           p_record_data  igf_sl_load_file_t.record_data%TYPE)
576   IS
577   SELECT * FROM   igf_sl_load_file_t
578   WHERE  SUBSTR(record_data,1,2)= p_record_data
579       AND    file_type= p_file_type
580       ORDER  BY lort_id;
581 
582    CURSOR  c_loan IS
583    SELECT  active
584           ,loan_id
585           ,award_id
586    FROM   igf_sl_loans_all
587    WHERE  NVL(external_loan_id_txt,loan_number) = l_loan_number;
588 
589    rec_c_loan c_loan%ROWTYPE;
590 
591   CURSOR c_igf_sl_lor (cp_v_loan_number igf_sl_loans_all.loan_number%TYPE) IS
592   SELECT lor.rec_type_ind
593   FROM   igf_sl_lor_all lor,
594          igf_sl_loans_all loan
595   WHERE  loan.loan_id     = lor.loan_id   AND
596          NVL(loan.external_loan_id_txt,loan.loan_number) = cp_v_loan_number;
597 
598   rec_c_igf_sl_lor c_igf_sl_lor%ROWTYPE;
599 
600 -- bug# 5045781
601   CURSOR  c_igf_aw_award_v (cp_n_award_id igf_aw_award_all.award_id%TYPE) IS
602     SELECT fmast.ci_cal_type ci_cal_type,
603            fmast.ci_sequence_number ci_sequence_number,
604            ci.alternate_code ci_alternate_code,
605            ci.start_dt ci_start_dt,
606            ci.end_dt ci_end_dt,
607            fcat.fed_fund_code fed_fund_code,
608            fcat.sys_fund_type sys_fund_type,
609            facon.person_id person_id,
610            pe.party_number person_number,
611            pit.api_person_id ssn,
612            pe.person_last_name || ',' || pe.person_first_name full_name,
613            awd.accepted_amt accepted_amt
614       FROM igf_aw_award_all awd,
615            igf_aw_fund_mast_all fmast,
616            igf_aw_fund_cat_all fcat,
617            igs_ca_inst ci,
618            igf_ap_fa_base_rec facon,
619            (SELECT api_person_id,
620                    pe_person_id
621               FROM igs_pe_person_id_typ pit_2,
622                    igs_pe_alt_pers_id api_2
623              WHERE api_2.person_id_type = pit_2.person_id_type
624                AND pit_2.s_person_id_type = 'SSN'
625                AND SYSDATE BETWEEN api_2.start_dt AND NVL (api_2.end_dt,SYSDATE)) pit,
626            hz_parties pe
627      WHERE fmast.fund_code = fcat.fund_code
628        AND fmast.ci_cal_type = ci.cal_type
629        AND fmast.ci_sequence_number = ci.sequence_number
630        AND awd.base_id = facon.base_id
631        AND pe.party_id = facon.person_id
632        AND pe.party_id = pit.pe_person_id(+)
633        AND fmast.fund_id = awd.fund_id
634        AND awd.award_id = cp_n_award_id;
635 
636 
637   rec_c_igf_aw_award_v  c_igf_aw_award_v%ROWTYPE;
638 
639   l_v_cl_file_type              igf_sl_cl_file_type.cl_file_type%TYPE;
640   e_skip                        EXCEPTION;
641   rec_scr_sl_resp               igf_sl_cl_resp_r1_all%ROWTYPE;
642   l_v_rec_type_ind              igf_sl_lor_all.rec_type_ind%TYPE;
643   l_n_award_id                  igf_aw_award_all.award_id%TYPE;
644   l_n_resp_guarantee_amt        igf_sl_cl_resp_r1_all.guarantee_amt%TYPE;
645   l_n_resp_fls_approved_amt     igf_sl_cl_resp_r1_all.fls_approved_amt%TYPE;
646   l_n_resp_flu_approved_amt     igf_sl_cl_resp_r1_all.flu_approved_amt%TYPE;
647   l_n_resp_flp_approved_amt     igf_sl_cl_resp_r1_all.flp_approved_amt%TYPE;
648   l_n_resp_alt_approved_amt     igf_sl_cl_resp_r1_all.alt_approved_amt%TYPE;
649   l_n_resp_actual_approved_amt  igf_sl_cl_resp_r1_all.alt_approved_amt%TYPE;
650   l_d_loan_per_begin_date       igf_sl_cl_resp_r1_all.loan_per_begin_date%TYPE;
651   l_d_loan_per_end_date         igf_sl_cl_resp_r1_all.loan_per_end_date%TYPE;
652   lv_resp_prc_type              VARCHAR2(30);
653   lv_resp_rec_type              VARCHAR2(30);
654   lv_sys_loan_version           VARCHAR2(30);
655   lv_fed_appl_form_code         VARCHAR2(30);
656   lv_loan_type                  VARCHAR2(30);
657 BEGIN
658   --
659   -- Important :
660   -- As the records like @8 etc follow the @1 record, and as @8 records
661   -- do not have the Loan Number to indicate that they belong to this Loan-Number,
662   -- We need to process so as to upload @8 records following @1 are for this
663   -- Loan Number, until the Next @1 record is encountered.
664   --
665   OPEN cur_1records('CL_ORIG_ACK','@1');
666   LOOP
667     BEGIN
668       gv_debug_str := 'PROCESS_1_RECORDS - 1'  ||' ';
669       FETCH cur_1records INTO Format_1_rec_temp;
670       Format_1_rec := Format_1_rec_temp;
671       IF cur_1records%NOTFOUND THEN
672         EXIT;
673       END IF;
674       l_loan_number    := NULL;
675       lv_resp_prc_type := NULL;
676       lv_resp_rec_type := NULL;
677 --MN 20-Dec-2004 11:57:05 - Initialize the flag in loop instead of outside the loop.
678 --This will be used for later processing of Successful r1 records.
679       l_resp_record_status := 'N';
680 
681       l_loan_number    := SUBSTR(Format_1_rec.record_data,208,17);
682       lv_resp_rec_type := LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,3,1)));
683       lv_resp_prc_type := LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,962,2)));
684 
685       gv_debug_str     := gv_debug_str || 'PROCESS_1_RECORDS - 2' ||' ';
686       l_loan_active    := NULL;
687 
688       fnd_file.new_line(fnd_file.log,1);
689       fnd_file.put(fnd_file.log,RPAD(igf_aw_gen.lookup_desc('IGF_GE_PARAMETERS','PROCESSING'),40));
690       fnd_file.new_line(fnd_file.log,1);
691 
692       log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_GE_PARAMETERS','CL_VERSION'),40),
693                        p_v_param_val => igf_aw_gen.lookup_desc('IGF_SL_CL_VERSION',g_v_cl_version)
694                      );
695       log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_GE_PARAMETERS','LOAN_NUMBER'),40),
696                        p_v_param_val => l_loan_number
697                      );
698       log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_SL_CL_CHANGE_FIELDS','AWARD_AMOUNT'),40),
699                        p_v_param_val => LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,190,6)))
700                      );
701       log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_SL_CL_ROSTER_LOGS','RECORD_TYPE'),40),
702                        p_v_param_val => igf_aw_gen.lookup_desc('IGF_SL_CL4_REC_ST_CODES',lv_resp_rec_type)
703                      );
704       log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_GE_PARAMETERS','PROCESSING_TYPE'),40),
705                        p_v_param_val => igf_aw_gen.lookup_desc('IGF_SL_PRC_TYPE_CODE',lv_resp_prc_type)
706                      );
707       IF g_v_cl_version  = 'RELEASE-5' THEN
708       log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','GUARNT_STATUS_CODE'),40),
709                        p_v_param_val => igf_aw_gen.lookup_desc('IGF_SL_GUARNT_STATUS',LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,992,2))))
710                      );
711       log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','LEND_STATUS_CODE'),40),
712                        p_v_param_val => igf_aw_gen.lookup_desc('IGF_SL_LEND_STATUS',LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,994,2))))
713                      );
714       log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','PNOTE_STATUS'),40),
715                        p_v_param_val => igf_aw_gen.lookup_desc('IGF_SL_PNOTE_STATUS',LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,996,2))))
716                      );
717       log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_GE_PARAMETERS','CREDIT_OVERRIDE'),40),
718                        p_v_param_val => igf_aw_gen.lookup_desc('IGF_SL_CREDIT_OVERRIDE',LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,998,2))))
719                      );
720       ELSIF g_v_cl_version  = 'RELEASE-4' THEN
721       log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','CL_REC_STATUS'),40),
722                        p_v_param_val => igf_aw_gen.lookup_desc('IGF_SL_CL4_REC_ST_CODES',lv_resp_rec_type)
723                      );
724       log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','APPL_LOAN_PHASE_CODE'),40),
725                        p_v_param_val => igf_aw_gen.lookup_desc('IGF_SL_CL_APP_PHASE_CODES',LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,864,4))))
726                      );
727       END IF;
728       -- new message
729       -- if processing type is not CR then only check for loan existing in system
730       --
731       fnd_file.new_line(fnd_file.log,2);
732       OPEN  c_loan;
733       FETCH c_loan INTO rec_c_loan;
734       l_loan_active := rec_c_loan.active;
735       l_n_award_id  := rec_c_loan.award_id;
736       IF c_loan%NOTFOUND THEN
737         l_n_award_id := -1;
738         CLOSE c_loan;
739         l_resp_record_status := 'I';
740         --
741         -- Loan Number not found in the System
742         --
743         fnd_file.new_line(fnd_file.log,1);
744         fnd_message.set_name('IGF','IGF_SL_CL_INS_RESP_REC');
745         fnd_message.set_token('LOAN_NUMBER', l_loan_number);
746         fnd_file.put_line(fnd_file.log,fnd_message.get);
747         gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - 3' ||' ';
748         fnd_message.set_name('IGF','IGF_SL_NO_LOAN_NUMBER');
749         fnd_message.set_token('LOAN_NUMBER',l_loan_number);
750         fnd_file.put_line(fnd_file.log,fnd_message.get);
751         fnd_file.new_line(fnd_file.log,1);
752         log_to_fnd(p_v_module => 'process_1_records',
753                    p_v_string => ' Loan number '||l_loan_number||' not found in the system '||
754                                  ' Processing Type ' ||igf_aw_gen.lookup_desc('IGF_SL_PRC_TYPE_CODE',lv_resp_prc_type)
755                   );
756         IF  lv_resp_prc_type <> 'CR' THEN
757           RAISE e_skip;
758         END IF;
759       END IF;
760       IF c_loan%ISOPEN THEN
761         CLOSE c_loan;
762       END IF;
763 
764       IF g_v_cl_version IN ('RELEASE-5','RELEASE-4') THEN
765         lv_sys_loan_version := '-1';
766         lv_sys_loan_version := igf_sl_award.get_loan_cl_version(p_n_award_id => l_n_award_id);
767         IF lv_sys_loan_version <> g_v_cl_version THEN
768           l_resp_record_status := 'M';
769           fnd_message.set_name('IGF','IGF_SL_CL_DIFF_VERSION_PRC');
770           fnd_message.set_token('RESP_VER',g_v_cl_version);
771           fnd_message.set_token('SYS_LOAN_VER',lv_sys_loan_version);
772           fnd_file.put_line(fnd_file.log, fnd_message.get);
773           RAISE e_skip;
774         END IF;
775       END IF;
776 
777       gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - 4' ||' ';
778 
779       IF l_loan_active = 'N' THEN
780         gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - 7' ||' ';
781         l_resp_record_status := 'I'; -- inactive loan
782         fnd_message.set_name('IGF','IGF_SL_CL_LOAN_INACTIVE');
783         fnd_message.set_token('LOAN_NUMBER',l_loan_number);
784         fnd_file.put_line(fnd_file.log, fnd_message.get);
785         RAISE e_skip;
786       END IF;
787 
788       IF lv_resp_prc_type NOT IN ('GP','CR','GO') THEN
789         l_resp_record_status := 'IP';
790         gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - 4 invalid prc type' ||' ';
791         fnd_message.set_name('IGF','IGF_SL_CL_RESP_INVLID_PRC');
792         fnd_file.put_line(fnd_file.log, fnd_message.get);
793         RAISE e_skip;
794       END IF;
795 
796       -- bvisvana - FA 161 - Bug # 5006583
797       lv_fed_appl_form_code := LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,510,1)));
798       lv_loan_type          := LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,188,2)));
799       IF ((lv_loan_type = 'PL' AND NVL(lv_fed_appl_form_code,'*') <> 'Q') OR
800           (lv_loan_type IN ('CS','SF','SU') AND NVL(lv_fed_appl_form_code,'*') <> 'M') OR
801           (lv_loan_type = 'AL' AND lv_fed_appl_form_code IS NOT NULL) OR
802 	  (lv_loan_type = 'GB' AND NVL(lv_fed_appl_form_code,'*') <> 'G')
803          ) THEN
804         l_resp_record_status := 'IA';
805         gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - invalid fed appl form code' ||' ';
806         fnd_file.put_line(fnd_file.log, igf_aw_gen.lookup_desc('IGF_SL_CL_ACK_REC_STATUS','IA'));
807         RAISE e_skip;
808       END IF;
809 
810       OPEN  c_igf_sl_lor (cp_v_loan_number => l_loan_number);
811       FETCH c_igf_sl_lor  INTO rec_c_igf_sl_lor;
812       CLOSE c_igf_sl_lor;
813 
814       l_v_rec_type_ind := rec_c_igf_sl_lor.rec_type_ind;
815       gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - 4 send rec type ' ||l_v_rec_type_ind ||' ';
816       log_to_fnd(p_v_module => 'process_1_records',
817                  p_v_string => 'cl_version       : '||g_v_cl_version ||
818                                'Send Record Type : '||l_v_rec_type_ind
819                 );
820       gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - after 4 send rec type ';
821       -- The response record processing is limited to following Record Types -
822       -- Release 5 -
823       -- M = Modification responses after the first notification of guarantee
824       -- N = Response to reprint request
825       -- R = Change Transaction Send response
826       -- S = Application responses up to and including the first notification of guarantee and pre-approval credit request responses
827       IF g_v_cl_version = 'RELEASE-4' THEN
828 
829         gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - cl version is 4 lv_resp_rec_type - ' || lv_resp_rec_type
830                         || ' - lv_resp_prc_type - ' || lv_resp_prc_type || ' ';
831         IF lv_resp_rec_type NOT IN ('A','I','G','B','P','D','C','M','N','R','T') THEN
832           l_resp_record_status := 'IR';
833           fnd_message.set_name('IGF','IGF_SL_CL_RESP_INVLID_PRC');
834           fnd_file.put_line(fnd_file.log, fnd_message.get);
835           RAISE e_skip;
836         END IF;
837 
838         IF lv_resp_prc_type IN ('GP','GO') THEN
839           --
840           -- do these checks only if this field is record type, for status values
841           -- these checks would not be done
842           --
843           IF lv_resp_rec_type IN ('C','M','N','R','T') THEN
844             IF lv_resp_prc_type = 'GP' THEN
845               IF ((l_v_rec_type_ind = 'R' AND lv_resp_rec_type <> 'N') OR
846                   (l_v_rec_type_ind <> 'R' AND lv_resp_rec_type = 'N')
847                    )THEN
848                 l_resp_record_status := 'IC';
849                 fnd_message.set_name('IGF','IGF_SL_CL_INV_COMB_PT_RC');
850                 fnd_file.put_line(fnd_file.log, fnd_message.get);
851                 RAISE e_skip;
852               END IF;
853             END IF;
854             gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - not reprint ';
855             IF l_v_rec_type_ind IN ('A','C') AND
856                lv_resp_rec_type NOT IN ('R','M') THEN
857               l_resp_record_status := 'IC';
858               fnd_message.set_name('IGF','IGF_SL_CL_INV_COMB_PT_RC');
859               fnd_file.put_line(fnd_file.log, fnd_message.get);
860               RAISE e_skip;
861             END IF;
862             gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - not M,R ';
863             IF l_v_rec_type_ind NOT IN ('A','C') AND
864                lv_resp_rec_type IN ('R','M') THEN
865               l_resp_record_status := 'IC';
866               fnd_message.set_name('IGF','IGF_SL_CL_INV_COMB_PT_RC');
867               fnd_file.put_line(fnd_file.log, fnd_message.get);
868               RAISE e_skip;
869             END IF;
870             gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - not A,C ';
871             IF l_v_rec_type_ind = 'T' AND
872                lv_resp_rec_type <> 'T' THEN
873               l_resp_record_status := 'IC';
874               fnd_message.set_name('IGF','IGF_SL_CL_INV_COMB_PT_RC');
875               fnd_file.put_line(fnd_file.log, fnd_message.get);
876               RAISE e_skip;
877             END IF;
878             gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - not T ';
879             IF l_v_rec_type_ind <> 'T' AND
880                lv_resp_rec_type = 'T' THEN
881               l_resp_record_status := 'IC';
882               fnd_message.set_name('IGF','IGF_SL_CL_INV_COMB_PT_RC');
883               fnd_file.put_line(fnd_file.log, fnd_message.get);
884               RAISE e_skip;
885             END IF;
886           END IF; -- rec type values
887         END IF; -- GO,GP
888 
889       ELSIF g_v_cl_version = 'RELEASE-5' THEN
890         gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - Release 5 not T ';
891         IF lv_resp_rec_type NOT IN ('M','N','R','S','C') THEN
892           l_resp_record_status := 'IR';
893           fnd_message.set_name('IGF','IGF_SL_CL_RESP_INVLID_PRC');
894           fnd_file.put_line(fnd_file.log, fnd_message.get);
895           RAISE e_skip;
896         END IF;
897         gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - Release 5 1 ';
898         IF lv_resp_prc_type IN ('GP','GO') THEN
899           IF lv_resp_prc_type = 'GP' THEN
900             IF ((l_v_rec_type_ind = 'R' AND lv_resp_rec_type <> 'N') OR
901                 (l_v_rec_type_ind <> 'R' AND lv_resp_rec_type = 'N')
902                  )THEN
903               l_resp_record_status := 'IC';
904               fnd_message.set_name('IGF','IGF_SL_CL_INV_COMB_PT_RC');
905               fnd_file.put_line(fnd_file.log, fnd_message.get);
906               RAISE e_skip;
907             END IF;
908           END IF;
909           gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - Release 5 2 ';
910           IF l_v_rec_type_ind IN ('A','C','T') AND
911              lv_resp_rec_type NOT IN ('S','R','M') THEN
912             l_resp_record_status := 'IC';
913             fnd_message.set_name('IGF','IGF_SL_CL_INV_COMB_PT_RC');
914             fnd_file.put_line(fnd_file.log, fnd_message.get);
915             RAISE e_skip;
916           END IF;
917           gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - Release 5 3 ';
918           IF l_v_rec_type_ind NOT IN ('A','C','T') AND
919              lv_resp_rec_type IN ('S','R','M') THEN
920             l_resp_record_status := 'IC';
921             fnd_message.set_name('IGF','IGF_SL_CL_INV_COMB_PT_RC');
922             fnd_file.put_line(fnd_file.log, fnd_message.get);
923             RAISE e_skip;
924           END IF;
925           gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - Release 5 4 ';
926           IF l_v_rec_type_ind = 'T' AND
927              lv_resp_rec_type <> 'S' THEN
928             l_resp_record_status := 'IC';
929             fnd_message.set_name('IGF','IGF_SL_CL_INV_COMB_PT_RC');
930             fnd_file.put_line(fnd_file.log, fnd_message.get);
931             RAISE e_skip;
932           END IF;
933           --Bug 4093687 UNABLE TO UPLOAD ORIGINATION ACKNOWLEGMENT FOR CL5
934           gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - Release 5 5 ';
935           /*IF l_v_rec_type_ind <> 'T' AND
936              lv_resp_rec_type = 'S' THEN
937             l_resp_record_status := 'IC';
938             fnd_message.set_name('IGF','IGF_SL_CL_INV_COMB_PT_RC');
939             fnd_file.put_line(fnd_file.log, fnd_message.get);
940             RAISE e_skip;
941           END IF;
942           */
943           gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - Release 5 6 ';
944         END IF;
945         gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - Release 5 7 ';
946       END IF;
947 
948       -- Person Records for Borrower and Student would be created and
949       -- relation based on the information that is contained in the School Certification Request
950       IF l_n_award_id = -1  AND lv_resp_prc_type = 'CR' THEN
951         gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - CR Processing 1 ';
952         log_to_fnd(p_v_module => 'process_1_records',
953                    p_v_string => ' School Certification Request information'
954                   );
955         rec_scr_sl_resp.b_last_name             :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,12,35)));
956         rec_scr_sl_resp.b_first_name            :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,47,12)));
957         rec_scr_sl_resp.b_middle_name           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,59,1)));
958         rec_scr_sl_resp.b_ssn                   :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,60,9))));
959         rec_scr_sl_resp.b_permt_addr1           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,69,30)));
960         rec_scr_sl_resp.b_permt_addr2           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,99,30)));
961         rec_scr_sl_resp.b_permt_city            :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,129,24)));
962         rec_scr_sl_resp.b_permt_state           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,159,2)));
963         rec_scr_sl_resp.b_permt_zip             :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,161,5))));
964         rec_scr_sl_resp.b_permt_zip_suffix      :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,166,4))));
965         rec_scr_sl_resp.b_permt_phone           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,170,10)));
966         rec_scr_sl_resp.b_date_of_birth         :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,180,8),'YYYYMMDD');
967         rec_scr_sl_resp.cl_loan_type            :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,188,2)));
968         rec_scr_sl_resp.req_loan_amt            :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,190,6))));
969         rec_scr_sl_resp.defer_req_code          :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,196,1)));
970         rec_scr_sl_resp.borw_interest_ind       :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,197,1)));
971         rec_scr_sl_resp.eft_auth_code           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,198,1)));
972         rec_scr_sl_resp.b_signature_code        :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,199,1)));
973         rec_scr_sl_resp.b_signature_date        :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,200,8),'YYYYMMDD');
974         rec_scr_sl_resp.loan_number             :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,208,17)));
975         rec_scr_sl_resp.b_citizenship_status    :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,228,1)));
976         rec_scr_sl_resp.b_state_of_legal_res    :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,229,2)));
977         rec_scr_sl_resp.b_legal_res_date        :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,231,6)||'01','YYYYMMDD');
978         rec_scr_sl_resp.b_default_status        :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,237,1)));
979         rec_scr_sl_resp.b_outstd_loan_code      :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,238,1)));
980         rec_scr_sl_resp.b_indicator_code        :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,239,1)));
981         rec_scr_sl_resp.s_last_name             :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,259,35)));
982         rec_scr_sl_resp.s_first_name            :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,294,12)));
983         rec_scr_sl_resp.s_middle_name           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,306,1)));
984         rec_scr_sl_resp.s_ssn                   :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,307,9))));
985         rec_scr_sl_resp.s_date_of_birth         :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,316,8),'YYYYMMDD');
986         rec_scr_sl_resp.s_citizenship_status    :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,324,1)));
987         rec_scr_sl_resp.s_default_code          :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,325,1)));
988         rec_scr_sl_resp.s_signature_code        :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,326,1)));
989         rec_scr_sl_resp.school_id               :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,347,8))));
990         rec_scr_sl_resp.loan_per_begin_date     :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,357,8),'YYYYMMDD');
991         rec_scr_sl_resp.loan_per_end_date       :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,365,8),'YYYYMMDD');
992         rec_scr_sl_resp.alt_appl_ver_code       :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,443,4))));
993         rec_scr_sl_resp.lender_id               :=  SUBSTR(Format_1_rec.record_data,458,6);
994         rec_scr_sl_resp.guarantor_id            :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,507,3)));
995         rec_scr_sl_resp.fed_appl_form_code      :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,510,1)));
996         rec_scr_sl_resp.b_license_state         :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,715,2)));
997         rec_scr_sl_resp.b_license_number        :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,717,20)));
998         rec_scr_sl_resp.b_ref_code              :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,737,1)));
999         rec_scr_sl_resp.pnote_delivery_code     :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,765,1)));
1000         rec_scr_sl_resp.b_foreign_postal_code   :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,766,14)));
1001         rec_scr_sl_resp.lend_non_ed_brc_id      :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,781,4)));
1002         rec_scr_sl_resp.lender_use_txt          :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,785,20)));
1003         rec_scr_sl_resp.guarantor_use_txt       :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,876,23)));
1004         rec_scr_sl_resp.b_permt_addr_chg_date   :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,899,8),'YYYYMMDD');
1005         rec_scr_sl_resp.alt_prog_type_code      :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,907,3)));
1006         rec_scr_sl_resp.prc_type_code           :=  lv_resp_prc_type;
1007         -- bvisvana - FA 161 - Bug # 5006583
1008         rec_scr_sl_resp.esign_src_typ_cd             :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,449,9)));
1009         rec_scr_sl_resp.b_alien_reg_num_txt          :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,240,19)));
1010 
1011         gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - CR Processing 2 ';
1012         IF g_v_cl_version = 'RELEASE-4' THEN
1013           gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - CR Processing Release 4 3';
1014           rec_scr_sl_resp.mpn_confirm_ind         :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,694,1)));
1015           rec_scr_sl_resp.guarnt_status_code      :=  NULL;
1016           rec_scr_sl_resp.lender_status_code      :=  NULL;
1017           rec_scr_sl_resp.pnote_status_code       :=  NULL;
1018           rec_scr_sl_resp.credit_status_code      :=  NULL;
1019           rec_scr_sl_resp.guarnt_status_date      :=  NULL;
1020           rec_scr_sl_resp.lender_status_date      :=  NULL;
1021           rec_scr_sl_resp.pnote_status_date       :=  NULL;
1022           rec_scr_sl_resp.credit_status_date      :=  NULL;
1023           rec_scr_sl_resp.act_serial_loan_code    :=  NULL;
1024           rec_scr_sl_resp.sch_non_ed_brc_id       :=  NULL;
1025           rec_scr_sl_resp.borr_credit_auth_code   :=  NULL;
1026           rec_scr_sl_resp.borr_sign_ind           :=  NULL;
1027           rec_scr_sl_resp.stud_sign_ind           :=  NULL;
1028           gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - CR Processing Release 4 4';
1029         ELSIF g_v_cl_version = 'RELEASE-5' THEN
1030           gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - CR Processing Release 5 5';
1031           rec_scr_sl_resp.guarnt_status_code      :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,992,2)));
1032           rec_scr_sl_resp.lender_status_code      :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,994,2)));
1033           rec_scr_sl_resp.pnote_status_code       :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,996,2)));
1034           rec_scr_sl_resp.credit_status_code      :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,998,2)));
1035           rec_scr_sl_resp.guarnt_status_date      :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,1000,14),'YYYYMMDDHH24MISS');
1036           rec_scr_sl_resp.lender_status_date      :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,1014,14),'YYYYMMDDHH24MISS');
1037           rec_scr_sl_resp.pnote_status_date       :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,1028,14),'YYYYMMDDHH24MISS');
1038           rec_scr_sl_resp.credit_status_date      :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,1042,14),'YYYYMMDDHH24MISS');
1039           rec_scr_sl_resp.act_serial_loan_code    :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,1056,1)));
1040           rec_scr_sl_resp.sch_non_ed_brc_id       :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,1090,4)));
1041           rec_scr_sl_resp.mpn_confirm_ind         :=  NULL;
1042           rec_scr_sl_resp.borr_credit_auth_code   :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,227,1)));
1043           rec_scr_sl_resp.borr_sign_ind           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,374,1)));
1044           rec_scr_sl_resp.stud_sign_ind           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,780,1)));
1045           gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - CR Processing Release 5 6';
1046         END IF;
1047         gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - CR Processing 7';
1048         -- invoke the procedure process_borrow_stud_rec to process borrower and student data in the response record
1049         log_to_fnd(p_v_module => 'process_1_records',
1050                    p_v_string => ' School Certification Request information - processing borrower student data'
1051                   );
1052         gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - CR Processing 8';
1053         process_borrow_stud_rec (p_rec_resp_r1   => rec_scr_sl_resp);
1054         fnd_file.new_line(fnd_file.log,1);
1055         gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - CR Processing 9';
1056         log_to_fnd(p_v_module => 'process_1_records',
1057                    p_v_string => ' School Certification Request information - processed borrower student data'
1058                   );
1059         gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - CR Processing 10';
1060       END IF; -- end if for CR
1061       --If the Response Guarantee Amount is different, it is possible that
1062       --the Response Disbursement Details also are different from system
1063       --If the Response Guarantee Amount is different from award accepted amount
1064       --raise the business event
1065       IF l_n_award_id <> -1 THEN
1066 
1067         --
1068         -- Raise this event only for final statuses
1069         --
1070         IF ( g_v_cl_version = 'RELEASE-4' AND lv_resp_rec_type IN ('B','G','D','P') ) OR  --MN 11-Jan-2005 earlier it was with l_v_rec_type_ind
1071            ( g_v_cl_version = 'RELEASE-5' AND TRIM(SUBSTR(Format_1_rec.record_data,992,2)) IN ('40', '30', '25') )
1072         THEN
1073 
1074           OPEN  c_igf_aw_award_v (cp_n_award_id => l_n_award_id);
1075           FETCH c_igf_aw_award_v INTO rec_c_igf_aw_award_v ;
1076           CLOSE c_igf_aw_award_v;
1077           gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - GaMt Diff 1';
1078           l_n_resp_guarantee_amt   := TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,688,5))));
1079           l_n_resp_fls_approved_amt    :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,464,5))));
1080           l_n_resp_flu_approved_amt    :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,469,5))));
1081           l_n_resp_flp_approved_amt    :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,474,5))));
1082           l_n_resp_alt_approved_amt    :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,488,5))));
1083           l_d_loan_per_begin_date  := fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,357,8),'YYYYMMDD');
1084           l_d_loan_per_end_date    := fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,365,8),'YYYYMMDD');
1085           --MN 11-Jan-2005 Get Actual Approved Amount based on fed und code and validate that against the Award Accepted Amount
1086           IF    NVL(rec_c_igf_aw_award_v.fed_fund_code, '*') = 'FLS' THEN
1087               l_n_resp_actual_approved_amt := l_n_resp_fls_approved_amt;
1088           ELSIF NVL(rec_c_igf_aw_award_v.fed_fund_code, '*') = 'FLU' THEN
1089               l_n_resp_actual_approved_amt := l_n_resp_flu_approved_amt;
1090           ELSIF NVL(rec_c_igf_aw_award_v.fed_fund_code, '*') IN ('FLP','GPLUSFL') THEN
1091               l_n_resp_actual_approved_amt := l_n_resp_flp_approved_amt;
1092           ELSIF NVL(rec_c_igf_aw_award_v.fed_fund_code, '*') = 'ALT' THEN
1093               l_n_resp_actual_approved_amt := l_n_resp_alt_approved_amt;
1094           END IF;
1095 
1096           IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
1097             fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.process_1_records.AmountComparison',
1098                               '|Fed Fund Type     - ' || NVL(rec_c_igf_aw_award_v.fed_fund_code, '*') ||
1099                               '|Guaranteed Amount - ' || l_n_resp_guarantee_amt ||
1100                               '|Approved Amount   - ' || l_n_resp_actual_approved_amt ||
1101                               '|Accepted Amount   - ' || rec_c_igf_aw_award_v.accepted_amt ||
1102                               '|g_v_cl_version    - ' || g_v_cl_version ||
1103                               '|l_v_rec_type_ind  - ' || l_v_rec_type_ind);
1104           END IF;
1105           gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - GaMt Diff 2';
1106           IF  NVL(l_n_resp_guarantee_amt,0) <> NVL(rec_c_igf_aw_award_v.accepted_amt,0) OR
1107               NVL(l_n_resp_actual_approved_amt, 0) <> NVL(rec_c_igf_aw_award_v.accepted_amt,0)
1108           THEN
1109             gv_debug_str := gv_debug_str || 'PROCESS_1_RECORDS - GaMt Diff 3';
1110             raise_gamt_event (
1111               p_v_ci_alternate_code   => rec_c_igf_aw_award_v.ci_alternate_code,
1112               p_d_ci_start_dt         => rec_c_igf_aw_award_v.ci_start_dt,
1113               p_d_ci_end_dt           => rec_c_igf_aw_award_v.ci_end_dt,
1114               p_v_person_number       => rec_c_igf_aw_award_v.person_number,
1115               p_v_person_name         => rec_c_igf_aw_award_v.full_name,
1116               p_v_ssn                 => rec_c_igf_aw_award_v.ssn,
1117               p_v_loan_number         => l_loan_number,
1118               p_d_loan_per_begin_date => l_d_loan_per_begin_date,
1119               p_d_loan_per_end_date   => l_d_loan_per_end_date,
1120               p_v_loan_type           => rec_c_igf_aw_award_v.fed_fund_code,
1121               p_n_award_accept_amt    => rec_c_igf_aw_award_v.accepted_amt,
1122               p_n_guarantee_amt       => l_n_resp_guarantee_amt,
1123               p_n_approved_amt        => l_n_resp_actual_approved_amt
1124             );
1125           END IF;
1126         END IF;
1127       END IF;
1128       IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
1129         fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.process_1_records.debug',gv_debug_str);
1130       END IF;
1131       gv_debug_str := '';
1132       insert_into_resp1(l_loan_number, l_resp_record_status, l_v_rec_type_ind);
1133     EXCEPTION
1134       WHEN e_skip THEN
1135         insert_into_resp1(l_loan_number, l_resp_record_status, l_v_rec_type_ind);
1136     END ;
1137   END LOOP;
1138   CLOSE cur_1records; -- Finish inserting all the @1 and @8 Records into Resp1 and Resp2 Tables correspondingly.
1139 
1140 EXCEPTION
1141  WHEN app_exception.record_lock_exception THEN
1142      RAISE;
1143  WHEN OTHERS THEN
1144      fnd_message.set_name('IGF','IGF_GE_UNHANDLED_EXP');
1145      fnd_message.set_token('NAME','IGF_SL_CL_ACK.PROCESS_1_RECORDS');
1146      IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
1147        fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.process_1_records.exception',gv_debug_str||' '||SQLERRM);
1148      END IF;
1149      gv_debug_str := '';
1150      igs_ge_msg_stack.add;
1151      app_exception.raise_exception;
1152 END process_1_records;
1153 
1154 
1155 /* Inserts Data into Resp1 ,Resp4 and Resp8 Tables*/
1156 
1157 PROCEDURE insert_into_resp1(p_loan_number          igf_sl_loans_all.loan_number%TYPE,
1158                             p_resp_record_status   igf_sl_cl_resp_r1_all.resp_record_status%TYPE,
1159                             p_rec_type_ind         igf_sl_cl_resp_r1_all.rec_type_ind%TYPE)
1160 AS
1161 /***************************************************************
1162    Created By       :    mesriniv
1163    Date Created By  :    2000/12/07
1164    Purpose          :    To Insert File data into IGF_SL_CL_RESP_R1
1165                     and IGF_SL_CL_RESP_R8 tables
1166    Known Limitations,Enhancements or Remarks
1167    Change History   :
1168    Who              When      What
1169    masehgal             17-Feb-2002     # 2216956    FACR007
1170                                         Added borr_sign_ind , Stud_sign_ind to TBH call for insert
1171  ***************************************************************/
1172 
1173 
1174 l_ind               NUMBER;
1175 l_clrp1_id          igf_sl_cl_resp_r1_all.clrp1_id%TYPE;
1176 l_row_id            VARCHAR2(25);
1177 l_start_guar_pos    NUMBER;
1178 l_start_orig_pos    NUMBER;
1179 
1180 
1181  --Select all the Records which are not @1 Records but @8 Records.
1182 
1183  CURSOR cur_other_records  ( p_file_type  igf_sl_load_file_t.file_type%TYPE)
1184  IS
1185    SELECT * FROM igf_sl_load_file_t
1186    WHERE  file_type  = p_file_type
1187    AND lort_id       > Format_1_rec.lort_id;
1188 
1189   TYPE r8_rec_type IS RECORD (
1190         clrp8_id                 igf_sl_cl_resp_r8_all.clrp8_id%TYPE,
1191         disb_date                igf_sl_cl_resp_r8_all.disb_date%TYPE,
1192         disb_gross_amt           igf_sl_cl_resp_r8_all.disb_gross_amt%TYPE,
1193         orig_fee                 igf_sl_cl_resp_r8_all.orig_fee%TYPE,
1194         guarantee_fee            igf_sl_cl_resp_r8_all.guarantee_fee%TYPE,
1195         net_disb_amt             igf_sl_cl_resp_r8_all.net_disb_amt%TYPE,
1196         disb_hold_rel_ind        igf_sl_cl_resp_r8_all.disb_hold_rel_ind%TYPE,
1197         disb_status              igf_sl_cl_resp_r8_all.disb_status%TYPE,
1198         guarnt_fee_paid          igf_sl_cl_resp_r8_all.guarnt_fee_paid%TYPE,
1199         orig_fee_paid            igf_sl_cl_resp_r8_all.orig_fee_paid%TYPE,
1200         layout_owner_code_txt    igf_sl_cl_resp_r8_all.layout_owner_code_txt%TYPE,
1201         layout_version_code_txt  igf_sl_cl_resp_r8_all.layout_version_code_txt%TYPE,
1202         record_code_txt          igf_sl_cl_resp_r8_all.record_code_txt%TYPE,
1203 --	direct_to_borr_flag      igf_sl_cl_resp_r8_all.direct_to_borr_flag%TYPE --akomurav changes according to FA163 TD
1204 	direct_to_borr_flag      igf_sl_cl_resp_r8_all.layout_version_code_txt%TYPE --temporarily stubbed out
1205      );
1206 
1207   r8_rec  r8_rec_type;
1208 
1209   TYPE r8_tab_type IS TABLE OF r8_rec%TYPE INDEX BY BINARY_INTEGER;
1210   r8_tab       r8_tab_type;
1211 
1212   rec_cl_resp_r1         igf_sl_cl_resp_r1_all%ROWTYPE;
1213 
1214   TYPE tab_resp_r2 IS TABLE OF igf_sl_cl_resp_r2_dtls%ROWTYPE INDEX BY BINARY_INTEGER;
1215   v_tab_resp_r2   tab_resp_r2;
1216   TYPE tab_resp_r3 IS TABLE OF igf_sl_cl_resp_r3_dtls%ROWTYPE INDEX BY BINARY_INTEGER;
1217   v_tab_resp_r3   tab_resp_r3;
1218   TYPE tab_resp_r7 IS TABLE OF igf_sl_cl_resp_r7_dtls%ROWTYPE INDEX BY BINARY_INTEGER;
1219   v_tab_resp_r7   tab_resp_r7;
1220   TYPE tab_clchrs_dtls IS TABLE OF igf_sl_clchrs_dtls%ROWTYPE INDEX BY BINARY_INTEGER;
1221   v_tab_clchrs_dtls   tab_clchrs_dtls;
1222   l_n_ctr_r2  NUMBER;
1223   l_n_ctr_r3  NUMBER;
1224   l_n_ctr_r7  NUMBER;
1225   l_n_ctr_r6  NUMBER;
1226 BEGIN
1227 
1228   log_to_fnd(p_v_module => 'insert_into_resp_r1',
1229              p_v_string => 'Checking fields common to RELEASE-4 AND RELEASE-5 for loan number ='||p_loan_number
1230             );
1231   -- fields common to both the RELASE-5 and RELEASE-4
1232   rec_cl_resp_r1.rec_code                     :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,1,2)));
1233   rec_cl_resp_r1.rec_type_ind                 :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,3,1)));
1234   rec_cl_resp_r1.b_last_name                  :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,12,35)));
1235   rec_cl_resp_r1.b_first_name                 :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,47,12)));
1236   rec_cl_resp_r1.b_middle_name                :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,59,1)));
1237   rec_cl_resp_r1.b_ssn                        :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,60,9))));
1238   rec_cl_resp_r1.b_permt_addr1                :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,69,30)));
1239   rec_cl_resp_r1.b_permt_addr2                :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,99,30)));
1240   rec_cl_resp_r1.b_permt_city                 :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,129,24)));
1241   rec_cl_resp_r1.b_permt_state                :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,159,2)));
1242   rec_cl_resp_r1.b_permt_zip                  :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,161,5))));
1243   rec_cl_resp_r1.b_permt_zip_suffix           :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,166,4))));
1244   rec_cl_resp_r1.b_permt_phone                :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,170,10)));
1245   rec_cl_resp_r1.b_date_of_birth              :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,180,8),'YYYYMMDD');
1246   rec_cl_resp_r1.cl_loan_type                 :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,188,2)));
1247   rec_cl_resp_r1.req_loan_amt                 :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,190,6))));
1248   rec_cl_resp_r1.defer_req_code               :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,196,1)));
1249   rec_cl_resp_r1.borw_interest_ind            :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,197,1)));
1250   rec_cl_resp_r1.eft_auth_code                :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,198,1)));
1251   rec_cl_resp_r1.b_signature_code             :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,199,1)));
1252   rec_cl_resp_r1.b_signature_date             :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,200,8),'YYYYMMDD');
1253   rec_cl_resp_r1.loan_number                  :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,208,17)));
1254   rec_cl_resp_r1.cl_seq_number                :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,225,2))));
1255   rec_cl_resp_r1.b_citizenship_status         :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,228,1)));
1256   rec_cl_resp_r1.b_state_of_legal_res         :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,229,2)));
1257   rec_cl_resp_r1.b_legal_res_date             :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,231,6)||'01','YYYYMMDD');
1258   rec_cl_resp_r1.b_default_status             :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,237,1)));
1259   rec_cl_resp_r1.b_outstd_loan_code           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,238,1)));
1260   rec_cl_resp_r1.b_indicator_code             :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,239,1)));
1261   rec_cl_resp_r1.s_last_name                  :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,259,35)));
1262   rec_cl_resp_r1.s_first_name                 :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,294,12)));
1263   rec_cl_resp_r1.s_middle_name                :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,306,1)));
1264   rec_cl_resp_r1.s_ssn                        :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,307,9))));
1265   rec_cl_resp_r1.s_date_of_birth              :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,316,8),'YYYYMMDD');
1266   rec_cl_resp_r1.s_citizenship_status         :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,324,1)));
1267   rec_cl_resp_r1.s_default_code               :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,325,1)));
1268   rec_cl_resp_r1.s_signature_code             :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,326,1)));
1269   rec_cl_resp_r1.school_id                    :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,347,8))));
1270   rec_cl_resp_r1.loan_per_begin_date          :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,357,8),'YYYYMMDD');
1271   rec_cl_resp_r1.loan_per_end_date            :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,365,8),'YYYYMMDD');
1272   rec_cl_resp_r1.grade_level_code             :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,373,1)));
1273   rec_cl_resp_r1.enrollment_code              :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,375,1)));
1274   rec_cl_resp_r1.anticip_compl_date           :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,376,8),'YYYYMMDD');
1275   rec_cl_resp_r1.coa_amt                      :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,384,5))));
1276   rec_cl_resp_r1.efc_amt                      :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,389,5))));
1277   rec_cl_resp_r1.est_fa_amt                   :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,394,5))));
1278   rec_cl_resp_r1.fls_cert_amt                 :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,399,5))));
1279   rec_cl_resp_r1.flu_cert_amt                 :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,404,5))));
1280   rec_cl_resp_r1.flp_cert_amt                 :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,409,5))));
1281   rec_cl_resp_r1.sch_cert_date                :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,414,8),'YYYYMMDD');
1282   rec_cl_resp_r1.alt_cert_amt                 :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,438,5))));
1283   rec_cl_resp_r1.alt_appl_ver_code            :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,443,4))));
1284   rec_cl_resp_r1.lender_id                    :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,458,6)));
1285   rec_cl_resp_r1.fls_approved_amt             :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,464,5))));
1286   rec_cl_resp_r1.flu_approved_amt             :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,469,5))));
1287   rec_cl_resp_r1.flp_approved_amt             :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,474,5))));
1288   rec_cl_resp_r1.alt_approved_amt             :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,488,5))));
1289   rec_cl_resp_r1.guarantor_id                 :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,507,3)));
1290   rec_cl_resp_r1.fed_appl_form_code           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,510,1)));
1291   rec_cl_resp_r1.guarnt_adj_ind               :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,531,1)));
1292   rec_cl_resp_r1.guarantee_date               :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,680,8),'YYYYMMDD');
1293   rec_cl_resp_r1.b_license_state              :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,715,2)));
1294   rec_cl_resp_r1.b_license_number             :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,717,20)));
1295   rec_cl_resp_r1.b_ref_code                   :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,737,1)));
1296   rec_cl_resp_r1.school_use_txt               :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,738,23)));
1297   rec_cl_resp_r1.pnote_delivery_code          :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,765,1)));
1298   rec_cl_resp_r1.b_foreign_postal_code        :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,766,14)));
1299   rec_cl_resp_r1.lend_non_ed_brc_id           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,781,4)));
1300   rec_cl_resp_r1.lender_use_txt               :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,785,20)));
1301   rec_cl_resp_r1.last_resort_lender           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,805,1)));
1302   rec_cl_resp_r1.resp_to_orig_code            :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,830,1)));
1303   rec_cl_resp_r1.err_mesg_1                   :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,831,3)));
1304   rec_cl_resp_r1.err_mesg_2                   :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,834,3)));
1305   rec_cl_resp_r1.err_mesg_3                   :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,837,3)));
1306   rec_cl_resp_r1.err_mesg_4                   :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,840,3)));
1307   rec_cl_resp_r1.err_mesg_5                   :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,843,3)));
1308   rec_cl_resp_r1.guarnt_amt_redn_code         :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,846,2)));
1309   rec_cl_resp_r1.tot_outstd_stafford          :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,848,8))))/100;
1310   rec_cl_resp_r1.tot_outstd_plus              :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,856,8))))/100;
1311   rec_cl_resp_r1.guarantor_use_txt            :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,876,23)));
1312   rec_cl_resp_r1.b_permt_addr_chg_date        :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,899,8),'YYYYMMDD');
1313   rec_cl_resp_r1.alt_prog_type_code           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,907,3)));
1314   rec_cl_resp_r1.alt_borw_tot_debt            :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,910,7))));
1315 --MN 16-Dec-2004 15:25 Interest has 3 decimal places after assumed DP.
1316   rec_cl_resp_r1.act_interest_rate            :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,957,5))))/1000;
1317   rec_cl_resp_r1.prc_type_code                :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,962,2)));
1318   rec_cl_resp_r1.service_type_code            :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,964,2)));
1319   rec_cl_resp_r1.rev_notice_of_guarnt         :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,966,1)));
1320   rec_cl_resp_r1.sch_refund_amt               :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,967,5))))/100;
1321   rec_cl_resp_r1.sch_refund_date              :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,974,8),'YYYYMMDD');
1322   rec_cl_resp_r1.resp_record_status           :=  p_resp_record_status;
1323   rec_cl_resp_r1.cl_version_code              :=  g_v_cl_version;
1324   -- bvisvana - FA 161 - Bug # 5006583
1325   rec_cl_resp_r1.esign_src_typ_cd             :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,449,9)));
1326   rec_cl_resp_r1.b_alien_reg_num_txt          :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,240,19)));
1327 
1328   -- fields for RELEASE-4 only
1329 
1330   IF g_v_cl_version = 'RELEASE-4' THEN
1331     log_to_fnd(p_v_module => 'insert_into_resp_r1',
1332                p_v_string => 'Seggrgating fields common to RELEASE-4'
1333               );
1334     rec_cl_resp_r1.borr_credit_auth_code        :=  NULL;
1335     rec_cl_resp_r1.borr_sign_ind                :=  NULL;
1336     rec_cl_resp_r1.duns_school_id               :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,449,9)));
1337     rec_cl_resp_r1.lend_apprv_denied_date       :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,479,8),'YYYYMMDD');
1338     rec_cl_resp_r1.lend_apprv_denied_code       :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,487,1)));
1339     rec_cl_resp_r1.duns_lender_id               :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,493,9)));
1340     rec_cl_resp_r1.duns_guarnt_id               :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,511,9)));
1341     rec_cl_resp_r1.lend_blkt_guarnt_ind         :=  NULL;
1342     rec_cl_resp_r1.lend_blkt_guarnt_appr_date   :=  NULL;
1343     rec_cl_resp_r1.guarantee_amt                :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,688,5))));
1344     rec_cl_resp_r1.req_serial_loan_code         :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,693,1)));
1345     rec_cl_resp_r1.mpn_confirm_ind              :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,694,1)));
1346     rec_cl_resp_r1.borw_confirm_ind             :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,695,1)));
1347     rec_cl_resp_r1.stud_sign_ind                :=  NULL;
1348     rec_cl_resp_r1.appl_loan_phase_code         :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,864,4)));
1349     rec_cl_resp_r1.appl_loan_phase_code_chg     :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,868,8),'YYYYMMDD');
1350     rec_cl_resp_r1.guarnt_status_code           :=  NULL;
1351     rec_cl_resp_r1.lender_status_code           :=  NULL;
1352     rec_cl_resp_r1.pnote_status_code            :=  NULL;
1353     rec_cl_resp_r1.credit_status_code           :=  NULL;
1354     rec_cl_resp_r1.guarnt_status_date           :=  NULL;
1355     rec_cl_resp_r1.lender_status_date           :=  NULL;
1356     rec_cl_resp_r1.pnote_status_date            :=  NULL;
1357     rec_cl_resp_r1.credit_status_date           :=  NULL;
1358     rec_cl_resp_r1.act_serial_loan_code         :=  NULL;
1359     rec_cl_resp_r1.sch_non_ed_brc_id            :=  NULL;
1360     rec_cl_resp_r1.amt_avail_for_reinst         :=  NULL;
1361     rec_cl_resp_r1.uniq_layout_vend_code        :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,982,4)));
1362     rec_cl_resp_r1.uniq_layout_ident_code       :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,986,2)));
1363     IF rec_cl_resp_r1.rec_type_ind IN ('A','I','G','B','P','D','T') THEN -- MN 13-Jan-2005 - Added Termination Status T
1364       rec_cl_resp_r1.cl_rec_status              :=  rec_cl_resp_r1.rec_type_ind;
1365 --MN 16-Dec-2004 15:25  The Sent Code and Received Codes are not same
1366 --      rec_cl_resp_r1.rec_type_ind               :=  NVL(p_rec_type_ind,'S');  -- should be same as sent one
1367     END IF; -- else retain old status
1368     rec_cl_resp_r1.cl_rec_status_last_update    :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,4,8),'YYYYMMDD');
1369 
1370   -- fields for RELEASE-5 only
1371   ELSIF g_v_cl_version = 'RELEASE-5' THEN
1372     log_to_fnd(p_v_module => 'insert_into_resp_r1',
1373                p_v_string => 'Seggregating fields common to RELEASE-5'
1374               );
1375     rec_cl_resp_r1.borr_credit_auth_code        :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,227,1)));
1376     rec_cl_resp_r1.borr_sign_ind                :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,374,1)));
1377     rec_cl_resp_r1.duns_school_id               :=  NULL;
1378     rec_cl_resp_r1.lend_apprv_denied_date       :=  NULL;
1379     rec_cl_resp_r1.lend_apprv_denied_code       :=  NULL;
1380     rec_cl_resp_r1.duns_lender_id               :=  NULL;
1381     rec_cl_resp_r1.duns_guarnt_id               :=  NULL;
1382     rec_cl_resp_r1.lend_blkt_guarnt_ind         :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,522,1)));
1383     rec_cl_resp_r1.lend_blkt_guarnt_appr_date   :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,523,8),'YYYYMMDD');
1384     rec_cl_resp_r1.guarantee_amt                :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,688,7))));
1385     rec_cl_resp_r1.req_serial_loan_code         :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,695,1)));
1386     rec_cl_resp_r1.mpn_confirm_ind              :=  NULL;
1387     rec_cl_resp_r1.borw_confirm_ind             :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,697,1)));
1388     rec_cl_resp_r1.stud_sign_ind                :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,780,1)));
1389     rec_cl_resp_r1.appl_loan_phase_code         :=  NULL;
1390     rec_cl_resp_r1.appl_loan_phase_code_chg     :=  NULL;
1391     rec_cl_resp_r1.guarnt_status_code           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,992,2)));
1392     rec_cl_resp_r1.lender_status_code           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,994,2)));
1393     rec_cl_resp_r1.pnote_status_code            :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,996,2)));
1394     rec_cl_resp_r1.credit_status_code           :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,998,2)));
1395     rec_cl_resp_r1.guarnt_status_date           :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,1000,14),'YYYYMMDDHH24MISS');
1396     rec_cl_resp_r1.lender_status_date           :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,1014,14),'YYYYMMDDHH24MISS');
1397     rec_cl_resp_r1.pnote_status_date            :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,1028,14),'YYYYMMDDHH24MISS');
1398     rec_cl_resp_r1.credit_status_date           :=  fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,1042,14),'YYYYMMDDHH24MISS');
1399     rec_cl_resp_r1.act_serial_loan_code         :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,1056,1)));
1400     rec_cl_resp_r1.sch_non_ed_brc_id            :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,1090,4)));
1401     rec_cl_resp_r1.amt_avail_for_reinst         :=  TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,1094,7))));
1402     rec_cl_resp_r1.uniq_layout_vend_code        :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,1142,4)));
1403     rec_cl_resp_r1.uniq_layout_ident_code       :=  LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,1146,2)));
1404     rec_cl_resp_r1.cl_rec_status                :=  NULL;
1405     rec_cl_resp_r1.cl_rec_status_last_update    :=  NULL;
1406 
1407   END IF;
1408 
1409     gv_debug_str := 'INSERT_INTO_RESP1 - 1' ||' ';
1410     log_to_fnd(p_v_module => 'insert_into_resp_r1',
1411                p_v_string => 'Invoking igf_sl_cl_resp_r1_pkg.insert_row'
1412               );
1413 
1414     igf_sl_cl_resp_r1_pkg.insert_row (
1415      x_mode                         =>   'R'                                         ,
1416      x_rowid                        =>   l_row_id                                    ,
1417      x_clrp1_id                     =>   l_clrp1_id                                  ,
1418      x_cbth_id                      =>   g_cbth_id                                   ,
1419      x_rec_code                     =>   rec_cl_resp_r1.rec_code                     ,
1420      x_rec_type_ind                 =>   rec_cl_resp_r1.rec_type_ind                 ,
1421      x_b_last_name                  =>   rec_cl_resp_r1.b_last_name                  ,
1422      x_b_first_name                 =>   rec_cl_resp_r1.b_first_name                 ,
1423      x_b_middle_name                =>   rec_cl_resp_r1.b_middle_name                ,
1424      x_b_ssn                        =>   rec_cl_resp_r1.b_ssn                        ,
1425      x_b_permt_addr1                =>   rec_cl_resp_r1.b_permt_addr1                ,
1426      x_b_permt_addr2                =>   rec_cl_resp_r1.b_permt_addr2                ,
1427      x_b_permt_city                 =>   rec_cl_resp_r1.b_permt_city                 ,
1428      x_b_permt_state                =>   rec_cl_resp_r1.b_permt_state                ,
1429      x_b_permt_zip                  =>   rec_cl_resp_r1.b_permt_zip                  ,
1430      x_b_permt_zip_suffix           =>   rec_cl_resp_r1.b_permt_zip_suffix           ,
1431      x_b_permt_phone                =>   rec_cl_resp_r1.b_permt_phone                ,
1432      x_b_date_of_birth              =>   rec_cl_resp_r1.b_date_of_birth              ,
1433      x_cl_loan_type                 =>   rec_cl_resp_r1.cl_loan_type                 ,
1434      x_req_loan_amt                 =>   rec_cl_resp_r1.req_loan_amt                 ,
1435      x_defer_req_code               =>   rec_cl_resp_r1.defer_req_code               ,
1436      x_borw_interest_ind            =>   rec_cl_resp_r1.borw_interest_ind            ,
1437      x_eft_auth_code                =>   rec_cl_resp_r1.eft_auth_code                ,
1438      x_b_signature_code             =>   rec_cl_resp_r1.b_signature_code             ,
1439      x_b_signature_date             =>   rec_cl_resp_r1.b_signature_date             ,
1440      x_loan_number                  =>   rec_cl_resp_r1.loan_number                  ,
1441      x_cl_seq_number                =>   rec_cl_resp_r1.cl_seq_number                ,
1442      x_b_citizenship_status         =>   rec_cl_resp_r1.b_citizenship_status         ,
1443      x_b_state_of_legal_res         =>   rec_cl_resp_r1.b_state_of_legal_res         ,
1444      x_b_legal_res_date             =>   rec_cl_resp_r1.b_legal_res_date             ,
1445      x_b_default_status             =>   rec_cl_resp_r1.b_default_status             ,
1446      x_b_outstd_loan_code           =>   rec_cl_resp_r1.b_outstd_loan_code           ,
1447      x_b_indicator_code             =>   rec_cl_resp_r1.b_indicator_code             ,
1448      x_s_last_name                  =>   rec_cl_resp_r1.s_last_name                  ,
1449      x_s_first_name                 =>   rec_cl_resp_r1.s_first_name                 ,
1450      x_s_middle_name                =>   rec_cl_resp_r1.s_middle_name                ,
1451      x_s_ssn                        =>   rec_cl_resp_r1.s_ssn                        ,
1452      x_s_date_of_birth              =>   rec_cl_resp_r1.s_date_of_birth              ,
1453      x_s_citizenship_status         =>   rec_cl_resp_r1.s_citizenship_status         ,
1454      x_s_default_code               =>   rec_cl_resp_r1.s_default_code               ,
1455      x_s_signature_code             =>   rec_cl_resp_r1.s_signature_code             ,
1456      x_school_id                    =>   rec_cl_resp_r1.school_id                    ,
1457      x_loan_per_begin_date          =>   rec_cl_resp_r1.loan_per_begin_date          ,
1458      x_loan_per_end_date            =>   rec_cl_resp_r1.loan_per_end_date            ,
1459      x_grade_level_code             =>   rec_cl_resp_r1.grade_level_code             ,
1460      x_enrollment_code              =>   rec_cl_resp_r1.enrollment_code              ,
1461      x_anticip_compl_date           =>   rec_cl_resp_r1.anticip_compl_date           ,
1462      x_coa_amt                      =>   rec_cl_resp_r1.coa_amt                      ,
1463      x_efc_amt                      =>   rec_cl_resp_r1.efc_amt                      ,
1464      x_est_fa_amt                   =>   rec_cl_resp_r1.est_fa_amt                   ,
1465      x_fls_cert_amt                 =>   rec_cl_resp_r1.fls_cert_amt                 ,
1466      x_flu_cert_amt                 =>   rec_cl_resp_r1.flu_cert_amt                 ,
1467      x_flp_cert_amt                 =>   rec_cl_resp_r1.flp_cert_amt                 ,
1468      x_sch_cert_date                =>   rec_cl_resp_r1.sch_cert_date                ,
1469      x_alt_cert_amt                 =>   rec_cl_resp_r1.alt_cert_amt                 ,
1470      x_alt_appl_ver_code            =>   rec_cl_resp_r1.alt_appl_ver_code            ,
1471      x_duns_school_id               =>   rec_cl_resp_r1.duns_school_id               ,
1472      x_lender_id                    =>   rec_cl_resp_r1.lender_id                    ,
1473      x_fls_approved_amt             =>   rec_cl_resp_r1.fls_approved_amt             ,
1474      x_flu_approved_amt             =>   rec_cl_resp_r1.flu_approved_amt             ,
1475      x_flp_approved_amt             =>   rec_cl_resp_r1.flp_approved_amt             ,
1476      x_alt_approved_amt             =>   rec_cl_resp_r1.alt_approved_amt             ,
1477      x_duns_lender_id               =>   rec_cl_resp_r1.duns_lender_id               ,
1478      x_guarantor_id                 =>   rec_cl_resp_r1.guarantor_id                 ,
1479      x_fed_appl_form_code           =>   rec_cl_resp_r1.fed_appl_form_code           ,
1480      x_duns_guarnt_id               =>   rec_cl_resp_r1.duns_guarnt_id               ,
1481      x_lend_blkt_guarnt_ind         =>   rec_cl_resp_r1.lend_blkt_guarnt_ind         ,
1482      x_lend_blkt_guarnt_appr_date   =>   rec_cl_resp_r1.lend_blkt_guarnt_appr_date   ,
1483      x_guarnt_adj_ind               =>   rec_cl_resp_r1.guarnt_adj_ind               ,
1484      x_guarantee_date               =>   rec_cl_resp_r1.guarantee_date               ,
1485      x_guarantee_amt                =>   rec_cl_resp_r1.guarantee_amt                ,
1486      x_req_serial_loan_code         =>   rec_cl_resp_r1.req_serial_loan_code         ,
1487      x_borw_confirm_ind             =>   rec_cl_resp_r1.borw_confirm_ind             ,
1488      x_b_license_state              =>   rec_cl_resp_r1.b_license_state              ,
1489      x_b_license_number             =>   rec_cl_resp_r1.b_license_number             ,
1490      x_b_ref_code                   =>   rec_cl_resp_r1.b_ref_code                   ,
1491      x_pnote_delivery_code          =>   rec_cl_resp_r1.pnote_delivery_code          ,
1492      x_b_foreign_postal_code        =>   rec_cl_resp_r1.b_foreign_postal_code        ,
1493      x_lend_non_ed_brc_id           =>   rec_cl_resp_r1.lend_non_ed_brc_id           ,
1494      x_last_resort_lender           =>   rec_cl_resp_r1.last_resort_lender           ,
1495      x_resp_to_orig_code            =>   rec_cl_resp_r1.resp_to_orig_code            ,
1496      x_err_mesg_1                   =>   rec_cl_resp_r1.err_mesg_1                   ,
1497      x_err_mesg_2                   =>   rec_cl_resp_r1.err_mesg_2                   ,
1498      x_err_mesg_3                   =>   rec_cl_resp_r1.err_mesg_3                   ,
1499      x_err_mesg_4                   =>   rec_cl_resp_r1.err_mesg_4                   ,
1500      x_err_mesg_5                   =>   rec_cl_resp_r1.err_mesg_5                   ,
1501      x_guarnt_amt_redn_code         =>   rec_cl_resp_r1.guarnt_amt_redn_code         ,
1502      x_tot_outstd_stafford          =>   rec_cl_resp_r1.tot_outstd_stafford          ,
1503      x_tot_outstd_plus              =>   rec_cl_resp_r1.tot_outstd_plus              ,
1504      x_b_permt_addr_chg_date        =>   rec_cl_resp_r1.b_permt_addr_chg_date        ,
1505      x_alt_prog_type_code           =>   rec_cl_resp_r1.alt_prog_type_code           ,
1506      x_alt_borw_tot_debt            =>   rec_cl_resp_r1.alt_borw_tot_debt            ,
1507      x_act_interest_rate            =>   rec_cl_resp_r1.act_interest_rate            ,
1508      x_prc_type_code                =>   rec_cl_resp_r1.prc_type_code                ,
1509      x_service_type_code            =>   rec_cl_resp_r1.service_type_code            ,
1510      x_rev_notice_of_guarnt         =>   rec_cl_resp_r1.rev_notice_of_guarnt         ,
1511      x_sch_refund_amt               =>   rec_cl_resp_r1.sch_refund_amt               ,
1512      x_sch_refund_date              =>   rec_cl_resp_r1.sch_refund_date              ,
1513      x_guarnt_status_code           =>   rec_cl_resp_r1.guarnt_status_code           ,
1514      x_lender_status_code           =>   rec_cl_resp_r1.lender_status_code           ,
1515      x_pnote_status_code            =>   rec_cl_resp_r1.pnote_status_code            ,
1516      x_credit_status_code           =>   rec_cl_resp_r1.credit_status_code           ,
1517      x_guarnt_status_date           =>   rec_cl_resp_r1.guarnt_status_date           ,
1518      x_lender_status_date           =>   rec_cl_resp_r1.lender_status_date           ,
1519      x_pnote_status_date            =>   rec_cl_resp_r1.pnote_status_date            ,
1520      x_credit_status_date           =>   rec_cl_resp_r1.credit_status_date           ,
1521      x_act_serial_loan_code         =>   rec_cl_resp_r1.act_serial_loan_code         ,
1522      x_amt_avail_for_reinst         =>   rec_cl_resp_r1.amt_avail_for_reinst         ,
1523      x_sch_non_ed_brc_id            =>   rec_cl_resp_r1.sch_non_ed_brc_id            ,
1524      x_uniq_layout_vend_code        =>   rec_cl_resp_r1.uniq_layout_vend_code        ,
1525      x_uniq_layout_ident_code       =>   rec_cl_resp_r1.uniq_layout_ident_code       ,
1526      x_resp_record_status           =>   rec_cl_resp_r1.resp_record_status           ,
1527      x_borr_sign_ind                =>   rec_cl_resp_r1.borr_sign_ind                ,
1528      x_stud_sign_ind                =>   rec_cl_resp_r1.stud_sign_ind                ,
1529      x_borr_credit_auth_code        =>   rec_cl_resp_r1.borr_credit_auth_code        ,
1530      x_mpn_confirm_ind              =>   rec_cl_resp_r1.mpn_confirm_ind              ,
1531      x_lender_use_txt               =>   rec_cl_resp_r1.lender_use_txt               ,
1532      x_guarantor_use_txt            =>   rec_cl_resp_r1.guarantor_use_txt            ,
1533      x_appl_loan_phase_code         =>   rec_cl_resp_r1.appl_loan_phase_code         ,
1534      x_appl_loan_phase_code_chg     =>   rec_cl_resp_r1.appl_loan_phase_code_chg     ,
1535      x_cl_rec_status                =>   rec_cl_resp_r1.cl_rec_status                ,
1536      x_cl_rec_status_last_update    =>   rec_cl_resp_r1.cl_rec_status_last_update    ,
1537      x_lend_apprv_denied_code       =>   rec_cl_resp_r1.lend_apprv_denied_code       ,
1538      x_lend_apprv_denied_date       =>   rec_cl_resp_r1.lend_apprv_denied_date       ,
1539      x_cl_version_code              =>   rec_cl_resp_r1.cl_version_code              ,
1540      x_school_use_txt               =>   rec_cl_resp_r1.school_use_txt                ,
1541      x_b_alien_reg_num_txt          =>   rec_cl_resp_r1.b_alien_reg_num_txt          ,
1542      x_esign_src_typ_cd             =>   rec_cl_resp_r1.esign_src_typ_cd
1543     );
1544 
1545     -- Upto a Max of 4 disbursements records info can be present in @1 record.
1546     -- Moving this data into PL/sql table.
1547 
1548     gv_debug_str := gv_debug_str || 'INSERT_INTO_RESP1 - 2' ||' ';
1549     l_ind := 1;
1550     FOR i IN 0..3 LOOP
1551 
1552        IF LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,(761+1*i) ,1))) IS NOT NULL THEN
1553 
1554            gv_debug_str := gv_debug_str || 'INSERT_INTO_RESP1 - 3' ||' ';
1555 
1556            r8_tab(l_ind).clrp8_id                :=      l_ind+1;
1557            r8_tab(l_ind).disb_date               :=      fnd_date.string_to_date(SUBSTR(Format_1_rec.record_data,( 536 +36*i),8),'YYYYMMDD');
1558            r8_tab(l_ind).disb_gross_amt          :=      TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,( 544 +36*i),7))))/100;
1559            r8_tab(l_ind).orig_fee                :=      TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,( 551 +36*i),7))))/100;
1560            r8_tab(l_ind).guarantee_fee           :=      TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,( 558 +36*i),7))))/100;
1561            r8_tab(l_ind).net_disb_amt            :=      TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,( 565 +36*i),7))))/100;
1562            r8_tab(l_ind).disb_hold_rel_ind       :=      LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,( 761 +1 *i),1)));
1563            r8_tab(l_ind).disb_status             :=      LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,( 826 +1 *i),1)));
1564            r8_tab(l_ind).record_code_txt         :=      '@1';
1565            IF g_v_cl_version = 'RELEASE-5' THEN
1566              r8_tab(l_ind).guarnt_fee_paid         :=      TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,( 929 +7 *i),7))))/100;
1567              r8_tab(l_ind).orig_fee_paid           :=      TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,(1057 +7 *i),7))))/100;
1568              r8_tab(l_ind).layout_owner_code_txt   :=      LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,1142,4)));
1569              r8_tab(l_ind).layout_version_code_txt :=      LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,1146,2)));
1570            ELSIF g_v_cl_version = 'RELEASE-4' THEN
1571 	     --akomurav changes made according to FA163 TD
1572 	     IF (i=0) THEN
1573 	       l_start_guar_pos := 701;
1574  	       l_start_orig_pos := 696;
1575  	     ELSIF (i=1) THEN
1576  	       l_start_guar_pos := 811;
1577  	       l_start_orig_pos := 806;
1578  	     ELSIF (i=2) THEN
1579  	       l_start_guar_pos := 821;
1580  	       l_start_orig_pos := 816;
1581  	     ELSIF (i=3) THEN
1582  	       l_start_guar_pos := 922;
1583  	       l_start_orig_pos := 917;
1584  	     END IF;
1585 	     r8_tab(l_ind).direct_to_borr_flag     :=      LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,( 706 +1 *i),1)));
1586              r8_tab(l_ind).guarnt_fee_paid         :=      TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,l_start_guar_pos,5))))/100;
1587              r8_tab(l_ind).orig_fee_paid           :=      TO_NUMBER(LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,l_start_orig_pos,5))))/100;
1588              r8_tab(l_ind).layout_owner_code_txt   :=      LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,982,4)));
1589              r8_tab(l_ind).layout_version_code_txt :=      LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,986,2)));
1590            END IF;
1591            l_ind := l_ind + 1;
1592            gv_debug_str := '';
1593        END IF;
1594      END LOOP;
1595 
1596 
1597     --This Fetch is to get all the @8 Records that follow the Current Format_1 Record.
1598     --And @8 records are alone inserted into IGF_SL_RESP_R8 Table
1599 
1600     gv_debug_str := gv_debug_str || 'INSERT_INTO_RESP1 - 4' || ' ';
1601     l_n_ctr_r2   := 0;
1602     l_n_ctr_r3   := 0;
1603     l_n_ctr_r7   := 0;
1604     l_n_ctr_r6   := 0;
1605     FOR other_rec IN cur_other_records('CL_ORIG_ACK') LOOP
1606 
1607 
1608       IF LTRIM(RTRIM(SUBSTR(other_rec.record_data,1,2))) IN ('@1','@T') THEN
1609          -- If the Next @1 record is Fetched, then It is the Next Loan Number.
1610          -- So, Otherrecords for this Loan Number are over.
1611          gv_debug_str := gv_debug_str || 'INSERT_INTO_RESP1 - 5' || ' ';
1612          EXIT;
1613 
1614       ELSIF LTRIM(RTRIM(SUBSTR(other_rec.record_data,1,2)))='@8' THEN
1615         IF g_v_cl_version = 'RELEASE-5' THEN
1616           -- From @8 records, we need to get the 16 disbursement records into the PL/sql table.
1617           gv_debug_str := gv_debug_str || 'INSERT_INTO_RESP1 - 6' || ' ';
1618           FOR i IN 0..15 LOOP
1619 
1620              IF LTRIM(RTRIM(SUBSTR(other_rec.record_data,(585+ 1*i),1))) IS NOT NULL THEN
1621                  gv_debug_str := gv_debug_str || 'INSERT_INTO_RESP1 - 7' || ' ';
1622                  r8_tab(l_ind).clrp8_id                :=   l_ind;
1623                  r8_tab(l_ind).disb_date               :=   fnd_date.string_to_date(SUBSTR(other_rec.record_data,(9 + 8*i),8),'YYYYMMDD');
1624                  r8_tab(l_ind).disb_gross_amt          :=   TO_NUMBER(LTRIM(RTRIM(SUBSTR(other_rec.record_data,( 137 + 7*i),7))))/100;
1625                  r8_tab(l_ind).orig_fee                :=   TO_NUMBER(LTRIM(RTRIM(SUBSTR(other_rec.record_data,( 249 + 7*i),7))))/100;
1626                  r8_tab(l_ind).guarantee_fee           :=   TO_NUMBER(LTRIM(RTRIM(SUBSTR(other_rec.record_data,( 361 + 7*i),7))))/100;
1627                  r8_tab(l_ind).net_disb_amt            :=   TO_NUMBER(LTRIM(RTRIM(SUBSTR(other_rec.record_data,( 473 + 7*i),7))))/100;
1628                  r8_tab(l_ind).disb_hold_rel_ind       :=   LTRIM(RTRIM(SUBSTR(other_rec.record_data,( 585 + 1*i),1)));
1629                  r8_tab(l_ind).disb_status             :=   LTRIM(RTRIM(SUBSTR(other_rec.record_data,( 601 + 1*i),1)));
1630                  r8_tab(l_ind).guarnt_fee_paid         :=   TO_NUMBER(LTRIM(RTRIM(SUBSTR(other_rec.record_data,( 617 + 7*i),7))))/100;
1631                  r8_tab(l_ind).orig_fee_paid           :=   TO_NUMBER(LTRIM(RTRIM(SUBSTR(other_rec.record_data,( 729 + 7*i),7))))/100;
1632                  r8_tab(l_ind).layout_owner_code_txt   :=   LTRIM(RTRIM(SUBSTR(other_rec.record_data,3,4)));
1633                  r8_tab(l_ind).layout_version_code_txt :=   LTRIM(RTRIM(SUBSTR(other_rec.record_data,7,2)));
1634                  r8_tab(l_ind).record_code_txt         :=   '@8';
1635 		 r8_tab(l_ind).direct_to_borr_flag     :=   LTRIM(RTRIM(SUBSTR(other_rec.record_data,(841 + 1*i),1)));--akomurav changes made according to FA163 TD
1636                  l_ind := l_ind + 1;
1637                  gv_debug_str := '';
1638              END IF;
1639 
1640           END LOOP;
1641         END IF;
1642       --Code has been added here to check if there is a @4 record format.
1643      --If the encountered Record is @4 and the @1 record specifies its presence then Insert else display message
1644 
1645       ELSIF LTRIM(RTRIM(SUBSTR(other_rec.record_data,1,2))) ='@4'  THEN
1646 
1647       --@1 record specifies its presence
1648            gv_debug_str := gv_debug_str || 'INSERT_INTO_RESP1 - 8' || ' ';
1649            IF LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,188,2)))='AL'   THEN
1650 
1651             --Insert into igf_sl_cl_resp_r4 table
1652                  gv_debug_str := gv_debug_str || 'INSERT_INTO_RESP1 - 9' || ' ';
1653                  IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
1654                    fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.insert_into_resp1.debug',gv_debug_str);
1655                  END IF;
1656                  insert_into_resp_r4(l_clrp1_id,
1657                                      other_rec.record_data);
1658                  gv_debug_str := '';
1659 
1660               IF l_title_flag IS NULL THEN
1661 
1662                   --
1663                   -- Default array values for Lookup Desc
1664                   --
1665                     gv_debug_str := gv_debug_str || 'INSERT_INTO_RESP1 - 10' || ' ';
1666                     title_array(1)  := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','FED_STAFFORD_LOAN_DEBT'),50,' ');
1667                     title_array(2)  := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','FED_SLS_DEBT'),50,' ');
1668                     title_array(3)  := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','HEAL_DEBT'),50,' ');
1669                     title_array(4)  := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','PERKINS_DEBT'),50,' ');
1670                     title_array(5)  := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','OTHER_DEBT'),50,' ');
1671                     title_array(6)  := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','CRDT_UNDER_DIFFT_NAME'),50,' ');
1672                     title_array(7)  := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','BORW_GROSS_ANNUAL_SAL'),50,' ');
1673                     title_array(8)  := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','BORW_OTHER_INCOME'),50,' ');
1674                     title_array(9)  := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','STUDENT_MAJOR'),50,' ');
1675                     title_array(10) := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','INT_RATE_OPTION'),50,' ');
1676                     title_array(11) := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','REPAYMENT_OPT_CODE'),50,' ');
1677                     title_array(12) := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','STUD_MTH_HOUSING_PYMT'),50,' ');
1678                     title_array(13) := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','STUD_MTH_CRDTCARD_PYMT'),50,' ');
1679                     title_array(14) := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','STUD_MTH_AUTO_PYMT'),50,' ');
1680                     title_array(15) := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','STUD_MTH_ED_LOAN_PYMT'),50,' ');
1681                     title_array(16) := RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','STUD_MTH_OTHER_PYMT'),50,' ');
1682                     title_array(17) := LPAD(igf_aw_gen.lookup_desc('IGF_SL_GEN','OFA_ALT_DETAILS'),80,' ');
1683                     title_array(18) := LPAD(igf_aw_gen.lookup_desc('IGF_SL_GEN','FILE_ALT_DETAILS'),40,' ');
1684                     l_title_flag:='Y';
1685 
1686               END IF;
1687 
1688             ELSIF LTRIM(RTRIM(SUBSTR(Format_1_rec.record_data,188,2))) <> 'AL' THEN
1689                  gv_debug_str := gv_debug_str || 'INSERT_INTO_RESP1 - 11' || ' ';
1690                  fnd_message.set_name('IGF','IGF_SL_CL_FORMAT_NOT_SUPP');
1691                  fnd_message.set_token('FORMAT',LTRIM(RTRIM(SUBSTR(other_rec.record_data,1,2))));
1692                  fnd_file.put_line(fnd_file.log, fnd_message.get);
1693 
1694             END IF;
1695 
1696       ELSIF LTRIM(RTRIM(SUBSTR(other_rec.record_data,1,2))) ='@2'  THEN
1697         l_n_ctr_r2 := NVL(l_n_ctr_r2,0) + 1;
1698         v_tab_resp_r2(l_n_ctr_r2).clrp1_id               := l_clrp1_id;
1699         v_tab_resp_r2(l_n_ctr_r2).record_code_txt        := LTRIM(RTRIM(SUBSTR(other_rec.record_data,1,2)));
1700         v_tab_resp_r2(l_n_ctr_r2).uniq_layout_vend_code  := LTRIM(RTRIM(SUBSTR(other_rec.record_data,3,4)));
1701         v_tab_resp_r2(l_n_ctr_r2).uniq_layout_ident_code := LTRIM(RTRIM(SUBSTR(other_rec.record_data,7,2)));
1702 
1703         IF g_v_cl_version = 'RELEASE-5' THEN
1704           v_tab_resp_r2(l_n_ctr_r2).filler_txt           :=  LTRIM(RTRIM(SUBSTR(other_rec.record_data,9,1191)));
1705         ELSIF g_v_cl_version = 'RELEASE-4' THEN
1706           v_tab_resp_r2(l_n_ctr_r2).filler_txt           :=  LTRIM(RTRIM(SUBSTR(other_rec.record_data,9,1031)));
1707         END IF;
1708 
1709       ELSIF LTRIM(RTRIM(SUBSTR(other_rec.record_data,1,2))) ='@3'  THEN
1710         l_n_ctr_r3 := NVL(l_n_ctr_r3,0) + 1;
1711         v_tab_resp_r3(l_n_ctr_r3).clrp1_id               := l_clrp1_id;
1712         v_tab_resp_r3(l_n_ctr_r3).record_code_txt        := LTRIM(RTRIM(SUBSTR(other_rec.record_data,1,2)));
1713         v_tab_resp_r3(l_n_ctr_r3).message_1_text         := LTRIM(RTRIM(SUBSTR(other_rec.record_data,3,160)));
1714         v_tab_resp_r3(l_n_ctr_r3).message_2_text         := LTRIM(RTRIM(SUBSTR(other_rec.record_data,163,160)));
1715         v_tab_resp_r3(l_n_ctr_r3).message_3_text         := LTRIM(RTRIM(SUBSTR(other_rec.record_data,323,160)));
1716         v_tab_resp_r3(l_n_ctr_r3).message_4_text         := LTRIM(RTRIM(SUBSTR(other_rec.record_data,483,160)));
1717         v_tab_resp_r3(l_n_ctr_r3).message_5_text         := LTRIM(RTRIM(SUBSTR(other_rec.record_data,643,160)));
1718 
1719       ELSIF LTRIM(RTRIM(SUBSTR(other_rec.record_data,1,2))) ='@7'  THEN
1720         l_n_ctr_r7 := NVL(l_n_ctr_r7,0) + 1;
1721         v_tab_resp_r7(l_n_ctr_r7).clrp1_id                       := l_clrp1_id;
1722         v_tab_resp_r7(l_n_ctr_r7).record_code_txt                := LTRIM(RTRIM(SUBSTR(other_rec.record_data,1,2)));
1723         v_tab_resp_r7(l_n_ctr_r7).layout_owner_code_txt          := LTRIM(RTRIM(SUBSTR(other_rec.record_data,3,4)));
1724         v_tab_resp_r7(l_n_ctr_r7).layout_identifier_code_txt     := LTRIM(RTRIM(SUBSTR(other_rec.record_data,7,2)));
1725         v_tab_resp_r7(l_n_ctr_r7).email_txt                      := LTRIM(RTRIM(SUBSTR(other_rec.record_data,9,256)));
1726         v_tab_resp_r7(l_n_ctr_r7).valid_email_flag               := LTRIM(RTRIM(SUBSTR(other_rec.record_data,265,1)));
1727         v_tab_resp_r7(l_n_ctr_r7).email_effective_date           := fnd_date.string_to_date(LTRIM(RTRIM(SUBSTR(other_rec.record_data,266,8))),'YYYYMMDD');
1728         v_tab_resp_r7(l_n_ctr_r7).borrower_temp_add_line_1_txt   := LTRIM(RTRIM(SUBSTR(other_rec.record_data,274,30)));
1729         v_tab_resp_r7(l_n_ctr_r7).borrower_temp_add_line_2_txt   := LTRIM(RTRIM(SUBSTR(other_rec.record_data,304,30)));
1730         v_tab_resp_r7(l_n_ctr_r7).borrower_temp_add_city_txt     := LTRIM(RTRIM(SUBSTR(other_rec.record_data,334,24)));
1731         v_tab_resp_r7(l_n_ctr_r7).borrower_temp_add_state_txt    := LTRIM(RTRIM(SUBSTR(other_rec.record_data,358,2)));
1732         v_tab_resp_r7(l_n_ctr_r7).borrower_temp_add_zip_num      := TO_NUMBER(LTRIM(RTRIM(SUBSTR(other_rec.record_data,360,5))));
1733         v_tab_resp_r7(l_n_ctr_r7).borrower_temp_add_zip_xtn_num  := TO_NUMBER(LTRIM(RTRIM(SUBSTR(other_rec.record_data,365,4))));
1734         v_tab_resp_r7(l_n_ctr_r7).borrower_forgn_postal_code_txt := LTRIM(RTRIM(SUBSTR(other_rec.record_data,369,14)));
1735 
1736       ELSIF LTRIM(RTRIM(SUBSTR(other_rec.record_data,1,2))) ='@6'  THEN
1737         -- change send response details are valid for RELEASE-4
1738         IF g_v_cl_version = 'RELEASE-4' THEN
1739           l_n_ctr_r6 := NVL(l_n_ctr_r6,0) + 1;
1740           v_tab_clchrs_dtls(l_n_ctr_r6).clrp1_id             := l_clrp1_id;
1741           v_tab_clchrs_dtls(l_n_ctr_r6).record_code          := LTRIM(RTRIM(SUBSTR(other_rec.record_data,1,2)));
1742           v_tab_clchrs_dtls(l_n_ctr_r6).send_record_txt      := LTRIM(RTRIM(SUBSTR(other_rec.record_data,3,478)));
1743           v_tab_clchrs_dtls(l_n_ctr_r6).error_message_1_code := LTRIM(RTRIM(SUBSTR(other_rec.record_data,481,3)));
1744           v_tab_clchrs_dtls(l_n_ctr_r6).error_message_2_code := LTRIM(RTRIM(SUBSTR(other_rec.record_data,484,3)));
1745           v_tab_clchrs_dtls(l_n_ctr_r6).error_message_3_code := LTRIM(RTRIM(SUBSTR(other_rec.record_data,487,3)));
1746           v_tab_clchrs_dtls(l_n_ctr_r6).error_message_4_code := LTRIM(RTRIM(SUBSTR(other_rec.record_data,490,3)));
1747           v_tab_clchrs_dtls(l_n_ctr_r6).error_message_5_code := LTRIM(RTRIM(SUBSTR(other_rec.record_data,493,3)));
1748         ELSE
1749            fnd_message.set_name('IGF','IGF_SL_CL_FORMAT_NOT_SUPP');
1750            fnd_message.set_token('FORMAT',LTRIM(RTRIM(SUBSTR(other_rec.record_data,1,2))));
1751            fnd_file.put_line(fnd_file.log, fnd_message.get);
1752         END IF;
1753 
1754       ELSE  -- Display Message only for Record Formats other than @T ,@1  @8, @2,@3,@7 , @6 and @4
1755            gv_debug_str := gv_debug_str || 'INSERT_INTO_RESP1 - 12' || ' ';
1756            -- Other Record Types are Not Supported in the Current Release.
1757            fnd_message.set_name('IGF','IGF_SL_CL_FORMAT_NOT_SUPP');
1758            fnd_message.set_token('FORMAT',LTRIM(RTRIM(SUBSTR(other_rec.record_data,1,2))));
1759            fnd_file.put_line(fnd_file.log, fnd_message.get);
1760 
1761       END IF;
1762       gv_debug_str := '';
1763     END LOOP;
1764 
1765     -- Insert the Disbursement records from the PL/sql table into the CL_RESP_R8 table.
1766     FOR i IN 1..l_ind-1 LOOP
1767 
1768          l_row_id := NULL;
1769          gv_debug_str := gv_debug_str || 'INSERT_INTO_RESP1 - 13' || ' ';
1770          igf_sl_cl_resp_r8_pkg.insert_row (
1771                x_mode                   => 'R',
1772                x_rowid                  => l_row_id,
1773                x_clrp1_id               => l_clrp1_id,
1774                x_clrp8_id               => i,
1775                x_disb_date              => r8_tab(i).disb_date,
1776                x_disb_gross_amt         => r8_tab(i).disb_gross_amt,
1777                x_orig_fee               => r8_tab(i).orig_fee,
1778                x_guarantee_fee          => r8_tab(i).guarantee_fee,
1779                x_net_disb_amt           => r8_tab(i).net_disb_amt,
1780                x_disb_hold_rel_ind      => r8_tab(i).disb_hold_rel_ind,
1781                x_disb_status            => r8_tab(i).disb_status,
1782                x_guarnt_fee_paid        => r8_tab(i).guarnt_fee_paid,
1783                x_orig_fee_paid          => r8_tab(i).orig_fee_paid,
1784                x_resp_record_status     => 'N',
1785                x_layout_owner_code_txt  => r8_tab(i).layout_owner_code_txt,
1786                x_layout_version_code_txt=> r8_tab(i).layout_version_code_txt,
1787                x_record_code_txt        => r8_tab(i).record_code_txt
1788 --	       x_direct_to_borr_flag     => NVL(r8_tab(i).direct_to_borr_flag,'N')
1789          );
1790          gv_debug_str := '';
1791     END LOOP;
1792 
1793   --Delete the Disbursement records from the PL/SQL Table after inserting into CL_RESP_R8 Table.
1794   gv_debug_str := gv_debug_str || 'INSERT_INTO_RESP1 - 14' || ' ';
1795   IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
1796     fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.insert_into_resp1.debug',gv_debug_str);
1797   END IF;
1798   r8_tab.delete;
1799   gv_debug_str := '';
1800 
1801    -- inserting into response r2,r3,r7 and igf_sl_clchrs_dtls tables
1802    IF v_tab_resp_r2.COUNT > 0 THEN
1803      l_n_ctr_r2 := 0;
1804      log_to_fnd(p_v_module => 'insert_into_resp_r1',
1805                 p_v_string => 'looping thru v_tab_resp_r2'
1806                );
1807      FOR l_n_ctr_r2 IN v_tab_resp_r2.FIRST .. v_tab_resp_r2.LAST
1808      LOOP
1809        insert_into_resp_r2(
1810          p_r2_record   =>  v_tab_resp_r2(l_n_ctr_r2)
1811        );
1812      END LOOP;
1813      IF v_tab_resp_r2.EXISTS(1) THEN
1814        v_tab_resp_r2.DELETE;
1815      END IF;
1816    END IF;
1817    IF v_tab_resp_r3.COUNT > 0 THEN
1818      l_n_ctr_r3 := 0;
1819      log_to_fnd(p_v_module => 'insert_into_resp_r1',
1820                 p_v_string => 'looping thru v_tab_resp_r3'
1821                );
1822      FOR l_n_ctr_r3 IN v_tab_resp_r3.FIRST .. v_tab_resp_r3.LAST
1823      LOOP
1824        insert_into_resp_r3(
1825          p_r3_record   =>  v_tab_resp_r3(l_n_ctr_r3)
1826         );
1827      END LOOP;
1828      IF v_tab_resp_r3.EXISTS(1) THEN
1829        v_tab_resp_r3.DELETE;
1830      END IF;
1831    END IF;
1832    IF v_tab_resp_r7.COUNT > 0 THEN
1833      l_n_ctr_r7 := 0;
1834       log_to_fnd(p_v_module => 'insert_into_resp_r1',
1835                  p_v_string => 'looping thru v_tab_resp_r7'
1836                 );
1837      FOR l_n_ctr_r7 IN v_tab_resp_r7.FIRST .. v_tab_resp_r7.LAST
1838      LOOP
1839        insert_into_resp_r7(
1840          p_r7_record   =>  v_tab_resp_r7(l_n_ctr_r7)
1841        );
1842      END LOOP;
1843      IF v_tab_resp_r7.EXISTS(1) THEN
1844        v_tab_resp_r7.DELETE;
1845      END IF;
1846    END IF;
1847    IF g_v_cl_version = 'RELEASE-4' THEN
1848      IF v_tab_clchrs_dtls.COUNT > 0 THEN
1849        l_n_ctr_r6 := 0;
1850       log_to_fnd(p_v_module => 'insert_into_resp_r1',
1851                  p_v_string => 'looping thru v_tab_clchrs_dtls'
1852                 );
1853        FOR l_n_ctr_r6 IN v_tab_clchrs_dtls.FIRST .. v_tab_clchrs_dtls.LAST
1854        LOOP
1855          insert_into_resp_r6(
1856            p_r6_record   =>  v_tab_clchrs_dtls(l_n_ctr_r6)
1857          );
1858        END LOOP;
1859        IF v_tab_clchrs_dtls.EXISTS(1) THEN
1860          v_tab_clchrs_dtls.DELETE;
1861        END IF;
1862      END IF;
1863    END IF;
1864 EXCEPTION
1865  WHEN app_exception.record_lock_exception THEN
1866      RAISE;
1867  WHEN OTHERS THEN
1868      fnd_message.set_name('IGF','IGF_GE_UNHANDLED_EXP');
1869      fnd_message.set_token('NAME','IGF_SL_CL_ACK.INSERT_INTO_RESP1');
1870      IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
1871        fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.insert_into_resp1.exception',gv_debug_str||' '|| SQLERRM);
1872      END IF;
1873      gv_debug_str := '';
1874      igs_ge_msg_stack.add;
1875      app_exception.raise_exception;
1876 END insert_into_resp1;
1877 
1878 
1879 -- MAIN PROCEDURE
1880 
1881 PROCEDURE process_ack(
1882  errbuf               OUT NOCOPY  VARCHAR2,
1883  retcode              OUT NOCOPY  NUMBER,
1884  p_c_update_disb_dtls IN          VARCHAR2
1885  )
1886 AS
1887 /***************************************************************
1888    Created By       :    mesriniv
1889    Date Created By  :    2000/12/07
1890    Purpose          :    To process all the @1 Records
1891    Known Limitations,Enhancements or Remarks
1892    Change History   :
1893    Who              When      What
1894    masehgal             17-Feb-2002     # 2216956  FACR007
1895                                         Added Elec_mpn_ind , Borrow_sign_ind in igf_sl_cl_resp_r1
1896  ***************************************************************/
1897      l_msg               NUMBER;
1898      l_mesg              VARCHAR2(100);
1899      l_rowid             VARCHAR2(25);
1900      l_index             NUMBER;
1901      lb_rejected_rec     BOOLEAN;
1902      -- Array to maintain the Error Messages
1903 
1904      TYPE t_message IS TABLE OF igf_sl_cl_resp_r1_all.err_mesg_2%TYPE
1905      INDEX BY BINARY_INTEGER;
1906 
1907      err_mesg_array      t_message;
1908 
1909      --Select the Error Messages from Edit Report
1910      CURSOR c_reject (p_chg_code igf_sl_edit_report_v.orig_chg_code%TYPE)
1911      IS
1912       SELECT rpad(field_desc,50)||sl_error_desc reject_desc FROM igf_sl_edit_report_v
1913       WHERE  loan_number       = loaded_1rec.loan_number
1914              AND orig_chg_code = p_chg_code
1915              ORDER BY edtr_id;
1916 
1917      lb_print_mess BOOLEAN;
1918      l_log_mesg  VARCHAR2(1000);
1919 
1920 BEGIN
1921 
1922   -- Assigning to global variable as the same is being used
1923   -- to conditionally invoke the upd_disb_details
1924     g_c_update_disb_dtls := p_c_update_disb_dtls ;
1925 
1926     gv_debug_str := '';
1927 
1928     gv_debug_str := 'MAIN - 1' || ' ';
1929     retcode := 0;
1930     gv_debug_str := gv_debug_str || 'MAIN - 2' || ' ';
1931     igf_aw_gen.set_org_id(NULL);
1932     gv_debug_str := gv_debug_str || 'MAIN - 3' || ' ';
1933 
1934     --
1935     -- Load the Datafile into the Interface tables.
1936     --
1937     IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
1938       fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.process_ack.debug',gv_debug_str);
1939     END IF;
1940     cl_load_file;
1941     gv_debug_str := '';
1942 
1943     --
1944     -- Fetch the @1 and @8Records for Processing after the Load File procedure has inserted the data from the
1945     -- CommonLine Response File into the Response 1 and Response 8 Tables
1946     --
1947 
1948     FOR loaded_1rec_temp IN cur_resp1_records(g_cbth_id,'N')
1949     LOOP
1950 
1951         loaded_1rec    := loaded_1rec_temp;
1952         l_loan_number  := NULL;
1953         lb_rejected_rec := FALSE;
1954         lb_print_mess   := TRUE;
1955         l_loan_number  := loaded_1rec.loan_number;
1956 
1957         fnd_file.new_line(fnd_file.log,1);
1958         fnd_message.set_name('IGF','IGF_SL_CL_INS_RESP_REC');
1959         fnd_message.set_token('LOAN_NUMBER', l_loan_number);
1960         fnd_file.put_line(fnd_file.log,fnd_message.get);
1961 
1962         gv_debug_str := gv_debug_str || 'MAIN - 9' || ' ';
1963         l_log_mesg := igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','S_SSN')      ||' : '||loaded_1rec.s_ssn;
1964         fnd_file.put_line(fnd_file.log, l_log_mesg);
1965         l_log_mesg := igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','S_FULL_NAME')||' : '
1966                                                           ||loaded_1rec.s_first_name||' '||loaded_1rec.s_last_name;
1967         fnd_file.put_line(fnd_file.log, l_log_mesg);
1968 --MN 16-Dec-2004 15:25 Log Borrower Name and SS as well.
1969         l_log_mesg := igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','B_SSN')      ||' : '||loaded_1rec.b_ssn;
1970         fnd_file.put_line(fnd_file.log, l_log_mesg);
1971         l_log_mesg := igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','B_FULL_NAME')||' : '
1972                                                           ||loaded_1rec.b_first_name||' '||loaded_1rec.b_last_name;
1973         fnd_file.put_line(fnd_file.log, l_log_mesg);
1974         --
1975         -- Delete records from Edit Report table with type="R" (Rejections) for this Loan Number
1976         --
1977         gv_debug_str := gv_debug_str || 'MAIN - 5' || ' ';
1978         IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
1979           fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.process_ack.debug',gv_debug_str);
1980         END IF;
1981 
1982         igf_sl_edit.delete_edit(l_loan_number, 'R');
1983         gv_debug_str := '';
1984 
1985 
1986         -- Need to insert all the Error Messages in the current @1 record into Edit Table
1987         -- Since there are Possiblly 5 Messages in the same record we need to insert them individually
1988         --
1989          gv_debug_str := gv_debug_str || 'MAIN - 6' || ' ';
1990          err_mesg_array.delete;
1991          gv_debug_str := gv_debug_str || 'MAIN - 7' || ' ';
1992          l_msg:=0;
1993 
1994          IF loaded_1rec.err_mesg_1 IS NOT NULL THEN
1995            l_msg:=l_msg+1;
1996            err_mesg_array(l_msg):=loaded_1rec.err_mesg_1;
1997          END IF;
1998 
1999          IF loaded_1rec.err_mesg_2 IS NOT NULL THEN
2000            l_msg:=l_msg+1;
2001            err_mesg_array(l_msg):=loaded_1rec.err_mesg_2;
2002          END IF;
2003 
2004          IF loaded_1rec.err_mesg_3 IS NOT NULL THEN
2005             l_msg:=l_msg+1;
2006             err_mesg_array(l_msg):=loaded_1rec.err_mesg_3;
2007          END IF;
2008 
2009          IF loaded_1rec.err_mesg_4 IS NOT NULL THEN
2010             l_msg:=l_msg+1;
2011             err_mesg_array(l_msg):=loaded_1rec.err_mesg_4;
2012          END IF;
2013 
2014          IF loaded_1rec.err_mesg_5 IS NOT NULL THEN
2015             l_msg:=l_msg+1;
2016             err_mesg_array(l_msg):=loaded_1rec.err_mesg_5;
2017          END IF;
2018 
2019 
2020          FOR l_index IN 1..l_msg LOOP
2021            --
2022            -- Insert Message
2023            --
2024            gv_debug_str := gv_debug_str || 'MAIN - 8' || ' ';
2025            igf_sl_edit.insert_edit(loaded_1rec.loan_number,
2026                                    'R',
2027                                    'IGF_SL_CL_ERROR',
2028                                    err_mesg_array(l_index),'','');
2029            gv_debug_str := '';
2030          END LOOP;
2031          FOR rej_rec IN c_reject('R') LOOP
2032            IF lb_print_mess THEN
2033              fnd_message.set_name('IGF','IGF_SL_CL_PRIN_REJ_DT');
2034              fnd_file.new_line(fnd_file.log,1);
2035              fnd_file.put_line(fnd_file.log,fnd_message.get);
2036              lb_rejected_rec := TRUE;
2037            END IF;
2038            lb_print_mess := FALSE;
2039            gv_debug_str := gv_debug_str || 'MAIN - 10' || ' ';
2040            fnd_file.put_line(fnd_file.log,'    '||rej_rec.reject_desc);
2041            gv_debug_str := '';
2042          END LOOP;
2043              --
2044              -- Call Procedure to update the LOR Table
2045              --
2046 
2047              gv_debug_str := gv_debug_str || 'MAIN - 11' || ' ';
2048              IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
2049               fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.process_ack.debug',gv_debug_str);
2050              END IF;
2051              fnd_file.new_line(fnd_file.log,1);
2052              update_lor(loaded_1rec.clrp1_id,l_loan_number,lb_rejected_rec);
2053              gv_debug_str := '';
2054         --
2055         -- Update the all the Response Record Status to 'Y'
2056         -- to indicate the Records have been processed for this Batch Id
2057         --
2058 
2059          igf_sl_cl_resp_r1_pkg.update_row (
2060            X_Mode                              => 'R',
2061            x_rowid                             => loaded_1rec.row_id,
2062            x_clrp1_id                          => loaded_1rec.clrp1_id,
2063            x_cbth_id                           => loaded_1rec.cbth_id,
2064            x_rec_code                          => loaded_1rec.rec_code,
2065            x_rec_type_ind                      => loaded_1rec.rec_type_ind,
2066            x_b_last_name                       => loaded_1rec.b_last_name,
2067            x_b_first_name                      => loaded_1rec.b_first_name,
2068            x_b_middle_name                     => loaded_1rec.b_middle_name,
2069            x_b_ssn                             => loaded_1rec.b_ssn,
2070            x_b_permt_addr1                     => loaded_1rec.b_permt_addr1,
2071            x_b_permt_addr2                     => loaded_1rec.b_permt_addr2,
2072            x_b_permt_city                      => loaded_1rec.b_permt_city,
2073            x_b_permt_state                     => loaded_1rec.b_permt_state,
2074            x_b_permt_zip                       => loaded_1rec.b_permt_zip,
2075            x_b_permt_zip_suffix                => loaded_1rec.b_permt_zip_suffix,
2076            x_b_permt_phone                     => loaded_1rec.b_permt_phone,
2077            x_b_date_of_birth                   => loaded_1rec.b_date_of_birth,
2078            x_cl_loan_type                      => loaded_1rec.cl_loan_type,
2079            x_req_loan_amt                      => loaded_1rec.req_loan_amt,
2080            x_defer_req_code                    => loaded_1rec.defer_req_code,
2081            x_borw_interest_ind                 => loaded_1rec.borw_interest_ind,
2082            x_eft_auth_code                     => loaded_1rec.eft_auth_code,
2083            x_b_signature_code                  => loaded_1rec.b_signature_code,
2084            x_b_signature_date                  => loaded_1rec.b_signature_date,
2085            x_loan_number                       => loaded_1rec.loan_number,
2086            x_cl_seq_number                     => loaded_1rec.cl_seq_number,
2087            x_b_citizenship_status              => loaded_1rec.b_citizenship_status,
2088            x_b_state_of_legal_res              => loaded_1rec.b_state_of_legal_res,
2089            x_b_legal_res_date                  => loaded_1rec.b_legal_res_date,
2090            x_b_default_status                  => loaded_1rec.b_default_status,
2091            x_b_outstd_loan_code                => loaded_1rec.b_outstd_loan_code,
2092            x_b_indicator_code                  => loaded_1rec.b_indicator_code,
2093            x_s_last_name                       => loaded_1rec.s_last_name,
2094            x_s_first_name                      => loaded_1rec.s_first_name,
2095            x_s_middle_name                     => loaded_1rec.s_middle_name,
2096            x_s_ssn                             => loaded_1rec.s_ssn,
2097            x_s_date_of_birth                   => loaded_1rec.s_date_of_birth,
2098            x_s_citizenship_status              => loaded_1rec.s_citizenship_status,
2099            x_s_default_code                    => loaded_1rec.s_default_code,
2100            x_s_signature_code                  => loaded_1rec.s_signature_code,
2101            x_school_id                         => loaded_1rec.school_id,
2102            x_loan_per_begin_date               => loaded_1rec.loan_per_begin_date,
2103            x_loan_per_end_date                 => loaded_1rec.loan_per_end_date,
2104            x_grade_level_code                  => loaded_1rec.grade_level_code,
2105            x_enrollment_code                   => loaded_1rec.enrollment_code,
2106            x_anticip_compl_date                => loaded_1rec.anticip_compl_date,
2107            x_coa_amt                           => loaded_1rec.coa_amt,
2108            x_efc_amt                           => loaded_1rec.efc_amt,
2109            x_est_fa_amt                        => loaded_1rec.est_fa_amt,
2110            x_fls_cert_amt                      => loaded_1rec.fls_cert_amt,
2111            x_flu_cert_amt                      => loaded_1rec.flu_cert_amt,
2112            x_flp_cert_amt                      => loaded_1rec.flp_cert_amt,
2113            x_sch_cert_date                     => loaded_1rec.sch_cert_date,
2114            x_alt_cert_amt                      => loaded_1rec.alt_cert_amt,
2115            x_alt_appl_ver_code                 => loaded_1rec.alt_appl_ver_code,
2116            x_duns_school_id                    => loaded_1rec.duns_school_id,
2117            x_lender_id                         => loaded_1rec.lender_id,
2118            x_fls_approved_amt                  => loaded_1rec.fls_approved_amt,
2119            x_flu_approved_amt                  => loaded_1rec.flu_approved_amt,
2120            x_flp_approved_amt                  => loaded_1rec.flp_approved_amt,
2121            x_alt_approved_amt                  => loaded_1rec.alt_approved_amt,
2122            x_duns_lender_id                    => loaded_1rec.duns_lender_id,
2123            x_guarantor_id                      => loaded_1rec.guarantor_id,
2124            x_fed_appl_form_code                => loaded_1rec.fed_appl_form_code,
2125            x_duns_guarnt_id                    => loaded_1rec.duns_guarnt_id,
2126            x_lend_blkt_guarnt_ind              => loaded_1rec.lend_blkt_guarnt_ind,
2127            x_lend_blkt_guarnt_appr_date        => loaded_1rec.lend_blkt_guarnt_appr_date,
2128            x_guarnt_adj_ind                    => loaded_1rec.guarnt_adj_ind,
2129            x_guarantee_date                    => loaded_1rec.guarantee_date,
2130            x_guarantee_amt                     => loaded_1rec.guarantee_amt,
2131            x_req_serial_loan_code              => loaded_1rec.req_serial_loan_code,
2132            x_borw_confirm_ind                  => loaded_1rec.borw_confirm_ind,
2133            x_b_license_state                   => loaded_1rec.b_license_state,
2134            x_b_license_number                  => loaded_1rec.b_license_number,
2135            x_b_ref_code                        => loaded_1rec.b_ref_code,
2136            x_pnote_delivery_code               => loaded_1rec.pnote_delivery_code,
2137            x_b_foreign_postal_code             => loaded_1rec.b_foreign_postal_code,
2138            x_lend_non_ed_brc_id                => loaded_1rec.lend_non_ed_brc_id,
2139            x_last_resort_lender                => loaded_1rec.last_resort_lender,
2140            x_resp_to_orig_code                 => loaded_1rec.resp_to_orig_code,
2141            x_err_mesg_1                        => loaded_1rec.err_mesg_1,
2142            x_err_mesg_2                        => loaded_1rec.err_mesg_2,
2143            x_err_mesg_3                        => loaded_1rec.err_mesg_3,
2144            x_err_mesg_4                        => loaded_1rec.err_mesg_4,
2145            x_err_mesg_5                        => loaded_1rec.err_mesg_5,
2146            x_guarnt_amt_redn_code              => loaded_1rec.guarnt_amt_redn_code,
2147            x_tot_outstd_stafford               => loaded_1rec.tot_outstd_stafford,
2148            x_tot_outstd_plus                   => loaded_1rec.tot_outstd_plus,
2149            x_b_permt_addr_chg_date             => loaded_1rec.b_permt_addr_chg_date,
2150            x_alt_prog_type_code                => loaded_1rec.alt_prog_type_code,
2151            x_alt_borw_tot_debt                 => loaded_1rec.alt_borw_tot_debt,
2152            x_act_interest_rate                 => loaded_1rec.act_interest_rate,
2153            x_prc_type_code                     => loaded_1rec.prc_type_code,
2154            x_service_type_code                 => loaded_1rec.service_type_code,
2155            x_rev_notice_of_guarnt              => loaded_1rec.rev_notice_of_guarnt,
2156            x_sch_refund_amt                    => loaded_1rec.sch_refund_amt,
2157            x_sch_refund_date                   => loaded_1rec.sch_refund_date,
2158            x_guarnt_status_code                => loaded_1rec.guarnt_status_code,
2159            x_lender_status_code                => loaded_1rec.lender_status_code,
2160            x_pnote_status_code                 => loaded_1rec.pnote_status_code,
2161            x_credit_status_code                => loaded_1rec.credit_status_code,
2162            x_guarnt_status_date                => loaded_1rec.guarnt_status_date,
2163            x_lender_status_date                => loaded_1rec.lender_status_date,
2164            x_pnote_status_date                 => loaded_1rec.pnote_status_date,
2165            x_credit_status_date                => loaded_1rec.credit_status_date,
2166            x_act_serial_loan_code              => loaded_1rec.act_serial_loan_code,
2167            x_amt_avail_for_reinst              => loaded_1rec.amt_avail_for_reinst,
2168            x_sch_non_ed_brc_id                 => loaded_1rec.sch_non_ed_brc_id,
2169            x_uniq_layout_vend_code             => loaded_1rec.uniq_layout_vend_code,
2170            x_uniq_layout_ident_code            => loaded_1rec.uniq_layout_ident_code,
2171            x_resp_record_status                => 'Y',
2172            x_stud_sign_ind                     => loaded_1rec.stud_sign_ind,
2173            x_borr_credit_auth_code             => loaded_1rec.borr_credit_auth_code,
2174            x_borr_sign_ind                     => loaded_1rec.borr_sign_ind,
2175            x_mpn_confirm_ind                   => loaded_1rec.mpn_confirm_ind,
2176            x_lender_use_txt                    => loaded_1rec.lender_use_txt,
2177            x_guarantor_use_txt                 => loaded_1rec.guarantor_use_txt,
2178            x_appl_loan_phase_code              => loaded_1rec.appl_loan_phase_code,
2179            x_appl_loan_phase_code_chg          => loaded_1rec.appl_loan_phase_code_chg,
2180            x_cl_rec_status                     => loaded_1rec.cl_rec_status,
2181            x_cl_rec_status_last_update         => loaded_1rec.cl_rec_status_last_update,
2182            x_lend_apprv_denied_code            => loaded_1rec.lend_apprv_denied_code,
2183            x_lend_apprv_denied_date            => loaded_1rec.lend_apprv_denied_date,
2184            x_cl_version_code                   => loaded_1rec.cl_version_code,
2185            x_school_use_txt                    => loaded_1rec.school_use_txt ,
2186            x_b_alien_reg_num_txt               => loaded_1rec.b_alien_reg_num_txt,
2187            x_esign_src_typ_cd                  => loaded_1rec.esign_src_typ_cd
2188 
2189          );
2190 
2191          gv_debug_str := '';
2192 
2193          -- invoke the procedure related to processing of change response records
2194          -- applicable for RELEASE-4 only.
2195          IF loaded_1rec.cl_version_code = 'RELEASE-4' THEN
2196            process_change_records (p_n_clrp1_id     =>  loaded_1rec.clrp1_id,
2197                                    p_v_loan_number  =>  loaded_1rec.loan_number);
2198            --
2199            -- update loan status for change record
2200            --
2201            igf_sl_gen.update_cl_chg_status(loaded_1rec.loan_number);
2202          END IF;
2203 
2204      END LOOP;
2205 
2206      COMMIT;
2207 
2208 
2209 EXCEPTION
2210 
2211 WHEN batch_exceptions THEN
2212        ROLLBACK;
2213        retcode := 2;
2214        errbuf  := NULL;
2215 
2216 WHEN app_exception.record_lock_exception THEN
2217        ROLLBACK;
2218        retcode := 2;
2219        errbuf := fnd_message.get_string('IGF','IGF_GE_LOCK_ERROR');
2220        igs_ge_msg_stack.conc_exception_hndl;
2221 WHEN OTHERS THEN
2222        ROLLBACK;
2223        RETCODE := 2;
2224        fnd_message.set_name('IGS','IGS_GE_UNHANDLED_EXP');
2225        fnd_message.set_token('NAME','IGF_SL_CL_ORIG_ACK.PROCESS_ACK');
2226        IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
2227          fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.process_ack.exception',gv_debug_str||' '|| SQLERRM);
2228        END IF;
2229        gv_debug_str := '';
2230        errbuf := fnd_message.get;
2231        igs_ge_msg_stack.conc_exception_hndl;
2232 
2233 END process_ack;
2234 
2235 
2236 PROCEDURE update_lor(p_clrp1_id     igf_sl_cl_resp_r1_all.clrp1_id%TYPE,
2237                      p_loan_number  igf_sl_loans_all.loan_number%TYPE,
2238                      p_rejected_rec  BOOLEAN)
2239 AS
2240 /***************************************************************
2241    Created By       :    mesriniv
2242    Date Created By  :    2000/12/07
2243    Purpose          :    To update the IGF_SL_LOR table
2244                     based on validations.
2245    Known Limitations,Enhancements or Remarks
2246    Change History   :
2247    Who         When                   What
2248    bvisvana    21-Sep-2005            Bug # 4168692 - IGF_SL_CL_INV_COMB_RT_RC changed to IGF_SL_CL_INV_COMB_PT_RC
2249    ridas       17-Sep-2004            Bug #3691153: Query optimized by using the table igf_sl_cl_recipient
2250                                       instead of the view igf_sl_cl_recipient_v
2251 
2252    bkkumar     02-04-04               FACR116 - The lender related comparison not required when "ALT" Loan
2253    bkkumar     08-oct-2003            Bug 3104228
2254                                       a) Impact of adding the relationship_cd
2255                                       in igf_sl_lor_all table and obsoleting
2256                                       BORW_LENDER_ID, DUNS_BORW_LENDER_ID,
2257                                       GUARANTOR_ID, DUNS_GUARNT_ID,
2258                                       LENDER_ID, DUNS_LENDER_ID
2259                                       LEND_NON_ED_BRC_ID, RECIPIENT_ID
2260                                       RECIPIENT_TYPE,DUNS_RECIP_ID
2261                                       RECIP_NON_ED_BRC_ID columns.
2262                                       b) The DUNS_BORW_LENDER_ID
2263                                       DUNS_GUARNT_ID
2264                                       DUNS_LENDER_ID
2265                                       DUNS_RECIP_ID columns are osboleted from the
2266                                       igf_sl_lor_loc_all table.
2267 
2268    bkkumar         18-sep-2003        Bug # 3104228 FA 122 Loan Enhancements
2269                                       In update_lor procedure changed the condition that
2270                                       loan status should be accepted if
2271                                       guarantee status is 20 or 40.
2272    agairola           15-Mar-2002     Modified the IGF_SL_LOANS_PKG update row call
2273                                       for Borrower Determination as part of Refunds DLD - 2144600
2274    masehgal           17-Feb-2002     # 2216956   FACR007
2275                                       Added Elec_mpn_ind , Borrow_sign_ind
2276  ***************************************************************/
2277 
2278 l_row_id                 VARCHAR2(25);
2279 l_log_mesg               VARCHAR2(1000);
2280 l_loan_status            igf_sl_loans_all.loan_status%TYPE;
2281 lv_defer_req_code           VARCHAR2(30);
2282 lv_s_signature_code         VARCHAR2(30);
2283 lv_stud_sign_ind            VARCHAR2(30);
2284 lv_log_mesg                 VARCHAR2(100);
2285 
2286 SKIP_UPDATE_LOANS EXCEPTION;
2287 --
2288 -- Select the LOR record for the current loan number
2289 --
2290 
2291    CURSOR cur_tbh_lor
2292    IS
2293    SELECT *
2294    FROM   igf_sl_lor_v
2295    WHERE  loan_id IN (SELECT loan_id FROM igf_sl_loans_all
2296                       WHERE  NVL(external_loan_id_txt,loan_number) = p_loan_number);
2297 
2298 --
2299 -- Select the Loans Data for the particular Loan number
2300 --
2301 CURSOR cur_tbh_loans IS
2302     SELECT igf_sl_loans.* FROM igf_sl_loans
2303     WHERE NVL(external_loan_id_txt,loan_number)= p_loan_number FOR UPDATE OF loan_status NOWAIT;
2304 
2305   lv_lender_id        VARCHAR2(30);
2306   lv_lend_non_ed_id   VARCHAR2(30);
2307   lv_recipient_id     VARCHAR2(30);
2308   lv_recip_non_ed_id  VARCHAR2(30);
2309   lv_guarant_id       VARCHAR2(30);
2310 
2311 
2312 -- Query optimized by using the table igf_sl_cl_recipient instead of the view igf_sl_cl_recipient_v (bug #3691153)
2313 CURSOR cur_find_lender IS
2314   SELECT
2315   lender_id,
2316   lend_non_ed_brc_id,
2317   guarantor_id,
2318   recipient_id,
2319   recip_non_ed_brc_id,
2320   enabled,
2321   relationship_cd
2322   FROM
2323   igf_sl_cl_recipient
2324   WHERE
2325   lender_id            = lv_lender_id    AND
2326   guarantor_id         = lv_guarant_id   AND
2327   recipient_id         = lv_recipient_id AND
2328   NVL(lend_non_ed_brc_id,'*')   = NVL(lv_lend_non_ed_id,'*') AND
2329   NVL(recip_non_ed_brc_id,'*')  = NVL(lv_recip_non_ed_id,'*');
2330 
2331   find_lender_rec cur_find_lender%ROWTYPE;
2332   lb_info_change BOOLEAN;
2333 
2334 CURSOR cur_find_rel_code(p_rel_code   VARCHAR2,
2335                          p_cal_type   VARCHAR2,
2336                          p_seq_number NUMBER)
2337 IS
2338 SELECT
2339 relationship_cd
2340 FROM
2341 igf_sl_cl_setup_all
2342 WHERE relationship_cd     =  p_rel_code
2343   AND ci_cal_type         =  p_cal_type
2344   AND ci_sequence_number  =  p_seq_number;
2345 
2346 find_rel_code_rec  cur_find_rel_code%ROWTYPE;
2347 
2348 CURSOR  c_igf_sl_loans (cp_v_loan_number igf_sl_loans_all.loan_number%TYPE) IS
2349 SELECT  lar.loan_number
2350        ,lar.loan_status
2351        ,lar.loan_chg_status
2352 FROM   igf_sl_loans_all lar
2353 WHERE  NVL(external_loan_id_txt,loan_number) = cp_v_loan_number;
2354 
2355 rec_c_igf_sl_loans c_igf_sl_loans%ROWTYPE;
2356 
2357 BEGIN
2358 
2359     gv_debug_str := 'UPDATE_LOR - 1' || ' ';
2360 
2361     FOR tbh_rec IN cur_tbh_lor LOOP
2362         lv_lender_id       := loaded_1rec.lender_id;
2363         lv_guarant_id      := loaded_1rec.guarantor_id;
2364         lv_lend_non_ed_id  := loaded_1rec.lend_non_ed_brc_id;
2365         lv_recip_non_ed_id := tbh_rec.recip_non_ed_brc_id;
2366         lv_recipient_id    := tbh_rec.recipient_id;
2367         lb_info_change     := FALSE;
2368 
2369 
2370         IF (NOT p_rejected_rec AND tbh_rec.fed_fund_code <> 'ALT') THEN
2371            IF lv_lender_id IS NOT NULL
2372               AND tbh_rec.lender_id IS NOT NULL
2373               AND (lv_lender_id  <> tbh_rec.lender_id) THEN
2374               lb_info_change := TRUE;
2375               fnd_message.set_name('IGF','IGF_SL_CL_LEND_CHG_UPD');
2376               fnd_message.set_token('LOR_LEND_CODE',tbh_rec.lender_id);
2377               fnd_message.set_token('ACK_FILE_LEND',lv_lender_id);
2378               fnd_file.put_line(fnd_file.log,fnd_message.get);
2379 
2380               tbh_rec.lender_id       := lv_lender_id;
2381               tbh_rec.borw_lender_id  := lv_lender_id;
2382 
2383            END IF;
2384            IF lv_guarant_id IS NOT NULL
2385               AND tbh_rec.guarantor_id IS NOT NULL
2386               AND(lv_guarant_id <> tbh_rec.guarantor_id) THEN
2387               lb_info_change := TRUE;
2388               fnd_message.set_name('IGF','IGF_SL_CL_GURANT_CHG_UPD');
2389               fnd_message.set_token('LOR_GUARN_CODE',tbh_rec.guarantor_id);
2390               fnd_message.set_token('ACK_FILE_GUARN',lv_guarant_id);
2391               fnd_file.put_line(fnd_file.log,fnd_message.get);
2392 
2393               tbh_rec.guarantor_id := lv_guarant_id;
2394 
2395            END IF;
2396            IF NVL(lv_lend_non_ed_id,'*') <> NVL(tbh_rec.lend_non_ed_brc_id,'*') THEN
2397               lb_info_change := TRUE;
2398               fnd_message.set_name('IGF','IGF_SL_CL_LNDBR_CHG_UPD');
2399               fnd_message.set_token('LOR_LNBR_CODE',NVL(tbh_rec.lend_non_ed_brc_id,'NULL'));
2400               fnd_message.set_token('ACK_FILE_BRC',NVL(lv_lend_non_ed_id,'NULL'));
2401               fnd_file.put_line(fnd_file.log,fnd_message.get);
2402 
2403               tbh_rec.lend_non_ed_brc_id := lv_lend_non_ed_id;
2404 
2405            END IF;
2406 
2407            IF lb_info_change  THEN
2408               --
2409               -- Print Recipient Information
2410               --
2411               fnd_message.set_name('IGF','IGF_SL_CL_LOAN_RECIP_INFO');
2412               fnd_message.set_token('RECIP',lv_recipient_id);
2413               fnd_message.set_token('BRC_CD',NVL(lv_recip_non_ed_id,'NULL'));
2414               fnd_file.put_line(fnd_file.log,fnd_message.get);
2415 
2416               --
2417               -- Check if record exists for this combination
2418               --
2419               OPEN cur_find_lender;
2420               FETCH cur_find_lender INTO find_lender_rec;
2421               IF cur_find_lender%FOUND THEN
2422                  CLOSE cur_find_lender;
2423                  IF find_lender_rec.enabled = 'N' THEN
2424                    fnd_message.set_name('IGF','IGF_SL_CL_SKIP_UPD_EN_FALSE');
2425                    fnd_file.put_line(fnd_file.log,fnd_message.get);
2426                    fnd_file.new_line(fnd_file.log,1);
2427 
2428                    RAISE SKIP_UPDATE_LOANS;
2429                  ELSE
2430                   --
2431                   -- Check if the rel code record exists for AY
2432                   --
2433                   OPEN  cur_find_rel_code(find_lender_rec.relationship_cd,tbh_rec.ci_cal_type,tbh_rec.ci_sequence_number);
2434                   FETCH cur_find_rel_code INTO find_rel_code_rec;
2435                   IF cur_find_rel_code%FOUND THEN
2436                     CLOSE cur_find_rel_code;
2437                     fnd_message.set_name('IGF','IGF_SL_CL_LEND_INFO_UPD');
2438                     fnd_file.put_line(fnd_file.log,fnd_message.get);
2439                     fnd_file.new_line(fnd_file.log,1);
2440                     tbh_rec.relationship_cd := find_lender_rec.relationship_cd;
2441                   ELSIF cur_find_rel_code%NOTFOUND THEN
2442                     CLOSE cur_find_rel_code;
2443                     fnd_message.set_name('IGF','IGF_SL_CL_SKIP_LND_AY_NOTFND');
2444                     fnd_message.set_token('REL_CODE',find_lender_rec.relationship_cd);
2445                     fnd_message.set_token('AWD_YR',tbh_rec.ci_alternate_code);
2446                     fnd_file.put_line(fnd_file.log,fnd_message.get);
2447                     fnd_file.new_line(fnd_file.log,1);
2448                     RAISE SKIP_UPDATE_LOANS;
2449                   END IF;
2450                  END IF;
2451               ELSIF cur_find_lender%NOTFOUND THEN
2452                  CLOSE cur_find_lender;
2453 
2454                  fnd_message.set_name('IGF','IGF_SL_CL_SKIP_LND_NOTFND');
2455                  fnd_file.put_line(fnd_file.log,fnd_message.get);
2456                  fnd_file.new_line(fnd_file.log,1);
2457 
2458                  RAISE SKIP_UPDATE_LOANS;
2459               END IF;
2460            END IF;
2461         END IF; -- rejected rec condition
2462 
2463         IF loaded_1rec.rec_type_ind <> 'N' THEN -- not re-print req
2464 
2465           gv_debug_str := gv_debug_str || 'UPDATE_LOR - 2' || ' ';
2466           tbh_rec.cl_seq_number         :=   loaded_1rec.cl_seq_number;
2467           tbh_rec.borw_confirm_ind      :=   loaded_1rec.borw_confirm_ind;
2468           tbh_rec.service_type_code     :=   loaded_1rec.service_type_code;
2469           tbh_rec.rev_notice_of_guarnt  :=   loaded_1rec.rev_notice_of_guarnt;
2470 
2471 
2472           IF (loaded_1rec.guarantee_date IS NOT NULL AND tbh_rec.guarantee_date IS NULL)
2473           OR loaded_1rec.guarantee_date > tbh_rec.guarantee_date THEN
2474               gv_debug_str := gv_debug_str || 'UPDATE_LOR - 3' || ' ';
2475               tbh_rec.guarnt_adj_ind         :=   loaded_1rec.guarnt_adj_ind;
2476               tbh_rec.guarantee_amt          :=   loaded_1rec.guarantee_amt;
2477               tbh_rec.guarantee_date         :=   loaded_1rec.guarantee_date;
2478               tbh_rec.guarnt_amt_redn_code   :=   loaded_1rec.guarnt_amt_redn_code;
2479               tbh_rec.act_interest_rate      :=   loaded_1rec.act_interest_rate;
2480 
2481           END IF;
2482 
2483           --  In case the Guarantee Status in LOR is Guaranteed (equivalent code is 40 )
2484           --  then no updation of guarantee status code and date
2485 /*
2486           IF ((loaded_1rec.guarnt_status_date IS NOT NULL AND tbh_rec.guarnt_status_date IS NULL)
2487               OR loaded_1rec.guarnt_status_date > tbh_rec.guarnt_status_date )
2488                AND NVL(tbh_rec.guarnt_status_code,'*') <> '40'  THEN
2489 */
2490           IF
2491                (tbh_rec.guarnt_status_code = '01' )
2492                OR
2493                (tbh_rec.guarnt_status_code = '05' AND  loaded_1rec.guarnt_status_code  <> '01')
2494                OR
2495                (tbh_rec.guarnt_status_code <>  '40'
2496                     AND loaded_1rec.guarnt_status_date > tbh_rec.guarnt_status_date
2497                     AND loaded_1rec.guarnt_status_code not in ('01','05'))
2498                OR
2499                (loaded_1rec.guarnt_status_date IS NOT NULL AND tbh_rec.guarnt_status_date IS NULL) THEN
2500               tbh_rec.guarnt_status_code:=loaded_1rec.guarnt_status_code;
2501               tbh_rec.guarnt_status_date:=loaded_1rec.guarnt_status_date;
2502               gv_debug_str := gv_debug_str || 'UPDATE_LOR - 4' || ' ';
2503           END IF;
2504 
2505 
2506           --  If the Lender status in LOR is Approved (equivalent code is 45)
2507           --  then updation of Lender status Code and Date is allowed only when the equivalent Lender Status Code
2508           --  in File is either 30 or 35
2509 
2510 /*
2511           IF (loaded_1rec.lender_status_date IS NOT NULL AND tbh_rec.lend_status_date IS NULL)
2512           OR loaded_1rec.lender_status_date >tbh_rec.lend_status_date THEN
2513 */
2514           IF
2515                (tbh_rec.lend_status_code = '01' )
2516                OR
2517                (tbh_rec.lend_status_code = '05' AND  loaded_1rec.lender_status_code  <> '01')
2518                OR
2519                ((tbh_rec.lend_status_code <>  '45'OR (tbh_rec.lend_status_code = '45'
2520                     AND loaded_1rec.lender_status_code IN ('30', '35')))
2521                     AND loaded_1rec.lender_status_date > tbh_rec.lend_status_date
2522                     AND loaded_1rec.lender_status_code not in ('01','05'))
2523                OR
2524                (loaded_1rec.lender_status_date IS NOT NULL AND tbh_rec.lend_status_date IS NULL) THEN
2525                 tbh_rec.lend_status_code := loaded_1rec.lender_status_code;
2526                 tbh_rec.lend_status_date := loaded_1rec.lender_status_date;
2527                   gv_debug_str := gv_debug_str || 'UPDATE_LOR - 6' || ' ';
2528           END IF;
2529 
2530 
2531           IF (loaded_1rec.sch_refund_date IS NOT NULL AND tbh_rec.sch_refund_date IS NULL)
2532           OR loaded_1rec.sch_refund_date>tbh_rec.sch_refund_date THEN
2533 
2534              tbh_rec.sch_refund_amt  := loaded_1rec.sch_refund_amt;
2535              tbh_rec.sch_refund_date := loaded_1rec.sch_refund_date;
2536              gv_debug_str := gv_debug_str || 'UPDATE_LOR - 7' || ' ';
2537 
2538           END IF;
2539 
2540           IF ((loaded_1rec.credit_status_date IS NOT NULL AND tbh_rec.credit_decision_date IS NULL)
2541           OR loaded_1rec.credit_status_date >= tbh_rec.credit_decision_date )
2542           AND (loaded_1rec.credit_status_code <> '01' OR tbh_rec.credit_override IS NULL )  --pssahni 10-Jan-2005  	Code 01 may not overwrite any other code, regardless of the date stamp.
2543           THEN
2544 
2545              -- credit override reference has been replaced by column crdt_decision_status
2546              -- change was done as part of CL4 changes and as discussed with sachin
2547              tbh_rec.credit_override := loaded_1rec.credit_status_code;  -- pssahni it shd be credit_override as per FD instead of crdt_decision_status
2548              tbh_rec.crdt_decision_status := loaded_1rec.credit_status_code;  -- mnade - 19-Jan-2005
2549              tbh_rec.credit_decision_date := loaded_1rec.credit_status_date;
2550              gv_debug_str := gv_debug_str || 'UPDATE_LOR - 8' || ' ';
2551 
2552           END IF;
2553 
2554           IF  (loaded_1rec.pnote_status_date IS NOT NULL AND tbh_rec.pnote_status_date IS NULL)
2555           OR  loaded_1rec.pnote_status_date > tbh_rec.pnote_status_date THEN
2556                 IF (tbh_rec.pnote_status < loaded_1rec.pnote_status_code)
2557                     OR tbh_rec.pnote_status IS NULL
2558                     OR ((tbh_rec.pnote_status = '60') AND  (loaded_1rec.pnote_status_code IN ('50','55')))
2559                 THEN
2560                     gv_debug_str := gv_debug_str || 'UPDATE_LOR - 12' || ' ';
2561                     tbh_rec.pnote_status         := loaded_1rec.pnote_status_code;
2562                     tbh_rec.pnote_status_date    := loaded_1rec.pnote_status_date;
2563                     tbh_rec.act_serial_loan_code := loaded_1rec.act_serial_loan_code;
2564 
2565                 END IF;
2566           END IF;
2567 
2568           -- Procedure call to compare the Disbursement Information in the Awards Disbursement and the newly
2569           -- inserted Disbursement Information
2570 
2571           gv_debug_str := gv_debug_str || 'UPDATE_LOR - 10' || ' ';
2572           IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
2573             fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.update_lor.debug',gv_debug_str);
2574           END IF;
2575          --Procedure call to compare the Alternate Borrow Details
2576           gv_debug_str := '';
2577           gv_debug_str := gv_debug_str || 'UPDATE_LOR - 11' || ' ';
2578           show_alt_details(p_clrp1_id,tbh_rec.loan_id);
2579 
2580           --IN case the Record Type Indicator in File is not N the following updations should
2581           --be done
2582 
2583           ELSIF  loaded_1rec.rec_type_ind='N' THEN
2584 
2585             IF  ((loaded_1rec.pnote_status_date IS NOT NULL AND tbh_rec.pnote_status_date IS NULL)
2586             OR  loaded_1rec.pnote_status_date > tbh_rec.pnote_status_date )
2587             THEN
2588                 -- pssahni 10-Jan-2005
2589                 -- A code may not be overwritten with a lower value code, regardless of date stamp
2590                 -- Code 60 may not be overwritten by any code except 50 and 55 regardless of the date stamp
2591                 -- bvisvana - Bug # 4121689 - Added a OR condition tbh_rec.pnote_status IS NULL
2592                 IF (tbh_rec.pnote_status < loaded_1rec.pnote_status_code)
2593                 OR (tbh_rec.pnote_status IS NULL)
2594                 OR ((tbh_rec.pnote_status = '60') AND  (loaded_1rec.pnote_status_code IN ('50','55')))
2595                 THEN
2596                     gv_debug_str := gv_debug_str || 'UPDATE_LOR - 12' || ' ';
2597                     tbh_rec.pnote_status         := loaded_1rec.pnote_status_code;
2598                     tbh_rec.pnote_status_date    := loaded_1rec.pnote_status_date;
2599                     tbh_rec.act_serial_loan_code := loaded_1rec.act_serial_loan_code;
2600                 END IF;
2601 
2602             END IF;
2603             gv_debug_str := gv_debug_str || 'UPDATE_LOR - 13' || ' ';
2604         END IF;  -- Check for Reprint Request or not ends here
2605 
2606      OPEN  c_igf_sl_loans (cp_v_loan_number => loaded_1rec.loan_number);
2607      FETCH c_igf_sl_loans INTO rec_c_igf_sl_loans ;
2608      CLOSE c_igf_sl_loans ;
2609 
2610      IF loaded_1rec.cl_version_code = 'RELEASE-5' THEN
2611        IF loaded_1rec.rec_type_ind = 'S' THEN
2612          IF (rec_c_igf_sl_loans.loan_status <> 'S') THEN
2613            fnd_message.set_name('IGF','IGF_SL_CL_SKIP_SENT');
2614            fnd_message.set_token('LOAN_STATUS',rec_c_igf_sl_loans.loan_status);
2615            fnd_file.put_line(fnd_file.log, fnd_message.get);
2616            log_to_fnd(p_v_module => 'UPDATE_LOR',
2617                       p_v_string => ' loan status <> S'
2618                      );
2619            RAISE skip_update_loans;
2620          END IF;
2621          IF ((rec_c_igf_sl_loans.loan_status = 'S') AND
2622              (tbh_rec.rec_type_ind IN ('A','C','T')) ) THEN
2623              NULL;
2624          ELSE
2625            fnd_message.set_name('IGF','IGF_SL_CL_INV_COMB_RT_RC');
2626            fnd_file.put_line(fnd_file.log, fnd_message.get);
2627            log_to_fnd(p_v_module => 'UPDATE_LOR',
2628                       p_v_string => ' loan status <> S and lor rec_type_ind NOT IN (A,C,T)'
2629                      );
2630            RAISE skip_update_loans;
2631          END IF;
2632        END IF;
2633        IF loaded_1rec.rec_type_ind = 'X' THEN
2634          fnd_message.set_name('IGF','IGF_SL_CL_CHG_X_SPRT');
2635          fnd_file.put_line(fnd_file.log, fnd_message.get);
2636          log_to_fnd(p_v_module => 'UPDATE_LOR',
2637                     p_v_string => ' Response Record type = X'
2638                    );
2639          RAISE skip_update_loans;
2640        END IF;
2641      END IF;
2642 
2643      IF loaded_1rec.cl_version_code = 'RELEASE-4' THEN
2644        -- 'R' Record can be uploaded into the system only if the Loan Status is "Accepted" and
2645        -- Loan Change Status is "Sent"
2646        IF loaded_1rec.rec_type_ind = 'R' THEN
2647          IF ((rec_c_igf_sl_loans.loan_status = 'A') AND (rec_c_igf_sl_loans.loan_chg_status = 'S')) THEN
2648            NULL;
2649          ELSE
2650            fnd_message.set_name('IGF','IGF_SL_CL_CHG_ST_SE_ACC');
2651            fnd_file.put_line(fnd_file.log, fnd_message.get);
2652            log_to_fnd(p_v_module => 'UPDATE_LOR',
2653                       p_v_string => ' R Record cannot be uploaded into the system. '||
2654                                     ' Loan status is not Accepted and Loan change status is not sent'
2655                      );
2656            RAISE skip_update_loans;
2657          END IF;
2658        END IF;
2659      END IF;
2660      -- common to both RELEASE-4 AND RELEASE-5
2661      IF loaded_1rec.rec_type_ind = 'N' THEN
2662        IF (rec_c_igf_sl_loans.loan_status <> 'S') THEN
2663          fnd_message.set_name('IGF','IGF_SL_CL_SKIP_SENT');
2664          fnd_message.set_token('LOAN_STATUS',rec_c_igf_sl_loans.loan_status);
2665          fnd_file.put_line(fnd_file.log, fnd_message.get);
2666          log_to_fnd(p_v_module => 'UPDATE_LOR',
2667                    p_v_string => ' loan status <> S'
2668                   );
2669          RAISE skip_update_loans;
2670        END IF;
2671        IF ((rec_c_igf_sl_loans.loan_status = 'S') AND
2672            (tbh_rec.rec_type_ind = 'R') AND
2673            loaded_1rec.prc_type_code = 'GP') THEN
2674            NULL;
2675        ELSE
2676          -- bvisvana - Bug # 4168692 - IGF_SL_CL_INV_COMB_RT_RC changed to IGF_SL_CL_INV_COMB_PT_RC
2677          fnd_message.set_name('IGF','IGF_SL_CL_INV_COMB_PT_RC');
2678          fnd_file.put_line(fnd_file.log, fnd_message.get);
2679          log_to_fnd(p_v_module => 'UPDATE_LOR',
2680                     p_v_string => ' loan status <> S and lor rec_type_ind NOT IN (A,C,T)'
2681                    );
2682          RAISE skip_update_loans;
2683        END IF;
2684      END IF;
2685      IF loaded_1rec.rec_type_ind = 'M' THEN
2686        IF tbh_rec.rec_type_ind NOT IN ('A','C') THEN
2687          fnd_message.set_name('IGF','IGF_SL_CL_INV_COMB_RT_RC');
2688          fnd_file.put_line(fnd_file.log, fnd_message.get);
2689          log_to_fnd(p_v_module => 'UPDATE_LOR',
2690                     p_v_string => ' send record type not in A and C'
2691                    );
2692          RAISE skip_update_loans;
2693        END IF;
2694        IF (rec_c_igf_sl_loans.loan_status NOT IN ('A','S')) THEN
2695          fnd_message.set_name('IGF','IGF_SL_CL_SKIP_SENT_M');
2696          fnd_file.put_line(fnd_file.log, fnd_message.get);
2697          log_to_fnd(p_v_module => 'UPDATE_LOR',
2698                    p_v_string => ' loan status <> S'
2699                   );
2700          RAISE skip_update_loans;
2701        END IF;
2702      END IF;
2703 
2704       -- Update the Table with all the above arrived values
2705       -- bvisvana - FA 161 - Bug # 5006583
2706       IF loaded_1rec.cl_version_code IN ('RELEASE-4','RELEASE-5') THEN
2707 
2708        tbh_rec.actual_record_type_code := loaded_1rec.rec_type_ind;
2709        tbh_rec.cl_rec_status           := NVL(loaded_1rec.cl_rec_status,tbh_rec.cl_rec_status);
2710         lv_defer_req_code   :=  loaded_1rec.defer_req_code;
2711         lv_s_signature_code :=  loaded_1rec.s_signature_code;
2712         lv_stud_sign_ind    :=  loaded_1rec.stud_sign_ind;
2713 
2714         IF loaded_1rec.fed_appl_form_code IN ('Q','G') THEN
2715           IF(loaded_1rec.defer_req_code IS NOT NULL) THEN
2716             lv_log_mesg := igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','DEFER_REQ_CODE') ||' - '||igf_aw_gen.lookup_desc('IGF_SL_CL_ERROR','502');
2717             fnd_file.put_line(fnd_file.log, lv_log_mesg);
2718             lv_defer_req_code := NULL;
2719           END IF;
2720           IF(loaded_1rec.s_signature_code IS NOT NULL) THEN
2721             lv_log_mesg := igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','S_SIGNATURE_CODE') ||' - '||igf_aw_gen.lookup_desc('IGF_SL_CL_ERROR','502');
2722             fnd_file.put_line(fnd_file.log, lv_log_mesg);
2723             lv_s_signature_code := NULL;
2724           END IF;
2725           IF(loaded_1rec.stud_sign_ind IS NOT NULL) THEN
2726             lv_log_mesg := igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','S_ESIGN_IND_CODE') ||' - '||igf_aw_gen.lookup_desc('IGF_SL_CL_ERROR','502');
2727             fnd_file.put_line(fnd_file.log, lv_log_mesg);
2728             lv_stud_sign_ind  := NULL;
2729           END IF;
2730         END IF; -- loaded_1rec.fed_appl_form_code = 'Q'
2731 
2732         IF loaded_1rec.fed_appl_form_code = 'M' THEN
2733           IF(loaded_1rec.defer_req_code IS NOT NULL) THEN
2734             lv_log_mesg := igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','DEFER_REQ_CODE') ||' - '||igf_aw_gen.lookup_desc('IGF_SL_CL_ERROR','502');
2735             fnd_file.put_line(fnd_file.log, lv_log_mesg);
2736             lv_defer_req_code := NULL;
2737           END IF;
2738         END IF; -- loaded_1rec.fed_appl_form_code = 'M'
2739      END IF;
2740 
2741      igf_sl_lor_pkg.update_row (
2742           X_Mode                              => 'R'                                      ,
2743           x_rowid                             => tbh_rec.row_id                           ,
2744           x_origination_id                    => tbh_rec.origination_id                   ,
2745           x_loan_id                           => tbh_rec.loan_id                          ,
2746           x_sch_cert_date                     => tbh_rec.sch_cert_date                    ,
2747           x_orig_status_flag                  => tbh_rec.orig_status_flag                 ,
2748           x_orig_batch_id                     => tbh_rec.orig_batch_id                    ,
2749           x_orig_batch_date                   => tbh_rec.orig_batch_date                  ,
2750           x_chg_batch_id                      => tbh_rec.chg_batch_id                     ,
2751           x_orig_ack_date                     => tbh_rec.orig_ack_date                    ,
2752           x_credit_override                   => tbh_rec.credit_override           ,
2753           x_credit_decision_date              => tbh_rec.credit_decision_date           ,
2754           x_req_serial_loan_code              => tbh_rec.req_serial_loan_code             ,
2755           x_act_serial_loan_code              => loaded_1rec.act_serial_loan_code         ,
2756           x_pnote_delivery_code               => tbh_rec.pnote_delivery_code              ,
2757           x_pnote_status                      => tbh_rec.pnote_status            ,
2758           x_pnote_status_date                 => tbh_rec.pnote_status_date            ,
2759           x_pnote_id                          => tbh_rec.pnote_id                         ,
2760           x_pnote_print_ind                   => tbh_rec.pnote_print_ind                  ,
2761           x_pnote_accept_amt                  => tbh_rec.pnote_accept_amt                 ,
2762           x_pnote_accept_date                 => tbh_rec.pnote_accept_date                ,
2763           x_unsub_elig_for_heal               => tbh_rec.unsub_elig_for_heal              ,
2764           x_disclosure_print_ind              => tbh_rec.disclosure_print_ind             ,
2765           x_orig_fee_perct                    => tbh_rec.orig_fee_perct                   ,
2766           x_borw_confirm_ind                  => loaded_1rec.borw_confirm_ind             ,
2767           x_borw_interest_ind                 => tbh_rec.borw_interest_ind                ,
2768           x_borw_outstd_loan_code             => tbh_rec.borw_outstd_loan_code            ,
2769           x_unsub_elig_for_depnt              => tbh_rec.unsub_elig_for_depnt             ,
2770           x_guarantee_amt                     => loaded_1rec.guarantee_amt                ,
2771           x_guarantee_date                    => loaded_1rec.guarantee_date               ,
2772           x_guarnt_amt_redn_code              => loaded_1rec.guarnt_amt_redn_code         ,
2773           x_guarnt_status_code                => tbh_rec.guarnt_status_code           ,
2774           x_guarnt_status_date                => tbh_rec.guarnt_status_date           ,
2775           x_lend_apprv_denied_code            => loaded_1rec.lend_apprv_denied_code       ,
2776           x_lend_apprv_denied_date            => loaded_1rec.lend_apprv_denied_date       ,
2777           x_lend_status_code                  => tbh_rec.lend_status_code           ,
2778           x_lend_status_date                  => tbh_rec.lend_status_date           ,
2779           x_guarnt_adj_ind                    => loaded_1rec.guarnt_adj_ind               ,
2780           x_grade_level_code                  => tbh_rec.grade_level_code                 ,
2781           x_enrollment_code                   => tbh_rec.enrollment_code                  ,
2782           x_anticip_compl_date                => tbh_rec.anticip_compl_date               ,
2783           x_borw_lender_id                    => loaded_1rec.lender_id                    ,
2784           x_duns_borw_lender_id               => NULL                                     ,
2785           x_guarantor_id                      => loaded_1rec.guarantor_id                 ,
2786           x_duns_guarnt_id                    => NULL                                     ,
2787           x_prc_type_code                     => tbh_rec.prc_type_code                    ,
2788           x_cl_seq_number                     => loaded_1rec.cl_seq_number                ,
2789           x_last_resort_lender                => tbh_rec.last_resort_lender               ,
2790           x_lender_id                         => NULL                                     ,
2791           x_duns_lender_id                    => NULL                                     ,
2792           x_lend_non_ed_brc_id                => loaded_1rec.lend_non_ed_brc_id           ,
2793           x_recipient_id                      => NULL                                     ,
2794           x_recipient_type                    => NULL                                     ,
2795           x_duns_recip_id                     => NULL                                     ,
2796           x_recip_non_ed_brc_id               => NULL                                     ,
2797           x_rec_type_ind                      => tbh_rec.rec_type_ind                     ,
2798           x_cl_loan_type                      => tbh_rec.cl_loan_type                     ,
2799           x_cl_rec_status                     => tbh_rec.cl_rec_status                    ,
2800           x_cl_rec_status_last_update         => loaded_1rec.cl_rec_status_last_update    ,
2801           x_alt_prog_type_code                => tbh_rec.alt_prog_type_code               ,
2802           x_alt_appl_ver_code                 => tbh_rec.alt_appl_ver_code                ,
2803           x_mpn_confirm_code                  => loaded_1rec.mpn_confirm_ind              ,
2804           x_resp_to_orig_code                 => tbh_rec.resp_to_orig_code                ,
2805           x_appl_loan_phase_code              => loaded_1rec.appl_loan_phase_code         ,
2806           x_appl_loan_phase_code_chg          => loaded_1rec.appl_loan_phase_code_chg     ,
2807           x_appl_send_error_codes             => tbh_rec.appl_send_error_codes            ,
2808           x_tot_outstd_stafford               => tbh_rec.tot_outstd_stafford              ,
2809           x_tot_outstd_plus                   => tbh_rec.tot_outstd_plus                  ,
2810           x_alt_borw_tot_debt                 => tbh_rec.alt_borw_tot_debt                ,
2811           x_act_interest_rate                 => loaded_1rec.act_interest_rate            ,
2812           x_service_type_code                 => loaded_1rec.service_type_code            ,
2813           x_rev_notice_of_guarnt              => loaded_1rec.rev_notice_of_guarnt         ,
2814           x_sch_refund_amt                    => loaded_1rec.sch_refund_amt               ,
2815           x_sch_refund_date                   => loaded_1rec.sch_refund_date              ,
2816           x_uniq_layout_vend_code             => tbh_rec.uniq_layout_vend_code            ,
2817           x_uniq_layout_ident_code            => tbh_rec.uniq_layout_ident_code           ,
2818           x_p_person_id                       => tbh_rec.p_person_id                      ,
2819           x_p_ssn_chg_date                    => tbh_rec.p_ssn_chg_date                   ,
2820           x_p_dob_chg_date                    => tbh_rec.p_dob_chg_date                   ,
2821           x_p_permt_addr_chg_date             => tbh_rec.p_permt_addr_chg_date            ,
2822           x_p_default_status                  => tbh_rec.p_default_status                 ,
2823           x_p_signature_code                  => loaded_1rec.b_signature_code             ,
2824           x_p_signature_date                  => loaded_1rec.b_signature_date             ,
2825           x_s_ssn_chg_date                    => tbh_rec.s_ssn_chg_date                   ,
2826           x_s_dob_chg_date                    => tbh_rec.s_dob_chg_date                   ,
2827           x_s_permt_addr_chg_date             => tbh_rec.s_permt_addr_chg_date            ,
2828           x_s_local_addr_chg_date             => tbh_rec.s_local_addr_chg_date            ,
2829           x_s_default_status                  => tbh_rec.s_default_status                 ,
2830           x_s_signature_code                  => lv_s_signature_code             ,
2831           x_pnote_batch_id                    => tbh_rec.pnote_batch_id                   ,
2832           x_pnote_ack_date                    => tbh_rec.pnote_ack_date                   ,
2833           x_pnote_mpn_ind                     => tbh_rec.pnote_mpn_ind                    ,
2834           x_elec_mpn_ind                      => tbh_rec.elec_mpn_ind                     ,
2835           x_borr_sign_ind                     => loaded_1rec.borr_sign_ind                ,
2836           x_stud_sign_ind                     => lv_stud_sign_ind                ,
2837           x_borr_credit_auth_code             => loaded_1rec.borr_credit_auth_code        ,
2838           x_relationship_cd                   => tbh_rec.relationship_cd                  ,
2839           x_interest_rebate_percent_num       => tbh_rec.interest_rebate_percent_num      ,
2840           x_cps_trans_num                     => tbh_rec.cps_trans_num                    ,
2841           x_atd_entity_id_txt                 => tbh_rec.atd_entity_id_txt                ,
2842           x_rep_entity_id_txt                 => tbh_rec.rep_entity_id_txt                ,
2843           x_crdt_decision_status              => tbh_rec.crdt_decision_status             ,
2844           x_note_message                      => tbh_rec.note_message                     ,
2845           x_book_loan_amt                     => tbh_rec.book_loan_amt                    ,
2846           x_book_loan_amt_date                => tbh_rec.book_loan_amt_date               ,
2847           x_pymt_servicer_amt                 => tbh_rec.pymt_servicer_amt                ,
2848           x_pymt_servicer_date                => tbh_rec.pymt_servicer_date               ,
2849           x_external_loan_id_txt              => tbh_rec.external_loan_id_txt             ,
2850           x_deferment_request_code            => lv_defer_req_code               ,
2851           x_eft_authorization_code            => loaded_1rec.eft_auth_code                ,
2852           x_requested_loan_amt                => tbh_rec.requested_loan_amt               ,
2853           x_actual_record_type_code           => tbh_rec.actual_record_type_code          ,
2854           x_reinstatement_amt                 => loaded_1rec.amt_avail_for_reinst         ,
2855           x_school_use_txt                    => loaded_1rec.school_use_txt               ,
2856           x_lender_use_txt                    => loaded_1rec.lender_use_txt               ,
2857           x_guarantor_use_txt                 => loaded_1rec.guarantor_use_txt            ,
2858           x_fls_approved_amt                  => loaded_1rec.fls_approved_amt             ,
2859           x_flu_approved_amt                  => loaded_1rec.flu_approved_amt             ,
2860           x_flp_approved_amt                  => loaded_1rec.flp_approved_amt             ,
2861           x_alt_approved_amt                  => loaded_1rec.alt_approved_amt             ,
2862           x_loan_app_form_code                => loaded_1rec.fed_appl_form_code           ,
2863           x_override_grade_level_code         => tbh_rec.override_grade_level_code        ,
2864           x_acad_begin_date                   => tbh_rec.acad_begin_date                  ,
2865           x_acad_end_date                     => tbh_rec.acad_end_date                    ,
2866           x_b_alien_reg_num_txt               => loaded_1rec.b_alien_reg_num_txt          ,
2867           x_esign_src_typ_cd                  => NVL(tbh_rec.esign_src_typ_cd,loaded_1rec.esign_src_typ_cd)
2868 
2869         );
2870 
2871         gv_debug_str := gv_debug_str || 'UPDATE_LOR - 14' || ' ';
2872         --Update the LOR LOC Table with the values arrived from the above Validations between
2873         --File Data and LOR Data
2874 
2875         DECLARE
2876           CURSOR c_tbh_lor_rec
2877           IS
2878           SELECT lor_loc.*
2879           FROM igf_sl_lor_loc lor_loc
2880           WHERE loan_id = tbh_rec.loan_id FOR UPDATE OF loan_status NOWAIT;
2881 
2882      BEGIN
2883 
2884       FOR lorloc_rec in c_tbh_lor_rec LOOP
2885       gv_debug_str := gv_debug_str || 'UPDATE_LOR-15' ||' ';
2886          igf_sl_lor_loc_pkg.update_row (
2887               X_Mode                              => 'R'                                      ,
2888               x_rowid                             => lorloc_rec.row_id                        ,
2889               x_loan_id                           => lorloc_rec.loan_id                       ,
2890               x_origination_id                    => lorloc_rec.origination_id                ,
2891               x_loan_number                       => lorloc_rec.loan_number                   ,
2892               x_loan_type                         => lorloc_rec.loan_type                     ,
2893               x_loan_amt_offered                  => lorloc_rec.loan_amt_offered              ,
2894               x_loan_amt_accepted                 => lorloc_rec.loan_amt_accepted             ,
2895               x_loan_per_begin_date               => lorloc_rec.loan_per_begin_date           ,
2896               x_loan_per_end_date                 => lorloc_rec.loan_per_end_date             ,
2897               x_acad_yr_begin_date                => lorloc_rec.acad_yr_begin_date            ,
2898               x_acad_yr_end_date                  => lorloc_rec.acad_yr_end_date              ,
2899               x_loan_status                       => lorloc_rec.loan_status                   ,
2900               x_loan_status_date                  => lorloc_rec.loan_status_date              ,
2901               x_loan_chg_status                   => lorloc_rec.loan_chg_status               ,
2902               x_loan_chg_status_date              => lorloc_rec.loan_chg_status_date          ,
2903               x_req_serial_loan_code              => lorloc_rec.req_serial_loan_code          ,
2904               x_act_serial_loan_code              => loaded_1rec.act_serial_loan_code         ,
2905               x_active                            => lorloc_rec.active                        ,
2906               x_active_date                       => lorloc_rec.active_date                   ,
2907               x_sch_cert_date                     => lorloc_rec.sch_cert_date                 ,
2908               x_orig_status_flag                  => lorloc_rec.orig_status_flag              ,
2909               x_orig_batch_id                     => lorloc_rec.orig_batch_id                 ,
2910               x_orig_batch_date                   => lorloc_rec.orig_batch_date               ,
2911               x_chg_batch_id                      => lorloc_rec.chg_batch_id                  ,
2912               x_orig_ack_date                     => lorloc_rec.orig_ack_date                 ,
2913               x_credit_override                   => loaded_1rec.credit_status_code           ,
2914               x_credit_decision_date              => loaded_1rec.credit_status_date           ,
2915               x_pnote_delivery_code               => lorloc_rec.pnote_delivery_code           ,
2916               x_pnote_status                      => loaded_1rec.pnote_status_code            ,
2917               x_pnote_status_date                 => loaded_1rec.pnote_status_date            ,
2918               x_pnote_id                          => lorloc_rec.pnote_id                      ,
2919               x_pnote_print_ind                   => lorloc_rec.pnote_print_ind               ,
2920               x_pnote_accept_amt                  => lorloc_rec.pnote_accept_amt              ,
2921               x_pnote_accept_date                 => lorloc_rec.pnote_accept_date             ,
2922               x_p_signature_code                  => loaded_1rec.b_signature_code             ,
2923               x_p_signature_date                  => loaded_1rec.b_signature_date             ,
2924               x_s_signature_code                  => loaded_1rec.s_signature_code             ,
2925               x_unsub_elig_for_heal               => lorloc_rec.unsub_elig_for_heal           ,
2926               x_disclosure_print_ind              => lorloc_rec.disclosure_print_ind          ,
2927               x_orig_fee_perct                    => lorloc_rec.orig_fee_perct                ,
2928               x_borw_confirm_ind                  => loaded_1rec.borw_confirm_ind             ,
2929               x_borw_interest_ind                 => lorloc_rec.borw_interest_ind             ,
2930               x_unsub_elig_for_depnt              => lorloc_rec.unsub_elig_for_depnt          ,
2931               x_guarantee_amt                     => loaded_1rec.guarantee_amt                ,
2932               x_guarantee_date                    => loaded_1rec.guarantee_date               ,
2933               x_guarnt_adj_ind                    => loaded_1rec.guarnt_adj_ind               ,
2934               x_guarnt_amt_redn_code              => loaded_1rec.guarnt_amt_redn_code         ,
2935               x_guarnt_status_code                => loaded_1rec.guarnt_status_code           ,
2936               x_guarnt_status_date                => loaded_1rec.guarnt_status_date           ,
2937               x_lend_apprv_denied_code            => loaded_1rec.lend_apprv_denied_code       ,
2938               x_lend_apprv_denied_date            => loaded_1rec.lend_apprv_denied_date       ,
2939               x_lend_status_code                  => loaded_1rec.lender_status_code           ,
2940               x_lend_status_date                  => loaded_1rec.lender_status_date           ,
2941               x_grade_level_code                  => lorloc_rec.grade_level_code              ,
2942               x_enrollment_code                   => lorloc_rec.enrollment_code               ,
2943               x_anticip_compl_date                => lorloc_rec.anticip_compl_date            ,
2944               x_borw_lender_id                    => loaded_1rec.lender_id                    ,
2945               x_duns_borw_lender_id               => NULL                                     ,
2946               x_guarantor_id                      => loaded_1rec.guarantor_id                 ,
2947               x_duns_guarnt_id                    => NULL                                     ,
2948               x_prc_type_code                     => lorloc_rec.prc_type_code                 ,
2949               x_rec_type_ind                      => lorloc_rec.rec_type_ind                  ,
2950               x_cl_loan_type                      => lorloc_rec.cl_loan_type                  ,
2951               x_cl_seq_number                     => loaded_1rec.cl_seq_number                ,
2952               x_last_resort_lender                => lorloc_rec.last_resort_lender            ,
2953               x_lender_id                         => loaded_1rec.lender_id                    ,
2954               x_duns_lender_id                    => NULL                                     ,
2955               x_lend_non_ed_brc_id                => loaded_1rec.lend_non_ed_brc_id           ,
2956               x_recipient_id                      => lorloc_rec.recipient_id                  ,
2957               x_recipient_type                    => lorloc_rec.recipient_type                ,
2958               x_duns_recip_id                     => NULL                                     ,
2959               x_recip_non_ed_brc_id               => lorloc_rec.recip_non_ed_brc_id           ,
2960               x_cl_rec_status                     => tbh_rec.cl_rec_status                    ,
2961               x_cl_rec_status_last_update         => loaded_1rec.cl_rec_status_last_update    ,
2962               x_alt_prog_type_code                => lorloc_rec.alt_prog_type_code            ,
2963               x_alt_appl_ver_code                 => lorloc_rec.alt_appl_ver_code             ,
2964               x_borw_outstd_loan_code             => lorloc_rec.borw_outstd_loan_code         ,
2965               x_mpn_confirm_code                  => loaded_1rec.mpn_confirm_ind              ,
2966               x_resp_to_orig_code                 => lorloc_rec.resp_to_orig_code             ,
2967               x_appl_loan_phase_code              => loaded_1rec.appl_loan_phase_code         ,
2968               x_appl_loan_phase_code_chg          => loaded_1rec.appl_loan_phase_code_chg     ,
2969               x_tot_outstd_stafford               => lorloc_rec.tot_outstd_stafford           ,
2970               x_tot_outstd_plus                   => lorloc_rec.tot_outstd_plus               ,
2971               x_alt_borw_tot_debt                 => lorloc_rec.alt_borw_tot_debt             ,
2972               x_act_interest_rate                 => loaded_1rec.act_interest_rate            ,
2973               x_service_type_code                 => loaded_1rec.service_type_code            ,
2974               x_rev_notice_of_guarnt              => loaded_1rec.rev_notice_of_guarnt         ,
2975               x_sch_refund_amt                    => loaded_1rec.sch_refund_amt               ,
2976               x_sch_refund_date                   => loaded_1rec.sch_refund_date              ,
2977               x_uniq_layout_vend_code             => lorloc_rec.uniq_layout_vend_code         ,
2978               x_uniq_layout_ident_code            => lorloc_rec.uniq_layout_ident_code        ,
2979               x_p_person_id                       => lorloc_rec.p_person_id                   ,
2980               x_p_ssn                             => lorloc_rec.p_ssn                         ,
2981               x_p_ssn_chg_date                    => lorloc_rec.p_ssn_chg_date                ,
2982               x_p_last_name                       => lorloc_rec.p_last_name                   ,
2983               x_p_first_name                      => lorloc_rec.p_first_name                  ,
2984               x_p_middle_name                     => lorloc_rec.p_middle_name                 ,
2985               x_p_permt_addr1                     => lorloc_rec.p_permt_addr1                 ,
2986               x_p_permt_addr2                     => lorloc_rec.p_permt_addr2                 ,
2987               x_p_permt_city                      => lorloc_rec.p_permt_city                  ,
2988               x_p_permt_state                     => lorloc_rec.p_permt_state                 ,
2989               x_p_permt_zip                       => lorloc_rec.p_permt_zip                   ,
2990               x_p_permt_addr_chg_date             => lorloc_rec.p_permt_addr_chg_date         ,
2991               x_p_permt_phone                     => lorloc_rec.p_permt_phone                 ,
2992               x_p_email_addr                      => lorloc_rec.p_email_addr                  ,
2993               x_p_date_of_birth                   => lorloc_rec.p_date_of_birth               ,
2994               x_p_dob_chg_date                    => lorloc_rec.p_dob_chg_date                ,
2995               x_p_license_num                     => lorloc_rec.p_license_num                 ,
2996               x_p_license_state                   => lorloc_rec.p_license_state               ,
2997               x_p_citizenship_status              => lorloc_rec.p_citizenship_status          ,
2998               x_p_alien_reg_num                   => lorloc_rec.p_alien_reg_num               ,
2999               x_p_default_status                  => lorloc_rec.p_default_status              ,
3000               x_p_foreign_postal_code             => lorloc_rec.p_foreign_postal_code         ,
3001               x_p_state_of_legal_res              => lorloc_rec.p_state_of_legal_res          ,
3002               x_p_legal_res_date                  => lorloc_rec.p_legal_res_date              ,
3003               x_s_ssn                             => lorloc_rec.s_ssn                         ,
3004               x_s_ssn_chg_date                    => lorloc_rec.s_ssn_chg_date                ,
3005               x_s_last_name                       => lorloc_rec.s_last_name                   ,
3006               x_s_first_name                      => lorloc_rec.s_first_name                  ,
3007               x_s_middle_name                     => lorloc_rec.s_middle_name                 ,
3008               x_s_permt_addr1                     => lorloc_rec.s_permt_addr1                 ,
3009               x_s_permt_addr2                     => lorloc_rec.s_permt_addr2                 ,
3010               x_s_permt_city                      => lorloc_rec.s_permt_city                  ,
3011               x_s_permt_state                     => lorloc_rec.s_permt_state                 ,
3012               x_s_permt_zip                       => lorloc_rec.s_permt_zip                   ,
3013               x_s_permt_addr_chg_date             => lorloc_rec.s_permt_addr_chg_date         ,
3014               x_s_permt_phone                     => lorloc_rec.s_permt_phone                 ,
3015               x_s_local_addr1                     => lorloc_rec.s_local_addr1                 ,
3016               x_s_local_addr2                     => lorloc_rec.s_local_addr2                 ,
3017               x_s_local_city                      => lorloc_rec.s_local_city                  ,
3018               x_s_local_state                     => lorloc_rec.s_local_state                 ,
3019               x_s_local_zip                       => lorloc_rec.s_local_zip                   ,
3020               x_s_local_addr_chg_date             => lorloc_rec.s_local_addr_chg_date         ,
3021               x_s_email_addr                      => lorloc_rec.s_email_addr                  ,
3022               x_s_date_of_birth                   => lorloc_rec.s_date_of_birth               ,
3023               x_s_dob_chg_date                    => lorloc_rec.s_dob_chg_date                ,
3024               x_s_license_num                     => lorloc_rec.s_license_num                 ,
3025               x_s_license_state                   => lorloc_rec.s_license_state               ,
3026               x_s_depncy_status                   => lorloc_rec.s_depncy_status               ,
3027               x_s_default_status                  => lorloc_rec.s_default_status              ,
3028               x_s_citizenship_status              => lorloc_rec.s_citizenship_status          ,
3029               x_s_alien_reg_num                   => lorloc_rec.s_alien_reg_num               ,
3030               x_s_foreign_postal_code             => lorloc_rec.s_foreign_postal_code         ,
3031               x_pnote_batch_id                    => lorloc_rec.pnote_batch_id                ,
3032               x_pnote_ack_date                    => lorloc_rec.pnote_ack_date                ,
3033               x_pnote_mpn_ind                     => lorloc_rec.pnote_mpn_ind                 ,
3034               x_award_id                          => lorloc_rec.award_id                      ,
3035               x_base_id                           => lorloc_rec.base_id                       ,
3036               x_document_id_txt                   => lorloc_rec.document_id_txt               ,
3037               x_loan_key_num                      => lorloc_rec.loan_key_num                  ,
3038               x_interest_rebate_percent_num       => lorloc_rec.interest_rebate_percent_num   ,
3039               x_fin_award_year                    => lorloc_rec.fin_award_year                ,
3040               x_cps_trans_num                     => lorloc_rec.cps_trans_num                 ,
3041               x_atd_entity_id_txt                 => lorloc_rec.atd_entity_id_txt             ,
3042               x_rep_entity_id_txt                 => lorloc_rec.rep_entity_id_txt             ,
3043               x_source_entity_id_txt              => lorloc_rec.source_entity_id_txt          ,
3044               x_pymt_servicer_amt                 => lorloc_rec.pymt_servicer_amt             ,
3045               x_pymt_servicer_date                => lorloc_rec.pymt_servicer_date            ,
3046               x_book_loan_amt                     => lorloc_rec.book_loan_amt                 ,
3047               x_book_loan_amt_date                => lorloc_rec.book_loan_amt_date            ,
3048               x_s_chg_birth_date                  => lorloc_rec.s_chg_birth_date              ,
3049               x_s_chg_ssn                         => lorloc_rec.s_chg_ssn                     ,
3050               x_s_chg_last_name                   => lorloc_rec.s_chg_last_name               ,
3051               x_b_chg_birth_date                  => lorloc_rec.b_chg_birth_date              ,
3052               x_b_chg_ssn                         => lorloc_rec.b_chg_ssn                     ,
3053               x_b_chg_last_name                   => lorloc_rec.b_chg_last_name               ,
3054               x_note_message                      => lorloc_rec.note_message                  ,
3055               x_full_resp_code                    => lorloc_rec.full_resp_code                ,
3056               x_s_permt_county                    => lorloc_rec.s_permt_county                ,
3057               x_b_permt_county                    => lorloc_rec.b_permt_county                ,
3058               x_s_permt_country                   => lorloc_rec.s_permt_country               ,
3059               x_b_permt_country                   => lorloc_rec.b_permt_country               ,
3060               x_crdt_decision_status              => lorloc_rec.crdt_decision_status          ,
3061               x_external_loan_id_txt              => lorloc_rec.external_loan_id_txt          ,
3062               x_deferment_request_code            => loaded_1rec.defer_req_code               ,
3063               x_eft_authorization_code            => loaded_1rec.eft_auth_code                ,
3064               x_requested_loan_amt                => lorloc_rec.requested_loan_amt            ,
3065               x_actual_record_type_code           => tbh_rec.actual_record_type_code          ,
3066               x_reinstatement_amt                 => loaded_1rec.amt_avail_for_reinst         ,
3067               x_school_use_txt                    => loaded_1rec.school_use_txt               ,
3068               x_lender_use_txt                    => loaded_1rec.lender_use_txt               ,
3069               x_guarantor_use_txt                 => loaded_1rec.guarantor_use_txt            ,
3070               x_fls_approved_amt                  => loaded_1rec.fls_approved_amt             ,
3071               x_flu_approved_amt                  => loaded_1rec.flu_approved_amt             ,
3072               x_flp_approved_amt                  => loaded_1rec.flp_approved_amt             ,
3073               x_alt_approved_amt                  => loaded_1rec.alt_approved_amt             ,
3074               x_loan_app_form_code                => loaded_1rec.fed_appl_form_code           ,
3075               x_alt_borrower_ind_flag             => lorloc_rec.alt_borrower_ind_flag         ,
3076               x_school_id_txt                     => lorloc_rec.school_id_txt                 ,
3077               x_cost_of_attendance_amt            => lorloc_rec.cost_of_attendance_amt        ,
3078               x_expect_family_contribute_amt      => lorloc_rec.expect_family_contribute_amt  ,
3079               x_established_fin_aid_amount        => lorloc_rec.established_fin_aid_amount    ,
3080               x_borower_electronic_sign_flag      => loaded_1rec.borr_sign_ind                ,
3081               x_student_electronic_sign_flag      => loaded_1rec.stud_sign_ind                ,
3082               x_borower_credit_authoriz_flag      => loaded_1rec.borr_credit_auth_code        ,
3083               x_mpn_type_flag                     => lorloc_rec.mpn_type_flag                 ,
3084               x_esign_src_typ_cd                  => loaded_1rec.esign_src_typ_cd
3085             );
3086     gv_debug_str := '';
3087     END LOOP;
3088 
3089    END;
3090 
3091 
3092     -- Update the Loan Status in Loans Table  based on the below conditions
3093    l_loan_status := NULL;
3094    IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
3095       fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.update_lor.debug',gv_debug_str||' loaded_1rec.prc_type_code ' || loaded_1rec.prc_type_code);
3096       fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.update_lor.debug',gv_debug_str||' tbh_rec.guarnt_status_code ' || tbh_rec.guarnt_status_code);
3097       fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.update_lor.debug',gv_debug_str||' tbh_rec.lend_status_code ' || tbh_rec.lend_status_code);
3098       fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.update_lor.debug',gv_debug_str||' tbh_rec.pnote_status ' || tbh_rec.pnote_status);
3099       fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.update_lor.debug',gv_debug_str||' tbh_rec.credit_override ' || tbh_rec.crdt_decision_status );
3100    END IF;
3101 
3102    IF loaded_1rec.cl_version_code = 'RELEASE-5' THEN
3103      IF loaded_1rec.prc_type_code='GP' THEN
3104        -- loan status should be accepted if guarantee status is  40.
3105        IF ( tbh_rec.guarnt_status_code ='40' -- FA 122 Loans Enhancements
3106        AND tbh_rec.lend_status_code= '45'
3107        AND tbh_rec.pnote_status    = '60'
3108        AND tbh_rec.crdt_decision_status IN ('05','35')) THEN
3109          -- Loan is Accepted
3110          gv_debug_str := gv_debug_str || 'UPDATE_LOR-16' || ' ';
3111          l_loan_status:='A';
3112          fnd_message.set_name('IGF','IGF_SL_CL_LOAN_ACC');
3113          fnd_message.set_token('LOAN_NUMBER',loaded_1rec.loan_number);
3114          fnd_file.put_line(fnd_file.log,fnd_message.get);
3115          fnd_file.new_line(fnd_file.log,1);
3116          log_to_fnd(p_v_module => 'update_lor',
3117                     p_v_string => ' Loan is Accepted'
3118                    );
3119 
3120        ELSIF (tbh_rec.guarnt_status_code ='30'
3121              OR tbh_rec.lend_status_code IN ('25','35')
3122              OR tbh_rec.crdt_decision_status  IN ('20','30')) THEN
3123 
3124          -- Loan is Rejected
3125          gv_debug_str := gv_debug_str || 'UPDATE_LOR-17' || ' ';
3126          l_loan_status:='R';
3127          fnd_message.set_name('IGF','IGF_SL_CL_LOAN_REJ');
3128          fnd_message.set_token('LOAN_NUMBER',loaded_1rec.loan_number);
3129          fnd_file.put_line(fnd_file.log,fnd_message.get);
3130          fnd_file.new_line(fnd_file.log,1);
3131          log_to_fnd(p_v_module => 'update_lor',
3132                     p_v_string => ' Loan is Rejected'
3133                    );
3134 
3135        ELSIF (tbh_rec.guarnt_status_code='35'
3136              OR tbh_rec.lend_status_code='30') THEN
3137 
3138          -- Loan is Terminated
3139          l_loan_status:='T';
3140          fnd_message.set_name('IGF','IGF_SL_CL_LOAN_TER');
3141          fnd_message.set_token('LOAN_NUMBER',loaded_1rec.loan_number);
3142          fnd_file.put_line(fnd_file.log,fnd_message.get);
3143          fnd_file.new_line(fnd_file.log,1);
3144          gv_debug_str := gv_debug_str || 'UPDATE_LOR-18' || ' ';
3145 
3146        END IF;
3147      END IF;    -- End of Condition of 'GP'
3148      IF loaded_1rec.prc_type_code='GO' THEN
3149        IF ( tbh_rec.guarnt_status_code ='40' AND
3150             tbh_rec.lend_status_code   = '45') THEN
3151          l_loan_status := 'A';
3152          fnd_message.set_name('IGF','IGF_SL_CL_LOAN_ACC');
3153          fnd_message.set_token('LOAN_NUMBER',loaded_1rec.loan_number);
3154          fnd_file.put_line(fnd_file.log,fnd_message.get);
3155          fnd_file.new_line(fnd_file.log,1);
3156          log_to_fnd(p_v_module => 'update_lor',
3157                     p_v_string => ' Loan is Accepted'
3158                    );
3159        END IF;
3160        IF (tbh_rec.guarnt_status_code ='30'OR
3161            tbh_rec.lend_status_code IN ('25','35')) THEN
3162          l_loan_status:='R';
3163          fnd_message.set_name('IGF','IGF_SL_CL_LOAN_REJ');
3164          fnd_message.set_token('LOAN_NUMBER',loaded_1rec.loan_number);
3165          fnd_file.put_line(fnd_file.log,fnd_message.get);
3166          fnd_file.new_line(fnd_file.log,1);
3167          log_to_fnd(p_v_module => 'update_lor',
3168                     p_v_string => ' Loan is Rejected'
3169                    );
3170        END IF;
3171        IF (tbh_rec.guarnt_status_code = '35') THEN
3172          -- Loan is Terminated
3173          l_loan_status:='T';
3174          fnd_message.set_name('IGF','IGF_SL_CL_LOAN_TER');
3175          fnd_message.set_token('LOAN_NUMBER',loaded_1rec.loan_number);
3176          fnd_file.put_line(fnd_file.log,fnd_message.get);
3177          fnd_file.new_line(fnd_file.log,1);
3178          log_to_fnd(p_v_module => 'update_lor',
3179                     p_v_string => ' Loan is Terminated'
3180                    );
3181        END IF;
3182      END IF;
3183    END IF;
3184 
3185    IF loaded_1rec.cl_version_code = 'RELEASE-4' THEN
3186 --MN 16-Dec-2004 15:27 Both G and B to be treated as Accepted for GP requests.
3187      IF ((loaded_1rec.prc_type_code='GP') AND (loaded_1rec.cl_rec_status in ('B', 'G'))) THEN
3188        l_loan_status := 'A';
3189        fnd_message.set_name('IGF','IGF_SL_CL_LOAN_ACC');
3190        fnd_message.set_token('LOAN_NUMBER',loaded_1rec.loan_number);
3191        fnd_file.put_line(fnd_file.log,fnd_message.get);
3192        fnd_file.new_line(fnd_file.log,1);
3193        log_to_fnd(p_v_module => 'update_lor',
3194                   p_v_string => ' Loan is Accepted'
3195                  );
3196      END IF;
3197 --MN 16-Dec-2004 15:27 Both G and B to be treated as Accepted for GO requests.
3198      IF ((loaded_1rec.prc_type_code='GO') AND (loaded_1rec.cl_rec_status in ('B', 'G'))) THEN
3199        l_loan_status := 'A';
3200        fnd_message.set_name('IGF','IGF_SL_CL_LOAN_ACC');
3201        fnd_message.set_token('LOAN_NUMBER',loaded_1rec.loan_number);
3202        fnd_file.put_line(fnd_file.log,fnd_message.get);
3203        fnd_file.new_line(fnd_file.log,1);
3204        log_to_fnd(p_v_module => 'update_lor',
3205                   p_v_string => ' Loan is Accepted'
3206                  );
3207      END IF;
3208      IF ((loaded_1rec.prc_type_code='GP') AND (loaded_1rec.cl_rec_status = 'D')) THEN
3209        l_loan_status:='R';
3210        fnd_message.set_name('IGF','IGF_SL_CL_LOAN_REJ');
3211        fnd_message.set_token('LOAN_NUMBER',loaded_1rec.loan_number);
3212        fnd_file.put_line(fnd_file.log,fnd_message.get);
3213        fnd_file.new_line(fnd_file.log,1);
3214        log_to_fnd(p_v_module => 'update_lor',
3215                   p_v_string => ' Loan is Rejected'
3216                  );
3217      END IF;
3218      IF ((loaded_1rec.prc_type_code='GO') AND (loaded_1rec.cl_rec_status = 'D')) THEN
3219        l_loan_status:='R';
3220        fnd_message.set_name('IGF','IGF_SL_CL_LOAN_REJ');
3221        fnd_message.set_token('LOAN_NUMBER',loaded_1rec.loan_number);
3222        fnd_file.put_line(fnd_file.log,fnd_message.get);
3223        fnd_file.new_line(fnd_file.log,1);
3224        log_to_fnd(p_v_module => 'update_lor',
3225                   p_v_string => ' Loan is rejected'
3226                  );
3227      END IF;
3228      IF ((loaded_1rec.prc_type_code IN ('GO','GP')) AND (loaded_1rec.cl_rec_status = 'T')) THEN
3229        -- Loan is Terminated
3230        l_loan_status:='T';
3231        fnd_message.set_name('IGF','IGF_SL_CL_LOAN_TER');
3232        fnd_message.set_token('LOAN_NUMBER',loaded_1rec.loan_number);
3233        fnd_file.put_line(fnd_file.log,fnd_message.get);
3234        fnd_file.new_line(fnd_file.log,1);
3235        log_to_fnd(p_v_module => 'update_lor',
3236                   p_v_string => ' Loan is Terminated'
3237                  );
3238      END IF;
3239    END IF;
3240 
3241    IF l_loan_status IS NOT NULL THEN
3242      IF l_loan_status = 'A' THEN   -- call only if loan is accepted
3243         compare_disbursements(l_loan_number);
3244      END IF;
3245      FOR loan_rec IN cur_tbh_loans LOOP
3246        gv_debug_str := gv_debug_str || 'UPDATE_LOR-19' || ' ';
3247        -- Modified the Update Row procedure call for the IGF_SL_LOANS_PKG to include the
3248        -- Borrower Determination as part of Refunds DLD - 2144600
3249        --
3250        -- check if loan status is sent, then only take the update
3251        --
3252        IF loan_rec.loan_status = 'S' THEN
3253           igf_sl_loans_pkg.update_row (
3254             X_Mode                              => 'R',
3255             x_rowid                             => loan_rec.row_id,
3256             x_loan_id                           => loan_rec.loan_id,
3257             x_award_id                          => loan_rec.award_id,
3258             x_seq_num                           => loan_rec.seq_num,
3259             x_loan_number                       => loan_rec.loan_number,
3260             x_loan_per_begin_date               => loan_rec.loan_per_begin_date,
3261             x_loan_per_end_date                 => loan_rec.loan_per_end_date,
3262             x_loan_status                       => l_loan_status,
3263             x_loan_status_date                  => TRUNC(SYSDATE),
3264             x_loan_chg_status                   => loan_rec.loan_chg_status,
3265             x_loan_chg_status_date              => loan_rec.loan_chg_status_date,
3266             x_active                            => loan_rec.active,
3267             x_active_date                       => loan_rec.active_date,
3268             x_borw_detrm_code                   => loan_rec.borw_detrm_code,
3269             x_legacy_record_flag                => NULL,
3270             x_external_loan_id_txt              => loan_rec.external_loan_id_txt
3271           );
3272        END IF;
3273        gv_debug_str := '';
3274      END LOOP;
3275    END IF;
3276    gv_debug_str := '';
3277  END LOOP;
3278 
3279  gv_debug_str := gv_debug_str || 'UPDATE_LOR-20' || ' ';
3280  IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
3281    fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.update_lor.debug',gv_debug_str);
3282  END IF;
3283  gv_debug_str := '';
3284 
3285 EXCEPTION
3286 
3287  WHEN SKIP_UPDATE_LOANS THEN
3288       NULL;
3289 
3290  WHEN app_exception.record_lock_exception THEN
3291      RAISE;
3292 
3293  WHEN OTHERS THEN
3294      fnd_message.set_name('IGF','IGF_GE_UNHANDLED_EXP');
3295      fnd_message.set_token('NAME','IGF_SL_CL_ACK.UPDATE_LOR');
3296      IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
3297        fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.update_lor.exception',gv_debug_str||' '|| SQLERRM);
3298      END IF;
3299      gv_debug_str := '';
3300      igs_ge_msg_stack.add;
3301      app_exception.raise_exception;
3302 
3303 END update_lor;
3304 
3305 PROCEDURE compare_disbursements(p_loan_number igf_sl_loans_all.loan_number%TYPE)
3306 AS
3307 /***************************************************************
3308    Created By       :    mesriniv
3309    Date Created By  :    2000/12/07
3310    Purpose          :    To Compare the Disbursement Amounts specified in the
3311                      Format @8 Record with Data in the IGF_AW_AWD_DISB table
3312    Known Limitations,Enhancements or Remarks
3313    Change History   :
3314    Who              When      What
3315    bvisvana         12-Sept-2005    Bug # 4575843.
3316                                     Removed the functionality of HOLD (place_disb_holds) and calling upd_disb_details
3317  ***************************************************************/
3318 
3319     l_old_count            NUMBER;
3320     l_new_count            NUMBER;
3321     l_award_id             igf_aw_awd_disb_all.award_id%TYPE;
3322     l_disb_num             igf_aw_awd_disb_all.disb_num%TYPE;
3323     l_disb_gross_amt       igf_aw_awd_disb_all.disb_gross_amt%TYPE;
3324 
3325 
3326       --Count the No.of Disbursements for the award id in Awards Disbursements Table
3327       CURSOR cur_count_old_disb
3328         IS
3329         SELECT award_id,  NVL(COUNT(disb_num),0) FROM igf_aw_awd_disb
3330         WHERE award_id = (SELECT award_id FROM igf_sl_loans
3331                           WHERE NVL(external_loan_id_txt,loan_number) = p_loan_number)
3332         GROUP BY award_id;
3333 
3334       --Count the No.of Disbursements for the award id in Response8 Disbursements Table
3335       CURSOR cur_count_new_disb (p_rec_status igf_sl_cl_resp_r8_all.resp_record_status%TYPE)
3336         IS
3337         SELECT NVL(COUNT(resp8.clrp8_id),0) FROM igf_sl_cl_resp_r8_all resp8
3338         WHERE clrp1_id                = loaded_1rec.clrp1_id
3339         AND  resp8.resp_record_status = p_rec_status;
3340 
3341       -- Check if the Disb-Num and Disb_gross_amts are same between the File and
3342       -- currently in our system.
3343       CURSOR cur_disb_same_data IS
3344         SELECT disb_num, disb_gross_amt FROM
3345         ((
3346          SELECT disb_num, NVL(disb_accepted_amt,0) disb_gross_amt  FROM igf_aw_awd_disb adisb
3347           WHERE award_id = l_award_id
3348           MINUS
3349           SELECT clrp8_id, disb_gross_amt FROM igf_sl_cl_resp_r8_all clrp8
3350           WHERE clrp1_id = loaded_1rec.clrp1_id
3351          )
3352          UNION ALL
3353          (SELECT clrp8_id, disb_gross_amt FROM igf_sl_cl_resp_r8_all clrp8
3354           WHERE clrp1_id = loaded_1rec.clrp1_id
3355           MINUS
3356           SELECT disb_num, NVL(disb_accepted_amt,0) disb_gross_amt FROM igf_aw_awd_disb adisb
3357           WHERE award_id = l_award_id
3358          )
3359         );
3360 
3361       --select the NewDisbursements for the award id in Response8 Disbursements Table
3362       CURSOR cur_new_disbursements(p_rec_status igf_sl_cl_resp_r8_all.resp_record_status%TYPE)
3363         IS
3364         SELECT * FROM igf_sl_cl_resp_r8
3365         WHERE clrp1_id         = loaded_1rec.clrp1_id
3366         AND resp_record_status = p_rec_status
3367         ORDER By clrp8_id;
3368 
3369       --Select the old Disbursements for the award id in Awards Disbursements Table
3370       CURSOR cur_old_disbursements
3371       IS
3372       SELECT * FROM  igf_aw_awd_disb
3373       WHERE award_id = l_award_id
3374       ORDER BY disb_num;
3375 
3376 
3377     --To update the Resp8 Records with Y as Record Status
3378 
3379     PROCEDURE update_resp8_rec_status(p_clrp1_id                igf_sl_cl_resp_r8_all.clrp1_id%TYPE,
3380                                       p_clrp8_id                igf_sl_cl_resp_r8_all.clrp8_id%TYPE,
3381                                       p_resp_record_status      igf_sl_cl_resp_r8_all.resp_record_status%TYPE)
3382     AS
3383     /***************************************************************
3384        Created By        :    mesriniv
3385        Date Created By   :    2000/12/07
3386        Purpose      :    To Update the Record Status of the Response8
3387                          Records as Processed
3388        Known Limitations,Enhancements or Remarks
3389        Change History    :
3390 --  Who          When            What
3391 --  mnade       21-Jan-2005     Bug - 4136563 - Disbursement update problems.
3392 --                              The disbursements in @8 will be updated based on the flag and
3393 --                              award disbursement changes status.
3394      ***************************************************************/
3395 
3396     --Select Response8 Records for Updation
3397     CURSOR cur_resp_r8
3398         IS
3399         SELECT *
3400         FROM igf_sl_cl_resp_r8
3401         WHERE   clrp1_id = p_clrp1_id
3402             AND clrp8_id = NVL(p_clrp8_id, clrp8_id)
3403             AND resp_record_status = 'N';
3404     l_resp_record_status    igf_sl_cl_resp_r8_all.resp_record_status%TYPE;
3405     BEGIN
3406 
3407       l_resp_record_status := p_resp_record_status;
3408       gv_debug_str := 'UPDATE_RESP8_REC_STATUS-1' || ' targetStatus - '|| l_resp_record_status || ' ';
3409 
3410       FOR resp_r8_rec in cur_resp_r8 LOOP
3411 
3412       gv_debug_str := gv_debug_str || 'UPDATE_RESP8_REC_STATUS-2' || ' ';
3413 
3414         igf_sl_cl_resp_r8_pkg.update_row (
3415           X_Mode                              => 'R',
3416           x_rowid                             => resp_r8_rec.row_id,
3417           x_clrp1_id                          => resp_r8_rec.clrp1_id,
3418           x_clrp8_id                          => resp_r8_rec.clrp8_id,
3419           x_disb_date                         => resp_r8_rec.disb_date,
3420           x_disb_gross_amt                    => resp_r8_rec.disb_gross_amt,
3421           x_orig_fee                          => resp_r8_rec.orig_fee,
3422           x_guarantee_fee                     => resp_r8_rec.guarantee_fee,
3423           x_net_disb_amt                      => resp_r8_rec.net_disb_amt,
3424           x_disb_hold_rel_ind                 => resp_r8_rec.disb_hold_rel_ind,
3425           x_disb_status                       => resp_r8_rec.disb_status,
3426           x_guarnt_fee_paid                   => resp_r8_rec.guarnt_fee_paid,
3427           x_orig_fee_paid                     => resp_r8_rec.orig_fee_paid,
3428           x_resp_record_status                => l_resp_record_status,
3429           x_layout_owner_code_txt             => resp_r8_rec.layout_owner_code_txt,
3430           x_layout_version_code_txt           => resp_r8_rec.layout_version_code_txt,
3431           x_record_code_txt                   => resp_r8_rec.record_code_txt
3432 --	  x_direct_to_borr_flag               => resp_r8_rec.direct_to_borr_flag
3433         );
3434       gv_debug_str := '';
3435       END LOOP;
3436 
3437      IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
3438        fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.update_resp8_rec_status.debug',gv_debug_str);
3439      END IF;
3440 
3441     END update_resp8_rec_status;
3442 
3443     PROCEDURE show_disb_details
3444     AS
3445 
3446      -- ActualLoan Amount       (from OFA)
3447      -- Requested Loan Amount   (from File)
3448      -- Guarantee Adj Indicator (From File)
3449      -- Guarantee Amount        (From File)
3450      -- Show all Disb details   (From OFA)
3451      --    Disb-Num    Disb-Gross   Fee1   Fee2   Fee_paid1   Fee_paid2   Disb-Net-Amt
3452      -- Show all Disb detail    (From File)
3453      --    Disb-Num    Disb-Gross   Fee1   Fee2   Fee_paid1   Fee_paid2   Disb-Net-Amt
3454 
3455     BEGIN
3456         gv_debug_str := 'SHOW_DISB_DETAILS-1' ||' ';
3457         IF p_disb_title IS  NULL THEN
3458             p_disb_title :=  LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','DISB_NUM'),30)
3459                            ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','DISB_DATE'),30)
3460                            ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','DISB_GROSS_AMT'),30)
3461                            ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','FEE_1'),30)
3462                            ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','FEE_2'),30)
3463                            ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','FEE_PAID_1'),30)
3464                            ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','FEE_PAID_2'),30)
3465                            ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','DISB_NET_AMT'),30)
3466 			                     ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_CL_ROSTER_LOGS','DIRECT_TO_BORR_IND'),35);
3467 
3468            p_disb_under_line := RPAD('-',30,'-')
3469                               ||RPAD('-',30,'-')
3470                               ||RPAD('-',30,'-')
3471                               ||RPAD('-',30,'-')
3472                               ||RPAD('-',30,'-')
3473                               ||RPAD('-',30,'-')
3474                               ||RPAD('-',30,'-')
3475 			                        ||RPAD('-',30,'-')
3476                               ||RPAD('-',35,'-');
3477         END IF;
3478 
3479         fnd_file.put_line(fnd_file.log,' ');
3480         fnd_file.put_line(fnd_file.log,igf_aw_gen.lookup_desc('IGF_SL_GEN','OFA_DISB_DETAILS'));
3481         fnd_file.put_line(fnd_file.log,p_disb_title);
3482         fnd_file.put_line(fnd_file.log,p_disb_under_line);
3483         --To show the Disbursement Details in OFA
3484 
3485         FOR OFA_disb IN cur_old_disbursements
3486         LOOP
3487              fnd_file.put_line(fnd_file.log,
3488                                  LPAD(TO_CHAR(OFA_disb.disb_num),30)
3489                                ||LPAD(fnd_date.date_to_displaydate(OFA_disb.disb_date),30)
3490                                ||LPAD(TO_CHAR(OFA_disb.disb_accepted_amt),30)                   -- disb gorss amt changed to disb accepted amt
3491                                ||LPAD(TO_CHAR(OFA_disb.fee_1),30)
3492                                ||LPAD(TO_CHAR(OFA_disb.fee_2),30)
3493                                ||LPAD(TO_CHAR(OFA_disb.fee_paid_1),30)
3494                                ||LPAD(TO_CHAR(OFA_disb.fee_paid_2),30)
3495                                ||LPAD(TO_CHAR(OFA_disb.disb_net_amt),30)
3496 			       ||LPAD(OFA_disb.direct_to_borr_flag,30));
3497         END LOOP;
3498 
3499         --To show the Disbursement details in File
3500         fnd_file.put_line(fnd_file.log,' ');
3501         fnd_file.put_line(fnd_file.log,igf_aw_gen.lookup_desc('IGF_SL_GEN','LOC_DISB_DETAILS'));
3502         fnd_file.put_line(fnd_file.log,p_disb_title);
3503         fnd_file.put_line(fnd_file.log,p_disb_under_line);
3504 
3505         FOR LOC_disb IN cur_new_disbursements('N')
3506         LOOP
3507            fnd_file.put_line(fnd_file.log,
3508                                LPAD(TO_CHAR(LOC_disb.clrp8_id),30)
3509                              ||LPAD(fnd_date.date_to_displaydate(LOC_disb.disb_date),30)
3510                              ||LPAD(TO_CHAR(LOC_disb.disb_gross_amt),30)
3511                              ||LPAD(TO_CHAR(LOC_disb.orig_fee),30)
3512                              ||LPAD(TO_CHAR(LOC_disb.guarantee_fee),30)
3513                              ||LPAD(TO_CHAR(LOC_disb.orig_fee_paid),30)
3514                              ||LPAD(TO_CHAR(LOC_disb.guarnt_fee_paid),30)
3515                              ||LPAD(TO_CHAR(LOC_disb.net_disb_amt),30)
3516 			     ||LPAD(LOC_disb.direct_to_borr_flag,30));
3517 
3518         END LOOP;
3519         gv_debug_str := gv_debug_str || 'SHOW_DISB_DETAILS-2' ||' ';
3520         IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
3521           fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.show_disb_details.debug',gv_debug_str);
3522         END IF;
3523     END show_disb_details;
3524 
3525     /***************************************************************
3526        Change History   :
3527        Who              When            What
3528        bvisvana         05-Sept-2005    Bug # 4149649	- Shows disb details only for those with differences
3529      ***************************************************************/
3530     PROCEDURE show_differing_disb_details
3531     AS
3532         CURSOR cur_loc_disb (p_rec_status igf_sl_cl_resp_r8_all.resp_record_status%TYPE)
3533         IS
3534         SELECT clrp8.* FROM igf_sl_cl_resp_r8 clrp8
3535         WHERE clrp1_id         = loaded_1rec.clrp1_id
3536         AND resp_record_status = p_rec_status;
3537 
3538         CURSOR c_tbh_cur(p_award_id igf_aw_award.award_id%TYPE,
3539                          p_disb_num igf_aw_awd_disb.disb_num%TYPE) IS
3540         SELECT adisb.* FROM igf_aw_awd_disb  adisb
3541         WHERE award_id = p_award_id AND disb_num = p_disb_num
3542         FOR UPDATE OF manual_hold_ind NOWAIT;
3543         l_resp_record_status      igf_sl_cl_resp_r8_all.resp_record_status%TYPE;
3544 
3545         l_disb_title           VARCHAR2(1000);
3546         l_disb_under_line      VARCHAR2(1000);
3547         counter                NUMBER;
3548 
3549     BEGIN
3550       counter := 0;
3551       l_disb_title :=  LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','DISB_NUM'),30)
3552                            ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','DISB_DATE'),30)
3553                            ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','DISB_GROSS_AMT'),30)
3554                            ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','FEE_1'),30)
3555                            ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','FEE_2'),30)
3556                            ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','FEE_PAID_1'),30)
3557                            ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','FEE_PAID_2'),30)
3558                            ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','DISB_NET_AMT'),30)
3559                            ||LPAD(igf_aw_gen.lookup_desc('IGF_GE_PARAMETERS','DISB_STATUS'),30)
3560                            ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','HOLD_REL_IND'),45)
3561                   			   ||LPAD(igf_aw_gen.lookup_desc('IGF_SL_CL_ROSTER_LOGS','DIRECT_TO_BORR_IND'),35);
3562 
3563       l_disb_under_line :=    RPAD('-',30,'-')
3564                               ||RPAD('-',30,'-')
3565                               ||RPAD('-',30,'-')
3566                               ||RPAD('-',30,'-')
3567                               ||RPAD('-',30,'-')
3568                               ||RPAD('-',30,'-')
3569                               ||RPAD('-',30,'-')
3570                               ||RPAD('-',30,'-')
3571                               ||RPAD('-',30,'-')
3572                               ||RPAD('-',45,'-')
3573                   			      ||RPAD('-',35,'-');
3574 
3575       FOR loc_disb in cur_loc_disb('N') LOOP
3576         FOR tbh_rec in c_tbh_cur(l_award_id, loc_disb.clrp8_id) LOOP
3577            IF tbh_rec.disb_gross_amt         <>  loc_disb.disb_gross_amt             OR
3578               NVL(tbh_rec.fee_1,0)           <>  NVL(loc_disb.orig_fee,0)            OR
3579               NVL(tbh_rec.fee_2,0)           <>  NVL(loc_disb.guarantee_fee,0)       OR
3580               NVL(tbh_rec.disb_net_amt,0)    <>  NVL(loc_disb.net_disb_amt,0)        OR
3581               NVL(tbh_rec.disb_date,SYSDATE) <>  NVL(loc_disb.disb_date,SYSDATE)     OR
3582               NVL(tbh_rec.hold_rel_ind,'*')  <>  NVL(loc_disb.disb_hold_rel_ind,'*') OR
3583               NVL(tbh_rec.disb_status,'*')   <>  NVL(loc_disb.disb_status,'*')       OR
3584               NVL(tbh_rec.fee_paid_1,0)      <>  NVL(loc_disb.orig_fee_paid,0)       OR
3585               NVL(tbh_rec.fee_paid_2,0)      <>  NVL(loc_disb.guarnt_fee_paid,0)     OR
3586 	      NVL(tbh_rec.direct_to_borr_flag,'N') <> NVL(loc_disb.direct_to_borr_flag,'N')
3587           THEN
3588           counter := counter + 1;
3589           awd_disb_array(counter) :=   LPAD(TO_CHAR(tbh_rec.disb_num),30)
3590                                        ||LPAD(fnd_date.date_to_displaydate(tbh_rec.disb_date),30)
3591                                        ||LPAD(TO_CHAR(NVL(tbh_rec.disb_accepted_amt,0)),30)
3592                                        ||LPAD(TO_CHAR(NVL(tbh_rec.fee_1,0)),30)
3593                                        ||LPAD(TO_CHAR(NVL(tbh_rec.fee_2,0)),30)
3594                                        ||LPAD(TO_CHAR(NVL(tbh_rec.fee_paid_1,0)),30)
3595                                        ||LPAD(TO_CHAR(NVL(tbh_rec.fee_paid_2,0)),30)
3596                                        ||LPAD(TO_CHAR(NVL(tbh_rec.disb_net_amt,0)),30)
3597                                        ||LPAD(NVL(TO_CHAR(IGF_AW_GEN.LOOKUP_DESC('IGF_SL_CL_DISB_STATUS',tbh_rec.disb_status)),' '),30)
3598                                        ||LPAD(NVL(TO_CHAR(IGF_AW_GEN.LOOKUP_DESC('IGF_SL_CL_HOLD_REL_IND_TF',tbh_rec.hold_rel_ind)),' '),45)
3599 				       ||LPAD(NVL(tbh_rec.direct_to_borr_flag,'N'),30);
3600 
3601           loc_disb_array(counter) :=   LPAD(TO_CHAR(loc_disb.clrp8_id),30)
3602                                        ||LPAD(fnd_date.date_to_displaydate(loc_disb.disb_date),30)
3603                                        ||LPAD(TO_CHAR(NVL(loc_disb.disb_gross_amt,0)),30)
3604                                        ||LPAD(TO_CHAR(NVL(loc_disb.orig_fee,0)),30)
3605                                        ||LPAD(TO_CHAR(NVL(loc_disb.guarantee_fee,0)),30)
3606                                        ||LPAD(TO_CHAR(NVL(loc_disb.orig_fee_paid,0)),30)
3607                                        ||LPAD(TO_CHAR(NVL(loc_disb.guarnt_fee_paid,0)),30)
3608                                        ||LPAD(TO_CHAR(NVL(loc_disb.net_disb_amt,0)),30)
3609                                        ||LPAD(NVL(TO_CHAR(IGF_AW_GEN.LOOKUP_DESC('IGF_SL_CL_DISB_STATUS',loc_disb.disb_status)),' '),30)
3610                                        ||LPAD(NVL(TO_CHAR(IGF_AW_GEN.LOOKUP_DESC('IGF_SL_CL_HOLD_REL_IND_TF', loc_disb.disb_hold_rel_ind)),' '),45)
3611 				       ||LPAD(NVL(loc_disb.direct_to_borr_flag,'N'),30);
3612 
3613           END IF;
3614         END LOOP;
3615       END LOOP;
3616       -- Display the information now
3617       fnd_file.put_line(fnd_file.log,' ');
3618       fnd_file.put_line(fnd_file.log,igf_aw_gen.lookup_desc('IGF_SL_GEN','OFA_DISB_DETAILS'));
3619       fnd_file.put_line(fnd_file.log,l_disb_title);
3620       fnd_file.put_line(fnd_file.log,l_disb_under_line);
3621 
3622       FOR i IN  1..counter LOOP
3623         fnd_file.put_line(fnd_file.log,awd_disb_array(i));
3624       END LOOP;
3625 
3626       fnd_file.put_line(fnd_file.log,' ');
3627       fnd_file.put_line(fnd_file.log,igf_aw_gen.lookup_desc('IGF_SL_GEN','LOC_DISB_DETAILS'));
3628       fnd_file.put_line(fnd_file.log,l_disb_title);
3629       fnd_file.put_line(fnd_file.log,l_disb_under_line);
3630 
3631       FOR i IN  1..counter LOOP
3632         fnd_file.put_line(fnd_file.log,loc_disb_array(i));
3633       END LOOP;
3634 
3635       fnd_file.put_line(fnd_file.log,' ');
3636 
3637     END show_differing_disb_details;
3638 
3639     --Procedure to update award disbursments Fee details with values from the File
3640 
3641     PROCEDURE upd_disb_details(p_disb_num  igf_aw_awd_disb_all.disb_num%TYPE)
3642      /***************************************************************
3643        Change History   :
3644        Who              When            What
3645        bvisvana         12-Sept-2005    Bug # 4575843
3646                                         Update the disb_accepted amt with the disb_gross_amt from response
3647      ***************************************************************/
3648     AS
3649         CURSOR cur_loc_disb (p_rec_status igf_sl_cl_resp_r8_all.resp_record_status%TYPE)
3650         IS
3651         SELECT clrp8.* FROM igf_sl_cl_resp_r8 clrp8
3652         WHERE clrp1_id         = loaded_1rec.clrp1_id
3653         AND resp_record_status = p_rec_status;
3654 
3655         CURSOR c_tbh_cur(p_award_id igf_aw_award.award_id%TYPE,
3656                          p_disb_num igf_aw_awd_disb.disb_num%TYPE) IS
3657         SELECT adisb.* FROM igf_aw_awd_disb  adisb
3658         WHERE award_id = p_award_id AND disb_num = p_disb_num
3659         FOR UPDATE OF manual_hold_ind NOWAIT;
3660         l_resp_record_status      igf_sl_cl_resp_r8_all.resp_record_status%TYPE;
3661     BEGIN
3662 
3663       FOR loc_disb in cur_loc_disb('N') LOOP  -- LOC Loop
3664 
3665         gv_debug_str := 'UPD_DISB_DETAILS-1' ||' ';
3666 
3667         FOR tbh_rec in c_tbh_cur(l_award_id, loc_disb.clrp8_id) LOOP  --CLRP8 Loop
3668 
3669           l_resp_record_status := 'N';
3670           gv_debug_str := gv_debug_str||'UPD_DISB_DETAILS-2' ||' ';
3671           IF  tbh_rec.disb_gross_amt         <>  loc_disb.disb_gross_amt             OR
3672               NVL(tbh_rec.fee_1,0)           <>  NVL(loc_disb.orig_fee,0)            OR
3673               NVL(tbh_rec.fee_2,0)           <>  NVL(loc_disb.guarantee_fee,0)       OR
3674               NVL(tbh_rec.disb_net_amt,0)    <>  NVL(loc_disb.net_disb_amt,0)        OR
3675               NVL(tbh_rec.disb_date,SYSDATE) <>  NVL(loc_disb.disb_date,SYSDATE)     OR
3676               NVL(tbh_rec.hold_rel_ind,'*')  <>  NVL(loc_disb.disb_hold_rel_ind,'*') OR
3677               NVL(tbh_rec.disb_status,'*')   <>  NVL(loc_disb.disb_status,'*')       OR
3678               NVL(tbh_rec.fee_paid_1,0)      <>  NVL(loc_disb.orig_fee_paid,0)       OR
3679               NVL(tbh_rec.fee_paid_2,0)      <>  NVL(loc_disb.guarnt_fee_paid,0)     OR
3680 	      NVL(tbh_rec.direct_to_borr_flag,'*') <> NVL(loc_disb.direct_to_borr_flag,'*')
3681           THEN                                                          -- LOR LOC Diff Check
3682 
3683             IF g_c_update_disb_dtls = 'Y' THEN                          -- Update Flag Check
3684               fnd_message.set_name('IGF','IGF_SL_CL_UPD_DISB_DTLS');
3685               fnd_message.set_token('DISB_NUM',loc_disb.clrp8_id);
3686               fnd_file.put_line(fnd_file.log,fnd_message.get);
3687 
3688               -- Update Flag Check
3689               igf_aw_awd_disb_pkg.update_row (
3690                x_Mode                      => 'R',
3691                x_rowid                     => tbh_rec.row_id,
3692                x_award_id                  => tbh_rec.award_id,
3693                x_disb_num                  => tbh_rec.disb_num,
3694                x_tp_cal_type               => tbh_rec.tp_cal_type,
3695                x_tp_sequence_number        => tbh_rec.tp_sequence_number,
3696                x_disb_gross_amt            => loc_disb.disb_gross_amt,
3697                x_fee_1                     => loc_disb.orig_fee,
3698                x_fee_2                     => loc_disb.guarantee_fee,
3699                x_disb_net_amt              => loc_disb.net_disb_amt,
3700                x_disb_date                 => loc_disb.disb_date,
3701                x_trans_type                => tbh_rec.trans_type,
3702                x_elig_status               => tbh_rec.elig_status,
3703                x_elig_status_date          => tbh_rec.elig_status_date,
3704                x_affirm_flag               => tbh_rec.affirm_flag,
3705                x_hold_rel_ind              => loc_disb.disb_hold_rel_ind,
3706                x_manual_hold_ind           => tbh_rec.manual_hold_ind,
3707                x_disb_status               => loc_disb.disb_status,
3708                x_disb_status_date          => TRUNC(SYSDATE),
3709                x_late_disb_ind             => tbh_rec.late_disb_ind,
3710                x_fund_dist_mthd            => tbh_rec.fund_dist_mthd,
3711                x_prev_reported_ind         => tbh_rec.prev_reported_ind,
3712                x_fund_release_date         => tbh_rec.fund_release_date,
3713                x_fund_status               => tbh_rec.fund_status,
3714                x_fund_status_date          => tbh_rec.fund_status_date,
3715                x_fee_paid_1                => loc_disb.orig_fee_paid,
3716                x_fee_paid_2                => loc_disb.guarnt_fee_paid,
3717                x_cheque_number             => tbh_rec.cheque_number,
3718                x_ld_cal_type               => tbh_rec.ld_cal_type,
3719                x_ld_sequence_number        => tbh_rec.ld_sequence_number,
3720                x_disb_accepted_amt         => loc_disb.disb_gross_amt, -- tbh_rec.disb_accepted_amt, -- bvisvana.SBCC Bug # 4575843
3721                x_disb_paid_amt             => tbh_rec.disb_paid_amt,
3722                x_rvsn_id                   => tbh_rec.rvsn_id,
3723                x_int_rebate_amt            => tbh_rec.int_rebate_amt,
3724                x_force_disb                => tbh_rec.force_disb,
3725                x_min_credit_pts            => tbh_rec.min_credit_pts,
3726                x_disb_exp_dt               => tbh_rec.disb_exp_dt,
3727                x_verf_enfr_dt              => tbh_rec.verf_enfr_dt,
3728                x_fee_class                 => tbh_rec.fee_class,
3729                x_show_on_bill              => tbh_rec.show_on_bill,
3730                x_attendance_type_code      => tbh_rec.attendance_type_code,
3731                x_base_attendance_type_code => tbh_rec.base_attendance_type_code,
3732                x_payment_prd_st_date       => tbh_rec.payment_prd_st_date,
3733                x_change_type_code          => tbh_rec.change_type_code,
3734                x_fund_return_mthd_code     => tbh_rec.fund_return_mthd_code
3735 --	       x_direct_to_borr_flag       => loc_disb.direct_to_borr_flag
3736               );
3737               l_resp_record_status := 'U';
3738             ELSE                                                        -- Else Update Flag Check
3739               l_resp_record_status := 'D';
3740             END IF;                                                     -- End Update Flag Check
3741           ELSE                                                          -- Else Diff Check
3742               l_resp_record_status := 'Y';
3743           END IF;                                                       -- End LOR LOC Diff Check
3744           IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
3745              fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.upd_disb_details.debug',gv_debug_str ||
3746                                                     '|clrp1_id - ' || loc_disb.clrp1_id ||
3747                                                     '|clrp8_id - ' || loc_disb.clrp8_id ||
3748                                                     '|l_resp_record_status - ' || l_resp_record_status
3749                                                     );
3750           END IF;
3751           gv_debug_str := '';
3752           update_resp8_rec_status(loc_disb.clrp1_id,
3753                                   loc_disb.clrp8_id,
3754                                   l_resp_record_status);
3755          END LOOP;  --END CLRP8 Loop
3756          IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
3757             fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.upd_disb_details.debug',gv_debug_str);
3758          END IF;
3759          gv_debug_str := '';
3760        END LOOP;  -- END LOC Loop
3761 
3762     END upd_disb_details;
3763 
3764 
3765     PROCEDURE place_disb_holds(p_award_id   igf_aw_awd_disb_all.award_id%TYPE)
3766     AS
3767         CURSOR c_tbh_cur(p_trans_type igf_aw_awd_disb.trans_type%TYPE)
3768         IS
3769         SELECT adisb.* FROM igf_aw_awd_disb adisb
3770         WHERE award_id = p_award_id  and
3771         trans_type = p_trans_type ;
3772 
3773       CURSOR cur_disb_hold_exists(cp_award_id    igf_db_disb_holds.award_id%TYPE,
3774                                   cp_disb_num    igf_db_disb_holds.disb_num%TYPE,
3775                                   cp_hold        igf_db_disb_holds.hold%TYPE ,
3776                                   cp_release_flag igf_db_disb_holds.release_flag%TYPE)
3777         IS
3778         SELECT count(row_id)
3779         FROM   igf_db_disb_holds
3780         WHERE  award_id = cp_award_id
3781         AND    disb_num = cp_disb_num
3782         AND    hold     = cp_hold
3783         AND    release_flag = cp_release_flag;
3784 
3785         l_rowid      VARCHAR2(30);
3786         l_hold_id    igf_db_disb_holds.hold_id%TYPE;
3787         l_rec_count  NUMBER;
3788 
3789     BEGIN
3790 
3791         FOR tbh_rec in c_tbh_cur('P') LOOP
3792 
3793            l_rowid   := NULL;
3794            l_hold_id := NULL;
3795            gv_debug_str := 'PLACE_DISB_HOLDS - 1'||' ';
3796            OPEN  cur_disb_hold_exists(tbh_rec.award_id,tbh_rec.disb_num,'CL','N');
3797            FETCH cur_disb_hold_exists into l_rec_count;
3798 
3799            IF NOT ( nvl(l_rec_count,0) > 0) THEN
3800            gv_debug_str := gv_debug_str || 'PLACE_DISB_HOLDS - 2'||' ';
3801                  igf_db_disb_holds_pkg.insert_row (
3802                       x_mode              => 'R',
3803                       x_rowid             => l_rowid,
3804                       x_hold_id           => l_hold_id,
3805                       x_award_id          => tbh_rec.award_id,
3806                       x_disb_num          => tbh_rec.disb_num,
3807                       x_hold              => 'CL',
3808                       x_hold_type         => 'SYSTEM',
3809                       x_hold_date         => TRUNC(sysdate),
3810                       x_release_flag      => 'N',
3811                       x_release_reason    =>  NULL,
3812                       x_release_date      =>  NULL
3813                      );
3814            gv_debug_str := gv_debug_str || 'PLACE_DISB_HOLDS - 3 '||' ';
3815            END IF;
3816            CLOSE cur_disb_hold_exists;
3817            IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
3818             fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.place_disb_holds.debug',gv_debug_str);
3819            END IF;
3820            gv_debug_str := '';
3821         END LOOP;
3822 
3823     END place_disb_holds;
3824 
3825 
3826 BEGIN
3827 
3828   --Fetch the Old and New No.of Records
3829 
3830   gv_debug_str := 'COMPARE_DISBURSEMENTS - 1' ||' ';
3831 
3832   OPEN cur_count_old_disb;
3833   FETCH cur_count_old_disb INTO l_award_id, l_old_count;
3834   IF l_old_count=0 THEN
3835      CLOSE cur_count_old_disb;
3836      RAISE NO_DATA_FOUND;
3837   END IF;
3838   CLOSE cur_count_old_disb;
3839 
3840   gv_debug_str := gv_debug_str || 'COMPARE_DISBURSEMENTS - 2' ||' ';
3841 
3842   OPEN cur_count_new_disb('N');
3843   FETCH cur_count_new_disb INTO l_new_count;
3844   IF l_new_count=0 THEN
3845      CLOSE cur_count_new_disb;
3846      RAISE NO_DATA_FOUND;
3847   END IF;
3848   CLOSE cur_count_new_disb;
3849 
3850   gv_debug_str := gv_debug_str || 'COMPARE_DISBURSEMENTS - 3' ||' ';
3851 
3852   IF l_old_count <> l_new_count THEN
3853 
3854      -- Show all details like Old(From OFA) and New Disbursement Amounts(From File)
3855      -- Guarantee Adj Indicator (From File)
3856      -- Guarantee Amount        (From File)
3857      -- Requested Loan Amount   (from File)
3858      gv_debug_str := gv_debug_str || 'COMPARE_DISBURSEMENTS - 4' ||' ';
3859      IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
3860        fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.compare_disbursements.debug',gv_debug_str);
3861      END IF;
3862      gv_debug_str := '';
3863 --
3864 -- put a message here comparing loc and system data,
3865 -- different number of loc and system disbursements
3866 --
3867      fnd_file.new_line(fnd_file.log,1);
3868      fnd_message.set_name('IGF','IGF_SL_CL_DIFF_DISB_NUM');
3869      fnd_file.put_line(fnd_file.log,fnd_message.get);
3870      fnd_file.new_line(fnd_file.log,1);
3871 
3872      show_disb_details;
3873 
3874      gv_debug_str := gv_debug_str || 'COMPARE_DISBURSEMENTS - 5' ||' ';
3875      -- Place Process Holds on All the Disbursement records.
3876      IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
3877        fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.compare_disbursements.debug',gv_debug_str);
3878      END IF;
3879      gv_debug_str := '';
3880      place_disb_holds(l_award_id);
3881      gv_debug_str := gv_debug_str || 'COMPARE_DISBURSEMENTS - 6' ||' ';
3882 
3883   ELSE
3884 
3885      OPEN cur_disb_same_data;
3886      FETCH cur_disb_same_data INTO l_disb_num, l_disb_gross_amt;
3887      gv_debug_str := gv_debug_str || 'COMPARE_DISBURSEMENTS - 7' ||' ';
3888 
3889      IF cur_disb_same_data%NOTFOUND THEN
3890 
3891        -- Indicates that disbursement data (Number of Disbursements and
3892        -- disb-gross-amts and loan_requested_amt ) are currently same,
3893        -- what was sent to the external processor.
3894 
3895        -- Update Fee_1, fee_2, fee_paid_1, fee_paid_2 from the file into
3896        -- disbursements records.
3897        gv_debug_str := gv_debug_str || 'COMPARE_DISBURSEMENTS - 8' ||' ';
3898 
3899        IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
3900          fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.compare_disbursements.debug',gv_debug_str);
3901        END IF;
3902        gv_debug_str := '';
3903        show_differing_disb_details;
3904        -- if the parameter update disbursement details  is set to 'y' only then
3905        -- invoke the upd_disb_details
3906        -- mnade 21-Jan-2005 - the Check of flag is done in the upd_disb_details
3907 --       IF g_c_update_disb_dtls = 'Y' THEN
3908          upd_disb_details(l_disb_num);
3909 --       END IF;
3910 
3911      ELSE
3912 
3913        gv_debug_str := gv_debug_str || 'COMPARE_DISBURSEMENTS - 9' ||' ';
3914        IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
3915          fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.compare_disbursements.debug',gv_debug_str);
3916        END IF;
3917        gv_debug_str := '';
3918 --
3919 -- put a message here
3920 -- different amounts
3921 --
3922        fnd_message.set_name('IGF','IGF_SL_CL_DIFF_DISB_AMTS');
3923        fnd_file.new_line(fnd_file.log,1);
3924        fnd_file.put_line(fnd_file.log,fnd_message.get);
3925        fnd_file.new_line(fnd_file.log,1);
3926 
3927        show_disb_details;
3928 
3929        -- Place Process Holds on All the Disbursement records.
3930        gv_debug_str := gv_debug_str || 'COMPARE_DISBURSEMENTS - 10' ||' ';
3931        IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
3932          fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.compare_disbursements.debug',gv_debug_str);
3933        END IF;
3934        gv_debug_str := '';
3935 
3936        -- bvisvana - SBCC Bug # 4575843 - Instead of placing holds do an update.
3937        -- place_disb_holds(l_award_id);
3938        upd_disb_details(l_disb_num);
3939 
3940      END IF;
3941      CLOSE cur_disb_same_data;
3942 
3943   END IF;
3944 
3945   -- Update the Status of the records in cl_resp_r8 to processed.
3946      gv_debug_str := gv_debug_str || 'COMPARE_DISBURSEMENTS - 11' ||' ';
3947      IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
3948        fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.compare_disbursements.debug',gv_debug_str);
3949      END IF;
3950      gv_debug_str := '';
3951      update_resp8_rec_status(loaded_1rec.clrp1_id, NULL, 'N');
3952 
3953 EXCEPTION
3954 
3955  WHEN app_exception.record_lock_exception THEN
3956     RAISE;
3957 
3958  WHEN OTHERS THEN
3959      fnd_message.set_name('IGF','IGF_GE_UNHANDLED_EXP');
3960      fnd_message.set_token('NAME','IGF_SL_CL_ACK.COMPARE_DISBURSEMENTS');
3961      IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
3962        fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.compare_disbursements.exception',gv_debug_str||' '|| SQLERRM);
3963      END IF;
3964      gv_debug_str := '';
3965      igs_ge_msg_stack.add;
3966      app_exception.raise_exception;
3967 
3968 END compare_disbursements;
3969 
3970 
3971 --Procedure Definition for Inserting into igf_sl_resp_r4 w.r.to new DLD
3972 
3973 PROCEDURE insert_into_resp_r4(p_clrp1_id             igf_sl_cl_resp_r1_all.clrp1_id%TYPE,
3974                               p_r4_record            igf_sl_load_file_t.record_data%TYPE)
3975 
3976 /***************************************************************
3977    Created By       :    mesriniv
3978    Date Created By  :    2001/05/13
3979    Purpose          :    To Insert File data into IGF_SL_CL_RESP_R4
3980 
3981    ENH Bug No.:1769051
3982    Bug Desc   :Development of Loans Processing for Nov 2001.
3983    Known Limitations,Enhancements or Remarks
3984    Change History   :
3985    Who              When      What
3986  ***************************************************************/
3987 
3988 AS
3989 
3990 
3991   l_rowid                VARCHAR2(25)      DEFAULT NULL;
3992   l_loan_id              igf_sl_loans_all.loan_id%TYPE;
3993   l_fed_stafford         igf_sl_alt_borw.fed_stafford_loan_debt%TYPE;
3994   l_fed_sls              igf_sl_alt_borw.fed_sls_debt%TYPE;
3995   rec_cl_resp_r4         igf_sl_cl_resp_r4_all%ROWTYPE;
3996   BEGIN  --for the procedure insert_into_resp_r4
3997 
3998   gv_debug_str := 'INSERT_INTO_RESP_R4 - 1' || ' ';
3999 
4000   IF g_v_cl_version = 'RELEASE-5' THEN
4001     rec_cl_resp_r4.stud_mth_housing_pymt       :=  TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,593,5))));
4002     rec_cl_resp_r4.stud_mth_crdtcard_pymt      :=  TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,598,5))));
4003     rec_cl_resp_r4.stud_mth_auto_pymt          :=  TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,603,5))));
4004     rec_cl_resp_r4.stud_mth_ed_loan_pymt       :=  TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,608,5))));
4005     rec_cl_resp_r4.stud_mth_other_pymt         :=  TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,613,5))));
4006     rec_cl_resp_r4.cosnr_1_forn_phone_prefix   :=  LTRIM(RTRIM(SUBSTR(p_r4_record,573,10)));
4007     rec_cl_resp_r4.cosnr_1_mth_housing_pymt    :=  TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,618,5))));
4008     rec_cl_resp_r4.cosnr_1_mth_crdtcard_pymt   :=  TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,623,5))));
4009     rec_cl_resp_r4.cosnr_1_mth_auto_pymt       :=  TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,628,5))));
4010     rec_cl_resp_r4.cosnr_1_mth_ed_loan_pymt    :=  TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,633,5))));
4011     rec_cl_resp_r4.cosnr_1_mth_other_pymt      :=  TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,638,5))));
4012     rec_cl_resp_r4.cosnr_1_crdt_auth_code      :=  LTRIM(RTRIM(SUBSTR(p_r4_record,668,1)));
4013     rec_cl_resp_r4.cosnr_2_forn_phone_prefix   :=  LTRIM(RTRIM(SUBSTR(p_r4_record,583,10)));
4014     rec_cl_resp_r4.cosnr_2_mth_housing_pymt    :=  TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,643,5))));
4015     rec_cl_resp_r4.cosnr_2_mth_crdtcard_pymt   :=  TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,648,5))));
4016     rec_cl_resp_r4.cosnr_2_mth_auto_pymt       :=  TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,653,5))));
4017     rec_cl_resp_r4.cosnr_2_mth_ed_loan_pymt    :=  TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,658,5))));
4018     rec_cl_resp_r4.cosnr_2_mth_other_pymt      :=  TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,663,5))));
4019     rec_cl_resp_r4.cosnr_2_crdt_auth_code      :=  LTRIM(RTRIM(SUBSTR(p_r4_record,669,1)));
4020     rec_cl_resp_r4.first_csgnr_elec_sign_flag  :=  LTRIM(RTRIM(SUBSTR(p_r4_record,670,1)));
4021     rec_cl_resp_r4.second_csgnr_elec_sign_flag :=  LTRIM(RTRIM(SUBSTR(p_r4_record,671,1)));
4022 
4023   ELSIF g_v_cl_version = 'RELEASE-4' THEN
4024     rec_cl_resp_r4.stud_mth_housing_pymt       :=  NULL;
4025     rec_cl_resp_r4.stud_mth_crdtcard_pymt      :=  NULL;
4026     rec_cl_resp_r4.stud_mth_auto_pymt          :=  NULL;
4027     rec_cl_resp_r4.stud_mth_ed_loan_pymt       :=  NULL;
4028     rec_cl_resp_r4.stud_mth_other_pymt         :=  NULL;
4029     rec_cl_resp_r4.cosnr_1_forn_phone_prefix   :=  NULL;
4030     rec_cl_resp_r4.cosnr_1_mth_housing_pymt    :=  NULL;
4031     rec_cl_resp_r4.cosnr_1_mth_crdtcard_pymt   :=  NULL;
4032     rec_cl_resp_r4.cosnr_1_mth_auto_pymt       :=  NULL;
4033     rec_cl_resp_r4.cosnr_1_mth_ed_loan_pymt    :=  NULL;
4034     rec_cl_resp_r4.cosnr_1_mth_other_pymt      :=  NULL;
4035     rec_cl_resp_r4.cosnr_1_crdt_auth_code      :=  NULL;
4036     rec_cl_resp_r4.cosnr_2_forn_phone_prefix   :=  NULL;
4037     rec_cl_resp_r4.cosnr_2_mth_housing_pymt    :=  NULL;
4038     rec_cl_resp_r4.cosnr_2_mth_crdtcard_pymt   :=  NULL;
4039     rec_cl_resp_r4.cosnr_2_mth_auto_pymt       :=  NULL;
4040     rec_cl_resp_r4.cosnr_2_mth_ed_loan_pymt    :=  NULL;
4041     rec_cl_resp_r4.cosnr_2_mth_other_pymt      :=  NULL;
4042     rec_cl_resp_r4.cosnr_2_crdt_auth_code      :=  NULL;
4043     rec_cl_resp_r4.first_csgnr_elec_sign_flag  :=  NULL;
4044     rec_cl_resp_r4.second_csgnr_elec_sign_flag :=  NULL;
4045   END IF;
4046 
4047   igf_sl_cl_resp_r4_pkg.insert_row (
4048       x_mode                              => 'R',
4049       x_rowid                             => l_rowid,
4050       x_clrp1_id                          => p_clrp1_id, --Corresponding id already inserted for @1 Record
4051       x_loan_number                       => l_loan_number,
4052       x_fed_stafford_loan_debt            => TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,9,5)))),
4053       x_fed_sls_debt                      => TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,14,5)))),
4054       x_heal_debt                         => TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,19,6)))),
4055       x_perkins_debt                      => TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,25,5)))),
4056       x_other_debt                        => TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,30,6)))),
4057       x_crdt_undr_difft_name              => LTRIM(RTRIM(SUBSTR(p_r4_record,43,1))),
4058       x_borw_gross_annual_sal             => TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,384,7)))),
4059       x_borw_other_income                 => TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,391,7)))),
4060       x_student_major                     => LTRIM(RTRIM(SUBSTR(p_r4_record,454,15))),
4061       x_int_rate_opt                      => LTRIM(RTRIM(SUBSTR(p_r4_record,571,1))),
4062       x_repayment_opt_code                => LTRIM(RTRIM(SUBSTR(p_r4_record,572,1))),
4063       x_stud_mth_housing_pymt             => rec_cl_resp_r4.stud_mth_housing_pymt  ,
4064       x_stud_mth_crdtcard_pymt            => rec_cl_resp_r4.stud_mth_crdtcard_pymt ,
4065       x_stud_mth_auto_pymt                => rec_cl_resp_r4.stud_mth_auto_pymt     ,
4066       x_stud_mth_ed_loan_pymt             => rec_cl_resp_r4.stud_mth_ed_loan_pymt  ,
4067       x_stud_mth_other_pymt               => rec_cl_resp_r4.stud_mth_other_pymt,
4068       x_cosnr_1_last_name                 => LTRIM(RTRIM(SUBSTR(p_r4_record,44,35))),
4069       x_cosnr_1_first_name                => LTRIM(RTRIM(SUBSTR(p_r4_record,79,12))),
4070       x_cosnr_1_middle_name               => LTRIM(RTRIM(SUBSTR(p_r4_record,91,1))),
4071       x_cosnr_1_ssn                       => LTRIM(RTRIM(SUBSTR(p_r4_record,92,9))),
4072       x_cosnr_1_citizenship               => LTRIM(RTRIM(SUBSTR(p_r4_record,101,1))),
4073       x_cosnr_1_addr_line1                => LTRIM(RTRIM(SUBSTR(p_r4_record,102,30))),
4074       x_cosnr_1_addr_line2                => LTRIM(RTRIM(SUBSTR(p_r4_record,132,30))),
4075       x_cosnr_1_city                      => LTRIM(RTRIM(SUBSTR(p_r4_record,162,24))),
4076       x_cosnr_1_state                     => LTRIM(RTRIM(SUBSTR(p_r4_record,192,2))),
4077       x_cosnr_1_zip                       => LTRIM(RTRIM(SUBSTR(p_r4_record,194,5))),
4078       x_cosnr_1_zip_suffix                => LTRIM(RTRIM(SUBSTR(p_r4_record,199,4))),
4079       x_cosnr_1_phone                     => LTRIM(RTRIM(SUBSTR(p_r4_record,203,10))),
4080       x_cosnr_1_sig_code                  => LTRIM(RTRIM(SUBSTR(p_r4_record,213,1))),
4081       x_cosnr_1_gross_anl_sal             => TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,398,7)))),
4082       x_cosnr_1_other_income              => TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,405,7)))),
4083       x_cosnr_1_forn_postal_code          => LTRIM(RTRIM(SUBSTR(p_r4_record,426,14))),
4084       x_cosnr_1_forn_phone_prefix         => rec_cl_resp_r4.cosnr_1_forn_phone_prefix,
4085       --MN 21-Jan-2005 - Using REPLACE to remove DOB containing 0s.
4086       x_cosnr_1_dob                       => TO_DATE(REPLACE(LTRIM(RTRIM(SUBSTR(p_r4_record,469,8))), '00000000', NULL),'YYYYMMDD'),
4087       x_cosnr_1_license_state             => LTRIM(RTRIM(SUBSTR(p_r4_record,477,2))),
4088       x_cosnr_1_license_num               => LTRIM(RTRIM(SUBSTR(p_r4_record,479,20))),
4089       x_cosnr_1_relationship_to           => LTRIM(RTRIM(SUBSTR(p_r4_record,559,1))),
4090       x_cosnr_1_years_at_addr             => LTRIM(RTRIM(SUBSTR(p_r4_record,563,2))),
4091       x_cosnr_1_mth_housing_pymt          => rec_cl_resp_r4.cosnr_1_mth_housing_pymt,
4092       x_cosnr_1_mth_crdtcard_pymt         => rec_cl_resp_r4.cosnr_1_mth_crdtcard_pymt,
4093       x_cosnr_1_mth_auto_pymt             => rec_cl_resp_r4.cosnr_1_mth_auto_pymt,
4094       x_cosnr_1_mth_ed_loan_pymt          => rec_cl_resp_r4.cosnr_1_mth_ed_loan_pymt,
4095       x_cosnr_1_mth_other_pymt            => rec_cl_resp_r4.cosnr_1_mth_other_pymt,
4096       x_cosnr_1_crdt_auth_code            => rec_cl_resp_r4.cosnr_1_crdt_auth_code,
4097       x_cosnr_2_last_name                 => LTRIM(RTRIM(SUBSTR(p_r4_record,214,35))),
4098       x_cosnr_2_first_name                => LTRIM(RTRIM(SUBSTR(p_r4_record,249,12))),
4099       x_cosnr_2_middle_name               => LTRIM(RTRIM(SUBSTR(p_r4_record,261,1))),
4100       x_cosnr_2_ssn                       => LTRIM(RTRIM(SUBSTR(p_r4_record,262,9))),
4101       x_cosnr_2_citizenship               => LTRIM(RTRIM(SUBSTR(p_r4_record,271,1))),
4102       x_cosnr_2_addr_line1                => LTRIM(RTRIM(SUBSTR(p_r4_record,272,30))),
4103       x_cosnr_2_addr_line2                => LTRIM(RTRIM(SUBSTR(p_r4_record,302,30))),
4104       x_cosnr_2_city                      => LTRIM(RTRIM(SUBSTR(p_r4_record,332,24))),
4105       x_cosnr_2_state                     => LTRIM(RTRIM(SUBSTR(p_r4_record,362,2))),
4106       x_cosnr_2_zip                       => LTRIM(RTRIM(SUBSTR(p_r4_record,364,5))),
4107       x_cosnr_2_zip_suffix                => LTRIM(RTRIM(SUBSTR(p_r4_record,369,4))),
4108       x_cosnr_2_phone                     => LTRIM(RTRIM(SUBSTR(p_r4_record,373,10))),
4109       x_cosnr_2_sig_code                  => LTRIM(RTRIM(SUBSTR(p_r4_record,383,1))),
4110       x_cosnr_2_gross_anl_sal             => TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,412,7)))),
4111       x_cosnr_2_other_income              => TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,419,7)))),
4112       x_cosnr_2_forn_postal_code          => LTRIM(RTRIM(SUBSTR(p_r4_record,440,14))),
4113       x_cosnr_2_forn_phone_prefix         => rec_cl_resp_r4.cosnr_2_forn_phone_prefix,
4114       --MN 21-Jan-2005 - Using REPLACE to remove DOB containing 0s.
4115       x_cosnr_2_dob                       => TO_DATE(REPLACE(LTRIM(RTRIM(SUBSTR(p_r4_record,499,8))), '00000000', NULL),'YYYYMMDD'),
4116       x_cosnr_2_license_state             => LTRIM(RTRIM(SUBSTR(p_r4_record,507,2))) ,
4117       x_cosnr_2_license_num               => LTRIM(RTRIM(SUBSTR(p_r4_record,509,20))),
4118       x_cosnr_2_relationship_to           => LTRIM(RTRIM(SUBSTR(p_r4_record,565,1))),
4119       x_cosnr_2_years_at_addr             => LTRIM(RTRIM(SUBSTR(p_r4_record,569,2))),
4120       x_cosnr_2_mth_housing_pymt          => rec_cl_resp_r4.cosnr_2_mth_housing_pymt,
4121       x_cosnr_2_mth_crdtcard_pymt         => rec_cl_resp_r4.cosnr_2_mth_crdtcard_pymt,
4122       x_cosnr_2_mth_auto_pymt             => rec_cl_resp_r4.cosnr_2_mth_auto_pymt,
4123       x_cosnr_2_mth_ed_loan_pymt          => rec_cl_resp_r4.cosnr_2_mth_ed_loan_pymt,
4124       x_cosnr_2_mth_other_pymt            => rec_cl_resp_r4.cosnr_2_mth_other_pymt,
4125       x_cosnr_2_crdt_auth_code            => rec_cl_resp_r4.cosnr_2_crdt_auth_code,
4126       x_other_loan_amt                    => TO_NUMBER (LTRIM(RTRIM(SUBSTR(p_r4_record,36,7)))),
4127       x_alt_layout_owner_code_txt         => LTRIM(RTRIM(SUBSTR(p_r4_record,3,4))),
4128       x_alt_layout_identi_code_txt        => LTRIM(RTRIM(SUBSTR(p_r4_record,7,2))),
4129       x_student_school_phone_txt          => LTRIM(RTRIM(SUBSTR(p_r4_record,549,10))),
4130       x_first_csgnr_elec_sign_flag        => rec_cl_resp_r4.first_csgnr_elec_sign_flag,
4131       x_second_csgnr_elec_sign_flag       => rec_cl_resp_r4.second_csgnr_elec_sign_flag
4132 
4133      );
4134 
4135   gv_debug_str := 'INSERT_INTO_RESP_R4 - 2' || ' ';
4136 
4137 
4138 EXCEPTION
4139 WHEN OTHERS THEN
4140      fnd_message.set_name('IGF','IGF_GE_UNHANDLED_EXP');
4141      fnd_message.set_token('NAME','IGF_SL_CL_ACK.INSERT_INTO_RESP_R4');
4142      IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
4143        fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.insert_into_resp_r4.exception',gv_debug_str||' '|| SQLERRM);
4144      END IF;
4145      gv_debug_str := '';
4146      igs_ge_msg_stack.add;
4147      app_exception.raise_exception;
4148 
4149 END insert_into_resp_r4;
4150 
4151 
4152 --Procedure declared and defined here to display the difference  in the Alternate Borrower Information between
4153 --OFA and that inserted into the igf_sl_cl_resp_r4 table
4154 
4155 PROCEDURE   show_alt_details(
4156                     p_clrp1_id  igf_sl_cl_resp_r1_all.clrp1_id%TYPE,
4157                     p_loan_id   igf_sl_loans_all.loan_id%TYPE
4158                     )
4159 
4160 /***************************************************************
4161    Created By       :    mesriniv
4162    Date Created By  :    2001/05/13
4163    Purpose          :    To display the Difference
4164                     in information between System Data
4165                     and File Data
4166 
4167    ENH Bug No.:1769051
4168    Bug Desc   :Development of Loans Processing for Nov 2001.
4169    Known Limitations,Enhancements or Remarks
4170    Change History   :
4171    Who              When      What
4172  ***************************************************************/
4173 
4174 
4175 AS
4176      --
4177      -- Cursor to Fetch the Alternate Borrower's Information in OFA
4178      --
4179      CURSOR cur_alt_borw
4180      IS
4181      SELECT borw.*
4182      FROM   igf_sl_alt_borw borw
4183      WHERE  loan_id=p_loan_id;
4184 
4185      --
4186      -- Cursor to Fetch the Alternate Borrower's Information loaded from File
4187      --
4188      CURSOR cur_resp4
4189      IS
4190      SELECT resp4.*
4191      FROM   igf_sl_cl_resp_r4 resp4
4192      WHERE  clrp1_id= p_clrp1_id;
4193 
4194      --
4195      -- Array declared here to store the difference in data.
4196      --
4197      TYPE tab_data_array IS TABLE OF VARCHAR2(2000) INDEX BY BINARY_INTEGER;
4198 
4199      ofa_rec        igf_sl_alt_borw%ROWTYPE;
4200      file_rec       igf_sl_cl_resp_r4%ROWTYPE;
4201 
4202      l_alt_title    VARCHAR2(2000);
4203      l_alt_data     VARCHAR2(2000);
4204      l_r4_data      VARCHAR2(2000);
4205      l_alt_line     VARCHAR2(2000);
4206      l_log_mesg     VARCHAR2(1000);
4207      data_array     tab_data_array;
4208 
4209      l_counter      NUMBER DEFAULT  0;
4210 
4211 BEGIN
4212 
4213    gv_debug_str := 'SHOW_ALT_DETAILS - 1 ' || ' ';
4214    --Fetch the respective information
4215    OPEN cur_alt_borw;
4216    FETCH cur_alt_borw INTO ofa_rec;
4217    CLOSE cur_alt_borw;
4218 
4219    OPEN cur_resp4;
4220    FETCH cur_resp4 INTO file_rec;
4221    CLOSE cur_resp4;
4222 
4223  -- Each Field in OFA is compared against the corresponding field from File and only
4224  -- that differ in values will be displayed in Log File.
4225 
4226    IF NVL(ofa_rec.fed_stafford_loan_debt,0) <> NVL(file_rec.fed_stafford_loan_debt,0) THEN
4227       l_counter  :=l_counter +1;
4228       data_array(l_counter) := title_array(1) || LPAD(NVL(TO_CHAR(ofa_rec.fed_stafford_loan_debt),' '),30) ||LPAD(NVL(TO_CHAR(file_rec.fed_stafford_loan_debt),' '),40);
4229    END IF;
4230 
4231    IF NVL(ofa_rec.fed_sls_debt,0) <> NVL(file_rec.fed_sls_debt,0) THEN
4232       l_counter  :=l_counter+1;
4233       data_array(l_counter) := title_array(2) || LPAD(NVL(TO_CHAR(ofa_rec.fed_sls_debt),' '),30) ||LPAD(NVL(TO_CHAR(file_rec.fed_sls_debt),' '),40);
4234    END IF;
4235 
4236    IF NVL(ofa_rec.heal_debt,0) <> NVL(file_rec.heal_debt,0) THEN
4237       l_counter  :=l_counter+1;
4238       data_array(l_counter) := title_array(3) || LPAD(NVL(TO_CHAR(ofa_rec.heal_debt),' '),30) ||LPAD(NVL(TO_CHAR(file_rec.heal_debt),' '),40);
4239    END IF;
4240 
4241    IF NVL(ofa_rec.perkins_debt,0) <> NVL(file_rec.perkins_debt,0) THEN
4242        l_counter  :=l_counter+1;
4243        data_array(l_counter) := title_array(4) || LPAD(NVL(TO_CHAR(ofa_rec.perkins_debt),' '),30) ||LPAD(NVL(TO_CHAR(file_rec.perkins_debt),' '),40);
4244    END IF;
4245 
4246    IF NVL(ofa_rec.other_debt,0) <> NVL(file_rec.other_debt,0) THEN
4247        l_counter  :=l_counter+1;
4248        data_array(l_counter) := title_array(5) || LPAD(NVL(TO_CHAR(ofa_rec.other_debt),' '),30) ||LPAD(NVL(TO_CHAR(file_rec.other_debt),' '),40);
4249    END IF;
4250 
4251    IF NVL(ofa_rec.crdt_undr_difft_name,' ') <> NVL(file_rec.crdt_undr_difft_name,' ') THEN
4252        l_counter  :=l_counter+1;
4253        data_array(l_counter) := title_array(6) || LPAD(NVL(ofa_rec.crdt_undr_difft_name,' '),30) ||LPAD(NVL(file_rec.crdt_undr_difft_name,' '),40);
4254    END IF;
4255 
4256    IF NVL(ofa_rec.borw_gross_annual_sal,0) <> NVL(file_rec.borw_gross_annual_sal,0) THEN
4257        l_counter  :=l_counter+1;
4258        data_array(l_counter) := title_array(7) || LPAD(NVL(TO_CHAR(ofa_rec.borw_gross_annual_sal),' '),30) ||LPAD(NVL(TO_CHAR(file_rec.borw_gross_annual_sal),' '),40);
4259    END IF;
4260 
4261    IF NVL(ofa_rec.borw_other_income,0) <> NVL(file_rec.borw_other_income,0) THEN
4262        l_counter  :=l_counter+1;
4263        data_array(l_counter) := title_array(8) || LPAD(NVL(TO_CHAR(ofa_rec.borw_other_income),' '),30) ||LPAD(NVL(TO_CHAR(file_rec.borw_other_income),' '),40);
4264    END IF;
4265 
4266    IF NVL(ofa_rec.student_major,' ') <> NVL(file_rec.student_major,' ') THEN
4267        l_counter  :=l_counter+1;
4268        data_array(l_counter) := title_array(9) || LPAD(NVL(ofa_rec.student_major,' '),30) ||LPAD(NVL(file_rec.student_major,' '),40);
4269    END IF;
4270 
4271    IF NVL(ofa_rec.int_rate_opt,' ') <> NVL(file_rec.int_rate_opt,' ') THEN
4272        l_counter  :=l_counter+1;
4273        data_array(l_counter) := title_array(10) || LPAD(NVL(ofa_rec.int_rate_opt,' '),30) ||LPAD(NVL(file_rec.int_rate_opt,' '),40);
4274    END IF;
4275 
4276    IF NVL(ofa_rec.repayment_opt_code,' ') <> NVL(file_rec.repayment_opt_code,' ') THEN
4277        l_counter  :=l_counter+1;
4278        data_array(l_counter) := title_array(11) || LPAD(NVL(ofa_rec.repayment_opt_code,' '),30) ||LPAD(NVL(file_rec.repayment_opt_code,' '),40);
4279    END IF;
4280 
4281    IF NVL(ofa_rec.stud_mth_housing_pymt,0) <> NVL(file_rec.stud_mth_housing_pymt,0) THEN
4282        l_counter  :=l_counter+1;
4283        data_array(l_counter) := title_array(12) || LPAD(NVL(TO_CHAR(ofa_rec.stud_mth_housing_pymt),' '),30) ||LPAD(NVL(TO_CHAR(file_rec.stud_mth_housing_pymt),' '),40);
4284    END IF;
4285 
4286    IF NVL(ofa_rec.stud_mth_crdtcard_pymt,0) <> NVL(file_rec.stud_mth_crdtcard_pymt,0) THEN
4287        l_counter  :=l_counter+1;
4288        data_array(l_counter) := title_array(13) || LPAD(NVL(TO_CHAR(ofa_rec.stud_mth_crdtcard_pymt), ' ') ,30)|| LPAD( NVL(TO_CHAR(file_rec.stud_mth_crdtcard_pymt), ' '), 40);
4289    END IF;
4290 
4291    IF NVL(ofa_rec.stud_mth_auto_pymt,0) <> NVL(file_rec.stud_mth_auto_pymt,0) THEN
4292        l_counter  :=l_counter+1;
4293        data_array(l_counter) := title_array(14) || LPAD(NVL(TO_CHAR(ofa_rec.stud_mth_auto_pymt),' '),30) ||LPAD(NVL(TO_CHAR(file_rec.stud_mth_auto_pymt),' '),40);
4294   END IF;
4295 
4296   IF NVL(ofa_rec.stud_mth_ed_loan_pymt,0) <> NVL(file_rec.stud_mth_ed_loan_pymt,0) THEN
4297        l_counter  :=l_counter+1;
4298        data_array(l_counter) := title_array(15) || LPAD(NVL(TO_CHAR(ofa_rec.stud_mth_ed_loan_pymt),' '),30) ||LPAD(NVL(TO_CHAR(file_rec.stud_mth_ed_loan_pymt),' '),40);
4299   END IF;
4300 
4301   IF NVL(ofa_rec.stud_mth_other_pymt,0) <> NVL(file_rec.stud_mth_other_pymt,0) THEN
4302        l_counter  :=l_counter+1;
4303        data_array(l_counter) := title_array(16) ||LPAD(NVL(TO_CHAR(ofa_rec.stud_mth_other_pymt),' '),30) ||LPAD(NVL(TO_CHAR(file_rec.stud_mth_other_pymt),' '),40);
4304   END IF;
4305 
4306   --To display the ALt Borrower's Details
4307 
4308   fnd_file.put_line(fnd_file.log, '');
4309 
4310 --To display the Heading for Fields having a difference and also the corresponding data
4311 
4312   IF l_counter <> 0 THEN
4313        BEGIN
4314 
4315          fnd_file.put_line(fnd_file.log, RPAD(' ',5)|| title_array(17) || title_array(18));
4316          fnd_file.put_line(fnd_file.log, RPAD(' ',5)||RPAD(' ',50)||RPAD('-',34,'-')||' '||RPAD('-',35,'-'));
4317 
4318          FOR i IN  1..l_counter LOOP
4319            fnd_file.put_line(fnd_file.log, RPAD(' ',5)||data_array(i));
4320          END LOOP;
4321 
4322        END;
4323 
4324        --Deleting the Data Stored in the array.
4325        data_array.DELETE;
4326 
4327   END IF;
4328 
4329   gv_debug_str := gv_debug_str || 'SHOW_ALT_DETAILS - 2 ' || ' ';
4330 
4331 EXCEPTION
4332 
4333  WHEN OTHERS THEN
4334      fnd_message.set_name('IGF','IGF_GE_UNHANDLED_EXP');
4335      fnd_message.set_token('NAME','IGF_SL_CL_ORIG_ACK.SHOW_ALT_DETAILS');
4336      IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
4337        fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.show_alt_details.exception',gv_debug_str||' '|| SQLERRM);
4338      END IF;
4339      gv_debug_str := '';
4340      igs_ge_msg_stack.add;
4341      app_exception.raise_exception;
4342 
4343 END show_alt_details;
4344 
4345 
4346 PROCEDURE log_to_fnd ( p_v_module IN VARCHAR2,
4347                        p_v_string IN VARCHAR2
4348                      ) AS
4349 ------------------------------------------------------------------
4350 --Created by  : Sanil Madathil, Oracle IDC
4351 --Date created: 21 October 2004
4352 --
4353 -- Purpose:
4354 -- Invoked     : from within create_file procedure
4355 -- Function    : Private procedure for logging all the statement level
4356 --               messages
4357 -- Parameters  : p_v_module   : IN parameter. Required.
4358 --               p_v_string   : IN parameter. Required.
4359 --
4360 --
4361 --Known limitations/enhancements and/or remarks:
4362 --
4363 --Change History:
4364 --Who         When            What
4365 ------------------------------------------------------------------
4366 BEGIN
4367   IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4368     fnd_log.string( fnd_log.level_statement, 'igf.plsql.igf_sl_cl_orig_ack.'||p_v_module, p_v_string);
4369   END IF;
4370 END log_to_fnd;
4371 
4372 PROCEDURE process_borrow_stud_rec (p_rec_resp_r1  IN  igf_sl_cl_resp_r1_all%ROWTYPE) AS
4373 ------------------------------------------------------------------
4374 --Created by  : Sanil Madathil, Oracle IDC
4375 --Date created: 05 November 2004
4376 --
4377 -- Purpose:
4378 -- Invoked     : from within process_1 procedure
4379 -- Function    : Private procedure for processing borrower student data
4380 --               available in the response record
4381 -- Parameters  : p_rec_resp_r1   : IN  parameter. Required.
4382 --
4383 --
4384 --
4385 --Known limitations/enhancements and/or remarks:
4386 --
4387 --Change History:
4388 --Who         When            What
4389 ------------------------------------------------------------------
4390   l_rec_resp_r1        igf_sl_cl_resp_r1_all%ROWTYPE;
4391   l_b_pers_exists      BOOLEAN;
4392   l_b_ret_status       BOOLEAN;
4393   l_c_borrow_created   VARCHAR2(1);
4394   l_c_student_created  VARCHAR2(1);
4395   l_c_rel_created      VARCHAR2(1);
4396   l_n_student_id       hz_parties.party_id%TYPE;
4397   l_n_borrower_id      hz_parties.party_id%TYPE;
4398   l_v_student_number   hz_parties.party_number%TYPE;
4399   l_v_borrower_number  hz_parties.party_number%TYPE;
4400   l_n_person_id        hz_parties.party_id%TYPE;
4401   l_v_person_number    hz_parties.party_number%TYPE;
4402 BEGIN
4403   log_to_fnd(p_v_module => 'process_borrow_stud_rec',
4404              p_v_string => ' p_rec_resp_r1.b_ssn              : ' || p_rec_resp_r1.b_ssn              ||
4405                            ' p_rec_resp_r1.b_last_name        : ' || p_rec_resp_r1.b_last_name        ||
4406                            ' p_rec_resp_r1.b_first_name       : ' || p_rec_resp_r1.b_first_name       ||
4407                            ' p_rec_resp_r1.b_middle_name      : ' || p_rec_resp_r1.b_middle_name      ||
4408                            ' p_rec_resp_r1.b_permt_addr1      : ' || p_rec_resp_r1.b_permt_addr1      ||
4409                            ' p_rec_resp_r1.b_permt_addr2      : ' || p_rec_resp_r1.b_permt_addr2      ||
4410                            ' p_rec_resp_r1.b_permt_city       : ' || p_rec_resp_r1.b_permt_city       ||
4411                            ' p_rec_resp_r1.b_permt_state      : ' || p_rec_resp_r1.b_permt_state      ||
4412                            ' p_rec_resp_r1.b_date_of_birth    : ' || p_rec_resp_r1.b_date_of_birth    ||
4413                            ' p_rec_resp_r1.s_ssn              : ' || p_rec_resp_r1.s_ssn              ||
4414                            ' p_rec_resp_r1.s_last_name        : ' || p_rec_resp_r1.s_last_name        ||
4415                            ' p_rec_resp_r1.s_first_name       : ' || p_rec_resp_r1.s_first_name       ||
4416                            ' p_rec_resp_r1.s_middle_name      : ' || p_rec_resp_r1.s_middle_name      ||
4417                            ' p_rec_resp_r1.s_date_of_birth    : ' || p_rec_resp_r1.s_date_of_birth    ||
4418                            ' p_rec_resp_r1.cl_loan_type       : ' || p_rec_resp_r1.cl_loan_type       ||
4419                            ' p_rec_resp_r1.b_indicator_code   : ' || p_rec_resp_r1.b_indicator_code
4420             );
4421   log_to_fnd(p_v_module => 'process_borrow_stud_rec',
4422              p_v_string => ' School Certification Request information '||
4423                            ' Loan Type = '|| p_rec_resp_r1.cl_loan_type
4424             );
4425   l_rec_resp_r1 := p_rec_resp_r1;
4426   -- plus loans
4427   IF l_rec_resp_r1.cl_loan_type = 'PL' THEN
4428     -- Check if the Borrower exists in the System by querying on active SSNs in the System
4429     IF l_rec_resp_r1.b_first_name IS NOT NULL THEN
4430       l_n_borrower_id      := NULL;
4431       l_v_borrower_number  := NULL;
4432       l_b_pers_exists      := FALSE;
4433       log_to_fnd(p_v_module => 'process_borrow_stud_rec',
4434                  p_v_string => ' Borrower information. Invoking perform_ssn_match '
4435                  );
4436       perform_ssn_match(
4437         p_rec_resp_r1     => l_rec_resp_r1,
4438         p_c_pers_typ_ind  => 'B',
4439         p_n_person_id     => l_n_borrower_id,
4440         p_n_person_number => l_v_borrower_number,
4441         p_c_pers_exists   => l_b_pers_exists
4442       );
4443       -- if matching SSN found, do not create the borrower person record
4444       IF (l_b_pers_exists) THEN
4445         l_c_borrow_created := 'Y';  -- pssahni 18-Jan-2005  We need to create relationship even if the person exsists
4446         log_to_fnd(p_v_module => 'process_borrow_stud_rec',
4447                    p_v_string => ' Borrower information found in the system: '||
4448                                  ' Borrower Id '    ||l_n_borrower_id         ||
4449                                  ' Borrower Number '||l_v_borrower_number
4450                    );
4451       ELSE
4452       -- no matching SSN found
4453       -- create the borrower person record
4454         l_b_ret_status := FALSE;
4455         l_b_ret_status := create_person_record(
4456                            p_rec_resp_r1     => l_rec_resp_r1,
4457                            p_c_pers_typ_ind  => 'B',
4458                            p_n_person_id     => l_n_borrower_id,
4459                            p_n_person_number => l_v_borrower_number
4460                          );
4461         -- if person creation failed set the borrower created flag to 'N'
4462         IF NOT(l_b_ret_status) THEN
4463           l_c_borrow_created := 'N';
4464         ELSE
4465         -- if person creation is successful set the borrower created flag to 'Y'
4466           l_c_borrow_created := 'Y';
4467         END IF;
4468       END IF;
4469     END IF;
4470     -- Check if the Student exists in the System by querying on active SSNs in the System.
4471     IF l_rec_resp_r1.s_first_name IS NOT NULL THEN
4472       l_n_student_id     := NULL;
4473       l_v_student_number := NULL;
4474       l_b_pers_exists    := FALSE;
4475       log_to_fnd(p_v_module => 'process_borrow_stud_rec',
4476                  p_v_string => ' Student information. Invoking perform_ssn_match '
4477                  );
4478       perform_ssn_match(
4479         p_rec_resp_r1     => l_rec_resp_r1,
4480         p_c_pers_typ_ind  => 'S',
4481         p_n_person_id     => l_n_student_id,
4482         p_n_person_number => l_v_student_number,
4483         p_c_pers_exists   => l_b_pers_exists
4484       );
4485       -- if matching SSN found, do not create the Student person record
4486       IF (l_b_pers_exists) THEN
4487         l_c_student_created := 'Y';   -- pssahni 18-Jan-2005  We need to create relationship even if the person exsists
4488         log_to_fnd(p_v_module => 'process_borrow_stud_rec',
4489                    p_v_string => ' Student information found in the system: '||
4490                                  ' Student Id '    ||l_n_student_id          ||
4491                                  ' Student Number '||l_v_student_number
4492                    );
4493       ELSE
4494       -- no matching SSN found
4495       -- create the Student person record
4496         l_b_ret_status := FALSE;
4497         l_b_ret_status := create_person_record(
4498                            p_rec_resp_r1     => l_rec_resp_r1,
4499                            p_c_pers_typ_ind  => 'S',
4500                            p_n_person_id     => l_n_student_id,
4501                            p_n_person_number => l_v_student_number
4502                          );
4503         -- if person creation failed set the Student created flag to 'N'
4504         IF NOT(l_b_ret_status) THEN
4505           l_c_student_created := 'N';
4506         ELSE
4507         -- if person creation is successful set the Student created flag to 'Y'
4508           l_c_student_created := 'Y';
4509         END IF;
4510       END IF;
4511     END IF;
4512     -- Create relation between borrower and Student if Student created flag to 'Y' and borrower created flag to 'Y'
4513     l_c_rel_created  := 'N';
4514     IF l_c_student_created = 'Y' AND l_c_borrow_created = 'Y' THEN
4515       l_b_ret_status := FALSE;
4516       l_b_ret_status := create_borrow_stud_rel (
4517                           p_n_borrower_id     => l_n_borrower_id,
4518                           p_v_borrower_number => l_v_borrower_number,
4519                           p_n_student_id      => l_n_student_id,
4520                           p_v_student_number  => l_v_student_number
4521                         ) ;
4522       -- if relation creation is successful set the relation created flag to 'Y'
4523       -- if relation creation is not successful set the relation created flag to 'N'
4524       IF (l_b_ret_status) THEN
4525         l_c_rel_created := 'Y';
4526       END IF;
4527     END IF;
4528     -- raise the business event
4529     raise_scr_event(
4530       p_rec_resp_r1       => l_rec_resp_r1,
4531       p_c_borrow_created  => l_c_borrow_created,
4532       p_c_student_created => l_c_student_created,
4533       p_c_rel_created     => l_c_rel_created
4534     );
4535   END IF;
4536 
4537   --akomurav
4538   --Grad Plus Loans
4539 
4540   IF l_rec_resp_r1.cl_loan_type = 'GB' THEN
4541      l_c_borrow_created  :=  'N';
4542      l_c_student_created := 'N';
4543      IF l_rec_resp_r1.s_ssn = l_rec_resp_r1.b_ssn THEN
4544         l_n_person_id :=NULL;
4545         l_v_person_number  :=NULL;
4546         l_b_pers_exists  := FALSE;
4547 
4548         perform_ssn_match(
4549         p_rec_resp_r1     => l_rec_resp_r1,
4550         p_c_pers_typ_ind  => 'B', -- Borrower or Student (both will work)
4551         p_n_person_id     => l_n_person_id,
4552         p_n_person_number => l_v_person_number,
4553         p_c_pers_exists   => l_b_pers_exists
4554         );
4555         -- if matching SSN found, do not create the Student person record
4556         IF (l_b_pers_exists) THEN
4557            l_c_borrow_created  := 'Y';
4558            l_c_student_created := 'Y';
4559         ELSE
4560            l_b_ret_status := FALSE;
4561            l_b_ret_status := create_person_record(
4562               p_rec_resp_r1     => l_rec_resp_r1,
4563               p_c_pers_typ_ind  => 'B', -- Borrower or Student (both with work)
4564               p_n_person_id     => l_n_person_id,
4565               p_n_person_number => l_v_person_number);
4566 
4567            IF NOT(l_b_ret_status) THEN
4568            -- If ret status is false means Borrower is not created implying student is also not created.
4569               l_c_borrow_created  :=  'N';
4570               l_c_student_created := 'N';
4571            ELSE
4572               l_c_borrow_created  := 'Y';
4573               l_c_student_created := 'Y';
4574            END IF;
4575         END IF;
4576      END IF;
4577      raise_scr_event(
4578        p_rec_resp_r1       => l_rec_resp_r1,
4579        p_c_borrow_created  => l_c_borrow_created,
4580        p_c_student_created => l_c_student_created,
4581        p_c_rel_created     => 'N'
4582       );
4583   END IF;
4584 
4585   -- Alternate loans
4586   IF l_rec_resp_r1.cl_loan_type = 'AL' THEN
4587     -- No relation would be created. Hence set the relation created flag to 'N' for alternate loans.
4588     l_c_rel_created := 'N';
4589     -- check If the Student himself/herself is Borrower
4590     IF (l_rec_resp_r1.b_indicator_code = 'Y') THEN
4591       -- Check if the Student exists in the System by querying on active SSNs in the System.
4592       IF l_rec_resp_r1.s_first_name IS NOT NULL THEN
4593         l_n_student_id     := NULL;
4594         l_v_student_number := NULL;
4595         l_b_pers_exists    := FALSE;
4596         log_to_fnd(p_v_module => 'process_borrow_stud_rec',
4597                    p_v_string => ' Student information. Invoking perform_ssn_match '
4598                   );
4599         perform_ssn_match(
4600           p_rec_resp_r1     => l_rec_resp_r1,
4601           p_c_pers_typ_ind  => 'S',
4602           p_n_person_id     => l_n_student_id,
4603           p_n_person_number => l_v_student_number,
4604           p_c_pers_exists   => l_b_pers_exists
4605         );
4606         -- if matching SSN found, do not create the Student person record
4607         IF (l_b_pers_exists) THEN
4608           l_c_student_created := 'N';
4609           l_c_borrow_created  := 'N';
4610           log_to_fnd(p_v_module => 'process_borrow_stud_rec',
4611                      p_v_string => ' Student information found in the system: '||
4612                                    ' Student Id '    ||l_n_student_id          ||
4613                                    ' Student Number '||l_v_student_number
4614                      );
4615         ELSE
4616         -- no matching SSN found
4617         -- create the Student person record
4618           l_b_ret_status := FALSE;
4619           l_b_ret_status := create_person_record(
4620                               p_rec_resp_r1     => l_rec_resp_r1,
4621                               p_c_pers_typ_ind  => 'S',
4622                               p_n_person_id     => l_n_student_id,
4623                               p_n_person_number => l_v_student_number
4624                             );
4625           -- if person creation failed set the Student created flag to 'N'
4626           IF NOT(l_b_ret_status) THEN
4627             l_c_student_created := 'N';
4628             l_c_borrow_created  := 'N';
4629           ELSE
4630           -- if person creation is successful set the Student created flag to 'Y'
4631             l_c_student_created := 'Y';
4632             l_c_borrow_created  := 'Y';
4633           END IF;
4634         END IF;
4635       END IF;
4636     -- If the Student himself/herself is not a loan Borrower
4637     ELSIF (l_rec_resp_r1.b_indicator_code = 'N') THEN
4638       IF l_rec_resp_r1.b_first_name IS NOT NULL THEN
4639         l_n_borrower_id      := NULL;
4640         l_v_borrower_number  := NULL;
4641         l_b_pers_exists      := FALSE;
4642         log_to_fnd(p_v_module => 'process_borrow_stud_rec',
4643                    p_v_string => ' Borrower information. Invoking perform_ssn_match '
4644                    );
4645         perform_ssn_match(
4646           p_rec_resp_r1     => l_rec_resp_r1,
4647           p_c_pers_typ_ind  => 'B',
4648           p_n_person_id     => l_n_borrower_id,
4649           p_n_person_number => l_v_borrower_number,
4650           p_c_pers_exists   => l_b_pers_exists
4651         );
4652         -- if matching SSN found, do not create the borrower person record
4653         IF (l_b_pers_exists) THEN
4654           l_c_borrow_created := 'N';
4655           log_to_fnd(p_v_module => 'process_borrow_stud_rec',
4656                      p_v_string => ' Borrower information found in the system: '||
4657                                    ' Borrower Id '    ||l_n_borrower_id         ||
4658                                    ' Borrower Number '||l_v_borrower_number
4659                     );
4660         ELSE
4661         -- no matching SSN found
4662         -- create the borrower person record
4663           l_b_ret_status := FALSE;
4664           l_b_ret_status := create_person_record(
4665                               p_rec_resp_r1     => l_rec_resp_r1,
4666                               p_c_pers_typ_ind  => 'B',
4667                               p_n_person_id     => l_n_borrower_id,
4668                               p_n_person_number => l_v_borrower_number
4669                             );
4670           -- if person creation failed set the borrower created flag to 'N'
4671           IF NOT(l_b_ret_status) THEN
4672             l_c_borrow_created := 'N';
4673           ELSE
4674           -- if person creation is successful set the borrower created flag to 'Y'
4675             l_c_borrow_created := 'Y';
4676           END IF;
4677         END IF;
4678       END IF;
4679       -- Check if the Student exists in the System by querying on active SSNs in the System.
4680       IF l_rec_resp_r1.s_first_name IS NOT NULL THEN
4681         l_n_student_id     := NULL;
4682         l_v_student_number := NULL;
4683         l_b_pers_exists    := FALSE;
4684         log_to_fnd(p_v_module => 'process_borrow_stud_rec',
4685                    p_v_string => ' Student information. Invoking perform_ssn_match '
4686                    );
4687         perform_ssn_match(
4688           p_rec_resp_r1     => l_rec_resp_r1,
4689           p_c_pers_typ_ind  => 'S',
4690           p_n_person_id     => l_n_student_id,
4691           p_n_person_number => l_v_student_number,
4692           p_c_pers_exists   => l_b_pers_exists
4693         );
4694         -- if matching SSN found, do not create the Student person record
4695         IF (l_b_pers_exists) THEN
4696           l_c_student_created := 'N';
4697           log_to_fnd(p_v_module => 'process_borrow_stud_rec',
4698                      p_v_string => ' Student information found in the system: '||
4699                                    ' Student Id '    ||l_n_student_id          ||
4700                                    ' Student Number '||l_v_student_number
4701                     );
4702         ELSE
4703         -- no matching SSN found
4704         -- create the Student person record
4705           l_b_ret_status := FALSE;
4706           l_b_ret_status := create_person_record(
4707                               p_rec_resp_r1     => l_rec_resp_r1,
4708                               p_c_pers_typ_ind  => 'S',
4709                               p_n_person_id     => l_n_student_id,
4710                               p_n_person_number => l_v_student_number
4711                             );
4712           -- if person creation failed set the Student created flag to 'N'
4713           IF NOT(l_b_ret_status) THEN
4714             l_c_student_created := 'N';
4715           ELSE
4716           -- if person creation is successful set the Student created flag to 'Y'
4717             l_c_student_created := 'Y';
4718           END IF;
4719         END IF;
4720       END IF;
4721     END IF;
4722     -- raise the business event
4723     raise_scr_event(
4724       p_rec_resp_r1       => l_rec_resp_r1,
4725       p_c_borrow_created  => l_c_borrow_created,
4726       p_c_student_created => l_c_student_created,
4727       p_c_rel_created     => l_c_rel_created
4728     );
4729   END IF;
4730 
4731 -- pssahni 18-Jan-2005
4732 -- Bug 	4125359 Person to be created for stafford loan also
4733   IF l_rec_resp_r1.cl_loan_type IN ('CS','SF','SU') THEN
4734     -- Check if the Borrower exists in the System by querying on active SSNs in the System
4735     IF l_rec_resp_r1.b_first_name IS NOT NULL THEN
4736       l_n_borrower_id      := NULL;
4737       l_v_borrower_number  := NULL;
4738       l_b_pers_exists      := FALSE;
4739       log_to_fnd(p_v_module => 'process_borrow_stud_rec',
4740                  p_v_string => ' Borrower information. Invoking perform_ssn_match '
4741                  );
4742       perform_ssn_match(
4743         p_rec_resp_r1     => l_rec_resp_r1,
4744         p_c_pers_typ_ind  => 'B',
4745         p_n_person_id     => l_n_borrower_id,
4746         p_n_person_number => l_v_borrower_number,
4747         p_c_pers_exists   => l_b_pers_exists
4748       );
4749       -- if matching SSN found, do not create the borrower person record
4750       IF (l_b_pers_exists) THEN
4751         l_c_borrow_created := 'Y';
4752         log_to_fnd(p_v_module => 'process_borrow_stud_rec',
4753                    p_v_string => ' Borrower information found in the system: '||
4754                                  ' Borrower Id '    ||l_n_borrower_id         ||
4755                                  ' Borrower Number '||l_v_borrower_number
4756                    );
4757       ELSE
4758       -- no matching SSN found
4759       -- create the borrower person record
4760         l_b_ret_status := FALSE;
4761         l_b_ret_status := create_person_record(
4762                            p_rec_resp_r1     => l_rec_resp_r1,
4763                            p_c_pers_typ_ind  => 'B',
4764                            p_n_person_id     => l_n_borrower_id,
4765                            p_n_person_number => l_v_borrower_number
4766                          );
4767         -- if person creation failed set the borrower created flag to 'N'
4768         IF NOT(l_b_ret_status) THEN
4769           l_c_borrow_created := 'N';
4770         ELSE
4771         -- if person creation is successful set the borrower created flag to 'Y'
4772           l_c_borrow_created := 'Y';
4773         END IF;
4774       END IF;
4775     END IF;
4776 
4777     l_c_student_created := 'N';
4778     l_c_rel_created := 'N';
4779     -- raise the business event
4780     raise_scr_event(
4781       p_rec_resp_r1       => l_rec_resp_r1,
4782       p_c_borrow_created  => l_c_borrow_created,
4783       p_c_student_created => l_c_student_created,
4784       p_c_rel_created     => l_c_rel_created
4785     );
4786   END IF;
4787 
4788 
4789 END process_borrow_stud_rec;
4790 
4791 
4792 PROCEDURE perform_ssn_match(p_rec_resp_r1     IN  igf_sl_cl_resp_r1_all%ROWTYPE,
4793                             p_c_pers_typ_ind  IN  VARCHAR2,
4794                             p_n_person_id     OUT NOCOPY hz_parties.party_id%TYPE,
4795                             p_n_person_number OUT NOCOPY hz_parties.party_number%TYPE,
4796                             p_c_pers_exists   OUT NOCOPY BOOLEAN
4797                             )  AS
4798 ------------------------------------------------------------------
4799 --Created by  : Sanil Madathil, Oracle IDC
4800 --Date created: 21 October 2004
4801 --
4802 -- Purpose:
4803 -- Invoked     : from within process_borrow_stud_rec procedure
4804 -- Function    : Private function for checking the matching SSN
4805 --
4806 -- Parameters  : p_rec_resp_r1      : IN  parameter. Required.
4807 --               p_n_person_id      : OUT parameter.
4808 --               p_n_person_number  : OUT parameter.
4809 --               p_c_pers_exists    : OUT parameter. Returns whether person
4810 --                                    with Active SSN exists in the System or not
4811 --Known limitations/enhancements and/or remarks:
4812 --
4813 --Change History:
4814 --Who         When            What
4815 ------------------------------------------------------------------
4816   CURSOR  c_ssn(cp_v_ssn  igs_pe_alt_pers_id.api_person_id_uf%TYPE) IS
4817   SELECT  'OSS'            person_rec_type --source of ssn from OSS
4818          ,hz.party_number  person_number
4819          ,hz.party_id      person_id
4820          ,api_person_id_uf prsn_ssn --unformatted ssn value
4821          ,hz.person_first_name firstname
4822          ,hz.person_last_name  lastname
4823   FROM    igs_pe_alt_pers_id api
4824          ,igs_pe_person_id_typ pit
4825          ,hz_parties hz
4826   WHERE   api.person_id_type   = pit.person_id_type
4827   AND     pit.s_person_id_type = 'SSN'
4828   AND     hz.party_id          = api.pe_person_id
4829   AND    (SYSDATE) BETWEEN api.start_dt AND NVL (api.end_dt, SYSDATE)
4830   AND     api.api_person_id_uf = cp_v_ssn
4831   UNION
4832   SELECT  'HRMS'          person_rec_type --source of ssn from HRMS
4833          ,hz.party_number person_number
4834          ,ppf.party_id    person_id
4835          ,igf_gr_gen.get_ssn_digits(ppf.national_identifier) prsn_ssn
4836          ,hz.person_first_name firstname
4837          ,hz.person_last_name  lastname
4838   FROM    per_all_people_f ppf
4839          ,per_business_groups_perf pbg
4840          ,per_person_types         ppt
4841          ,hz_parties               hz
4842          ,hz_person_profiles       hp
4843   WHERE   igs_en_gen_001.check_hrms_installed = 'Y'
4844   AND     pbg.legislation_code   = 'US'
4845   AND     ppt.system_person_type = 'EMP'
4846   AND     ppt.person_type_id     = ppf.person_type_id
4847   AND     pbg.business_group_id  = ppf.business_group_id
4848   AND     TRUNC(SYSDATE) BETWEEN ppf.effective_start_date AND ppf.effective_end_date
4849   AND     ppf.party_id           = hz.party_id
4850   AND     hp.effective_end_date IS NULL
4851   AND     igf_ap_matching_process_pkg.remove_spl_chr(ppf.national_identifier) = cp_v_ssn;
4852 
4853   TYPE tab_firstname_typ IS TABLE OF hz_parties.person_first_name%TYPE;
4854   TYPE tab_lastname_typ  IS TABLE OF hz_parties.person_last_name%TYPE;
4855   TYPE tab_prsn_ssn_typ  IS TABLE OF igs_pe_alt_pers_id.api_person_id_uf%TYPE;
4856   TYPE tab_personid_typ  IS TABLE OF hz_parties.party_id%TYPE;
4857   TYPE tab_personnum_typ IS TABLE OF hz_parties.party_number%TYPE;
4858   TYPE tab_rec_typ       IS TABLE OF VARCHAR2(30);
4859 
4860   v_tab_firstname_typ       tab_firstname_typ;
4861   v_tab_lastname_typ        tab_lastname_typ ;
4862   v_tab_prsn_ssn_typ        tab_prsn_ssn_typ ;
4863   v_tab_personid_typ        tab_personid_typ ;
4864   v_tab_personnum_typ       tab_personnum_typ;
4865   v_tab_rec_typ             tab_rec_typ      ;
4866 
4867   l_v_ssn             igf_ap_isir_ints_all.current_ssn_txt%TYPE;
4868   l_c_per_oss_exists  BOOLEAN;
4869   l_n_cnt             NUMBER;
4870 BEGIN
4871   log_to_fnd(p_v_module => ' Entered Procedure perform_ssn_match. The input parameters are',
4872              p_v_string => ' p_rec_resp_r1.b_ssn              : ' || p_rec_resp_r1.b_ssn              ||
4873                            ' p_rec_resp_r1.b_last_name        : ' || p_rec_resp_r1.b_last_name        ||
4874                            ' p_rec_resp_r1.b_first_name       : ' || p_rec_resp_r1.b_first_name       ||
4875                            ' p_rec_resp_r1.b_middle_name      : ' || p_rec_resp_r1.b_middle_name      ||
4876                            ' p_rec_resp_r1.b_permt_addr1      : ' || p_rec_resp_r1.b_permt_addr1      ||
4877                            ' p_rec_resp_r1.b_permt_addr2      : ' || p_rec_resp_r1.b_permt_addr2      ||
4878                            ' p_rec_resp_r1.b_permt_city       : ' || p_rec_resp_r1.b_permt_city       ||
4879                            ' p_rec_resp_r1.b_permt_state      : ' || p_rec_resp_r1.b_permt_state      ||
4880                            ' p_rec_resp_r1.b_date_of_birth    : ' || p_rec_resp_r1.b_date_of_birth    ||
4881                            ' p_rec_resp_r1.s_ssn              : ' || p_rec_resp_r1.s_ssn              ||
4882                            ' p_rec_resp_r1.s_last_name        : ' || p_rec_resp_r1.s_last_name        ||
4883                            ' p_rec_resp_r1.s_first_name       : ' || p_rec_resp_r1.s_first_name       ||
4884                            ' p_rec_resp_r1.s_middle_name      : ' || p_rec_resp_r1.s_middle_name      ||
4885                            ' p_rec_resp_r1.s_date_of_birth    : ' || p_rec_resp_r1.s_date_of_birth    ||
4886                            ' p_rec_resp_r1.cl_loan_type       : ' || p_rec_resp_r1.cl_loan_type       ||
4887                            ' p_rec_resp_r1.b_indicator_code   : ' || p_rec_resp_r1.b_indicator_code
4888             );
4889 
4890   l_c_per_oss_exists := FALSE;
4891 
4892   IF p_c_pers_typ_ind = 'B' THEN
4893     l_v_ssn  := p_rec_resp_r1.b_ssn ;
4894   ELSIF p_c_pers_typ_ind = 'S' THEN
4895     l_v_ssn  := p_rec_resp_r1.s_ssn ;
4896   END IF;
4897 
4898   log_to_fnd(p_v_module => 'perform_ssn_match',
4899              p_v_string => ' verifying if already the pl/sql tables exist. '||
4900                            ' If exists truncate all the elements'
4901             );
4902   -- if the pl/sql table exists , re initialize these by deleting all elements of the array
4903   IF v_tab_firstname_typ.EXISTS(1) THEN
4904     v_tab_firstname_typ.DELETE;
4905   END IF;
4906 
4907   IF v_tab_lastname_typ.EXISTS(1) THEN
4908     v_tab_lastname_typ.DELETE;
4909   END IF;
4910 
4911   IF v_tab_prsn_ssn_typ.EXISTS(1) THEN
4912     v_tab_prsn_ssn_typ.DELETE;
4913   END IF;
4914 
4915   IF v_tab_personid_typ.EXISTS(1) THEN
4916     v_tab_personid_typ.DELETE;
4917   END IF;
4918 
4919   IF v_tab_personnum_typ.EXISTS(1) THEN
4920     v_tab_personnum_typ.DELETE;
4921   END IF;
4922 
4923   IF v_tab_rec_typ.EXISTS(1) THEN
4924     v_tab_rec_typ.DELETE;
4925   END IF;
4926   log_to_fnd(p_v_module => 'perform_ssn_match',
4927              p_v_string => ' Querying on active SSNs in the System. '
4928             );
4929   OPEN  c_ssn (cp_v_ssn => l_v_ssn);
4930   FETCH c_ssn  BULK COLLECT INTO v_tab_rec_typ,
4931                                  v_tab_personnum_typ,
4932                                  v_tab_personid_typ,
4933                                  v_tab_prsn_ssn_typ,
4934                                  v_tab_firstname_typ,
4935                                  v_tab_lastname_typ;
4936   CLOSE c_ssn;
4937   IF v_tab_firstname_typ.COUNT = 0 THEN
4938 
4939     log_to_fnd(p_v_module => 'perform_ssn_match',
4940                p_v_string => ' No active SSNs found in the System. creating person record'
4941               );
4942     fnd_message.set_name('IGF','IGF_SL_CL_SCR_P_NOFOUND');
4943     fnd_message.set_token('SSN',l_v_ssn);
4944     fnd_file.put_line(fnd_file.log, fnd_message.get);
4945     p_n_person_id     := NULL;
4946     p_n_person_number := NULL;
4947     p_c_pers_exists   := FALSE;
4948     RETURN;
4949   END IF;
4950   log_to_fnd(p_v_module => 'perform_ssn_match',
4951              p_v_string => ' Active SSN Records found. Performing SSN match'
4952             );
4953 
4954   FOR l_n_cnt IN v_tab_personid_typ.FIRST..v_tab_personid_typ.LAST
4955   LOOP
4956     log_to_fnd(p_v_module => 'perform_ssn_match',
4957                p_v_string => v_tab_rec_typ (l_n_cnt)
4958               );
4959     IF v_tab_rec_typ(l_n_cnt) IN ('OSS','HRMS') THEN
4960       log_to_fnd(p_v_module => 'perform_ssn_match',
4961                  p_v_string => 'Active SSNs found in the OSS System.'
4962                 );
4963       p_n_person_id     := v_tab_personid_typ(l_n_cnt);
4964       p_n_person_number := v_tab_personnum_typ(l_n_cnt);
4965       p_c_pers_exists   := TRUE;
4966       fnd_message.set_name('IGF','IGF_SL_CL_SCR_P_FOUND');
4967       fnd_message.set_token('SSN',l_v_ssn);
4968       fnd_message.set_token('PERSON_NUMBER',p_n_person_number);
4969       fnd_file.put_line(fnd_file.log, fnd_message.get);
4970       EXIT;
4971     END IF;
4972   END LOOP;
4973 
4974 END perform_ssn_match;
4975 
4976 FUNCTION create_person_record(p_rec_resp_r1     IN  igf_sl_cl_resp_r1_all%ROWTYPE,
4977                               p_c_pers_typ_ind  IN  VARCHAR2,
4978                               p_n_person_id     OUT NOCOPY hz_parties.party_id%TYPE,
4979                               p_n_person_number OUT NOCOPY hz_parties.party_number%TYPE
4980                               )
4981 RETURN BOOLEAN AS
4982 ------------------------------------------------------------------
4983 --Created by  : Sanil Madathil, Oracle IDC
4984 --Date created: 21 October 2004
4985 --
4986 -- Purpose:
4987 -- Invoked     : from within process_borrow_stud_rec procedure
4988 -- Function    : Private function for creating person record
4989 --
4990 -- Parameters  : p_hz_parties_rec   : IN parameter. Required.
4991 --               p_n_person_id      : OUT parameter.
4992 --               p_n_person_number  : OUT parameter.
4993 --
4994 --
4995 --Known limitations/enhancements and/or remarks:
4996 --
4997 --Change History:
4998 --Who         When            What
4999 ------------------------------------------------------------------
5000   CURSOR c_person_id_type( cp_v_pers_id_type   VARCHAR2 ) IS
5001   SELECT person_id_type
5002   FROM   igs_pe_person_id_typ
5003   WHERE  s_person_id_type = cp_v_pers_id_type ;
5004 
5005 
5006   l_n_msg_count            NUMBER ;
5007   l_v_msg_data             VARCHAR2(1000);
5008   l_v_return_status        VARCHAR2(10);
5009   l_v_rowid                ROWID;
5010   l_n_person_id            hz_parties.party_id%TYPE;
5011   l_v_person_number        hz_parties.party_number%TYPE;
5012   l_v_person_id_type       igs_pe_person_id_typ.person_id_type%TYPE;
5013   l_n_location_ovn         hz_locations.object_version_number%TYPE;
5014   l_rec_resp_r1            igf_sl_cl_resp_r1_all%ROWTYPE;
5015   l_v_ssn                  igf_ap_isir_ints_all.current_ssn_txt%TYPE;
5016   l_v_person_first_name    hz_parties.person_first_name%TYPE;
5017   l_v_person_last_name     hz_parties.person_last_name%TYPE;
5018   l_v_person_middle_name   hz_parties.person_middle_name%TYPE;
5019   l_d_date_of_birth        igs_pe_person.birth_dt%TYPE;
5020   l_b_ret_status           BOOLEAN;
5021 BEGIN
5022 
5023  log_to_fnd(p_v_module => 'create_person_record',
5024              p_v_string => ' p_rec_resp_r1.b_ssn              : ' || p_rec_resp_r1.b_ssn              ||
5025                            ' p_rec_resp_r1.b_last_name        : ' || p_rec_resp_r1.b_last_name        ||
5026                            ' p_rec_resp_r1.b_first_name       : ' || p_rec_resp_r1.b_first_name       ||
5027                            ' p_rec_resp_r1.b_middle_name      : ' || p_rec_resp_r1.b_middle_name      ||
5028                            ' p_rec_resp_r1.b_permt_addr1      : ' || p_rec_resp_r1.b_permt_addr1      ||
5029                            ' p_rec_resp_r1.b_permt_addr2      : ' || p_rec_resp_r1.b_permt_addr2      ||
5030                            ' p_rec_resp_r1.b_permt_city       : ' || p_rec_resp_r1.b_permt_city       ||
5031                            ' p_rec_resp_r1.b_permt_state      : ' || p_rec_resp_r1.b_permt_state      ||
5032                            ' p_rec_resp_r1.b_date_of_birth    : ' || p_rec_resp_r1.b_date_of_birth    ||
5033                            ' p_rec_resp_r1.s_ssn              : ' || p_rec_resp_r1.s_ssn              ||
5034                            ' p_rec_resp_r1.s_last_name        : ' || p_rec_resp_r1.s_last_name        ||
5035                            ' p_rec_resp_r1.s_first_name       : ' || p_rec_resp_r1.s_first_name       ||
5036                            ' p_rec_resp_r1.s_middle_name      : ' || p_rec_resp_r1.s_middle_name      ||
5037                            ' p_rec_resp_r1.s_date_of_birth    : ' || p_rec_resp_r1.s_date_of_birth    ||
5038                            ' p_rec_resp_r1.cl_loan_type       : ' || p_rec_resp_r1.cl_loan_type       ||
5039                            ' p_rec_resp_r1.b_indicator_code   : ' || p_rec_resp_r1.b_indicator_code
5040             );
5041 
5042   OPEN  c_person_id_type (cp_v_pers_id_type => 'SSN');
5043   FETCH c_person_id_type INTO l_v_person_id_type;
5044   IF c_person_id_type%NOTFOUND THEN
5045     log_to_fnd(p_v_module => 'create_person_record',
5046                p_v_string => ' Alternate Person ID of type SSN is not setup. Unable to create SSN record for the student.'
5047               );
5048     fnd_message.set_name('IGF','IGF_SL_CL_SCR_P_FAIL');
5049     fnd_file.put_line(fnd_file.log, fnd_message.get);
5050     log_to_fnd(p_v_module => 'create_person_record',
5051                p_v_string => ' Person creation failed '
5052               );
5053     p_n_person_id      := NULL;
5054     p_n_person_number  := NULL;
5055     RETURN FALSE;
5056   END IF;
5057   CLOSE c_person_id_type;
5058 
5059   l_rec_resp_r1       := p_rec_resp_r1;
5060 
5061   IF p_c_pers_typ_ind = 'B' THEN
5062     l_v_ssn                :=  l_rec_resp_r1.b_ssn ;
5063     l_v_person_first_name  :=  l_rec_resp_r1.b_first_name;
5064     l_v_person_last_name   :=  l_rec_resp_r1.b_last_name;
5065     l_v_person_middle_name :=  l_rec_resp_r1.b_middle_name;
5066     l_d_date_of_birth      :=  l_rec_resp_r1.b_date_of_birth;
5067   ELSIF p_c_pers_typ_ind = 'S' THEN
5068     l_v_ssn                :=  l_rec_resp_r1.s_ssn ;
5069     l_v_person_first_name  :=  l_rec_resp_r1.s_first_name;
5070     l_v_person_last_name   :=  l_rec_resp_r1.s_last_name;
5071     l_v_person_middle_name :=  l_rec_resp_r1.s_middle_name;
5072     l_d_date_of_birth      :=  l_rec_resp_r1.s_date_of_birth;
5073   END IF;
5074 
5075 
5076   l_v_rowid           := NULL;
5077   l_n_person_id       := NULL;
5078   l_v_person_number   := NULL;
5079   l_n_location_ovn    := NULL;
5080 
5081   log_to_fnd(p_v_module => 'create_person_record',
5082              p_v_string => ' Invoking igs_pe_person_pkg.insert_row '
5083             );
5084 
5085   igs_pe_person_pkg.insert_row
5086   (
5087     x_msg_count                => l_n_msg_count,
5088     x_msg_data                 => l_v_msg_data,
5089     x_return_status            => l_v_return_status,
5090     x_rowid                    => l_v_rowid,
5091     x_person_id                => l_n_person_id,
5092     x_person_number            => l_v_person_number,
5093     x_surname                  => INITCAP(l_v_person_last_name),
5094     x_middle_name              => l_v_person_middle_name,
5095     x_given_names              => INITCAP(l_v_person_first_name),
5096     x_sex                      => NULL,
5097     x_title                    => NULL,
5098     x_staff_member_ind         => NULL,
5099     x_deceased_ind             => NULL,
5100     x_suffix                   => NULL,
5101     x_pre_name_adjunct         => NULL,
5102     x_archive_exclusion_ind    => NULL,
5103     x_archive_dt               => NULL,
5104     x_purge_exclusion_ind      => NULL,
5105     x_purge_dt                 => NULL,
5106     x_deceased_date            => NULL,
5107     x_proof_of_ins             => NULL,
5108     x_proof_of_immu            => NULL,
5109     x_birth_dt                 => l_d_date_of_birth,
5110     x_salutation               => NULL,
5111     x_oracle_username          => NULL,
5112     x_preferred_given_name     => NULL,
5113     x_email_addr               => NULL,
5114     x_level_of_qual_id         => NULL,
5115     x_military_service_reg     => NULL,
5116     x_veteran                  => NULL,
5117     x_hz_parties_ovn           => l_n_location_ovn,
5118     x_attribute_category       => NULL,
5119     x_attribute1               => NULL,
5120     x_attribute2               => NULL,
5121     x_attribute3               => NULL,
5122     x_attribute4               => NULL,
5123     x_attribute5               => NULL,
5124     x_attribute6               => NULL,
5125     x_attribute7               => NULL,
5126     x_attribute8               => NULL,
5127     x_attribute9               => NULL,
5128     x_attribute10              => NULL,
5129     x_attribute11              => NULL,
5130     x_attribute12              => NULL,
5131     x_attribute13              => NULL,
5132     x_attribute14              => NULL,
5133     x_attribute15              => NULL,
5134     x_attribute16              => NULL,
5135     x_attribute17              => NULL,
5136     x_attribute18              => NULL,
5137     x_attribute19              => NULL,
5138     x_attribute20              => NULL,
5139     x_person_id_type           => l_v_person_id_type,
5140     x_api_person_id            => igf_ap_matching_process_pkg.format_ssn(l_v_ssn)/*,
5141     x_attribute21              => NULL,
5142     x_attribute22              => NULL,
5143     x_attribute23              => NULL,
5144     x_attribute24              => NULL*/
5145   );
5146 
5147   IF l_v_return_status <> 'S'  THEN
5148     fnd_message.set_name('IGF','IGF_SL_CL_SCR_P_FAIL');
5149     fnd_file.put_line(fnd_file.log, fnd_message.get);
5150     log_to_fnd(p_v_module => 'create_person_record',
5151                p_v_string => ' Person creation failed '
5152               );
5153     p_n_person_id      := NULL;
5154     p_n_person_number  := NULL;
5155     RETURN FALSE;
5156   END IF;
5157   fnd_message.set_name('IGF','IGF_SL_CL_SCR_P_SUC');
5158   fnd_message.set_token('PERSON_NUMBER',l_v_person_number);
5159   fnd_file.put_line(fnd_file.log, fnd_message.get);
5160   log_to_fnd(p_v_module => 'create_person_record',
5161              p_v_string => ' Person created, Person Number '||l_v_person_number
5162             );
5163   -- If Person is created successfully then create Address Information
5164   log_to_fnd(p_v_module => 'create_person_record',
5165              p_v_string => ' creating address information'
5166             );
5167 /*
5168 -- mnade 20-Jan-2005 - This If codition is taken off to create addressed for all loans.
5169   -- create_person_addr_record needs to be invoked for borrower or when student himeself/herself
5170   -- is borrower
5171   IF ((l_rec_resp_r1.cl_loan_type IN ('PL','AL') AND p_c_pers_typ_ind = 'B') OR
5172       (l_rec_resp_r1.cl_loan_type = 'AL' AND l_rec_resp_r1.b_indicator_code = 'Y')) THEN
5173 */
5174   l_b_ret_status:= create_person_addr_record(p_n_person_id     => l_n_person_id,
5175                                              p_v_person_number => l_v_person_number,
5176                                              p_rec_resp_r1     => l_rec_resp_r1
5177                                            );
5178     -- no action is being taken even if the above call out returns an error status
5179 --  END IF;
5180   -- bvisvana -  Bug # 4522973 - To create the phone contact point once the person is created
5181   -- Do this only for the borrower.
5182   IF l_n_person_id IS NOT NULL AND p_c_pers_typ_ind = 'B'  THEN
5183       IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
5184         fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.create_person_record.debug','Before calling create_person_telephone_record ');
5185       END IF;
5186       l_b_ret_status := create_person_telephone_record ( p_n_person_id     => l_n_person_id,
5187                                                          p_rec_resp_r1     => l_rec_resp_r1
5188                                                        ) ;
5189       IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
5190         fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.create_person_record.debug','After calling create_person_telephone_record ');
5191       END IF;
5192   END IF;
5193 
5194   p_n_person_id      := l_n_person_id;
5195   p_n_person_number  := l_v_person_number;
5196   RETURN TRUE;
5197 
5198 
5199 END create_person_record;
5200 
5201 FUNCTION create_person_addr_record(p_n_person_id     IN  hz_parties.party_id%TYPE,
5202                                    p_v_person_number IN  hz_parties.party_number%TYPE,
5203                                    p_rec_resp_r1     IN  igf_sl_cl_resp_r1_all%ROWTYPE
5204                                    ) RETURN BOOLEAN AS
5205 ------------------------------------------------------------------
5206 --Created by  : Sanil Madathil, Oracle IDC
5207 --Date created: 21 October 2004
5208 --
5209 -- Purpose:
5210 -- Invoked     : from within create_person_record function
5211 -- Function    : Private function for creating person address
5212 --               records
5213 -- Parameters  : p_n_person_id     : IN parameter. Required.
5214 --               p_v_person_number : IN parameter. Required.
5215 --               p_hz_parties_rec  : IN parameter. Required.
5216 --
5217 --Known limitations/enhancements and/or remarks:
5218 --
5219 --Change History:
5220 --Who         When            What
5221 --rajagupt    29-Jun-06       bug #5348743, Added check to handle lv_return_status of warning type
5222 ------------------------------------------------------------------
5223   l_v_rowid                   ROWID;
5224   l_n_location_id             igs_pe_person_addr.location_id%TYPE;
5225   l_n_msg_count               NUMBER ;
5226   l_v_msg_data                VARCHAR2(1000);
5227   l_v_return_status           VARCHAR2(10);
5228   l_n_party_site_id           igs_pe_person_addr.party_site_id%TYPE;
5229   l_n_location_ovn            hz_locations.object_version_number%TYPE;
5230   l_n_party_site_ovn          igs_pe_person_addr.party_site_ovn%TYPE;
5231   l_d_last_update_date        DATE;
5232   l_n_person_id               hz_parties.party_id%TYPE;
5233   l_v_person_number           hz_parties.party_number%TYPE;
5234   l_v_party_site_use          hz_party_site_uses.site_use_type%TYPE;
5235   l_n_party_site_use_id       hz_party_site_uses.party_site_use_id%TYPE;
5236   l_d_site_use_last_upd_dt    DATE;
5237   l_d_profile_last_upd_dt     DATE;
5238   l_v_permt_addr1             igs_pe_person_addr.addr_line_1%TYPE;
5239   l_v_permt_addr2             igs_pe_person_addr.addr_line_2%TYPE;
5240   l_v_permt_city              hz_parties.city%TYPE;
5241   l_v_permt_state             hz_parties.state%TYPE;
5242   l_v_postal_code             igs_pe_person_addr.postal_code%TYPE;
5243   l_rec_resp_r1               igf_sl_cl_resp_r1_all%ROWTYPE;
5244 BEGIN
5245   log_to_fnd(p_v_module => 'create_person_addr_record',
5246              p_v_string => ' p_rec_resp_r1.b_ssn              : ' || p_rec_resp_r1.b_ssn              ||
5247                            ' p_rec_resp_r1.b_last_name        : ' || p_rec_resp_r1.b_last_name        ||
5248                            ' p_rec_resp_r1.b_first_name       : ' || p_rec_resp_r1.b_first_name       ||
5249                            ' p_rec_resp_r1.b_middle_name      : ' || p_rec_resp_r1.b_middle_name      ||
5250                            ' p_rec_resp_r1.b_permt_addr1      : ' || p_rec_resp_r1.b_permt_addr1      ||
5251                            ' p_rec_resp_r1.b_permt_addr2      : ' || p_rec_resp_r1.b_permt_addr2      ||
5252                            ' p_rec_resp_r1.b_permt_city       : ' || p_rec_resp_r1.b_permt_city       ||
5253                            ' p_rec_resp_r1.b_permt_state      : ' || p_rec_resp_r1.b_permt_state      ||
5254                            ' p_rec_resp_r1.b_date_of_birth    : ' || p_rec_resp_r1.b_date_of_birth    ||
5255                            ' p_rec_resp_r1.s_ssn              : ' || p_rec_resp_r1.s_ssn              ||
5256                            ' p_rec_resp_r1.s_last_name        : ' || p_rec_resp_r1.s_last_name        ||
5257                            ' p_rec_resp_r1.s_first_name       : ' || p_rec_resp_r1.s_first_name       ||
5258                            ' p_rec_resp_r1.s_middle_name      : ' || p_rec_resp_r1.s_middle_name      ||
5259                            ' p_rec_resp_r1.s_date_of_birth    : ' || p_rec_resp_r1.s_date_of_birth    ||
5260                            ' p_rec_resp_r1.cl_loan_type       : ' || p_rec_resp_r1.cl_loan_type       ||
5261                            ' p_rec_resp_r1.b_indicator_code   : ' || p_rec_resp_r1.b_indicator_code
5262             );
5263   l_n_person_id        := p_n_person_id;
5264   l_v_person_number    := p_v_person_number;
5265   l_rec_resp_r1        := p_rec_resp_r1;
5266   l_v_permt_addr1      := l_rec_resp_r1.b_permt_addr1;
5267   l_v_permt_addr2      := l_rec_resp_r1.b_permt_addr2;
5268   l_v_permt_city       := l_rec_resp_r1.b_permt_city;
5269   l_v_permt_state      := l_rec_resp_r1.b_permt_state;
5270   l_v_postal_code      := l_rec_resp_r1.b_permt_zip;
5271 
5272   -- If the Student himself/herself is Borrower i.e. l_rec_resp_r1.b_indicator_code = 'Y' THEN
5273   -- address will be created for the student instead of borrower. In this case Student address would
5274   -- be same as the borrower address.
5275 
5276   l_v_rowid            := NULL;
5277   l_n_location_id      := NULL;
5278   l_n_party_site_id    := NULL;
5279   l_n_party_site_ovn   := NULL;
5280   l_n_location_ovn     := NULL;
5281   l_v_return_status    := NULL;
5282   l_d_last_update_date := NULL;
5283   l_v_msg_data         := NULL;
5284 
5285   igs_pe_person_addr_pkg.insert_row
5286   (
5287            p_action                     => 'R',
5288            p_rowid                      => l_v_rowid,
5289            p_location_id                => l_n_location_id,
5290            p_start_dt                   => NULL,
5291            p_end_dt                     => NULL,
5292            p_country                    => 'US',
5293            p_address_style              => NULL,
5294            p_addr_line_1                => INITCAP( l_v_permt_addr1),
5295            p_addr_line_2                => INITCAP( l_v_permt_addr2),
5296            p_addr_line_3                => NULL,
5297            p_addr_line_4                => NULL,
5298            p_date_last_verified         => NULL,
5299            p_correspondence             => NULL,
5300            p_city                       => INITCAP(l_v_permt_city),
5301            p_state                      => l_v_permt_state,
5302            p_province                   => NULL,
5303            p_county                     => NULL,
5304            p_postal_code                => l_v_postal_code,
5305            p_address_lines_phonetic     => NULL,
5306            p_delivery_point_code        => NULL,
5307            p_other_details_1            => NULL,
5308            p_other_details_2            => NULL,
5309            p_other_details_3            => NULL,
5310            l_return_status              => l_v_return_status,
5311            l_msg_data                   => l_v_msg_data,
5312            p_party_id                   => l_n_person_id,
5313            p_party_site_id              => l_n_party_site_id,
5314            p_party_type                 => NULL,
5315            p_last_update_date           => l_d_last_update_date,
5316            p_party_site_ovn             => l_n_party_site_ovn,
5317            p_location_ovn               => l_n_location_ovn,
5318            p_status                     => 'A'
5319   );
5320   -- if address creation failed
5321   IF l_v_return_status IN ('E','U')  THEN
5322     fnd_message.set_name('IGF','IGF_SL_CL_SCR_P_ADD_FAIL');
5323     fnd_message.set_token('PERSON_NUMBER',l_v_person_number);
5324     fnd_file.put_line(fnd_file.log, fnd_message.get);
5325     log_to_fnd(p_v_module => 'create_person_addr_record',
5326                p_v_string => ' Person address creation failed '
5327               );
5328     RETURN FALSE;
5329     -- bug 5348743
5330   ELSIF l_v_return_status = 'W' THEN
5331      fnd_file.put_line(fnd_file.log, l_v_msg_data);
5332      log_to_fnd(p_v_module => 'create_person_addr_record',
5333                p_v_string => ' Person address creation warning '
5334               );
5335   ELSE
5336   -- person address created successfully
5337       fnd_message.set_name('IGF','IGF_SL_CL_SCR_P_ADD_SUC');
5338       fnd_message.set_token('PERSON_NUMBER',l_v_person_number);
5339       fnd_file.put_line(fnd_file.log, fnd_message.get);
5340       log_to_fnd(p_v_module => 'create_person_addr_record',
5341                  p_v_string => ' Person address created, Person Number '||l_v_person_number
5342                 );
5343   END IF;
5344       log_to_fnd(p_v_module => 'create_person_addr_record',
5345                  p_v_string => ' verifying the profile for address usage '
5346                 );
5347    l_v_party_site_use := fnd_profile.value('IGF_AP_DEF_ADDR_USAGE');
5348    IF  l_v_party_site_use IS NULL THEN
5349       l_v_party_site_use := 'HOME';
5350    END IF;
5351 
5352    log_to_fnd(p_v_module => 'create_person_addr_record',
5353               p_v_string => ' Verified the profile for address usage.party site usage is '||l_v_party_site_use
5354              );
5355 
5356   l_v_rowid                := NULL;
5357   l_n_party_site_use_id    := NULL;
5358   l_v_return_status        := NULL;
5359   l_d_last_update_date     := NULL;
5360   l_v_msg_data             := NULL;
5361   l_d_site_use_last_upd_dt := NULL;
5362   l_d_profile_last_upd_dt  := NULL;
5363   l_n_party_site_ovn       := NULL;
5364 
5365    log_to_fnd(p_v_module => 'create_person_addr_record',
5366               p_v_string => ' Invoking igs_pe_party_site_use_pkg.hz_party_site_uses_ak'
5367              );
5368 
5369    igs_pe_party_site_use_pkg.hz_party_site_uses_ak (
5370                              p_action                      => 'INSERT',
5371                              p_rowid                       => l_v_rowid,
5372                              p_party_site_use_id           => l_n_party_site_use_id,
5373                              p_party_site_id               => l_n_party_site_id,
5374                              p_site_use_type               => l_v_party_site_use,
5375                              p_status                      => 'A',
5376                              p_return_status               => l_v_return_status  ,
5377                              p_msg_data                    => l_v_msg_data,
5378                              p_last_update_date            => l_d_last_update_date,
5379                              p_site_use_last_update_date   => l_d_site_use_last_upd_dt,
5380                              p_profile_last_update_date    => l_d_profile_last_upd_dt,
5381                              p_hz_party_site_use_ovn       => l_n_party_site_ovn
5382                      );
5383 
5384   IF l_v_return_status <> 'S'  THEN
5385     log_to_fnd(p_v_module => 'create_person_addr_record',
5386                p_v_string => ' igs_pe_party_site_use_pkg.hz_party_site_uses_ak failed '
5387               );
5388     RETURN FALSE;
5389   END IF;
5390   log_to_fnd(p_v_module => 'create_person_addr_record',
5391              p_v_string => ' igs_pe_party_site_use_pkg.hz_party_site_uses_ak successfully executed'
5392             );
5393   RETURN TRUE;
5394 END create_person_addr_record;
5395 
5396 FUNCTION create_person_telephone_record (p_n_person_id     IN  hz_parties.party_id%TYPE,
5397                                          p_rec_resp_r1     IN  igf_sl_cl_resp_r1_all%ROWTYPE
5398                                         ) RETURN BOOLEAN AS
5399 ------------------------------------------------------------------
5400 --Created by  : bvisvana, Oracle IDC
5401 --Date created: 29 July 2005
5402 --
5403 -- Purpose     : To create the Phone contact point for the person
5404 -- Invoked     : from within create_person_addr_record
5405 -- Parameters  : p_n_person_id and p_rec_resp_r1
5406 --
5407 --Known limitations/enhancements and/or remarks:
5408 --
5409 --Change History:
5410 --Who         When            What
5411 ------------------------------------------------------------------
5412 l_rowid               ROWID;
5413 l_return_status       VARCHAR2(10);
5414 l_last_update_date    DATE ;
5415 l_contact_point_id    VARCHAR2(25);
5416 l_contact_point_ovn   VARCHAR2(25);
5417 l_msg_data            VARCHAR2(1000);
5418 l_perm_phone          VARCHAR2(10);
5419 l_area_code           VARCHAR2(3);
5420 l_phone_num           VARCHAR2(7);
5421 
5422 BEGIN
5423 
5424   l_rowid             := NULL;
5425   l_last_update_date  := NULL;
5426   l_contact_point_id  := NULL;
5427   l_contact_point_ovn := NULL;
5428   l_msg_data          := NULL;
5429   l_area_code         := NULL;
5430   l_phone_num         := NULL;
5431   l_perm_phone        := p_rec_resp_r1.b_permt_phone;
5432 
5433   IF LTRIM(RTRIM(l_perm_phone)) <> 'N/A' and LENGTH(LTRIM(RTRIM(l_perm_phone))) = 10 THEN
5434      l_area_code  :=  SUBSTR(l_perm_phone,1,3);
5435      IF l_area_code = '000' THEN
5436         l_area_code := NULL;
5437      ENd IF;
5438      l_phone_num  :=  SUBSTR(l_perm_phone,4);
5439     IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
5440       fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.create_person_telephone_record.debug','p_n_person_id = '||p_n_person_id);
5441       fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.create_person_telephone_record.debug','Area_code = '||l_area_code);
5442       fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.create_person_telephone_record.debug','Phone_num = '||l_phone_num);
5443     END IF;
5444   ELSE
5445     IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
5446       fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.create_person_telephone_record.debug','Since phone number N/A or length not equal to 10 ..returning as false');
5447     END IF;
5448     RETURN FALSE;
5449   END IF;
5450   igs_pe_contact_point_pkg.hz_contact_points_akp(
5451                                                   p_action	             => 'INSERT',
5452                                                   p_rowid		             => l_rowid,
5453                                                   p_status	             => 'A',
5454                                                   p_owner_table_name     => 'HZ_PARTIES',
5455                                                   p_owner_table_id       => p_n_person_id,
5456                                                   p_primary_flag	       => 'N',
5457                                                   p_phone_country_code   => NULL,
5458                                                   p_phone_area_code      => l_area_code,
5459                                                   p_phone_number         => l_phone_num,
5460                                                   p_phone_extension      => NULL,
5461                                                   p_phone_line_type      => 'GEN',
5462                                                   p_return_status	       => l_return_status,
5463                                                   p_msg_data             => l_msg_data,
5464                                                   p_last_update_date     => l_last_update_date,
5465                                                   p_contact_point_id     => l_contact_point_id,
5466                                                   p_contact_point_ovn    => l_contact_point_ovn,
5467                                                   p_attribute_category   => NULL,
5468                                                   p_attribute1           => NULL,
5469                                                   p_attribute2           => NULL,
5470                                                   p_attribute3           => NULL,
5471                                                   p_attribute4           => NULL,
5472                                                   p_attribute5           => NULL,
5473                                                   p_attribute6           => NULL,
5474                                                   p_attribute7           => NULL,
5475                                                   p_attribute8           => NULL,
5476                                                   p_attribute9           => NULL,
5477                                                   p_attribute10          => NULL,
5478                                                   p_attribute11          => NULL,
5479                                                   p_attribute12          => NULL,
5480                                                   p_attribute13          => NULL,
5481                                                   p_attribute14          => NULL,
5482                                                   p_attribute15          => NULL,
5483                                                   p_attribute16          => NULL,
5484                                                   p_attribute17          => NULL,
5485                                                   p_attribute18          => NULL,
5486                                                   p_attribute19          => NULL,
5487                                                   p_attribute20          => NULL
5488                                                 );
5489     IF l_return_status <> 'S' THEN
5490       IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
5491         fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.create_person_telephone_record.debug','FALSE - Telephone return status = '||l_return_status);
5492       END IF;
5493       RETURN FALSE;
5494     ELSE
5495       IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
5496         fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.create_person_telephone_record.debug','TRUE - Telephone return status = '||l_return_status);
5497       END IF;
5498       RETURN TRUE;
5499     END IF;
5500 END create_person_telephone_record;
5501 
5502 
5503 FUNCTION create_borrow_stud_rel ( p_n_borrower_id     IN  hz_parties.party_id%TYPE,
5504                                   p_v_borrower_number IN  hz_parties.party_number%TYPE,
5505                                   p_n_student_id      IN  hz_parties.party_id%TYPE,
5506                                   p_v_student_number  IN  hz_parties.party_number%TYPE
5507                                  ) RETURN BOOLEAN AS
5508 ------------------------------------------------------------------
5509 --Created by  : Sanil Madathil, Oracle IDC
5510 --Date created: 21 October 2004
5511 --
5512 -- Purpose:
5513 -- Invoked     : from within process_borrow_stud_rec procedure
5514 -- Function    : Private function for creating borrower student relation
5515 --
5516 -- Parameters  : p_n_borrower_id     : IN parameter. Required.
5517 --               p_v_borrower_number : IN parameter. Required.
5518 --               p_n_student_id      : IN parameter. Required.
5519 --               p_v_student_number  : IN parameter. Required.
5520 --
5521 --Known limitations/enhancements and/or remarks:
5522 --
5523 --Change History:
5524 --Who         When            What
5525 -- pssahni   18-Jan-2005      Added functionality to check if relationship
5526 --                            already exsist between the student and borrower
5527 ------------------------------------------------------------------
5528  -- Get the details of relationship
5529  CURSOR c_get_relationship( p_subject_id hz_relationships.subject_id%TYPE,
5530                             p_object_id hz_relationships.object_id%TYPE
5531            ) IS
5532    SELECT relationship_type
5533      FROM hz_relationships
5534     WHERE subject_id = p_subject_id
5535       AND object_id  = p_object_id;
5536 
5537   l_relationship c_get_relationship%ROWTYPE;
5538 
5539   l_n_msg_count               NUMBER ;
5540   l_v_msg_data                VARCHAR2(1000);
5541   l_v_return_status           VARCHAR2(10);
5542   l_d_last_update_date        DATE;
5543   l_n_location_ovn            hz_locations.object_version_number%TYPE;
5544   l_n_relationship_id         hz_relationships.relationship_id%TYPE;
5545   l_n_party_id                hz_parties.party_id%TYPE;
5546   l_v_party_number            hz_parties.party_number%TYPE;
5547 
5548 
5549 BEGIN
5550   log_to_fnd(p_v_module => 'create_borrow_stud_rel',
5551              p_v_string => ' p_n_borrower_id     : ' ||p_n_borrower_id       ||
5552                            ' p_v_borrower_number : ' ||p_v_borrower_number   ||
5553                            ' p_n_student_id      : ' ||p_n_student_id        ||
5554                            ' p_v_student_number  : ' ||p_v_student_number
5555             );
5556 
5557 -- pssahni 18-Jan-2005
5558 -- Since we are creating relationships for exsisting persons so we need to
5559 -- first check if any relationship exsists between the borrower and student
5560   OPEN c_get_relationship (p_n_borrower_id, p_n_student_id);
5561   FETCH c_get_relationship INTO l_relationship;
5562   IF c_get_relationship%FOUND THEN            --Relationship exsists.
5563     CLOSE c_get_relationship;
5564     fnd_message.set_name('IGF','IGF_SL_CL_SCR_REL_EXSIST');
5565     fnd_message.set_token('PERSON_NUMBER',p_v_borrower_number);
5566     fnd_message.set_token('ST_PERSON_NUM',p_v_student_number);
5567     fnd_file.put_line(fnd_file.log, fnd_message.get);
5568     RETURN FALSE;
5569   ELSE                                       -- Create relationship
5570       CLOSE c_get_relationship;
5571       igs_pe_relationships_pkg.creatupdate_party_relationship(
5572             p_action                  => 'INSERT',
5573             p_subject_id              => p_n_borrower_id,
5574             p_object_id               => p_n_student_id,
5575             p_party_relationship_type => 'PARENT/CHILD',
5576             p_relationship_code       => 'PARENT_OF',
5577             p_comments                => NULL,
5578             p_start_date              => SYSDATE,
5579             p_end_date                => NULL,
5580             p_last_update_date        => l_d_last_update_date,
5581             p_return_status           => l_v_return_status,
5582             p_msg_count               => l_n_msg_count,
5583             p_msg_data                => l_v_msg_data,
5584             p_party_relationship_id   => l_n_relationship_id,
5585             p_party_id                => l_n_party_id,
5586             p_party_number            => l_v_party_number,
5587             p_object_version_number   => l_n_location_ovn
5588       );
5589 
5590       IF (l_v_return_status <> 'S') THEN
5591         fnd_message.set_name('IGF','IGF_SL_CL_SCR_REL_FAIL');
5592         fnd_message.set_token('PERSON_NUMBER',p_v_borrower_number);
5593         fnd_message.set_token('ST_PERSON_NUM',p_v_student_number);
5594         fnd_file.put_line(fnd_file.log, fnd_message.get);
5595         log_to_fnd(p_v_module => 'create_borrow_stud_rel',
5596                    p_v_string => ' igs_pe_relationships_pkg.creatupdate_party_relationship failed '
5597                   );
5598         RETURN FALSE;
5599       END IF;
5600       fnd_message.set_name('IGF','IGF_SL_CL_SCR_REL_SUC');
5601       fnd_message.set_token('PERSON_NUMBER',p_v_borrower_number);
5602       fnd_message.set_token('ST_PERSON_NUM',p_v_student_number);
5603       fnd_file.put_line(fnd_file.log, fnd_message.get);
5604       log_to_fnd(p_v_module => 'create_borrow_stud_rel',
5605                  p_v_string => ' igs_pe_relationships_pkg.creatupdate_party_relationship successful. '
5606                 );
5607       RETURN TRUE;
5608 
5609     END IF;
5610 
5611 END create_borrow_stud_rel;
5612 
5613 
5614 PROCEDURE prepare_scr_message (itemtype   IN VARCHAR2,
5615                                  itemkey    IN VARCHAR2,
5616                                  actid      IN NUMBER,
5617                                  funcmode   IN VARCHAR2,
5618                                  resultout  OUT NOCOPY VARCHAR2)
5619 
5620 AS
5621 ------------------------------------------------------------------
5622 --Created by  : Sanil Madathil, Oracle IDC
5623 --Date created: 04 November 2004
5624 --
5625 -- Purpose:
5626 -- Invoked     : invoked from workflow
5627 -- Function    : public function which return the release version attribute .
5628 --               This would decide the workflow Notification Content
5629 -- Parameters  :
5630 --
5631 --
5632 --Known limitations/enhancements and/or remarks:
5633 --
5634 --Change History:
5635 --Who         When            What
5636 ------------------------------------------------------------------
5637 BEGIN
5638 
5639     resultout := wf_engine.getitemattrtext(
5640                           itemtype,
5641                           itemkey,
5642                           'RELEASE_VERSION');
5643     IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
5644       fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_sl_cl_orig_ack.prepare_scr_message.debug','resultout ' || resultout);
5645     END IF;
5646 
5647 EXCEPTION
5648     WHEN OTHERS THEN
5649     resultout := NULL;
5650     wf_core.context ('IGF_SL_CL_ORIG_ACK',
5651                       'PREPARE_SCR_MESSAGE', itemtype,
5652                        itemkey,TO_CHAR(actid), funcmode);
5653     IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
5654       fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_sl_cl_orig_ack.prepare_scr_message.debug','sqlerrm ' || SQLERRM);
5655     END IF;
5656 END prepare_scr_message;
5657 
5658 PROCEDURE raise_scr_event  ( p_rec_resp_r1        IN  igf_sl_cl_resp_r1_all%ROWTYPE,
5659                              p_c_borrow_created   IN  VARCHAR2,
5660                              p_c_student_created  IN  VARCHAR2,
5661                              p_c_rel_created      IN  VARCHAR2
5662                            ) AS
5663 ------------------------------------------------------------------
5664 --Created by  : Sanil Madathil, Oracle IDC
5665 --Date created: 04 November 2004
5666 --
5667 -- Purpose:
5668 -- Invoked     : from within process_borrow_stud_rec procedure
5669 -- Function    : private function which would raise the business event
5670 --
5671 -- Parameters  :
5672 --
5673 --
5674 --Known limitations/enhancements and/or remarks:
5675 --
5676 --Change History:
5677 --Who         When            What
5678 -- bvisvana    26-Sep-2005    Bug # 4141704 - IGF_SL_FED_APPL_FORM_CODE replaced with IGF_SL_CL_APP_FORM_CODE since
5679 --                            IGF_SL_CL_APP_FORM_CODE has the complete set of lookup_code for Application Form Code
5680 ------------------------------------------------------------------
5681   CURSOR  c_wf_event_key IS
5682   SELECT  igf_sl_cl_scr_seq.NEXTVAL
5683   FROM    DUAL;
5684 
5685   l_wf_event_t            wf_event_t;
5686   l_wf_parameter_list_t   wf_parameter_list_t;
5687   l_wf_event_name         VARCHAR2(255);
5688   l_wf_event_key          NUMBER;
5689   l_v_role                fnd_user.user_name%TYPE;
5690   l_rec_resp_r1           igf_sl_cl_resp_r1_all%ROWTYPE;
5691 BEGIN
5692   log_to_fnd(p_v_module => 'raise_scr_event',
5693              p_v_string => ' p_rec_resp_r1.loan_number  : ' ||p_rec_resp_r1.loan_number ||
5694                            ' p_c_borrow_created         : ' ||p_c_borrow_created        ||
5695                            ' p_c_student_created        : ' ||p_c_student_created       ||
5696                            ' p_c_rel_created            : ' ||p_c_rel_created
5697             );
5698   log_to_fnd(p_v_module => 'raise_scr_event',
5699              p_v_string => 'Initializing the wf_event_t object'
5700             );
5701   l_rec_resp_r1  := p_rec_resp_r1;
5702 
5703   -- initialize the wf_event_t object
5704   wf_event_t.initialize(l_wf_event_t);
5705   l_wf_event_name := 'oracle.apps.igf.sl.loans.ffelp.LoanCertificationRequest';
5706   log_to_fnd(p_v_module => 'raise_scr_event',
5707              p_v_string => 'Setting the workflow event name '||l_wf_event_name
5708             );
5709   -- set the event name
5710   l_wf_event_t.seteventname( peventname => l_wf_event_name);
5711 
5712   log_to_fnd(p_v_module => 'raise_scr_event',
5713              p_v_string => 'Obtaining the workflow event key'
5714             );
5715   OPEN  c_wf_event_key;
5716   FETCH c_wf_event_key INTO l_wf_event_key;
5717   CLOSE c_wf_event_key ;
5718 
5719   log_to_fnd(p_v_module => 'raise_scr_event',
5720              p_v_string => 'The workflow event key '||l_wf_event_key
5721             );
5722   l_wf_event_t.setEventKey ( pEventKey => l_wf_event_name|| l_wf_event_key );
5723   -- set the parameter list
5724   log_to_fnd(p_v_module => 'raise_scr_event',
5725              p_v_string => 'setting the parameter list'
5726             );
5727   l_wf_event_t.setParameterList ( pParameterList => l_wf_parameter_list_t );
5728 
5729   -- Now add the parameters to the list to be passed to the workflow
5730   log_to_fnd(p_v_module => 'raise_scr_event',
5731              p_v_string => 'Adding the parameters to the list passed to the workflow'
5732             );
5733 
5734   log_to_fnd(p_v_module => 'raise_scr_event',
5735              p_v_string => 'Before calling the fnd.profile.value(USERNAME)'
5736             );
5737 
5738   l_v_role := fnd_global.user_name;
5739 
5740   log_to_fnd(p_v_module => 'raise_scr_event',
5741              p_v_string => 'After calling the fnd.profile.value(USERNAME)..The value of the USERNAME is '||l_v_role
5742             );
5743 
5744   wf_event.addparametertolist(
5745        p_name          => 'USER_ID',
5746        p_value         => l_v_role,
5747        p_parameterlist => l_wf_parameter_list_t
5748        );
5749   wf_event.addparametertolist(
5750        p_name          => 'RELEASE_VERSION',
5751        p_value         => g_v_cl_version,
5752        p_parameterlist => l_wf_parameter_list_t
5753        );
5754 
5755   wf_event.addparametertolist(
5756        p_name          => 'ATT_1',
5757        p_value         => l_rec_resp_r1.b_last_name,
5758        p_parameterlist => l_wf_parameter_list_t
5759        );
5760 
5761   wf_event.addparametertolist(
5762        p_name          => 'ATT_2',
5763        p_value         => l_rec_resp_r1.b_first_name,
5764        p_parameterlist => l_wf_parameter_list_t
5765        );
5766 
5767   wf_event.addparametertolist(
5768        p_name          => 'ATT_3',
5769        p_value         => l_rec_resp_r1.b_middle_name,
5770        p_parameterlist => l_wf_parameter_list_t
5771        );
5772 
5773   wf_event.addparametertolist(
5774        p_name          => 'ATT_4',
5775        p_value         => l_rec_resp_r1.b_ssn,
5776        p_parameterlist => l_wf_parameter_list_t
5777        );
5778 
5779   wf_event.addparametertolist(
5780        p_name          => 'ATT_5',
5781        p_value         => l_rec_resp_r1.b_permt_addr1,
5782        p_parameterlist => l_wf_parameter_list_t
5783        );
5784 
5785   wf_event.addparametertolist(
5786        p_name          => 'ATT_6',
5787        p_value         => l_rec_resp_r1.b_permt_addr2,
5788        p_parameterlist => l_wf_parameter_list_t
5789        );
5790 
5791   wf_event.addparametertolist(
5792        p_name          => 'ATT_7',
5793        p_value         => l_rec_resp_r1.b_permt_city,
5794        p_parameterlist => l_wf_parameter_list_t
5795        );
5796 
5797   wf_event.addparametertolist(
5798        p_name          => 'ATT_8',
5799        p_value         => l_rec_resp_r1.b_permt_state,
5800        p_parameterlist => l_wf_parameter_list_t
5801        );
5802 
5803   wf_event.addparametertolist(
5804        p_name          => 'ATT_9',
5805        p_value         => l_rec_resp_r1.b_permt_zip,
5806        p_parameterlist => l_wf_parameter_list_t
5807        );
5808 
5809   wf_event.addparametertolist(
5810        p_name          => 'ATT_10',
5811        p_value         => l_rec_resp_r1.b_permt_zip_suffix,
5812        p_parameterlist => l_wf_parameter_list_t
5813        );
5814 
5815   wf_event.addparametertolist(
5816        p_name          => 'ATT_11',
5817        p_value         => l_rec_resp_r1.b_permt_phone,
5818        p_parameterlist => l_wf_parameter_list_t
5819        );
5820 
5821   wf_event.addparametertolist(
5822        p_name          => 'ATT_12',
5823        p_value         => l_rec_resp_r1.b_date_of_birth,
5824        p_parameterlist => l_wf_parameter_list_t
5825        );
5826 
5827   wf_event.addparametertolist(
5828        p_name          => 'ATT_13',
5829        p_value         => l_rec_resp_r1.cl_loan_type||' - ' || igf_aw_gen.lookup_desc('IGF_SL_CL_LOAN_TYPE',l_rec_resp_r1.cl_loan_type),
5830        p_parameterlist => l_wf_parameter_list_t
5831        );
5832 
5833   wf_event.addparametertolist(
5834        p_name          => 'ATT_14',
5835        p_value         => l_rec_resp_r1.req_loan_amt,
5836        p_parameterlist => l_wf_parameter_list_t
5837        );
5838 
5839   wf_event.addparametertolist(
5840        p_name          => 'ATT_15',
5841        p_value         => l_rec_resp_r1.defer_req_code||' - ' ||igf_aw_gen.lookup_desc('IGF_SL_CL_DEF_REQ_CODE',l_rec_resp_r1.defer_req_code),
5842        p_parameterlist => l_wf_parameter_list_t
5843        );
5844 
5845   wf_event.addparametertolist(
5846        p_name          => 'ATT_16',
5847        p_value         => l_rec_resp_r1.borw_interest_ind||' - '||igf_aw_gen.lookup_desc('IGF_SL_CL_BORW_INT_IND',l_rec_resp_r1.borw_interest_ind),
5848        p_parameterlist => l_wf_parameter_list_t
5849        );
5850 
5851   wf_event.addparametertolist(
5852        p_name          => 'ATT_17',
5853        p_value         => l_rec_resp_r1.eft_auth_code||' - ' ||igf_aw_gen.lookup_desc('IGF_SL_CL_EFT_AUTH_CODE',l_rec_resp_r1.eft_auth_code),
5854        p_parameterlist => l_wf_parameter_list_t
5855        );
5856 
5857   wf_event.addparametertolist(
5858        p_name          => 'ATT_18',
5859        p_value         => l_rec_resp_r1.b_signature_code||' - ' ||igf_aw_gen.lookup_desc('IGF_SL_CL_BORW_SIGN_CODE',l_rec_resp_r1.b_signature_code),
5860        p_parameterlist => l_wf_parameter_list_t
5861        );
5862 
5863   wf_event.addparametertolist(
5864        p_name          => 'ATT_19',
5865        p_value         => l_rec_resp_r1.b_signature_date,
5866        p_parameterlist => l_wf_parameter_list_t
5867        );
5868 
5869   wf_event.addparametertolist(
5870        p_name          => 'ATT_20',
5871        p_value         => l_rec_resp_r1.loan_number,
5872        p_parameterlist => l_wf_parameter_list_t
5873        );
5874 
5875   IF g_v_cl_version = 'RELEASE-5' THEN
5876 
5877     wf_event.addparametertolist(
5878        p_name          => 'ATT_21',
5879        p_value         => l_rec_resp_r1.borr_credit_auth_code,
5880        p_parameterlist => l_wf_parameter_list_t
5881        );
5882 
5883     wf_event.addparametertolist(
5884        p_name          => 'ATT_22',
5885        p_value         => l_rec_resp_r1.b_citizenship_status||' - '||igf_aw_gen.lookup_desc('IGF_SL_CITIZENSHIP_STAT', l_rec_resp_r1.b_citizenship_status),
5886        p_parameterlist => l_wf_parameter_list_t
5887        );
5888 
5889     wf_event.addparametertolist(
5890        p_name          => 'ATT_23',
5891        p_value         => l_rec_resp_r1.b_state_of_legal_res||' - ' ||igf_aw_gen.lookup_desc('IGF_AP_STATE_CODES',l_rec_resp_r1.b_state_of_legal_res),
5892        p_parameterlist => l_wf_parameter_list_t
5893        );
5894     wf_event.addparametertolist(
5895        p_name          => 'ATT_24',
5896        p_value         => l_rec_resp_r1.b_legal_res_date,
5897        p_parameterlist => l_wf_parameter_list_t
5898        );
5899 
5900     wf_event.addparametertolist(
5901        p_name          => 'ATT_25',
5902        p_value         => l_rec_resp_r1.b_default_status||' - ' ||igf_aw_gen.lookup_desc('IGF_SL_P_DEFAULT_STATUS',l_rec_resp_r1.b_default_status),
5903        p_parameterlist => l_wf_parameter_list_t
5904        );
5905 
5906     wf_event.addparametertolist(
5907        p_name          => 'ATT_26',
5908        p_value         => l_rec_resp_r1.b_outstd_loan_code||' - '||igf_aw_gen.lookup_desc('IGF_AP_YES_NO',l_rec_resp_r1.b_outstd_loan_code),
5909        p_parameterlist => l_wf_parameter_list_t
5910        );
5911 
5912     wf_event.addparametertolist(
5913        p_name          => 'ATT_27',
5914        p_value         => l_rec_resp_r1.b_indicator_code||' - '||igf_aw_gen.lookup_desc('IGF_AP_YES_NO',l_rec_resp_r1.b_indicator_code),
5915        p_parameterlist => l_wf_parameter_list_t
5916        );
5917 
5918     wf_event.addparametertolist(
5919        p_name          => 'ATT_28',
5920        p_value         => l_rec_resp_r1.s_last_name,
5921        p_parameterlist => l_wf_parameter_list_t
5922        );
5923 
5924     wf_event.addparametertolist(
5925        p_name          => 'ATT_29',
5926        p_value         => l_rec_resp_r1.s_first_name,
5927        p_parameterlist => l_wf_parameter_list_t
5928        );
5929 
5930     wf_event.addparametertolist(
5931        p_name          => 'ATT_30',
5932        p_value         => l_rec_resp_r1.s_middle_name,
5933        p_parameterlist => l_wf_parameter_list_t
5934        );
5935 
5936     wf_event.addparametertolist(
5937        p_name          => 'ATT_31',
5938        p_value         => l_rec_resp_r1.s_ssn,
5939        p_parameterlist => l_wf_parameter_list_t
5940        );
5941 
5942     wf_event.addparametertolist(
5943        p_name          => 'ATT_32',
5944        p_value         => l_rec_resp_r1.s_date_of_birth,
5945        p_parameterlist => l_wf_parameter_list_t
5946        );
5947 
5948     wf_event.addparametertolist(
5949        p_name          => 'ATT_33',
5950        p_value         => l_rec_resp_r1.s_citizenship_status||' - ' ||igf_aw_gen.lookup_desc('IGF_SL_CITIZENSHIP_STAT',l_rec_resp_r1.s_citizenship_status),
5951        p_parameterlist => l_wf_parameter_list_t
5952        );
5953 
5954     wf_event.addparametertolist(
5955        p_name          => 'ATT_34',
5956        p_value         => l_rec_resp_r1.s_default_code||' - ' ||igf_aw_gen.lookup_desc('IGF_SL_S_DEFAULT_STATUS',l_rec_resp_r1.s_default_code),
5957        p_parameterlist => l_wf_parameter_list_t
5958        );
5959 
5960     wf_event.addparametertolist(
5961        p_name          => 'ATT_35',
5962        p_value         => l_rec_resp_r1.s_signature_code||' - '||igf_aw_gen.lookup_desc('IGF_SL_CL_STUD_SIGN_CODE',l_rec_resp_r1.s_signature_code),
5963        p_parameterlist => l_wf_parameter_list_t
5964        );
5965 
5966     wf_event.addparametertolist(
5967        p_name          => 'ATT_36',
5968        p_value         => l_rec_resp_r1.school_id,
5969        p_parameterlist => l_wf_parameter_list_t
5970        );
5971 
5972     wf_event.addparametertolist(
5973        p_name          => 'ATT_37',
5974        p_value         => l_rec_resp_r1.loan_per_begin_date,
5975        p_parameterlist => l_wf_parameter_list_t
5976        );
5977 
5978     wf_event.addparametertolist(
5979        p_name          => 'ATT_38',
5980        p_value         => l_rec_resp_r1.loan_per_end_date,
5981        p_parameterlist => l_wf_parameter_list_t
5982        );
5983     wf_event.addparametertolist(
5984        p_name          => 'ATT_39',
5985        p_value         => l_rec_resp_r1.borr_sign_ind||' - '||igf_aw_gen.lookup_desc('IGF_SL_CL_ELE_SIGN_IND',l_rec_resp_r1.borr_sign_ind),
5986        p_parameterlist => l_wf_parameter_list_t
5987        );
5988 
5989     wf_event.addparametertolist(
5990        p_name          => 'ATT_40',
5991        p_value         => l_rec_resp_r1.alt_appl_ver_code||' - '||igf_aw_gen.lookup_desc('IGF_SL_ALT_LOAN_CODE',l_rec_resp_r1.alt_appl_ver_code) ,
5992        p_parameterlist => l_wf_parameter_list_t
5993        );
5994 
5995     wf_event.addparametertolist(
5996        p_name          => 'ATT_41',
5997        p_value         => l_rec_resp_r1.lender_id,
5998        p_parameterlist => l_wf_parameter_list_t
5999        );
6000 
6001     wf_event.addparametertolist(
6002        p_name          => 'ATT_42',
6003        p_value         => l_rec_resp_r1.guarantor_id,
6004        p_parameterlist => l_wf_parameter_list_t
6005        );
6006     -- Bug # 4141704
6007     wf_event.addparametertolist(
6008        p_name          => 'ATT_43',
6009        p_value         => l_rec_resp_r1.fed_appl_form_code||' - '||igf_aw_gen.lookup_desc('IGF_SL_CL_APP_FORM_CODE',l_rec_resp_r1.fed_appl_form_code),
6010        p_parameterlist => l_wf_parameter_list_t
6011        );
6012 
6013     wf_event.addparametertolist(
6014        p_name          => 'ATT_44',
6015        p_value         => l_rec_resp_r1.b_license_state||' - '||igf_aw_gen.lookup_desc('IGF_AP_STATE_CODES',l_rec_resp_r1.b_license_state),
6016        p_parameterlist => l_wf_parameter_list_t
6017        );
6018 
6019     wf_event.addparametertolist(
6020        p_name          => 'ATT_45',
6021        p_value         => l_rec_resp_r1.b_license_number,
6022        p_parameterlist => l_wf_parameter_list_t
6023        );
6024 
6025     wf_event.addparametertolist(
6026        p_name          => 'ATT_46',
6027        p_value         => l_rec_resp_r1.b_ref_code||' - '||igf_aw_gen.lookup_desc('IGF_SL_CL_BORW_REF_INF',l_rec_resp_r1.b_ref_code),
6028        p_parameterlist => l_wf_parameter_list_t
6029        );
6030 
6031     wf_event.addparametertolist(
6032        p_name          => 'ATT_47',
6033        p_value         => l_rec_resp_r1.pnote_delivery_code||' - '||igf_aw_gen.lookup_desc('IGF_SL_PNOTE_DELIVERY',l_rec_resp_r1.pnote_delivery_code),
6034        p_parameterlist => l_wf_parameter_list_t
6035        );
6036 
6037     wf_event.addparametertolist(
6038        p_name          => 'ATT_48',
6039        p_value         => l_rec_resp_r1.b_foreign_postal_code,
6040        p_parameterlist => l_wf_parameter_list_t
6041        );
6042     wf_event.addparametertolist(
6043        p_name          => 'ATT_49',
6044        p_value         => l_rec_resp_r1.stud_sign_ind||' - '||igf_aw_gen.lookup_desc('IGF_SL_CL_ELE_SIGN_IND',l_rec_resp_r1.stud_sign_ind),
6045        p_parameterlist => l_wf_parameter_list_t
6046        );
6047 
6048     wf_event.addparametertolist(
6049        p_name          => 'ATT_50',
6050        p_value         => l_rec_resp_r1.lend_non_ed_brc_id,
6051        p_parameterlist => l_wf_parameter_list_t
6052        );
6053 
6054    wf_event.addparametertolist(
6055        p_name          => 'ATT_51',
6056        p_value         => l_rec_resp_r1.lender_use_txt,
6057        p_parameterlist => l_wf_parameter_list_t
6058        );
6059 
6060     wf_event.addparametertolist(
6061        p_name          => 'ATT_52',
6062        p_value         => l_rec_resp_r1.guarantor_use_txt,
6063        p_parameterlist => l_wf_parameter_list_t
6064        );
6065 
6066     wf_event.addparametertolist(
6067        p_name          => 'ATT_53',
6068        p_value         => l_rec_resp_r1.b_permt_addr_chg_date,
6069        p_parameterlist => l_wf_parameter_list_t
6070        );
6071 
6072     wf_event.addparametertolist(
6073        p_name          => 'ATT_54',
6074        p_value         => l_rec_resp_r1.alt_prog_type_code,
6075        p_parameterlist => l_wf_parameter_list_t
6076        );
6077 
6078     wf_event.addparametertolist(
6079        p_name          => 'ATT_55',
6080        p_value         => l_rec_resp_r1.prc_type_code||' - '||igf_aw_gen.lookup_desc('IGF_SL_PRC_TYPE_CODE',l_rec_resp_r1.prc_type_code),
6081        p_parameterlist => l_wf_parameter_list_t
6082        );
6083     -- No mapping field available for ATT_56. Discussed with TD writer
6084     -- Td writer agreed upon to skip this ATT_56
6085 
6086      wf_event.addparametertolist(
6087        p_name          => 'ATT_57',
6088        p_value         => l_rec_resp_r1.guarnt_status_code||' - ' ||igf_aw_gen.lookup_desc('IGF_SL_GUARNT_STATUS',l_rec_resp_r1.guarnt_status_code),
6089        p_parameterlist => l_wf_parameter_list_t
6090        );
6091 
6092     wf_event.addparametertolist(
6093        p_name          => 'ATT_58',
6094        p_value         => l_rec_resp_r1.lender_status_code||' - '||igf_aw_gen.lookup_desc('IGF_SL_LEND_STATUS',l_rec_resp_r1.lender_status_code),
6095        p_parameterlist => l_wf_parameter_list_t
6096        );
6097 
6098     wf_event.addparametertolist(
6099        p_name          => 'ATT_59',
6100        p_value         => l_rec_resp_r1.pnote_status_code||' - '||igf_aw_gen.lookup_desc('IGF_SL_PNOTE_STATUS',l_rec_resp_r1.pnote_status_code),
6101        p_parameterlist => l_wf_parameter_list_t
6102        );
6103 
6104     wf_event.addparametertolist(
6105        p_name          => 'ATT_60',
6106        p_value         => l_rec_resp_r1.credit_status_code||' - '||igf_aw_gen.lookup_desc('IGF_SL_CREDIT_OVERRIDE',l_rec_resp_r1.credit_status_code),
6107        p_parameterlist => l_wf_parameter_list_t
6108        );
6109 
6110     wf_event.addparametertolist(
6111        p_name          => 'ATT_61',
6112        p_value         => l_rec_resp_r1.guarnt_status_date,
6113        p_parameterlist => l_wf_parameter_list_t
6114        );
6115 
6116     wf_event.addparametertolist(
6117        p_name          => 'ATT_62',
6118        p_value         => l_rec_resp_r1.lender_status_date,
6119        p_parameterlist => l_wf_parameter_list_t
6120        );
6121 
6122     wf_event.addparametertolist(
6123        p_name          => 'ATT_63',
6124        p_value         => l_rec_resp_r1.pnote_status_date,
6125        p_parameterlist => l_wf_parameter_list_t
6126        );
6127 
6128     wf_event.addparametertolist(
6129        p_name          => 'ATT_64',
6130        p_value         => l_rec_resp_r1.credit_status_date,
6131        p_parameterlist => l_wf_parameter_list_t
6132        );
6133 
6134     wf_event.addparametertolist(
6135        p_name          => 'ATT_65',
6136        p_value         => l_rec_resp_r1.act_serial_loan_code||' - ' ||igf_aw_gen.lookup_desc('IGF_SL_SERIAL_LOAN_CODE',l_rec_resp_r1.act_serial_loan_code),
6137        p_parameterlist => l_wf_parameter_list_t
6138        );
6139 
6140     wf_event.addparametertolist(
6141        p_name          => 'ATT_66',
6142        p_value         => l_rec_resp_r1.sch_non_ed_brc_id,
6143        p_parameterlist => l_wf_parameter_list_t
6144        );
6145 
6146     wf_event.addparametertolist(
6147        p_name          => 'ATT_67',
6148        p_value         => igf_aw_gen.lookup_desc('IGF_AP_YES_NO',p_c_borrow_created),
6149        p_parameterlist => l_wf_parameter_list_t
6150        );
6151 
6152     wf_event.addparametertolist(
6153        p_name          => 'ATT_68',
6154        p_value         => igf_aw_gen.lookup_desc('IGF_AP_YES_NO',p_c_student_created),
6155        p_parameterlist => l_wf_parameter_list_t
6156        );
6157 
6158     wf_event.addparametertolist(
6159        p_name          => 'ATT_69',
6160        p_value         => igf_aw_gen.lookup_desc('IGF_AP_YES_NO',p_c_rel_created),
6161        p_parameterlist => l_wf_parameter_list_t
6162        );
6163 
6164   END IF;
6165 
6166   IF g_v_cl_version = 'RELEASE-4' THEN
6167 
6168     wf_event.addparametertolist(
6169        p_name          => 'ATT_21',
6170        p_value         => l_rec_resp_r1.b_citizenship_status||' - '||igf_aw_gen.lookup_desc('IGF_SL_CITIZENSHIP_STAT', l_rec_resp_r1.b_citizenship_status),
6171        p_parameterlist => l_wf_parameter_list_t
6172        );
6173 
6174     wf_event.addparametertolist(
6175        p_name          => 'ATT_22',
6176        p_value         => l_rec_resp_r1.b_state_of_legal_res||' - '||igf_aw_gen.lookup_desc('IGF_AP_STATE_CODES',l_rec_resp_r1.b_state_of_legal_res),
6177        p_parameterlist => l_wf_parameter_list_t
6178        );
6179     wf_event.addparametertolist(
6180        p_name          => 'ATT_23',
6181        p_value         => l_rec_resp_r1.b_legal_res_date,
6182        p_parameterlist => l_wf_parameter_list_t
6183        );
6184 
6185     wf_event.addparametertolist(
6186        p_name          => 'ATT_24',
6187        p_value         => l_rec_resp_r1.b_default_status||' - ' ||igf_aw_gen.lookup_desc('IGF_SL_P_DEFAULT_STATUS',l_rec_resp_r1.b_default_status),
6188        p_parameterlist => l_wf_parameter_list_t
6189        );
6190 
6191     wf_event.addparametertolist(
6192        p_name          => 'ATT_25',
6193        p_value         => l_rec_resp_r1.b_outstd_loan_code||' - '||igf_aw_gen.lookup_desc('IGF_AP_YES_NO',l_rec_resp_r1.b_outstd_loan_code),
6194        p_parameterlist => l_wf_parameter_list_t
6195        );
6196 
6197     wf_event.addparametertolist(
6198        p_name          => 'ATT_26',
6199        p_value         => l_rec_resp_r1.b_indicator_code||' - '||igf_aw_gen.lookup_desc('IGF_AP_YES_NO',l_rec_resp_r1.b_indicator_code),
6200        p_parameterlist => l_wf_parameter_list_t
6201        );
6202 
6203     wf_event.addparametertolist(
6204        p_name          => 'ATT_27',
6205        p_value         => l_rec_resp_r1.s_last_name,
6206        p_parameterlist => l_wf_parameter_list_t
6207        );
6208 
6209     wf_event.addparametertolist(
6210        p_name          => 'ATT_28',
6211        p_value         => l_rec_resp_r1.s_first_name,
6212        p_parameterlist => l_wf_parameter_list_t
6213        );
6214 
6215     wf_event.addparametertolist(
6216        p_name          => 'ATT_29',
6217        p_value         => l_rec_resp_r1.s_middle_name,
6218        p_parameterlist => l_wf_parameter_list_t
6219        );
6220 
6221     wf_event.addparametertolist(
6222        p_name          => 'ATT_30',
6223        p_value         => l_rec_resp_r1.s_ssn,
6224        p_parameterlist => l_wf_parameter_list_t
6225        );
6226 
6227     wf_event.addparametertolist(
6228        p_name          => 'ATT_31',
6229        p_value         => l_rec_resp_r1.s_date_of_birth,
6230        p_parameterlist => l_wf_parameter_list_t
6231        );
6232 
6233     wf_event.addparametertolist(
6234        p_name          => 'ATT_32',
6235        p_value         => l_rec_resp_r1.s_citizenship_status||' - '||igf_aw_gen.lookup_desc('IGF_SL_CITIZENSHIP_STAT',l_rec_resp_r1.s_citizenship_status),
6236        p_parameterlist => l_wf_parameter_list_t
6237        );
6238 
6239     wf_event.addparametertolist(
6240        p_name          => 'ATT_33',
6241        p_value         => l_rec_resp_r1.s_default_code||' - '||igf_aw_gen.lookup_desc('IGF_SL_S_DEFAULT_STATUS',l_rec_resp_r1.s_default_code),
6242        p_parameterlist => l_wf_parameter_list_t
6243        );
6244 
6245     wf_event.addparametertolist(
6246        p_name          => 'ATT_34',
6247        p_value         => l_rec_resp_r1.s_signature_code||' - '||igf_aw_gen.lookup_desc('IGF_SL_CL_STUD_SIGN_CODE',l_rec_resp_r1.s_signature_code),
6248        p_parameterlist => l_wf_parameter_list_t
6249        );
6250 
6251     wf_event.addparametertolist(
6252        p_name          => 'ATT_35',
6253        p_value         => l_rec_resp_r1.school_id,
6254        p_parameterlist => l_wf_parameter_list_t
6255        );
6256 
6257     wf_event.addparametertolist(
6258        p_name          => 'ATT_36',
6259        p_value         => l_rec_resp_r1.loan_per_begin_date,
6260        p_parameterlist => l_wf_parameter_list_t
6261        );
6262 
6263     wf_event.addparametertolist(
6264        p_name          => 'ATT_37',
6265        p_value         => l_rec_resp_r1.loan_per_end_date,
6266        p_parameterlist => l_wf_parameter_list_t
6267        );
6268 
6269     wf_event.addparametertolist(
6270        p_name          => 'ATT_38',
6271        p_value         => l_rec_resp_r1.alt_appl_ver_code||' - '||igf_aw_gen.lookup_desc('IGF_SL_ALT_LOAN_CODE',l_rec_resp_r1.alt_appl_ver_code) ,
6272        p_parameterlist => l_wf_parameter_list_t
6273        );
6274 
6275     wf_event.addparametertolist(
6276        p_name          => 'ATT_39',
6277        p_value         => l_rec_resp_r1.lender_id,
6278        p_parameterlist => l_wf_parameter_list_t
6279        );
6280 
6281     wf_event.addparametertolist(
6282        p_name          => 'ATT_40',
6283        p_value         => l_rec_resp_r1.guarantor_id,
6284        p_parameterlist => l_wf_parameter_list_t
6285        );
6286     -- Bug # 4141704
6287     wf_event.addparametertolist(
6288        p_name          => 'ATT_41',
6289        p_value         => l_rec_resp_r1.fed_appl_form_code||' - '||igf_aw_gen.lookup_desc('IGF_SL_CL_APP_FORM_CODE',l_rec_resp_r1.fed_appl_form_code),
6290        p_parameterlist => l_wf_parameter_list_t
6291        );
6292 
6293     wf_event.addparametertolist(
6294        p_name          => 'ATT_42',
6295        p_value         => l_rec_resp_r1.mpn_confirm_ind||' - '||igf_aw_gen.lookup_desc('IGF_SL_CL_MPN_CONF_IND',l_rec_resp_r1.mpn_confirm_ind),
6296        p_parameterlist => l_wf_parameter_list_t
6297        );
6298 
6299 
6300     wf_event.addparametertolist(
6301        p_name          => 'ATT_43',
6302        p_value         => l_rec_resp_r1.b_license_state||' - '||igf_aw_gen.lookup_desc('IGF_AP_STATE_CODES',l_rec_resp_r1.b_license_state),
6303        p_parameterlist => l_wf_parameter_list_t
6304        );
6305 
6306     wf_event.addparametertolist(
6307        p_name          => 'ATT_44',
6308        p_value         => l_rec_resp_r1.b_license_number,
6309        p_parameterlist => l_wf_parameter_list_t
6310        );
6311 
6312     wf_event.addparametertolist(
6313        p_name          => 'ATT_45',
6314        p_value         => l_rec_resp_r1.b_ref_code||' - '||igf_aw_gen.lookup_desc('IGF_SL_CL_BORW_REF_INF',l_rec_resp_r1.b_ref_code),
6315        p_parameterlist => l_wf_parameter_list_t
6316        );
6317 
6318     wf_event.addparametertolist(
6319        p_name          => 'ATT_46',
6320        p_value         => l_rec_resp_r1.pnote_delivery_code||' - '||igf_aw_gen.lookup_desc('IGF_SL_PNOTE_DELIVERY',l_rec_resp_r1.pnote_delivery_code),
6321        p_parameterlist => l_wf_parameter_list_t
6322        );
6323 
6324     wf_event.addparametertolist(
6325        p_name          => 'ATT_47',
6326        p_value         => l_rec_resp_r1.b_foreign_postal_code,
6327        p_parameterlist => l_wf_parameter_list_t
6328        );
6329 
6330     wf_event.addparametertolist(
6331        p_name          => 'ATT_48',
6332        p_value         => igf_aw_gen.lookup_desc('IGF_AP_YES_NO',p_c_borrow_created),
6333        p_parameterlist => l_wf_parameter_list_t
6334        );
6335 
6336     wf_event.addparametertolist(
6337        p_name          => 'ATT_49',
6338        p_value         => igf_aw_gen.lookup_desc('IGF_AP_YES_NO',p_c_student_created),
6339        p_parameterlist => l_wf_parameter_list_t
6340        );
6341 
6342     wf_event.addparametertolist(
6343        p_name          => 'ATT_50',
6344        p_value         => igf_aw_gen.lookup_desc('IGF_AP_YES_NO',p_c_rel_created),
6345        p_parameterlist => l_wf_parameter_list_t
6346        );
6347 
6348   END IF;
6349 
6350   -- raise the business event
6351   log_to_fnd(p_v_module => 'raise_scr_event',
6352              p_v_string => 'Raising the business event'
6353             );
6354   wf_event.RAISE (p_event_name => l_wf_event_name,
6355                   p_event_key  => l_wf_event_key,
6356                   p_parameters => l_wf_parameter_list_t
6357                  );
6358   l_wf_parameter_list_t.DELETE;
6359 
6360 END raise_scr_event;
6361 
6362 PROCEDURE raise_gamt_event  ( p_v_ci_alternate_code   IN igs_ca_inst_all.alternate_code%TYPE,
6363                               p_d_ci_start_dt         IN igs_ca_inst_all.start_dt%TYPE,
6364                               p_d_ci_end_dt           IN igs_ca_inst_all.end_dt%TYPE,
6365                               p_v_person_number       IN hz_parties.party_number%TYPE,
6366                               p_v_person_name         IN hz_parties.party_name%TYPE,
6367                               p_v_ssn                 IN igf_ap_isir_ints_all.current_ssn_txt%TYPE,
6368                               p_v_loan_number         IN igf_sl_loans_all.loan_number%TYPE,
6369                               p_d_loan_per_begin_date IN igf_sl_loans_all.loan_per_begin_date%TYPE,
6370                               p_d_loan_per_end_date   IN igf_sl_loans_all.loan_per_end_date%TYPE,
6371                               p_v_loan_type           IN igf_aw_fund_cat_all.fed_fund_code%TYPE,
6372                               p_n_award_accept_amt    IN igf_aw_award_all.accepted_amt%TYPE,
6373                               p_n_guarantee_amt       IN igf_sl_cl_resp_r1_all.guarantee_amt%TYPE,
6374                               p_n_approved_amt        IN igf_sl_cl_resp_r1_all.alt_approved_amt%TYPE
6375                             ) AS
6376 ------------------------------------------------------------------
6377 --Created by  : Sanil Madathil, Oracle IDC
6378 --Date created: 04 November 2004
6379 --
6380 -- Purpose:
6381 -- Invoked     : from within process_borrow_stud_rec procedure
6382 -- Function    : private function which would raise the business event
6383 --
6384 -- Parameters  :
6385 --
6386 --
6387 --Known limitations/enhancements and/or remarks:
6388 --
6389 --Change History:
6390 --Who         When            What
6391 ------------------------------------------------------------------
6392   CURSOR  c_wf_event_key IS
6393   SELECT  igf_sl_cl_scr_seq.NEXTVAL -- MN 12-Jan-2005 - As the WorkFlow in use is common between
6394                                     -- Amt Diff and SCR Diff using same sequence and removing igf_sl_cl_gamt_seq
6395   FROM    DUAL;
6396 
6397   l_wf_event_t            wf_event_t;
6398   l_wf_parameter_list_t   wf_parameter_list_t;
6399   l_wf_event_name         VARCHAR2(255);
6400   l_wf_event_key          NUMBER;
6401   l_v_role                fnd_user.user_name%TYPE;
6402 
6403 BEGIN
6404   log_to_fnd(p_v_module => 'raise_gamt_event',
6405              p_v_string => '|p_v_ci_alternate_code    : ' ||p_v_ci_alternate_code   ||
6406                            '|p_d_ci_start_dt          : ' ||p_d_ci_start_dt         ||
6407                            '|p_d_ci_end_dt            : ' ||p_d_ci_end_dt           ||
6408                            '|p_v_person_number        : ' ||p_v_person_number       ||
6409                            '|p_v_person_number        : ' ||p_v_person_number       ||
6410                            '|p_v_person_name          : ' ||p_v_person_name         ||
6411                            '|p_v_ssn                  : ' ||p_v_ssn                 ||
6412                            '|p_v_loan_number          : ' ||p_v_loan_number         ||
6413                            '|p_d_loan_per_begin_date  : ' ||p_d_loan_per_begin_date ||
6414                            '|p_d_loan_per_end_date    : ' ||p_d_loan_per_end_date   ||
6415                            '|p_v_loan_type            : ' ||p_v_loan_type           ||
6416                            '|p_n_award_accept_amt     : ' ||p_n_award_accept_amt    ||
6417                            '|p_n_guarantee_amt        : ' ||p_n_guarantee_amt       ||
6418                            '|p_n_approved_amt         : ' ||p_n_approved_amt
6419             );
6420 
6421   log_to_fnd(p_v_module => 'raise_gamt_event',
6422              p_v_string => 'Initializing the wf_event_t object'
6423             );
6424 
6425   -- initialize the wf_event_t object
6426   wf_event_t.initialize(l_wf_event_t);
6427   l_wf_event_name := 'oracle.apps.igf.sl.loans.ffelp.LoanGuaranteeAmount';
6428   log_to_fnd(p_v_module => 'raise_gamt_event',
6429              p_v_string => 'Setting the workflow event name '||l_wf_event_name
6430             );
6431   -- set the event name
6432   l_wf_event_t.seteventname( peventname => l_wf_event_name);
6433 
6434   log_to_fnd(p_v_module => 'raise_gamt_event',
6435              p_v_string => 'Obtaining the workflow event key'
6436             );
6437   OPEN  c_wf_event_key;
6438   FETCH c_wf_event_key INTO l_wf_event_key;
6439   CLOSE c_wf_event_key ;
6440 
6441   log_to_fnd(p_v_module => 'raise_gamt_event',
6442              p_v_string => 'The workflow event key '||l_wf_event_key
6443             );
6444   l_wf_event_t.setEventKey ( pEventKey => l_wf_event_name|| l_wf_event_key );
6445   -- set the parameter list
6446   log_to_fnd(p_v_module => 'raise_gamt_event',
6447              p_v_string => 'setting the parameter list'
6448             );
6449   l_wf_event_t.setParameterList ( pParameterList => l_wf_parameter_list_t );
6450 
6451   -- Now add the parameters to the list to be passed to the workflow
6452   log_to_fnd(p_v_module => 'raise_gamt_event',
6453              p_v_string => 'Adding the parameters to the list passed to the workflow'
6454             );
6455 
6456   log_to_fnd(p_v_module => 'raise_gamt_event',
6457              p_v_string => 'Before calling the fnd.profile.value(USERNAME)..'
6458             );
6459 
6460   l_v_role := fnd_global.user_name;
6461 
6462   log_to_fnd(p_v_module => 'raise_gamt_event',
6463              p_v_string => 'After calling the fnd.profile.value(USERNAME)..The value of the USERNAME is '||l_v_role
6464             );
6465 
6466   wf_event.addparametertolist(
6467        p_name          => 'USER_ID',
6468        p_value         => l_v_role,
6469        p_parameterlist => l_wf_parameter_list_t
6470        );
6471   wf_event.addparametertolist(
6472        p_name          => 'ATT_1',
6473        p_value         => p_v_ci_alternate_code,
6474        p_parameterlist => l_wf_parameter_list_t
6475        );
6476 
6477   wf_event.addparametertolist(
6478        p_name          => 'ATT_2',
6479        p_value         => (p_d_ci_start_dt ||'-'||p_d_ci_end_dt),
6480        p_parameterlist => l_wf_parameter_list_t
6481        );
6482 
6483   wf_event.addparametertolist(
6484        p_name          => 'ATT_3',
6485        p_value         => p_v_person_number,
6486        p_parameterlist => l_wf_parameter_list_t
6487        );
6488 
6489   wf_event.addparametertolist(
6490        p_name          => 'ATT_4',
6491        p_value         => p_v_person_name,
6492        p_parameterlist => l_wf_parameter_list_t
6493        );
6494 
6495   wf_event.addparametertolist(
6496        p_name          => 'ATT_5',
6497        p_value         => p_v_ssn,
6498        p_parameterlist => l_wf_parameter_list_t
6499        );
6500 
6501   wf_event.addparametertolist(
6502        p_name          => 'ATT_6',
6503        p_value         => p_v_loan_number,
6504        p_parameterlist => l_wf_parameter_list_t
6505        );
6506 
6507   wf_event.addparametertolist(
6508        p_name          => 'ATT_7',
6509        p_value         => p_d_loan_per_begin_date||'-'||p_d_loan_per_end_date,
6510        p_parameterlist => l_wf_parameter_list_t
6511        );
6512 
6513   wf_event.addparametertolist(
6514        p_name          => 'ATT_8',
6515        p_value         => igf_aw_gen.lookup_desc('IGF_AW_FED_FUND ',p_v_loan_type),
6516        p_parameterlist => l_wf_parameter_list_t
6517        );
6518 
6519   wf_event.addparametertolist(
6520        p_name          => 'ATT_9',
6521        p_value         => p_n_award_accept_amt,
6522        p_parameterlist => l_wf_parameter_list_t
6523        );
6524 
6525   wf_event.addparametertolist(
6526        p_name          => 'ATT_10',
6527        p_value         => p_n_guarantee_amt,
6528        p_parameterlist => l_wf_parameter_list_t
6529        );
6530 
6531   wf_event.addparametertolist(
6532        p_name          => 'ATT_11',
6533        p_value         => p_n_approved_amt,
6534        p_parameterlist => l_wf_parameter_list_t
6535        );
6536 
6537  -- raise the business event
6538   log_to_fnd(p_v_module => 'raise_gamt_event',
6539              p_v_string => 'Raising the business event'
6540             );
6541   wf_event.RAISE (p_event_name => l_wf_event_name,
6542                   p_event_key  => l_wf_event_key,
6543                   p_parameters => l_wf_parameter_list_t
6544                  );
6545   l_wf_parameter_list_t.DELETE;
6546 END raise_gamt_event;
6547 
6548 PROCEDURE insert_into_resp_r2(p_r2_record    IN   igf_sl_cl_resp_r2_dtls%ROWTYPE) AS
6549 ------------------------------------------------------------------
6550 --Created by  : Sanil Madathil, Oracle IDC
6551 --Date created: 07 November 2004
6552 --
6553 -- Purpose:
6554 -- Invoked     : from within insert_into_resp1 procedure
6555 -- Function    : private procedure which would insert into resp r2 table
6556 --
6557 -- Parameters  :
6558 --
6559 --
6560 --Known limitations/enhancements and/or remarks:
6561 --
6562 --Change History:
6563 --Who         When            What
6564 ------------------------------------------------------------------
6565   l_v_rowid                  ROWID;
6566   l_n_clresp2_id             igf_sl_cl_resp_r2_dtls.clresp2_id%TYPE;
6567   l_n_clrp1_id               igf_sl_cl_resp_r1_all.clrp1_id%TYPE;
6568   rec_cl_resp_r2             igf_sl_cl_resp_r2_dtls%ROWTYPE;
6569 
6570 BEGIN
6571   l_v_rowid       :=  NULL;
6572   l_n_clresp2_id  :=  NULL;
6573   rec_cl_resp_r2  :=  p_r2_record;
6574   l_n_clrp1_id    :=  rec_cl_resp_r2.clrp1_id;
6575 
6576 
6577   log_to_fnd(p_v_module => 'insert_into_resp_r2',
6578              p_v_string => 'invoking igf_sl_cl_resp_r2_dtls_pkg.insert_row for clrp1_id ='||l_n_clrp1_id
6579             );
6580 
6581 
6582   igf_sl_cl_resp_r2_dtls_pkg.insert_row(
6583     x_rowid                        =>  l_v_rowid      ,
6584     x_clresp2_id                   =>  l_n_clresp2_id ,
6585     x_clrp1_id                     =>  l_n_clrp1_id   ,
6586     x_record_code_txt              =>  rec_cl_resp_r2.record_code_txt,
6587     x_uniq_layout_vend_code        =>  rec_cl_resp_r2.uniq_layout_vend_code,
6588     x_uniq_layout_ident_code       =>  rec_cl_resp_r2.uniq_layout_ident_code,
6589     x_filler_txt                   =>  rec_cl_resp_r2.filler_txt,
6590     x_mode                         =>  'R'
6591   );
6592 END insert_into_resp_r2;
6593 
6594 
6595 PROCEDURE insert_into_resp_r3(p_r3_record   IN igf_sl_cl_resp_r3_dtls%ROWTYPE) AS
6596 ------------------------------------------------------------------
6597 --Created by  : Sanil Madathil, Oracle IDC
6598 --Date created: 07 November 2004
6599 --
6600 -- Purpose:
6601 -- Invoked     : from within insert_into_resp1 procedure
6602 -- Function    : private procedure which would insert into resp r3 table
6603 --
6604 -- Parameters  :
6605 --
6606 --
6607 --Known limitations/enhancements and/or remarks:
6608 --
6609 --Change History:
6610 --Who         When            What
6611 ------------------------------------------------------------------
6612   l_v_rowid                   ROWID;
6613   l_n_clresp3_id             igf_sl_cl_resp_r3_dtls.clresp3_id%TYPE;
6614   l_n_clrp1_id               igf_sl_cl_resp_r1_all.clrp1_id%TYPE;
6615   rec_cl_resp_r3             igf_sl_cl_resp_r3_dtls%ROWTYPE;
6616 
6617 BEGIN
6618   l_v_rowid         :=  NULL;
6619   l_n_clresp3_id    :=  NULL;
6620   rec_cl_resp_r3    :=  p_r3_record;
6621   l_n_clrp1_id      :=  rec_cl_resp_r3.clrp1_id;
6622 
6623 
6624   log_to_fnd(p_v_module => 'insert_into_resp_r3',
6625              p_v_string => 'invoking igf_sl_cl_resp_r3_dtls_pkg.insert_row for clrp1_id ='||l_n_clrp1_id
6626             );
6627 
6628   igf_sl_cl_resp_r3_dtls_pkg.insert_row(
6629     x_rowid                =>  l_v_rowid,
6630     x_clresp3_id           =>  l_n_clresp3_id,
6631     x_clrp1_id             =>  l_n_clrp1_id,
6632     x_record_code_txt      =>  rec_cl_resp_r3.record_code_txt,
6633     x_message_1_text       =>  rec_cl_resp_r3.message_1_text,
6634     x_message_2_text       =>  rec_cl_resp_r3.message_2_text,
6635     x_message_3_text       =>  rec_cl_resp_r3.message_3_text,
6636     x_message_4_text       =>  rec_cl_resp_r3.message_4_text,
6637     x_message_5_text       =>  rec_cl_resp_r3.message_5_text,
6638     x_mode                 =>  'R'
6639   );
6640 
6641 END insert_into_resp_r3;
6642 
6643 PROCEDURE insert_into_resp_r7(p_r7_record  IN  igf_sl_cl_resp_r7_dtls%ROWTYPE) AS
6644 ------------------------------------------------------------------
6645 --Created by  : Sanil Madathil, Oracle IDC
6646 --Date created: 07 November 2004
6647 --
6648 -- Purpose:
6649 -- Invoked     : from within insert_into_resp1 procedure
6650 -- Function    : private procedure which would insert into resp r7 table
6651 --
6652 -- Parameters  :
6653 --
6654 --
6655 --Known limitations/enhancements and/or remarks:
6656 --
6657 --Change History:
6658 --Who         When            What
6659 ------------------------------------------------------------------
6660   l_v_rowid                   ROWID;
6661   l_n_clresp7_id             igf_sl_cl_resp_r7_dtls.clresp7_id%TYPE;
6662   l_n_clrp1_id               igf_sl_cl_resp_r1_all.clrp1_id%TYPE;
6663   rec_cl_resp_r7             igf_sl_cl_resp_r7_dtls%ROWTYPE;
6664 
6665 BEGIN
6666   l_v_rowid       :=  NULL;
6667   l_n_clresp7_id  :=  NULL;
6668   rec_cl_resp_r7  :=  p_r7_record;
6669   l_n_clrp1_id    :=  rec_cl_resp_r7.clrp1_id;
6670 
6671 
6672   log_to_fnd(p_v_module => 'insert_into_resp_r7',
6673              p_v_string => 'invoking igf_sl_cl_resp_r3_dtls_pkg.insert_row for clrp1_id ='||l_n_clrp1_id
6674             );
6675 
6676   igf_sl_cl_resp_r7_dtls_pkg.insert_row(
6677     x_rowid                        =>  l_v_rowid,
6678     x_clresp7_id                   =>  l_n_clresp7_id,
6679     x_clrp1_id                     =>  l_n_clrp1_id,
6680     x_record_code_txt              =>  rec_cl_resp_r7.record_code_txt,
6681     x_layout_owner_code_txt        =>  rec_cl_resp_r7.layout_owner_code_txt,
6682     x_layout_identifier_code_txt   =>  rec_cl_resp_r7.layout_identifier_code_txt,
6683     x_email_txt                    =>  rec_cl_resp_r7.email_txt,
6684     x_valid_email_flag             =>  rec_cl_resp_r7.valid_email_flag,
6685     x_email_effective_date         =>  rec_cl_resp_r7.email_effective_date,
6686     x_borrower_temp_add_line_1_txt =>  rec_cl_resp_r7.borrower_temp_add_line_1_txt,
6687     x_borrower_temp_add_line_2_txt =>  rec_cl_resp_r7.borrower_temp_add_line_2_txt,
6688     x_borrower_temp_add_city_txt   =>  rec_cl_resp_r7.borrower_temp_add_city_txt,
6689     x_borrower_temp_add_state_txt  =>  rec_cl_resp_r7.borrower_temp_add_state_txt,
6690     x_borrower_temp_add_zip_num    =>  rec_cl_resp_r7.borrower_temp_add_zip_num,
6691     x_borr_temp_add_zip_xtn_num    =>  rec_cl_resp_r7.borrower_temp_add_zip_xtn_num,
6692     x_borr_forgn_postal_code_txt   =>  rec_cl_resp_r7.borrower_forgn_postal_code_txt,
6693     x_mode                         =>  'R'
6694   );
6695 
6696 END insert_into_resp_r7;
6697 
6698 PROCEDURE insert_into_resp_r6(p_r6_record    IN igf_sl_clchrs_dtls%ROWTYPE )AS
6699 ------------------------------------------------------------------
6700 --Created by  : Sanil Madathil, Oracle IDC
6701 --Date created: 07 November 2004
6702 --
6703 -- Purpose:
6704 -- Invoked     : from within insert_into_resp1 procedure
6705 -- Function    : private procedure which would insert into igf_sl_clchrs_dtls table
6706 --
6707 -- Parameters  :
6708 --
6709 --
6710 --Known limitations/enhancements and/or remarks:
6711 --
6712 --Change History:
6713 --Who         When            What
6714 ------------------------------------------------------------------
6715   l_v_rowid                   ROWID;
6716   rec_cl_resp_r6             igf_sl_clchrs_dtls%ROWTYPE;
6717   l_n_clrp1_id               igf_sl_cl_resp_r1_all.clrp1_id%TYPE;
6718   l_n_clchgrsp_id            igf_sl_clchrs_dtls.clchgrsp_id%TYPE;
6719 
6720 BEGIN
6721   l_v_rowid       :=  NULL;
6722   l_n_clchgrsp_id :=  NULL;
6723   rec_cl_resp_r6  :=  p_r6_record;
6724   l_n_clrp1_id    :=  rec_cl_resp_r6.clrp1_id;
6725 
6726   log_to_fnd(p_v_module => 'insert_into_resp_r6',
6727              p_v_string => 'invoking igf_sl_clchrs_dtls_pkg.insert_row for clrp1_id ='||l_n_clrp1_id
6728             );
6729 
6730   igf_sl_clchrs_dtls_pkg.insert_row (
6731     x_rowid                         =>  l_v_rowid,
6732     x_clchgrsp_id                   =>  l_n_clchgrsp_id,
6733     x_clrp1_id                      =>  l_n_clrp1_id,
6734     x_record_code                   =>  rec_cl_resp_r6.record_code,
6735     x_send_record_txt               =>  rec_cl_resp_r6.send_record_txt      ,
6736     x_error_message_1_code          =>  rec_cl_resp_r6.error_message_1_code ,
6737     x_error_message_2_code          =>  rec_cl_resp_r6.error_message_2_code ,
6738     x_error_message_3_code          =>  rec_cl_resp_r6.error_message_3_code ,
6739     x_error_message_4_code          =>  rec_cl_resp_r6.error_message_4_code ,
6740     x_error_message_5_code          =>  rec_cl_resp_r6.error_message_5_code ,
6741     x_record_process_code           =>  rec_cl_resp_r6.record_process_code,
6742     x_mode                          =>  'R'
6743   );
6744 
6745 
6746 END insert_into_resp_r6;
6747 
6748 PROCEDURE process_change_records (p_n_clrp1_id     IN  igf_sl_cl_resp_r1_all.clrp1_id%TYPE,
6749                                   p_v_loan_number  IN  igf_sl_loans_all.loan_number%TYPE) AS
6750 ------------------------------------------------------------------
6751 --Created by  : Sanil Madathil, Oracle IDC
6752 --Date created: 07 November 2004
6753 --
6754 -- Purpose:
6755 -- Invoked     : from within process_ack procedure
6756 -- Function    : private procedure which updates igf_sl_clchrs_dtls table
6757 --
6758 -- Parameters  : p_n_clrp1_id  : IN. Required
6759 --
6760 --
6761 --Known limitations/enhancements and/or remarks:
6762 --
6763 --Change History:
6764 --Who         When            What
6765 ------------------------------------------------------------------
6766   CURSOR  c_sl_clchsn_dtls (cp_v_loan_number igf_sl_loans_all.loan_number%TYPE) IS
6767   --cp_v_send_record_txt igf_sl_clchsn_dtls.send_record_txt%TYPE)
6768   SELECT  chdt.*, chdt.ROWID row_id
6769   FROM    igf_sl_clchsn_dtls chdt
6770   WHERE   loan_number_txt = cp_v_loan_number
6771   AND     chdt.status_code     = 'S';
6772 
6773   rec_c_sl_clchsn_dtls  c_sl_clchsn_dtls%ROWTYPE;
6774 
6775   CURSOR  c_sl_clchrs_dtls (cp_n_clrp1_id         igf_sl_cl_resp_r1_all.clrp1_id%TYPE,
6776                             cp_v_send_record_txt  igf_sl_clchrs_dtls.send_record_txt%TYPE) IS
6777   SELECT  chrsdtls.*
6778   FROM    igf_sl_clchrs_dtls chrsdtls
6779   WHERE   chrsdtls.clrp1_id = cp_n_clrp1_id
6780           AND send_record_txt = TRIM(cp_v_send_record_txt);
6781 
6782   rec_c_sl_clchrs_dtls    c_sl_clchrs_dtls%ROWTYPE;
6783 
6784   l_n_clrp1_id              igf_sl_cl_resp_r1_all.clrp1_id%TYPE;
6785   l_v_response_status_code  igf_sl_clchsn_dtls.response_status_code%TYPE;
6786   l_v_status_code           igf_sl_clchsn_dtls.status_code%TYPE;
6787   e_skip_change_rec         EXCEPTION;
6788 BEGIN
6789   log_to_fnd(p_v_module => 'process_change_records',
6790              p_v_string => '|p_n_clrp1_id = ' || p_n_clrp1_id ||
6791                            '|p_v_loan_number = ' || p_v_loan_number
6792                            );
6793   l_n_clrp1_id := p_n_clrp1_id;
6794   fnd_file.new_line(fnd_file.log,2);
6795   fnd_file.put_line(fnd_file.log,RPAD(igf_aw_gen.lookup_desc('IGF_GE_PARAMETERS','PROCESSING'),40));
6796 
6797   FOR rec_c_sl_clchsn_dtls IN c_sl_clchsn_dtls (cp_v_loan_number => p_v_loan_number)  -- sl_cl_chsn_dtls rec processing
6798   LOOP
6799     -- Missing c_sl_clchrs_dtls means that the change is accepted by the processor
6800     -- If data is present then need to check for error_message and Mark the c_sl_clchsn_dtls and reject.
6801     -- initialize the status code to Acknowledge
6802     l_v_status_code := 'A';
6803     -- initialize the value to Accepted
6804     l_v_response_status_code := 'A';
6805     OPEN c_sl_clchrs_dtls (cp_n_clrp1_id         =>  p_n_clrp1_id,
6806                            cp_v_send_record_txt  =>  rec_c_sl_clchsn_dtls.send_record_txt);
6807     FETCH c_sl_clchrs_dtls INTO rec_c_sl_clchrs_dtls;
6808     IF c_sl_clchrs_dtls%FOUND THEN                                 -- Check for errors if any
6809 
6810         -- If there error codes are present, it would mean that the change record is rejected,
6811         -- update the change record with status code 'R'.
6812         -- If there are no error codes present, it would mean that the change record is accepted,
6813         -- update the change record status to 'A'.
6814         IF (rec_c_sl_clchrs_dtls.error_message_1_code IS NOT NULL OR
6815             rec_c_sl_clchrs_dtls.error_message_2_code IS NOT NULL OR
6816             rec_c_sl_clchrs_dtls.error_message_3_code IS NOT NULL OR
6817             rec_c_sl_clchrs_dtls.error_message_4_code IS NOT NULL OR
6818             rec_c_sl_clchrs_dtls.error_message_5_code IS NOT NULL ) THEN
6819           l_v_response_status_code := 'R';
6820           log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','ERROR_MSG_1_CODE'),40),
6821                            p_v_param_val => igf_aw_gen.lookup_desc('IGF_SL_CL_ERROR',rec_c_sl_clchrs_dtls.error_message_1_code)
6822                          );
6823           log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','ERROR_MSG_2_CODE'),40),
6824                            p_v_param_val => igf_aw_gen.lookup_desc('IGF_SL_CL_ERROR',rec_c_sl_clchrs_dtls.error_message_2_code)
6825                          );
6826           log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','ERROR_MSG_3_CODE'),40),
6827                            p_v_param_val => igf_aw_gen.lookup_desc('IGF_SL_CL_ERROR',rec_c_sl_clchrs_dtls.error_message_3_code)
6828                          );
6829           log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','ERROR_MSG_4_CODE'),40),
6830                            p_v_param_val => igf_aw_gen.lookup_desc('IGF_SL_CL_ERROR',rec_c_sl_clchrs_dtls.error_message_4_code)
6831                          );
6832           log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','ERROR_MSG_5_CODE'),40),
6833                            p_v_param_val => igf_aw_gen.lookup_desc('IGF_SL_CL_ERROR',rec_c_sl_clchrs_dtls.error_message_5_code)
6834                          );
6835         END IF;
6836     END IF;                                                        -- End Check for errors if any
6837     CLOSE c_sl_clchrs_dtls;
6838 
6839         log_parameters ( p_v_param_typ => RPAD(igf_aw_gen.lookup_desc('IGF_SL_LOAN_FIELDS','CHG_RESP_STATUS'),40),
6840                          p_v_param_val => igf_aw_gen.lookup_desc('IGF_SL_CL_CHG_RESP_STATUS',l_v_response_status_code)
6841                        );
6842         log_to_fnd(p_v_module => 'process_change_records',
6843                    p_v_string => 'invoking igf_sl_clchsn_dtls_pkg.update_row for change send id ='||rec_c_sl_clchsn_dtls.clchgsnd_id
6844                   );
6845         igf_sl_clchsn_dtls_pkg.update_row (
6846           x_rowid                             =>    rec_c_sl_clchsn_dtls.row_id                        ,
6847           x_clchgsnd_id                       =>    rec_c_sl_clchsn_dtls.clchgsnd_id                   ,
6848           x_award_id                          =>    rec_c_sl_clchsn_dtls.award_id                      ,
6849           x_loan_number_txt                   =>    rec_c_sl_clchsn_dtls.loan_number_txt               ,
6850           x_cl_version_code                   =>    rec_c_sl_clchsn_dtls.cl_version_code               ,
6851           x_change_field_code                 =>    rec_c_sl_clchsn_dtls.change_field_code             ,
6852           x_change_record_type_txt            =>    rec_c_sl_clchsn_dtls.change_record_type_txt        ,
6853           x_change_code_txt                   =>    rec_c_sl_clchsn_dtls.change_code_txt               ,
6854           x_status_code                       =>    l_v_status_code                                    ,
6855           x_status_date                       =>    rec_c_sl_clchsn_dtls.status_date                   ,
6856           x_response_status_code              =>    l_v_response_status_code                           ,
6857           x_old_value_txt                     =>    rec_c_sl_clchsn_dtls.old_value_txt                 ,
6858           x_new_value_txt                     =>    rec_c_sl_clchsn_dtls.new_value_txt                 ,
6859           x_old_date                          =>    rec_c_sl_clchsn_dtls.old_date                      ,
6860           x_new_date                          =>    rec_c_sl_clchsn_dtls.new_date                      ,
6861           x_old_amt                           =>    rec_c_sl_clchsn_dtls.old_amt                       ,
6862           x_new_amt                           =>    rec_c_sl_clchsn_dtls.new_amt                       ,
6863           x_disbursement_number               =>    rec_c_sl_clchsn_dtls.disbursement_number           ,
6864           x_disbursement_date                 =>    rec_c_sl_clchsn_dtls.disbursement_date             ,
6865           x_change_issue_code                 =>    rec_c_sl_clchsn_dtls.change_issue_code             ,
6866           x_disbursement_cancel_date          =>    rec_c_sl_clchsn_dtls.disbursement_cancel_date      ,
6867           x_disbursement_cancel_amt           =>    rec_c_sl_clchsn_dtls.disbursement_cancel_amt       ,
6868           x_disbursement_revised_amt          =>    rec_c_sl_clchsn_dtls.disbursement_revised_amt      ,
6869           x_disbursement_revised_date         =>    rec_c_sl_clchsn_dtls.disbursement_revised_date     ,
6870           x_disbursement_reissue_code         =>    rec_c_sl_clchsn_dtls.disbursement_reissue_code     ,
6871           x_disbursement_reinst_code          =>    rec_c_sl_clchsn_dtls.disbursement_reinst_code      ,
6872           x_disbursement_return_amt           =>    rec_c_sl_clchsn_dtls.disbursement_return_amt       ,
6873           x_disbursement_return_date          =>    rec_c_sl_clchsn_dtls.disbursement_return_date      ,
6874           x_disbursement_return_code          =>    rec_c_sl_clchsn_dtls.disbursement_return_code      ,
6875           x_post_with_disb_return_amt         =>    rec_c_sl_clchsn_dtls.post_with_disb_return_amt     ,
6876           x_post_with_disb_return_date        =>    rec_c_sl_clchsn_dtls.post_with_disb_return_date    ,
6877           x_post_with_disb_return_code        =>    rec_c_sl_clchsn_dtls.post_with_disb_return_code    ,
6878           x_prev_with_disb_return_amt         =>    rec_c_sl_clchsn_dtls.prev_with_disb_return_amt     ,
6879           x_prev_with_disb_return_date        =>    rec_c_sl_clchsn_dtls.prev_with_disb_return_date    ,
6880           x_school_use_txt                    =>    rec_c_sl_clchsn_dtls.school_use_txt                ,
6881           x_lender_use_txt                    =>    rec_c_sl_clchsn_dtls.lender_use_txt                ,
6882           x_guarantor_use_txt                 =>    rec_c_sl_clchsn_dtls.guarantor_use_txt             ,
6883           x_validation_edit_txt               =>    rec_c_sl_clchsn_dtls.validation_edit_txt           ,
6884           x_send_record_txt                   =>    rec_c_sl_clchsn_dtls.send_record_txt               ,
6885           x_mode                              =>    'R'
6886         );
6887 
6888   END LOOP;   -- END sl_cl_chsn_dtls rec processing
6889 
6890   fnd_file.new_line(fnd_file.log,2);
6891   fnd_file.put_line(fnd_file.log,RPAD(igf_aw_gen.lookup_desc('IGF_GE_PARAMETERS','RECORDS_PROCESSED'),40));
6892 
6893 END process_change_records;
6894 
6895 PROCEDURE log_parameters ( p_v_param_typ IN VARCHAR2,
6896                            p_v_param_val IN VARCHAR2
6897                          ) AS
6898 ------------------------------------------------------------------
6899 --Created by  : Sanil Madathil, Oracle IDC
6900 --Date created: 21 October 2004
6901 --
6902 -- Purpose:
6903 -- Invoked     : from within process_1 procedure
6904 -- Function    : Private procedure for logging
6905 --
6906 -- Parameters  : p_v_param_typ   : IN parameter. Required.
6907 --               p_v_param_val   : IN parameter. Required.
6908 --
6909 --
6910 --Known limitations/enhancements and/or remarks:
6911 --
6912 --Change History:
6913 --Who         When            What
6914 ------------------------------------------------------------------
6915   BEGIN
6916     fnd_file.put_line(fnd_file.log, p_v_param_typ || ' : ' || p_v_param_val );
6917   END log_parameters;
6918 
6919 END igf_sl_cl_orig_ack;