DBA Data[Home] [Help]

PACKAGE BODY: APPS.IGF_SP_CREATE_BASE_REC

Source


1 PACKAGE BODY igf_sp_create_base_rec AS
2 /* $Header: IGFSP01B.pls 120.8 2006/02/14 23:07:02 ridas ship $ */
3 
4  ------------------------------------------------------------------------------------
5   --Created by  : smanglm (Oracle IDC)
6   --Date created: 2002/01/11
7   --
8   --Purpose:  Created as part of the build for DLD Sponsorship
9   --          This package deals with the creation of equivalent records of OSS in
10   --          Financial Aid system. The system is a pre-requisite for Assigning students
11   --          sponsor and also for sponsor award process.
12   --          It has the following procedure/function:
13   --             i)  procedure create_base_record  - this is the main procedure called
14   --                 from the concurrent manager
15   --            ii)  function create_fa_base_record - this is a function called from
16   --                 create_base_records for actual creation of the base records
17   --
18   --Known limitations/enhancements and/or remarks:
19   --
20   --Change History:
21   --Who         When            What
22   --svuppala    06-Dec-2005     Bug#4767660 Not able to assign a student to sponsorship
23   --                            Modified Function: create_fa_base_record.
24   -- svuppala    14-Oct-04      Bug # 3416936 Modified TBH call to addeded field
25   --                            Eligible for Additional Unsubsidized Loans
26   -- vvutukur    18-Jul-2003     Enh#3038511.FICR106 Build. Modified procedure create_base_record.
27   -- shtatiko    15-MAR-2003     Bug# 2772277, Modified create_base_record and added log_parameter
28   -- vchappid    26-Feb-2003     Bug#2747335, In function igf_sp_assign_pub, Base ID will be returned
29   --                            when there exists Base ID for the Award Calendar Instance
30   -- shtaiko     24-JAN-2003     Bug# 2684853, Modified create_fa_base_record
31   -- smadathi    03-jun-2003     Bug 2620288. Modified procedures create_base_record,
32   --                            write_log_file
33   -- masehgal   03-Nov-2002     # 2613546  FA 105_108 Multi Award Years
34   --                            Added pell alt expense in fa base call
35   -- masehgal   25-Sep-2002     FA 104 - To Do Enhancements
36   --                            Added manual_disb_hold in FA Base update
37   -- smadathi   14-Jun-2002     Bug 2413695. write_log_file_head modified.
38   -- | gvarapra   14-sep-2004         FA138 - ISIR Enhancements                    |
39   -- |                                Changed arguments in call to                 |
40   -- |                                IGF_AP_FA_BASE_RECORD_PKG.                   |
41   -------------------------------------------------------------------------------------
42 
43 PROCEDURE log_parameter (
44             p_c_param_name IN VARCHAR2,
45             p_c_param_value IN VARCHAR2 ) AS
46 ------------------------------------------------------------------------------------
47 --Created by  : shtatiko ( Oracle IDC)
48 --Date created: 24-MAR-2003
49 --
50 --Purpose:  This procedure will log the passed parameter and its value to the log file.
51 --
52 --Known limitations/enhancements and/or remarks:
53 --
54 --Change History:
55 --Who         When            What
56 -------------------------------------------------------------------------------------
57 BEGIN
58   fnd_message.set_name('IGS','IGS_FI_CRD_INT_ALL_PARAMETER');
59   fnd_message.set_token('PARM_TYPE', p_c_param_name);
60   fnd_message.set_token('PARM_CODE', p_c_param_value);
61   fnd_file.put_line(fnd_file.LOG, fnd_message.get );
62 END log_parameter;
63 
64 
65 PROCEDURE create_base_record
66               (errbuf               OUT NOCOPY VARCHAR2,
67                retcode              OUT NOCOPY NUMBER,
68                p_award_year         IN  VARCHAR2,
69                p_person_id          IN  igs_pe_person.person_id%TYPE,
70                p_person_group_id    IN  igs_pe_prsid_grp_mem.group_id%TYPE,
71                p_org_id             IN  NUMBER )
72 AS
73  ------------------------------------------------------------------------------------
74  --Created by  : smanglm ( Oracle IDC)
75  --Date created: 2002/01/11
76  --
77  --Purpose:  Created as part of the build for DLD Sponsorship
78  --          this is the main procedure called from the concurrent manager
79  --
80  --          parameter description:
81  --          errbuf                   - standard conc. req. paramater
82  --          retcode                  - standard conc. req. paramater
83  --          p_award_year             - award year calendar for which base id
84  --                                     needs to be created
85  --          p_person_id              - Person ID for whom base id should be
86  --                                     created in the FA system
87  --          p_person_group_id        - Indicates Person Group Id for which base
88  --                                     ids should be created in the FA system
89  --
90  --Known limitations/enhancements and/or remarks:
91  --
92  --Change History:
93  --Who         When            What
94  --ridas       08-Feb-2006     Bug #5021084. Added new parameter 'lv_group_type' in call
95  --                            to igf_ap_ss_pkg.get_pid
96  --bvisvana    31-Aug-2005     FA 157 - Bug # 4382371 - Dynamic person Id Inclusion.
97  --                            Removed the normal cursor c_person_id and made it as REF CURSOR
98  --rasahoo     17-NOV-2003     FA 128 - ISIR update 2004-05
99  --                            added new parameter award_fmly_contribution_type to
100  --                            igf_ap_fa_base_rec_pkg.update_row
101  --vvutukur    18-Jul-2003     Enh#3038511.FICR106 Build. Added call to generic procedure
102  --                            igs_fi_crdapi_util.get_award_year_status to validate Award Year Status.
103  --shtatiko    25-MAR-2003     Bug# 2772277, Added parameter logging for PERSON, NAME, STATUS and REASON
104  --                            Removed write_log_file and write_log_file_head.
105  --                            Added log_person_details and log_status procedures
106  --smadathi    03-jun-2003     Bug 2620288. Modified cursor c_person_id to fetch
107  --                            the records from view igs_pe_prsid_grp_mem
108  --                            instead of igs_pe_prsid_grp_mem_v. This fix is done to remove
109  --                            Non-mergable view exists in the select and to reduce shared memory
110  --                            within the acceptable limit
111  -------------------------------------------------------------------------------------
112   l_cal_type             igs_ca_inst.cal_type%TYPE;
113   l_sequence_number      igs_ca_inst.sequence_number%TYPE;
114   l_message              VARCHAR2(4000);
115   l_status               BOOLEAN;
116   l_base_id              igf_ap_fa_base_rec.base_id%TYPE;
117   l_count                NUMBER(1) := 0;
118   l_v_awd_yr_status_cd   igf_ap_batch_aw_map.award_year_status_code%TYPE;
119   l_v_message_name       fnd_new_messages.message_name%TYPE;
120 
121   TYPE RefCur IS REF CURSOR;
122   c_person_id RefCur;
123   l_person_id       hz_parties.party_id%TYPE;
124   lv_status         VARCHAR2(1);
125  	l_list            VARCHAR2(32767);
126   lv_group_type     igs_pe_persid_group_v.group_type%TYPE;
127 
128   /*
129     cursor to fetch person_id based on the person_group_id
130   */
131   /*CURSOR c_person_id (cp_group_id igs_pe_prsid_grp_mem_v.group_id%TYPE) IS
132   SELECT person_id
133   FROM   igs_pe_prsid_grp_mem
134   WHERE  group_id = cp_group_id
135   AND    (TRUNC(start_date) <= TRUNC(SYSDATE) OR (start_date IS NULL))
136   AND    (TRUNC(end_date)  >= TRUNC(SYSDATE) OR (end_date IS NULL));*/
137 
138    PROCEDURE log_person_details ( p_n_person_id  igs_pe_person.person_id%TYPE )
139    AS
140    ------------------------------------------------------------------------------------
141    --Created by  : shtatiko ( Oracle IDC)
142    --Date created: 25-MAR-2003
143    --
144    --Purpose:  To log person details.
145    --
146    --Known limitations/enhancements and/or remarks:
147    --
148    --Change History:
149    --Who         When            What
150   -------------------------------------------------------------------------------------
151 
152   CURSOR c_person_detail (cp_person_id igs_pe_person.person_id%TYPE) IS
153   SELECT person_number,
154          full_name
155   FROM   igs_pe_person_base_v
156   WHERE  person_id = cp_person_id;
157   rec_person_detail c_person_detail%ROWTYPE;
158 
159   BEGIN
160       OPEN c_person_detail(p_n_person_id);
161       FETCH c_person_detail INTO rec_person_detail;
162       log_parameter (
163         p_c_param_name  => igs_fi_gen_gl.get_lkp_meaning ( 'IGS_FI_LOCKBOX', 'PERSON' ),
164         p_c_param_value => rec_person_detail.person_number
165       );
166       log_parameter (
167         p_c_param_name  => igs_fi_gen_gl.get_lkp_meaning ( 'IGS_FI_HOLDS', 'PERSON_NAME' ),
168         p_c_param_value => rec_person_detail.full_name
169       );
170       CLOSE c_person_detail;
171   END log_person_details;
172 
173    PROCEDURE log_status ( p_b_status IN BOOLEAN, p_c_message IN VARCHAR2 )
174    AS
175    ------------------------------------------------------------------------------------
176    --Created by  : shtatiko ( Oracle IDC)
177    --Date created: 25-MAR-2003
178    --
179    --Purpose:  To log status of creation of FA Base Record.
180    --
181    --Known limitations/enhancements and/or remarks:
182    --
183    --Change History:
184    --Who         When            What
185   -------------------------------------------------------------------------------------
186 
187   BEGIN
188     IF p_b_status THEN
189       log_parameter (
190         p_c_param_name  => igs_fi_gen_gl.get_lkp_meaning ( 'IGS_FI_LOCKBOX', 'STATUS' ),
191         p_c_param_value => igs_fi_gen_gl.get_lkp_meaning ( 'IGS_FI_LOCKBOX', 'SUCCESS' )
192       );
193       fnd_file.put_line ( fnd_file.LOG, '  ' || fnd_message.get_string('IGF', 'IGF_SP_SUCCESS') );
194       fnd_file.put_line ( fnd_file.LOG, ' ');
195     ELSE
196       log_parameter (
197         p_c_param_name  => igs_fi_gen_gl.get_lkp_meaning ( 'IGS_FI_LOCKBOX', 'STATUS' ),
198         p_c_param_value => igs_fi_gen_gl.get_lkp_meaning ( 'IGS_FI_LOCKBOX', 'ERROR' )
199       );
200       fnd_file.put_line ( fnd_file.LOG, '  ' || p_c_message );
201       fnd_file.put_line ( fnd_file.LOG, ' ');
202     END IF;
203   END log_status;
204 
205 BEGIN
206   /*
207     set the org id
208   */
209   igf_aw_gen.set_org_id(p_org_id);
210   /*
211     either person id or person group id should be passed,
212     both should not be passed.
213     checking when none of them have been passed
214   */
215   IF p_person_id IS NULL AND p_person_group_id IS NULL THEN
216       retcode := 2 ;
217       errbuf  := FND_MESSAGE.GET_STRING('IGS','IGS_FI_PRS_OR_PRSIDGRP');
218       /*
219         write to the log file
220       */
221       FND_FILE.PUT_LINE(FND_FILE.LOG,' ');
222       FND_FILE.PUT_LINE(FND_FILE.LOG,' ');
223       FND_MESSAGE.SET_NAME('IGS','IGS_FI_PRS_OR_PRSIDGRP');
224       FND_FILE.PUT_LINE(FND_FILE.LOG,FND_MESSAGE.GET);
225       FND_FILE.PUT_LINE(FND_FILE.LOG,' ');
226       FND_FILE.PUT_LINE(FND_FILE.LOG,' ');
227       RETURN;
228   END IF;
229   /*
230     checking when both of p_person_id and p_person_group_id are passed
231   */
232   IF p_person_id IS NOT NULL AND p_person_group_id IS NOT NULL THEN
233       retcode := 2 ;
234       errbuf  := FND_MESSAGE.GET_STRING('IGS','IGS_FI_PRS_OR_PRSIDGRP');
235       /*
236         write to the log file
237       */
238       FND_FILE.PUT_LINE(FND_FILE.LOG,' ');
239       FND_FILE.PUT_LINE(FND_FILE.LOG,' ');
240       FND_MESSAGE.SET_NAME('IGS','IGS_FI_PRS_OR_PRSIDGRP');
241       FND_FILE.put_line(FND_FILE.LOG,FND_MESSAGE.GET);
242       FND_FILE.PUT_LINE(FND_FILE.LOG,' ');
243       FND_FILE.PUT_LINE(FND_FILE.LOG,' ');
244       RETURN;
245   END IF;
246   /*
247     validation of parameters done
248   */
249 
250   /*
251     get the cal type and seq number based on alternate code (p_award_year passed)
252   */
253   l_cal_type        := LTRIM(RTRIM(SUBSTR(p_award_year,1,10))) ;
254   l_sequence_number := TO_NUMBER(SUBSTR(p_award_year,11)) ;
255 
256   l_v_message_name := NULL;
257   --Validate the Award Year Status. If the status is not open, log the message in log file and
258   --complete the process with error.
259   igs_fi_crdapi_util.get_award_year_status( p_v_awd_cal_type     =>  l_cal_type,
260                                             p_n_awd_seq_number   =>  l_sequence_number,
261                                             p_v_awd_yr_status    =>  l_v_awd_yr_status_cd,
262                                             p_v_message_name     =>  l_v_message_name
263                                            );
264   IF l_v_message_name IS NOT NULL THEN
265     retcode := 2;
266     IF l_v_message_name = 'IGF_SP_INVALID_AWD_YR_STATUS' THEN
267       fnd_message.set_name('IGF',l_v_message_name);
268     ELSE
269       fnd_message.set_name('IGS',l_v_message_name);
270     END IF;
271     fnd_file.put_line(fnd_file.log,' ');
272     fnd_file.put_line(fnd_file.log,fnd_message.get);
273     fnd_file.put_line(fnd_file.log,' ');
274     RETURN;
275   END IF;
276 
277   /*
278     if person id is passed, call the function create_fa_base_record for that person id
279     else fetch all the relevant person_id for the passed person group id
280   */
281   IF p_person_id IS NOT NULL THEN
282      /*
283        call the  function create_fa_base_record for this person id
284      */
285      l_status:= create_fa_base_record ( p_cal_type => l_cal_type,
286                                         p_sequence_number => l_sequence_number,
287                                         p_person_id => p_person_id,
288                                         p_base_id   => l_base_id,
289                                         p_message => l_message);
290      l_count := 1;
291      /*
292        write the result to log file
293      */
294       -- Logging of parameters(PERSON, NAME, STATUS and REASON) has been added as part of
295       -- Bug 2772277.
296       log_person_details ( p_person_id );
297       log_status ( l_status, l_message );
298 
299   ELSIF p_person_group_id IS NOT NULL THEN -- person_group_id is passed
300      /*
301        loop through all the person id present for the group id
302      */
303      -- FOR rec_person_id IN c_person_id (p_person_group_id)
304      --FA 157 - Bug # 4382371 - Dynamic person Id Inclusion
305      --Bug #5021084
306      l_list := igf_ap_ss_pkg.get_pid(p_person_group_id,lv_status,lv_group_type);
307 
308      --Bug #5021084. Passing Group ID if the group type is STATIC.
309      IF lv_group_type = 'STATIC' THEN
310         OPEN c_person_id FOR 'SELECT party_id person_id FROM hz_parties WHERE party_id IN (' || l_list  || ') ' USING p_person_group_id;
311      ELSIF lv_group_type = 'DYNAMIC' THEN
312         OPEN c_person_id FOR 'SELECT party_id person_id FROM hz_parties WHERE party_id IN (' || l_list  || ') ';
313      END IF;
314 
315      LOOP
316 
317              FETCH c_person_id INTO l_person_id;
318              EXIT WHEN c_person_id%NOTFOUND;
319              -- Logging of parameters(PERSON, NAME, STATUS and REASON) has been added as part of
320              -- Bug 2772277.
321              log_person_details (l_person_id);
322              /*
323                call the  function create_fa_base_record for all the person id
324              */
325              l_status:= create_fa_base_record ( p_cal_type => l_cal_type,
326                                                 p_sequence_number => l_sequence_number,
327                                                 p_person_id => l_person_id,
328                                                 p_base_id => l_base_id,
329                                                 p_message => l_message);
330              /*
331                write the result to log file
332              */
333               l_count := 1;
334               log_status ( l_status, l_message );
335      END LOOP;
336   END IF;
337   IF l_count = 0 THEN
338     FND_MESSAGE.SET_NAME('IGF','IGF_SP_NO_PERSON');
339     FND_FILE.PUT_LINE(FND_FILE.LOG,FND_MESSAGE.GET);
340     FND_FILE.PUT_LINE(FND_FILE.LOG,' ');
341   END IF;
342 EXCEPTION
343   WHEN OTHERS THEN
344     RETCODE := 2 ;
345     FND_MESSAGE.SET_NAME('IGS','IGS_GE_UNHANDLED_EXP');
346     FND_MESSAGE.SET_TOKEN('NAME','create_base_records');
347     errbuf := FND_MESSAGE.GET ;
348     IGS_GE_MSG_STACK.CONC_EXCEPTION_HNDL ;
349 END create_base_record;
350 
351 FUNCTION create_fa_base_record
352               (p_cal_type           IN  igs_ca_inst.cal_type%TYPE,
353                p_sequence_number    IN  igs_ca_inst.sequence_number%TYPE,
354                p_person_id          IN  igs_pe_person.person_id%TYPE,
355                p_base_id            OUT NOCOPY igf_ap_fa_base_rec.base_id%TYPE,
356                p_message            OUT NOCOPY VARCHAR2)
357 RETURN BOOLEAN
358 AS
359  ------------------------------------------------------------------------------------
360  --Created by  : smanglm ( Oracle IDC)
361  --Date created: 2002/01/11
362  --
363  --Purpose:  Created as part of the build for DLD Sponsorship
364  --          this is the private function to create the FA records
365  --
366  --          parameter description:
367  --          p_cal_type               - calendar type for the award year
368  --          p_sequence_number        - sequence_numver for teh award year
369  --          p_person_id              - Person ID for whom base id should be
370  --                                     created in the FA system
371  --          p_message                - error messages generated to be passed back
372  --
373  --          ALERT                    - if this function is made public, validation
374  --                                     for the parameters need to be added
375  --
376  --Known limitations/enhancements and/or remarks:
377  --
378  --Change History:
379  --Who         When            What
380  -- ridas      15-Feb-2006     Bug #5021084. Removed trunc function from cursor SSN_CUR
381  --svuppala    06-Dec-2005     Bug#4767660 Not able to assign a student to sponsorship
382  --                            While returning the error message the function fnd_message.get
383  --                            was used 2 times. So, assigned p_message with IGF_AP_SSN_REQD
384  --                            prior to logging the message. Used fnd_message.get to log the message.
385  --rajagupt    06-Oct-2005     Bug#4068548 - added a new cursor ssn_cur
386  --vchappid    26-Feb-2003     Bug#2747335, Base ID will be returned when there exists Base ID for
387  --                            the Award Calendar Instance
388  -- shtatiko   24-JAN-2003     Bug# 2584853, Added message IGF_AP_FA_BASE_REC_ALL
389  -- masehgal   25-Sep-2002     FA 104 - To Do Enhancements
390  --                            Added manual_disb_hold in FA Base update
391  -------------------------------------------------------------------------------------
392    l_rowid    igf_ap_fa_base_rec.ROW_ID%TYPE;
393    l_base_id  igf_ap_fa_base_rec.BASE_ID%TYPE;
394    /*
395      cursor to see whether the FA records for the passsed in person id exists or not
396    */
397    CURSOR c_exists (cp_person_id igs_pe_person.person_id%TYPE,
398                     cp_cal_type igs_ca_inst.cal_type%TYPE,
399                     cp_sequence_number igs_ca_inst.sequence_number%TYPE) IS
400           SELECT base_id
401           FROM   igf_ap_fa_base_rec
402           WHERE  person_id = cp_person_id
403           AND    ci_cal_type = cp_cal_type
404           AND    ci_sequence_number = cp_sequence_number;
405 
406    l_exists   c_exists%ROWTYPE;
407 
408 -- cursor to get the ssn no of a person
409    CURSOR ssn_cur(cp_person_id number) IS
410           SELECT api_person_id,api_person_id_uf, end_dt
411           FROM   igs_pe_alt_pers_id
412           WHERE  pe_person_id=cp_person_id
413           AND    person_id_type like 'SSN'
414           AND    SYSDATE < = NVL(end_dt,SYSDATE);
415 
416 	        rec_ssn_cur ssn_cur%ROWTYPE;
417           lv_profile_value VARCHAR2(20);
418  BEGIN
419 
420    /*
421      create the FA records only when it does not exist
422    */
423    OPEN c_exists (p_person_id,
424                   p_cal_type,
425                   p_sequence_number);
426    FETCH c_exists INTO l_exists;
427    IF c_exists%NOTFOUND THEN
428       /*
429         create the FA base record
430       */
431 
432      --check if the ssn no is available or not
433 
434      fnd_profile.get('IGF_AP_SSN_REQ_FOR_BASE_REC',lv_profile_value);
435 
436 
437           IF (lv_profile_value = 'Y') THEN
438             OPEN ssn_cur(p_person_id) ;
439             FETCH ssn_cur INTO rec_ssn_cur;
440             IF ssn_cur%NOTFOUND THEN
441               fnd_message.set_name('IGF','IGF_AP_SSN_REQD');
442               p_message := 'IGF_AP_SSN_REQD';
443               fnd_file.put_line(fnd_file.log,fnd_message.get);
444               RETURN FALSE;
445             ELSE
446               CLOSE ssn_cur;
447             END IF;
448 
449           END IF;
450 
451           igf_ap_fa_base_rec_pkg.insert_row (
452                             X_ROWID                          =>     l_rowid         ,
453                             X_BASE_ID                        =>     l_base_id       ,
454                             X_CI_CAL_TYPE                    =>     p_cal_type      ,
455                             X_PERSON_ID                      =>     p_person_id     ,
456                             X_CI_SEQUENCE_NUMBER             =>     p_sequence_number,
457                             X_ORG_ID                         =>     NULL    ,
458                             X_COA_PENDING                    =>     NULL    ,
459                             X_VERIFICATION_PROCESS_RUN       =>     NULL    ,
460                             X_INST_VERIF_STATUS_DATE         =>     NULL    ,
461                             X_MANUAL_VERIF_FLAG              =>     NULL    ,
462                             X_FED_VERIF_STATUS               =>     NULL    ,
463                             X_FED_VERIF_STATUS_DATE          =>     NULL    ,
464                             X_INST_VERIF_STATUS              =>     NULL    ,
465                             X_NSLDS_ELIGIBLE                 =>     NULL    ,
466                             X_EDE_CORRECTION_BATCH_ID        =>     NULL    ,
467                             X_FA_PROCESS_STATUS_DATE         =>     NULL    ,
468                             X_ISIR_CORR_STATUS               =>     NULL    ,
469                             X_ISIR_CORR_STATUS_DATE          =>     NULL    ,
470                             X_ISIR_STATUS                    =>     NULL    ,
471                             X_ISIR_STATUS_DATE               =>     NULL    ,
472                             X_COA_CODE_F                     =>     NULL    ,
473                             X_COA_CODE_I                     =>     NULL    ,
474                             X_COA_F                          =>     NULL    ,
475                             X_COA_I                          =>     NULL    ,
476                             X_DISBURSEMENT_HOLD              =>     NULL    ,
477                             X_FA_PROCESS_STATUS              =>     NULL    ,
478                             X_NOTIFICATION_STATUS            =>     NULL    ,
479                             X_NOTIFICATION_STATUS_DATE       =>     NULL    ,
480                             X_PACKAGING_STATUS               =>     NULL    ,
481                             X_PACKAGING_STATUS_DATE          =>     NULL    ,
482                             X_TOTAL_PACKAGE_ACCEPTED         =>     NULL    ,
483                             X_TOTAL_PACKAGE_OFFERED          =>     NULL    ,
484                             X_ADMSTRUCT_ID                   =>     NULL    ,
485                             X_ADMSEGMENT_1                   =>     NULL    ,
486                             X_ADMSEGMENT_2                   =>     NULL    ,
487                             X_ADMSEGMENT_3                   =>     NULL    ,
488                             X_ADMSEGMENT_4                   =>     NULL    ,
489                             X_ADMSEGMENT_5                   =>     NULL    ,
490                             X_ADMSEGMENT_6                   =>     NULL    ,
491                             X_ADMSEGMENT_7                   =>     NULL    ,
492                             X_ADMSEGMENT_8                   =>     NULL    ,
493                             X_ADMSEGMENT_9                   =>     NULL    ,
494                             X_ADMSEGMENT_10                  =>     NULL    ,
495                             X_ADMSEGMENT_11                  =>     NULL    ,
496                             X_ADMSEGMENT_12                  =>     NULL    ,
497                             X_ADMSEGMENT_13                  =>     NULL    ,
498                             X_ADMSEGMENT_14                  =>     NULL    ,
499                             X_ADMSEGMENT_15                  =>     NULL    ,
500                             X_ADMSEGMENT_16                  =>     NULL    ,
501                             X_ADMSEGMENT_17                  =>     NULL    ,
502                             X_ADMSEGMENT_18                  =>     NULL    ,
503                             X_ADMSEGMENT_19                  =>     NULL    ,
504                             X_ADMSEGMENT_20                  =>     NULL    ,
505                             X_PACKSTRUCT_ID                  =>     NULL    ,
506                             X_PACKSEGMENT_1                  =>     NULL    ,
507                             X_PACKSEGMENT_2                  =>     NULL    ,
508                             X_PACKSEGMENT_3                  =>     NULL    ,
509                             X_PACKSEGMENT_4                  =>     NULL    ,
510                             X_PACKSEGMENT_5                  =>     NULL    ,
511                             X_PACKSEGMENT_6                  =>     NULL    ,
512                             X_PACKSEGMENT_7                  =>     NULL    ,
513                             X_PACKSEGMENT_8                  =>     NULL    ,
514                             X_PACKSEGMENT_9                  =>     NULL    ,
515                             X_PACKSEGMENT_10                 =>     NULL    ,
516                             X_PACKSEGMENT_11                 =>     NULL    ,
517                             X_PACKSEGMENT_12                 =>     NULL    ,
518                             X_PACKSEGMENT_13                 =>     NULL    ,
519                             X_PACKSEGMENT_14                 =>     NULL    ,
520                             X_PACKSEGMENT_15                 =>     NULL    ,
521                             X_PACKSEGMENT_16                 =>     NULL    ,
522                             X_PACKSEGMENT_17                 =>     NULL    ,
523                             X_PACKSEGMENT_18                 =>     NULL    ,
524                             X_PACKSEGMENT_19                 =>     NULL    ,
525                             X_PACKSEGMENT_20                 =>     NULL    ,
526                             X_MISCSTRUCT_ID                  =>     NULL    ,
527                             X_MISCSEGMENT_1                  =>     NULL    ,
528                             X_MISCSEGMENT_2                  =>     NULL    ,
529                             X_MISCSEGMENT_3                  =>     NULL    ,
530                             X_MISCSEGMENT_4                  =>     NULL    ,
531                             X_MISCSEGMENT_5                  =>     NULL    ,
532                             X_MISCSEGMENT_6                  =>     NULL    ,
533                             X_MISCSEGMENT_7                  =>     NULL    ,
534                             X_MISCSEGMENT_8                  =>     NULL    ,
535                             X_MISCSEGMENT_9                  =>     NULL    ,
536                             X_MISCSEGMENT_10                 =>     NULL    ,
537                             X_MISCSEGMENT_11                 =>     NULL    ,
538                             X_MISCSEGMENT_12                 =>     NULL    ,
539                             X_MISCSEGMENT_13                 =>     NULL    ,
540                             X_MISCSEGMENT_14                 =>     NULL    ,
541                             X_MISCSEGMENT_15                 =>     NULL    ,
542                             X_MISCSEGMENT_16                 =>     NULL    ,
543                             X_MISCSEGMENT_17                 =>     NULL    ,
544                             X_MISCSEGMENT_18                 =>     NULL    ,
545                             X_MISCSEGMENT_19                 =>     NULL    ,
546                             X_MISCSEGMENT_20                 =>     NULL    ,
547                             X_PROF_JUDGEMENT_FLG             =>     NULL    ,
548                             X_NSLDS_DATA_OVERRIDE_FLG        =>     NULL    ,
549                             X_TARGET_GROUP                   =>     NULL    ,
550                             X_COA_FIXED                      =>     NULL    ,
551                             X_COA_PELL                       =>     NULL    ,
552                             X_MODE                           =>     'R'     ,
553                             X_PROFILE_STATUS                 =>     NULL    ,
554                             X_PROFILE_STATUS_DATE            =>     NULL    ,
555                             X_PROFILE_FC                     =>     NULL    ,
556                             X_TOLERANCE_AMOUNT               =>     NULL    ,
557                             x_manual_disb_hold               =>     NULL    ,
558                             x_pell_alt_expense               =>     NULL    ,
559                             x_assoc_org_num                  =>     NULL    ,
560                             x_award_fmly_contribution_type   =>     '1',
561                             x_isir_locked_by                 =>     NULL,
562                             x_adnl_unsub_loan_elig_flag      => 'N',
563                             x_lock_awd_flag                  => 'N',
564                             x_lock_coa_flag                  => 'N'
565                             );
566 
567 
568       CLOSE c_exists;
569       p_base_id := l_base_id;
570       p_message := NULL;
571       RETURN TRUE;
572    ELSE
573       /*
574         return FALSE with error message
575       */
576       -- when the BaseID is already existing for the Person, Award Calendar Instance then this function will assign
577       -- the existing base_id to the OUT varaible. This function is being called in igf_sp_assign_pub (IGFSP05B.pls)
578       -- when there already exists a Base ID then even though the return status is FALSE, Base ID will be used for
579       -- further processing in igf_sp_assign_pub
580       p_base_id := l_exists.base_id;
581       CLOSE c_exists;
582       -- Changed this message to include token, person name as per Bug# 2684853
583       fnd_message.set_name('IGS', 'IGS_FI_FA_BASE_REC_ALL');
584       fnd_message.set_token ('PERSON_NAME', igs_ge_gen_001.adm_get_name(p_person_id) );
585       p_message := fnd_message.get ;
586       RETURN FALSE;
587    END IF;
588  EXCEPTION
589    WHEN OTHERS THEN
590       IF c_exists%ISOPEN THEN
591          CLOSE c_exists;
592       END IF;
593       p_base_id := NULL;
594       p_message := FND_MESSAGE.GET;
595       RETURN FALSE;
596  END create_fa_base_record;
597 
598 END igf_sp_create_base_rec;