DBA Data[Home] [Help]

PACKAGE BODY: APPS.IGS_UC_PROC_UCAS_DATA

Source


1 PACKAGE BODY igs_uc_proc_ucas_data AS
2 /* $Header: IGSUC43B.pls 120.2 2006/08/21 06:15:09 jbaber noship $  */
3 
4 
5   PROCEDURE process_ucas_data (
6      errbuf               OUT NOCOPY   VARCHAR2
7     ,retcode              OUT NOCOPY   NUMBER
8     ,p_proc_ref_data      IN  VARCHAR2
9     ,p_proc_appl_data     IN  VARCHAR2) IS
10 
11     /******************************************************************
12      Created By      :   rgangara
13      Date Created By :   12-JUNE-2003
14      Purpose         :  To call different procedures for processing UCAS data.
15      Known limitations,enhancements,remarks:
16      Change History
17      Who       When         What
18      06-JUL-03 dsridhar     Bug No: 3085608. Changing the processing order to call
19                             igs_uc_proc_reference_data.process_cvjointadmissions after
20                             igs_uc_proc_com_inst_data.process_cvinstitution.
21      18-JAN-06 anwest       Bug# 4950285 R12 Disable OSS Mandate
22      11-Jul-06 jbaber       Added call to process_cvrefcountry for UCAS 2007 Support
23     ***************************************************************** */
24   BEGIN
25 
26       --anwest 18-JAN-2006 Bug# 4950285 R12 Disable OSS Mandate
27       IGS_GE_GEN_003.SET_ORG_ID;
28 
29       IF p_proc_ref_data = 'N' AND p_proc_appl_data = 'N' THEN
30           fnd_message.set_name('IGS','IGS_UC_NO_REF_APPL_PROC');
31           errbuf  := fnd_message.get;
32           fnd_file.put_line(fnd_file.log, errbuf);
33           retcode:=2;
34           RETURN;
35       END IF;
36 
37 
38       -- general validation/setup check procedures.
39       -- general validations procedure and package variable initialization
40       igs_uc_proc_com_inst_data.common_data_setup (errbuf,
41                                                    retcode) ;
42 
43       -- if the above procedure returns any error then exit the conc. process with error.
44       IF retcode = 2 THEN
45          RETURN;
46       END IF;
47 
48       -- Reference Data
49       IF p_proc_ref_data = 'Y' THEN
50 
51          igs_uc_proc_com_inst_data.process_uvinstitution      ;
52          igs_uc_proc_reference_data.process_cvrefcodes        ;
53          igs_uc_proc_reference_data.process_cvrefawardbody    ;
54 
55          igs_uc_proc_reference_data.process_cvrefapr          ;
56          igs_uc_proc_reference_data.process_cvrefkeyword      ;
57          igs_uc_proc_reference_data.process_cvrefpocc         ;
58 
59          igs_uc_proc_reference_data.process_cvrefofferabbrev  ;
60          igs_uc_proc_com_inst_data.process_uvofferabbrev      ;
61          igs_uc_proc_reference_data.process_cvrefsubj         ;
62 
63          igs_uc_proc_reference_data.process_cvreftariff       ;
64 
65          igs_uc_proc_com_inst_data.process_cvinstitution      ;
66          igs_uc_proc_reference_data.process_cvjointadmissions ;
67 
68          igs_uc_proc_com_inst_data.process_cveblsubject       ;
69          igs_uc_proc_com_inst_data.process_cvschool           ;
70          igs_uc_proc_com_inst_data.process_cvschoolcontact    ;
71 
72          igs_uc_proc_com_inst_data.process_cvcourse           ;
73          igs_uc_proc_com_inst_data.process_uvcourse           ;
74          igs_uc_proc_com_inst_data.process_uvcoursekeyword    ;
75 
76          igs_uc_proc_reference_data.process_cvrefcountry      ;
77 
78       END IF;
79 
80       -- Application Data
81       IF p_proc_appl_data = 'Y' THEN
82 
83          igs_uc_proc_application_data.appl_data_setup (retcode, errbuf) ; -- general validations for Application data.
84 
85          -- if the above procedure returns any error then exit the conc. process with error.
86          IF retcode = 2 THEN
87             RETURN;
88          END IF;
89 
90          igs_uc_proc_application_data.process_ivstarn         ;
91          igs_uc_proc_application_data.process_ivstark         ;
92 
93          igs_uc_proc_application_data.process_ivstarc         ;
94          igs_uc_proc_application_data.process_ivstarg         ;
95          igs_uc_proc_application_data.process_ivstart         ;
96 
97          igs_uc_proc_application_data.process_ivstara         ;
98          igs_uc_proc_application_data.process_ivqualification ;
99 
100          igs_uc_proc_application_data.process_ivstatement     ;
101 
102          igs_uc_proc_application_data.process_ivreference     ;
103          igs_uc_proc_application_data.process_ivoffer         ;
104          igs_uc_proc_application_data.process_ivstarx         ;
105 
106          igs_uc_proc_application_data.process_ivstarh         ;
107          igs_uc_proc_application_data.process_ivstarpqr       ;
108          igs_uc_proc_application_data.process_ivformquals     ;
109 
110          igs_uc_proc_application_data.process_ivstarz1        ;
111          igs_uc_proc_application_data.process_ivstarz2        ;
112          igs_uc_proc_application_data.process_ivstarw         ;
113 
114       END IF;
115 
116 
117 --      ==============================================================================
118 --                    Launching of Process UCAS Data Error Report
119 --      ==============================================================================
120 
121 
122       -- Submit the Error report IGSUCJ36  to show the errors generated while Importing data.
123        DECLARE
124           l_rep_request_id   NUMBER ;
125           l_conc_request_id  NUMBER;
126 
127        BEGIN
128 
129           fnd_file.put_line(fnd_file.log, '==========================================================================');
130 
131           l_rep_request_id := NULL ;
132 
133           l_rep_request_id := Fnd_Request.Submit_Request
134                               ('IGS',
135                                'IGSUCS36',
136                                 'Process UCAS Data Error Report',
137                                 NULL,
138                                 FALSE,
139                                 l_conc_request_id ,
140                                 CHR(0) ,
141                                 NULL,
142                                 NULL,
143                                 NULL,
144                                 NULL, NULL, NULL, NULL, NULL,
145                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
146                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
147                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
148                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
149                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
150                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
151                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
152                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
153                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
154                                );
155 
156 
157           IF l_rep_request_id > 0 THEN
158                  -- if error report successfully submitted then log message
159                  fnd_file.put_line( fnd_file.LOG ,' ');
160                  fnd_message.set_name('IGS','IGS_UC_LAUNCH_PROC_ERR_REP');
161                  fnd_message.set_token('REQ_ID',TO_CHAR(l_rep_request_id));
162                  fnd_file.put_line( fnd_file.LOG ,fnd_message.get);
163           ELSE
164                  -- if error report failed to be launched then log message
165                  fnd_message.set_name('IGS','IGS_UC_PROC_ERR_REP_ERR');
166                  fnd_file.put_line( fnd_file.LOG ,fnd_message.get);
167           END IF;
168 
169        END;
170 
171   EXCEPTION
172        WHEN OTHERS THEN
173          ROLLBACK;
174          retcode := 2;
175          -- even though the admission import process completes in error , this process should continue processing
176          Fnd_Message.Set_name('IGS','IGS_GE_UNHANDLED_EXP');
177          fnd_message.set_token('NAME','IGS_UC_PROC_UCAS_DATA.PROCESS_UCAS_DATA'||' - '||SQLERRM);
178          errbuf  := fnd_message.get;
179          fnd_file.put_line(fnd_file.LOG, errbuf);
180          igs_ge_msg_stack.conc_exception_hndl;
181   END process_ucas_data;
182 
183 
184 
185 
186 
187   PROCEDURE log_proc_complete(p_view_name VARCHAR2, p_success_cnt NUMBER, p_error_cnt NUMBER) IS
188     /******************************************************************
189      Created By      :   rgangara
190      Date Created By :   12-JUNE-2003
191      Purpose         :   This process is for logging message marking the completion
192                          of the processing for that Hercules view.
193      Known limitations,enhancements,remarks:
194      Change History
195      Who       When         What
196     ***************************************************************** */
197 
198   BEGIN
199      fnd_message.set_name('IGS','IGS_UC_PROC_DATA_COMP_STATS');
200      fnd_message.set_token('VIEW', p_view_name);
201      fnd_message.set_token('TOT_RECS' , TO_CHAR(p_success_cnt + p_error_cnt));
202      fnd_message.set_token('SUCC_RECS', TO_CHAR(p_success_cnt));
203      fnd_message.set_token('ERR_RECS' , TO_CHAR(p_error_cnt));
204      fnd_file.put_line(fnd_file.log, fnd_message.get);
205      fnd_file.put_line(fnd_file.log, '==========================================================================');
206      fnd_file.put_line(fnd_file.log, ' ');
207 
208 
209   END log_proc_complete;
210 
211 
212 
213 
214   PROCEDURE log_error_msg(p_error_code igs_uc_uinst_ints.error_code%TYPE) IS
215     /******************************************************************
216      Created By      :   rgangara
217      Date Created By :   12-JUNE-2003
218      Purpose         :   This process fetches the message/meaning from Lookups
219                          for the error code that is passed in as parameter.
220      Known limitations,enhancements,remarks:
221      Change History
222      Who       When         What
223     ***************************************************************** */
224 
225      -- get the error message/meaning from Lookups
226      CURSOR get_err_msg_cur IS
227      SELECT meaning
228      FROM   igs_lookup_values
229      WHERE  lookup_type = 'IGS_UC_DATA_ERRORS'
230      AND    lookup_code = p_error_code;
231 
232      l_meaning igs_lookup_values.meaning%TYPE;
233 
234   BEGIN
235 
236      OPEN get_err_msg_cur;
237      FETCH get_err_msg_cur INTO l_meaning;
238      IF get_err_msg_cur%NOTFOUND THEN
239         fnd_message.set_name('IGS','IGS_UC_INVALID_ERR_CODE');
240         fnd_message.set_token('ERROR_CODE', p_error_code);
241         fnd_file.put_line(fnd_file.log, fnd_message.get);
242      ELSE
243         fnd_file.put_line(fnd_file.log, p_error_code || ' - ' ||l_meaning);
244      END IF;
245 
246      CLOSE get_err_msg_cur;
247   END log_error_msg;
248 
249 
250 END igs_uc_proc_ucas_data;