DBA Data[Home] [Help]

PACKAGE BODY: APPS.OKL_AM_SYSTEM_PARAMS_PVT

Source


1 PACKAGE BODY OKL_AM_SYSTEM_PARAMS_PVT AS
2 /* $Header: OKLRASAB.pls 120.9.12010000.2 2009/08/18 08:11:03 nikshah ship $ */
3 
4   -- Start of comments
5   --
6   -- Procedure Name  : process_system_params
7   -- Description     : procedure to create or update rec in OKL_SYSTEM_PARAMS_ALL_V
8   -- Business Rules  :
9   -- Parameters      :
10   -- Version         : 1.0
11   -- History         : RMUNJULU Created
12   --
13   -- End of comments
14   PROCEDURE process_system_params(
15     p_api_version                  IN NUMBER,
16     p_init_msg_list                IN VARCHAR2,
17     x_return_status                OUT NOCOPY VARCHAR2,
18     x_msg_count                    OUT NOCOPY NUMBER,
19     x_msg_data                     OUT NOCOPY VARCHAR2,
20     p_sypv_rec                     IN sypv_rec_type,
21     x_sypv_rec                     OUT NOCOPY sypv_rec_type) IS
22 
23         l_api_name VARCHAR2(30) := 'process_system_params';
24       	l_api_version CONSTANT NUMBER := G_API_VERSION;
25         l_return_status    VARCHAR2(1) := G_RET_STS_SUCCESS;
26 
27 
28        -- DJANASWA Bug 6653304 start  Proj: Asset Repo for a Loan
29 
30         l_tax_book_1               OKL_SYSTEM_PARAMS_ALL.TAX_BOOK_1%type;
31         l_tax_book_2               OKL_SYSTEM_PARAMS_ALL.TAX_BOOK_2%type;
32         l_fa_location_id           OKL_SYSTEM_PARAMS_ALL.FA_LOCATION_ID%type;
33         l_formula_id               OKL_SYSTEM_PARAMS_ALL.FORMULA_ID%type;
34         l_asset_key_id             OKL_SYSTEM_PARAMS_ALL.ASSET_KEY_ID%type;
35         l_asst_add_book_type_code  OKL_SYSTEM_PARAMS_ALL.ASST_ADD_BOOK_TYPE_CODE%TYPE;
36         l_rpt_prod_book_type_code  OKL_SYSTEM_PARAMS_ALL.RPT_PROD_BOOK_TYPE_CODE%TYPE;
37         l_tax_book_name_1          FA_BOOK_CONTROLS.BOOK_TYPE_NAME%TYPE;
38         l_tax_book_name_2          FA_BOOK_CONTROLS.BOOK_TYPE_NAME%TYPE;
39 
40         l_tax_1                    OKL_SYSTEM_PARAMS_ALL.TAX_BOOK_1%type;
41         l_tax_2                    OKL_SYSTEM_PARAMS_ALL.TAX_BOOK_2%type;
42         l_asst_book_type_name      FA_BOOK_CONTROLS.BOOK_TYPE_NAME%TYPE;
43 
44         --NIKSHAH added below variables, bug # 8570053
45         l_sec_rep_method           okl_sys_acct_opts.SECONDARY_REP_METHOD%TYPE;
46         l_rpt_book_type            OKL_SYSTEM_PARAMS.rpt_prod_book_type_code%TYPE;
47         --NIKSHAH added above variables, bug # 8570053
48         G_EXCEPTION_HALT_VALIDATION  EXCEPTION;
49 
50    CURSOR c_tax_book_csr (cp_asst_add_book_type_code VARCHAR2, cp_tax_book VARCHAR2) IS
51      SELECT 'x'
52      FROM fa_book_controls
53      where book_class =  'TAX'
54      AND   distribution_source_book = cp_asst_add_book_type_code
55      AND   book_type_code = cp_tax_book;
56 
57    CURSOR c_asst_book_type_name_csr (cp_asst_add_book_type_code VARCHAR2) IS
58      SELECT BOOK_TYPE_NAME
59      FROM fa_book_controls
60      where book_class =  'CORPORATE'
61      AND   book_type_code = cp_asst_add_book_type_code;
62 
63    CURSOR c_tax_book_name_csr (cp_tax_book_code VARCHAR2) IS
64      SELECT BOOK_TYPE_NAME
65      FROM fa_book_controls
66      where book_type_code = cp_tax_book_code;
67 
68 
69       -- DJANASWA Bug 6653304 end  Proj: Asset Repo for a Loan
70 
71    --NIKSHAH added below cursor, bug # 8570053
72    CURSOR c_get_sec_repr_method IS
73    select secondary_rep_method, rpt_prod_book_type_code
74    from   okl_system_params p, okl_sys_acct_opts a
75    where  p.org_id = a.org_id;
76 
77 
78   BEGIN
79 
80        IF( FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
81           FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
82                          'OKL_AM_SYSTEM_PARAMS_PVT.process_system_params',
83                          'Begin(+)');
84        END IF;
85 
86        -- Check API version, initialize message list and create savepoint
87        l_return_status := OKL_API.start_activity(
88                                        p_api_name      => l_api_name,
89                                        p_pkg_name      => G_PKG_NAME,
90                                        p_init_msg_list => p_init_msg_list,
91                                        l_api_version   => l_api_version,
92                                        p_api_version   => p_api_version,
93                                        p_api_type      => '_PVT',
94                                        x_return_status => x_return_status);
95 
96        -- Rollback if error setting activity for api
97        IF (l_return_status = G_RET_STS_UNEXP_ERROR) THEN
98           RAISE G_EXCEPTION_UNEXPECTED_ERROR;
99        ELSIF (l_return_status = G_RET_STS_ERROR) THEN
100           RAISE G_EXCEPTION_ERROR;
101        END IF;
102 
103 
104 
105        -- DJANASWA Bug 6653304 start  Proj: Asset Repo for a Loan
106 -- Added validations for the new columns added to the table okl_system_params_all.
107 -- 1. If any one or more of the following fields has values: Tax Asset Book 1, Tax Asset Book 2,
108 --    Asset Key, Fixed Asset Location, Asset Cost Formula
109 --    then ensure that all of the following fields have values:
110 --    Asset Addition Corporate Book, Tax Asset Book 1, Fixed Asset Location
111 -- 2. If Tax Asset Book 1 and/or  Tax Asset Book 2 have values then ensure that they are tax books related to
112 --    the 'Asset Addition Corporate Book'.
113 -- 3. There are no duplicate values among the following 3 fields: Reporting Product Asset Book,
114 --    Tax Asset Book 1, Tax Asset Book 2
115 
116         l_tax_book_1              := null;
117         l_tax_book_2              := null;
118         l_fa_location_id          := null;
119         l_formula_id              := null;
120         l_asset_key_id            := null;
121         l_asst_add_book_type_code := NULL;
122         l_rpt_prod_book_type_code := NULL;
123         l_tax_book_name_1         := NULL;
124         l_tax_book_name_2         := NULL;
125         l_asst_book_type_name     := NULL;
126 
127         l_tax_book_1              := p_sypv_rec.TAX_BOOK_1;
128         l_tax_book_2              := p_sypv_rec.TAX_BOOK_2;
129         l_fa_location_id          := p_sypv_rec.FA_LOCATION_ID;
130         l_formula_id              := p_sypv_rec.FORMULA_ID;
131         l_asset_key_id            := p_sypv_rec.ASSET_KEY_ID;
132         l_asst_add_book_type_code := p_sypv_rec.ASST_ADD_BOOK_TYPE_CODE;
133         l_rpt_prod_book_type_code := p_sypv_rec.RPT_PROD_BOOK_TYPE_CODE;
134 
135 
136 --  Tax Book 1 is NOT NULL, others are NULL
137        IF  (l_tax_book_1 IS NOT NULL AND l_tax_book_1 <> OKL_API.G_MISS_CHAR)  THEN
138 
139            IF  ( l_asst_add_book_type_code IS NULL OR  l_asst_add_book_type_code =  OKL_API.G_MISS_CHAR)
140                 THEN
141                    l_return_status := OKL_API.G_RET_STS_ERROR;
142                    -- Asset Addition Corporate Book cannot be NULL.
143                    OKL_API.set_message(      p_app_name      => 'OKL',
144                                              p_msg_name      => 'OKL_AM_CORPORATE_BOOK_MISSING');
145            END IF;
146 
147 
148            IF  (l_fa_location_id IS NULL OR l_fa_location_id = OKL_API.G_MISS_NUM)
149                 THEN
150                    l_return_status := OKL_API.G_RET_STS_ERROR;
151                    --  l_fa_location_id cannot be NULL.
152                    OKL_API.set_message(      p_app_name      => 'OKL',
153                                              p_msg_name      => 'OKL_AM_FA_LOCATION_ID_MISSING');
154            END IF;
155 
156        END IF;
157 
158        IF (l_return_status = OKL_API.G_RET_STS_ERROR) THEN
159           RAISE G_EXCEPTION_HALT_VALIDATION;
160           -- RAISE G_EXCEPTION_ERROR;
161        END IF;
162 
163 --  LOCATION_ID is NOT NULL, others are NULL
164        IF  (l_fa_location_id IS NOT NULL AND l_fa_location_id <> OKL_API.G_MISS_NUM)  THEN
165 
166            IF  ( l_asst_add_book_type_code IS NULL OR  l_asst_add_book_type_code =  OKL_API.G_MISS_CHAR)
167                 THEN
168                    l_return_status := OKL_API.G_RET_STS_ERROR;
169                    -- Asset Addition Corporate Book cannot be NULL.
170                    OKL_API.set_message(      p_app_name      => 'OKL',
171                                              p_msg_name      => 'OKL_AM_CORPORATE_BOOK_MISSING');
172            END IF;
173 
174            IF  (l_tax_book_1 IS  NULL OR l_tax_book_1 = OKL_API.G_MISS_CHAR)
175                 THEN
176                    l_return_status := OKL_API.G_RET_STS_ERROR;
177                    --  l_tax_book_1 cannot be NULL.
178                    OKL_API.set_message(      p_app_name      => 'OKL',
179                                              p_msg_name      => 'OKL_AM_TAX_BOOK_1_MISSING');
180            END IF;
181 
182 
183        END IF;
184 
185        IF (l_return_status = OKL_API.G_RET_STS_ERROR) THEN
186           RAISE G_EXCEPTION_HALT_VALIDATION;
187           -- RAISE G_EXCEPTION_ERROR;
188        END IF;
189 
190 --  ASSET KEY is NOT NULL, others are NULL
191        IF  (l_asset_key_id IS NOT NULL AND l_asset_key_id <> OKL_API.G_MISS_NUM) THEN
192 
193            IF  ( l_asst_add_book_type_code IS NULL OR  l_asst_add_book_type_code =  OKL_API.G_MISS_CHAR)
194                 THEN
195                    l_return_status := OKL_API.G_RET_STS_ERROR;
196                    -- Asset Addition Corporate Book cannot be NULL.
197                    OKL_API.set_message(      p_app_name      => 'OKL',
198                                              p_msg_name      => 'OKL_AM_CORPORATE_BOOK_MISSING');
199            END IF;
200 
201            IF  (l_tax_book_1 IS  NULL OR l_tax_book_1 = OKL_API.G_MISS_CHAR)
202                 THEN
203                    l_return_status := OKL_API.G_RET_STS_ERROR;
204                    --  l_tax_book_1 cannot be NULL.
205                    OKL_API.set_message(      p_app_name      => 'OKL',
206                                              p_msg_name      => 'OKL_AM_TAX_BOOK_1_MISSING');
207            END IF;
208 
209            IF  (l_fa_location_id IS NULL OR l_fa_location_id = OKL_API.G_MISS_NUM)
210                 THEN
211                    l_return_status := OKL_API.G_RET_STS_ERROR;
212                    --  l_fa_location_id cannot be NULL.
213                    OKL_API.set_message(      p_app_name      => 'OKL',
214                                              p_msg_name      => 'OKL_AM_FA_LOCATION_ID_MISSING');
215 
216           END IF;
217 
218        END IF;
219 
220        IF (l_return_status = OKL_API.G_RET_STS_ERROR) THEN
221           RAISE G_EXCEPTION_HALT_VALIDATION;
222           -- RAISE G_EXCEPTION_ERROR;
223        END IF;
224 
225 --  FORMULA_ID is NOT NULL, others are NULL
226 
227        IF  (l_formula_id IS NOT NULL AND l_formula_id <> OKL_API.G_MISS_NUM) THEN
228 
229            IF  ( l_asst_add_book_type_code IS NULL OR  l_asst_add_book_type_code =  OKL_API.G_MISS_CHAR)
230                 THEN
231                    l_return_status := OKL_API.G_RET_STS_ERROR;
232                    -- Asset Addition Corporate Book cannot be NULL.
233                    OKL_API.set_message(      p_app_name      => 'OKL',
234                                              p_msg_name      => 'OKL_AM_CORPORATE_BOOK_MISSING');
235            END IF;
236 
237            IF  (l_tax_book_1 IS  NULL OR l_tax_book_1 = OKL_API.G_MISS_CHAR)
238                 THEN
239                    l_return_status := OKL_API.G_RET_STS_ERROR;
240                    --  l_tax_book_1 cannot be NULL.
241                    OKL_API.set_message(      p_app_name      => 'OKL',
242                                              p_msg_name      => 'OKL_AM_TAX_BOOK_1_MISSING');
243            END IF;
244 
245 
246            IF  (l_fa_location_id IS NULL OR l_fa_location_id = OKL_API.G_MISS_NUM)
247                 THEN
248                    l_return_status := OKL_API.G_RET_STS_ERROR;
249                    --  l_fa_location_id cannot be NULL.
250                    OKL_API.set_message(      p_app_name      => 'OKL',
251                                              p_msg_name      => 'OKL_AM_FA_LOCATION_ID_MISSING');
252 
253           END IF;
254 
255 
256        END IF;
257 
258        IF (l_return_status = OKL_API.G_RET_STS_ERROR) THEN
259           RAISE G_EXCEPTION_HALT_VALIDATION;
260           -- RAISE G_EXCEPTION_ERROR;
261        END IF;
262 
263 --  TAX BOOK 2 is NOT NULL, others are NULL
264 
265        IF  (l_tax_book_2 IS  NOT NULL AND  l_tax_book_2 <> OKL_API.G_MISS_CHAR) THEN
266 
270                    -- Asset Addition Corporate Book cannot be NULL.
267            IF  ( l_asst_add_book_type_code IS NULL OR  l_asst_add_book_type_code =  OKL_API.G_MISS_CHAR)
268                 THEN
269                    l_return_status := OKL_API.G_RET_STS_ERROR;
271                    OKL_API.set_message(      p_app_name      => 'OKL',
272                                              p_msg_name      => 'OKL_AM_CORPORATE_BOOK_MISSING');
273            END IF;
274 
275            IF  (l_tax_book_1 IS  NULL OR l_tax_book_1 = OKL_API.G_MISS_CHAR)
276                 THEN
277                    l_return_status := OKL_API.G_RET_STS_ERROR;
278                    --  l_tax_book_1 cannot be NULL.
279                    OKL_API.set_message(      p_app_name      => 'OKL',
280                                              p_msg_name      => 'OKL_AM_TAX_BOOK_1_MISSING');
281            END IF;
282 
283            IF  (l_fa_location_id IS NULL OR l_fa_location_id = OKL_API.G_MISS_NUM)
284                 THEN
285                    l_return_status := OKL_API.G_RET_STS_ERROR;
286                    --  l_fa_location_id cannot be NULL.
287                    OKL_API.set_message(      p_app_name      => 'OKL',
288                                              p_msg_name      => 'OKL_AM_FA_LOCATION_ID_MISSING');
289 
290           END IF;
291 
292 
293        END IF;
294 
295        IF (l_return_status = OKL_API.G_RET_STS_ERROR) THEN
296           RAISE G_EXCEPTION_HALT_VALIDATION;
297           -- RAISE G_EXCEPTION_ERROR;
298        END IF;
299 
300 
301 -- corporate book and tax books are valid combinations
302                       OPEN c_asst_book_type_name_csr (l_asst_add_book_type_code);
303                       FETCH c_asst_book_type_name_csr INTO l_asst_book_type_name;
304                       CLOSE c_asst_book_type_name_csr;
305 
306                        OPEN c_tax_book_name_csr (l_tax_book_1);
307                        FETCH c_tax_book_name_csr INTO l_tax_book_name_1;
308                        CLOSE c_tax_book_name_csr;
309 
310                        OPEN c_tax_book_name_csr (l_tax_book_2);
311                        FETCH c_tax_book_name_csr INTO l_tax_book_name_2;
312                        CLOSE c_tax_book_name_csr;
313 
314        IF  ( l_asst_add_book_type_code IS NOT NULL AND  l_asst_add_book_type_code <>  OKL_API.G_MISS_CHAR)  THEN
315            IF (l_tax_book_1 IS NOT NULL AND  l_tax_book_1 <>  OKL_API.G_MISS_CHAR) THEN
316               OPEN  c_tax_book_csr (l_asst_add_book_type_code, l_tax_book_1);
317               FETCH c_tax_book_csr INTO l_tax_1;
318                   IF c_tax_book_csr%NOTFOUND THEN
319 
320                       l_return_status := OKL_API.G_RET_STS_ERROR;
321                       OKL_API.SET_MESSAGE(p_app_name          => 'OKL',
322                                     p_msg_name          => 'OKL_AM_INVALID_TAX_BOOK',
323                                             p_token1        => 'TAX_BOOK',
324                                             p_token1_value  =>  l_tax_book_name_1,
325                                             p_token2        => 'CORPORATE_BOOK',
326                                             p_token2_value  =>  l_asst_book_type_name);
327                      --  RAISE G_EXCEPTION_HALT_VALIDATION;
328                   END IF;
329              CLOSE c_tax_book_csr;
330           END IF;
331 
332           IF (l_tax_book_2 IS NOT NULL AND  l_tax_book_2 <>  OKL_API.G_MISS_CHAR) THEN
333               OPEN  c_tax_book_csr (l_asst_add_book_type_code, l_tax_book_2);
334               FETCH c_tax_book_csr INTO l_tax_2;
335                   IF c_tax_book_csr%NOTFOUND THEN
336 
337                       l_return_status := OKL_API.G_RET_STS_ERROR;
338                       OKL_API.SET_MESSAGE(p_app_name          => 'OKL',
339                                     p_msg_name          => 'OKL_AM_INVALID_TAX_BOOK',
340                                             p_token1        => 'TAX_BOOK',
341                                             p_token1_value  =>  l_tax_book_name_2,
342                                             p_token2        => 'CORPORATE_BOOK',
343                                             p_token2_value  =>  l_asst_book_type_name);
344                      -- RAISE G_EXCEPTION_HALT_VALIDATION;
345                   END IF;
346              CLOSE c_tax_book_csr;
347 
348          END IF;
349      END IF;
350 
351        IF (l_return_status = OKL_API.G_RET_STS_ERROR) THEN
352           RAISE G_EXCEPTION_HALT_VALIDATION;
353           -- RAISE G_EXCEPTION_ERROR;
354        END IF;
355 
356 -- no duplicate l_rpt_prod_book_type_code and tax book 1 and Tax Book 2
357 --Commented below if by NIKSHAH for bug 8570053
358 /*
359        IF (l_rpt_prod_book_type_code IS NOT NULL AND  l_rpt_prod_book_type_code <>  OKL_API.G_MISS_CHAR) THEN
360 
361            IF (l_tax_book_1 IS NOT NULL AND  l_tax_book_1 <>  OKL_API.G_MISS_CHAR) THEN
362 
363                     IF (l_rpt_prod_book_type_code = l_tax_book_1) THEN
364                           -- l_rpt_prod_book_type_code and Tax Book 1 cannot be the same.
365                         l_return_status := OKL_API.G_RET_STS_ERROR;
366                         OKL_API.set_message(p_app_name      => 'OKL',
367                                             p_msg_name      => 'OKL_AM_TAX_BOOK_2_DUPLICATE',
368                                             p_token1        => 'TAX_BOOK2',
369                                             p_token1_value  =>  l_tax_book_name_1);
370                    END IF;
371             END IF;
372 
373 
374            IF (l_tax_book_2 IS NOT NULL AND  l_tax_book_2 <>  OKL_API.G_MISS_CHAR) THEN
375 
376                     IF (l_rpt_prod_book_type_code = l_tax_book_2) THEN
377                           -- l_rpt_prod_book_type_code and Tax Book 2 cannot be the same.
378                         l_return_status := OKL_API.G_RET_STS_ERROR;
379                         OKL_API.set_message(p_app_name      => 'OKL',
383                    END IF;
380                                             p_msg_name      => 'OKL_AM_TAX_BOOK_2_DUPLICATE',
381                                             p_token1        => 'TAX_BOOK2',
382                                             p_token1_value  =>  l_tax_book_name_2);
384             END IF;
385 
386        END IF;
387 */
388 -- no duplicate tax books
389        IF (l_tax_book_1 IS NOT NULL AND  l_tax_book_1 <>  OKL_API.G_MISS_CHAR) THEN
390 
391            IF (l_tax_book_2 IS NOT NULL AND  l_tax_book_2 <>  OKL_API.G_MISS_CHAR) THEN
392 
393                     IF (l_tax_book_1 = l_tax_book_2) THEN
394                           -- Tax Book1 and Tax Book 2 cannot be the same.
395                         l_return_status := OKL_API.G_RET_STS_ERROR;
396                         OKL_API.set_message(p_app_name      => 'OKL',
397                                             p_msg_name      => 'OKL_AM_TAX_BOOK_2_DUPLICATE',
398                                             p_token1        => 'TAX_BOOK2',
399                                             p_token1_value  =>  l_tax_book_name_2);
400                    END IF;
401             END IF;
402 
403        END IF;
404 
405        IF (l_return_status = OKL_API.G_RET_STS_ERROR) THEN
406           RAISE G_EXCEPTION_HALT_VALIDATION;
407           -- RAISE G_EXCEPTION_ERROR;
408        END IF;
409 
410 
411       -- DJANASWA Bug 6653304 end  Proj: Asset Repo for a Loan
412 
413       --Added conditions for Tax asset book1, Tax asset book2
414       --as per the bug 8570053 by NIKSHAH
415       --START #8570053
416       OPEN c_get_sec_repr_method;
417       FETCH c_get_sec_repr_method INTO l_sec_rep_method, l_rpt_book_type;
418       CLOSE c_get_sec_repr_method;
419 
420       IF l_sec_rep_method IS NOT NULL AND
421          l_tax_book_1 IS NOT NULL AND
422          l_tax_book_2 IS NOT NULL
423       THEN
424         IF l_sec_rep_method <> 'NOT_APPLICABLE' THEN
425           IF l_tax_book_1 <> l_rpt_book_type AND l_tax_book_2 <> l_rpt_book_type THEN
426             l_return_status := OKL_API.G_RET_STS_ERROR;
427             OKL_API.set_message(p_app_name      => 'OKL',
428                                 p_msg_name      => 'OKL_AM_RPT_PROD_AST_BOOK');
429           END IF;
430         END IF;
431       END IF;
432       IF (l_return_status = OKL_API.G_RET_STS_ERROR) THEN
433          RAISE G_EXCEPTION_HALT_VALIDATION;
434       END IF;
435       --END #8570053
436 
437 
438        -- If no id passed then insert else update
439        IF p_sypv_rec.id IS NULL OR p_sypv_rec.id = G_MISS_NUM THEN
440 
441           -- Call TAPI insert
442           OKL_SYSTEM_PARAMS_ALL_PUB.insert_system_parameters(
443                     p_api_version    => p_api_version,
444                     p_init_msg_list  => G_FALSE,
445                     x_return_status  => l_return_status,
446                     x_msg_count      => x_msg_count,
447                     x_msg_data       => x_msg_data,
448                     p_sypv_rec       => p_sypv_rec,
449                     x_sypv_rec       => x_sypv_rec);
450 
451           -- raise exception if api returns error
452           IF (l_return_status = G_RET_STS_UNEXP_ERROR) THEN
453              RAISE G_EXCEPTION_UNEXPECTED_ERROR;
454           ELSIF (l_return_status = G_RET_STS_ERROR) THEN
455              RAISE G_EXCEPTION_ERROR;
456           END IF;
457        ELSE
458 
459           -- Call TAPI update
460           OKL_SYSTEM_PARAMS_ALL_PUB.update_system_parameters(
461                     p_api_version    => p_api_version,
462                     p_init_msg_list  => G_FALSE,
463                     x_return_status  => l_return_status,
464                     x_msg_count      => x_msg_count,
465                     x_msg_data       => x_msg_data,
466                     p_sypv_rec       => p_sypv_rec,
467                     x_sypv_rec       => x_sypv_rec);
468 
469           -- raise exception if api returns error
470           IF (l_return_status = G_RET_STS_UNEXP_ERROR) THEN
471              RAISE G_EXCEPTION_UNEXPECTED_ERROR;
472           ELSIF (l_return_status = G_RET_STS_ERROR) THEN
473              RAISE G_EXCEPTION_ERROR;
474           END IF;
475        END IF;
476 
477        x_return_status := l_return_status;
478 
479        -- End Activity
480        OKL_API.end_activity (x_msg_count, x_msg_data);
481 
482        IF( FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
483           FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
484                          'OKL_AM_SYSTEM_PARAMS_PVT.process_system_params',
485                          'End(-)');
486        END IF;
487 
488   EXCEPTION
489 
490 
491       WHEN  G_EXCEPTION_HALT_VALIDATION THEN
492           IF c_tax_book_csr%ISOPEN THEN
493              CLOSE c_tax_book_csr;
494           END IF;
495 
496              x_return_status := OKL_API.handle_exceptions(
497                                        p_api_name  => l_api_name,
498                                        p_pkg_name  => G_PKG_NAME,
499                                        p_exc_name  => 'OKL_API.G_RET_STS_ERROR',
500                                        x_msg_count => x_msg_count,
501                                        x_msg_data  => x_msg_data,
502                                        p_api_type  => '_PVT');
503 
504            IF( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
505               FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,
506                              'OKL_AM_SYSTEM_PARAMS_PVT.process_system_params',
507                              'EXP - G_EXCEPTION_ERROR');
508            END IF;
509 
510 
511       WHEN G_EXCEPTION_ERROR THEN
512           IF c_tax_book_csr%ISOPEN THEN
513              CLOSE c_tax_book_csr;
517                                        p_api_name  => l_api_name,
514           END IF;
515 
516             x_return_status := OKL_API.handle_exceptions(
518                                        p_pkg_name  => G_PKG_NAME,
519                                        p_exc_name  => 'OKL_API.G_RET_STS_ERROR',
520                                        x_msg_count => x_msg_count,
521                                        x_msg_data  => x_msg_data,
522                                        p_api_type  => '_PVT');
523 
524            IF( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
525               FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,
526                              'OKL_AM_SYSTEM_PARAMS_PVT.process_system_params',
527                              'EXP - G_EXCEPTION_ERROR');
528            END IF;
529 
530       WHEN G_EXCEPTION_UNEXPECTED_ERROR THEN
531           IF c_tax_book_csr%ISOPEN THEN
532              CLOSE c_tax_book_csr;
533           END IF;
534 
535             x_return_status := OKL_API.handle_exceptions(
536                                        p_api_name  => l_api_name,
537                                        p_pkg_name  => G_PKG_NAME,
538                                        p_exc_name  => 'OKL_API.G_RET_STS_UNEXP_ERROR',
539                                        x_msg_count => x_msg_count,
540                                        x_msg_data  => x_msg_data,
541                                        p_api_type  => '_PVT');
542 
543            IF( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
544               FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,
545                              'OKL_AM_SYSTEM_PARAMS_PVT.process_system_params',
546                              'EXP - G_EXCEPTION_UNEXPECTED_ERROR');
547            END IF;
548 
549       WHEN OTHERS THEN
550           IF c_tax_book_csr%ISOPEN THEN
551              CLOSE c_tax_book_csr;
552           END IF;
553 
554             x_return_status := OKL_API.handle_exceptions(
555                                        p_api_name  => l_api_name,
556                                        p_pkg_name  => G_PKG_NAME,
557                                        p_exc_name  => 'OTHERS',
558                                        x_msg_count => x_msg_count,
559                                        x_msg_data  => x_msg_data,
560                                        p_api_type  => '_PVT');
561 
562            IF( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
563               FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,
564                              'OKL_AM_SYSTEM_PARAMS_PVT.process_system_params',
565                              'EXP - OTHERS');
566            END IF;
567   END process_system_params;
568 
569 END OKL_AM_SYSTEM_PARAMS_PVT;