[Home] [Help]
PACKAGE BODY: APPS.OKL_ACC_GROUP_PUB
Source
1 PACKAGE BODY OKL_ACC_GROUP_PUB AS
2 /* $Header: OKLPAGCB.pls 115.5 2002/12/18 12:09:28 kjinger noship $ */
3
4
5 PROCEDURE create_acc_group(p_api_version IN NUMBER
6 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
7 ,x_return_status OUT NOCOPY VARCHAR2
8 ,x_msg_count OUT NOCOPY NUMBER
9 ,x_msg_data OUT NOCOPY VARCHAR2
10 ,p_agcv_rec IN agcv_rec_type
11 ,p_agbv_tbl IN agbv_tbl_type
12 ,x_agcv_rec OUT NOCOPY agcv_rec_type
13 ,x_agbv_tbl OUT NOCOPY agbv_tbl_type )
14
15 IS
16
17 i NUMBER;
18 l_api_name CONSTANT VARCHAR2(30) := 'create_acc_ccid';
19 l_agcv_rec agcv_rec_type := p_agcv_rec;
20 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
21 l_agbv_tbl agbv_tbl_type := p_agbv_tbl;
22
23
24 BEGIN
25
26 SAVEPOINT create_acc_group;
27 x_return_status := FND_API.G_RET_STS_SUCCESS;
28
29 -- customer pre-processing
30
31
32
33
34
35 -- vertical industry-preprocessing
36
37
38
39
40
41 -- call complex entity API
42
43
44
45 okl_acc_group_pvt.create_acc_group(p_api_version => p_api_version
46 ,p_init_msg_list => p_init_msg_list
47 ,x_return_status => l_return_status
48 ,x_msg_count => x_msg_count
49 ,x_msg_data => x_msg_data
50 ,p_agcv_rec => l_agcv_rec
51 ,p_agbv_tbl => l_agbv_tbl
52 ,x_agcv_rec => x_agcv_rec
53 ,x_agbv_tbl => x_agbv_tbl);
54
55 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
56 RAISE FND_API.G_EXC_ERROR;
57 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
58 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
59 END IF;
60
61
62 l_agcv_rec := x_agcv_rec;
63 l_agbv_tbl := x_agbv_tbl;
64
65 -- vertical industry-post-processing
66
67
68
69
70
71 -- customer post-processing
72
73
74
75
76
77
78 EXCEPTION
79 WHEN FND_API.G_EXC_ERROR THEN
80 ROLLBACK TO create_acc_group;
81 x_return_status := FND_API.G_RET_STS_ERROR;
82
83 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
84 ,p_count => x_msg_count
85 ,p_data => x_msg_data);
86
87 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
88 ROLLBACK TO create_acc_group;
89 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
90 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
91 ,p_count => x_msg_count
92 ,p_data => x_msg_data);
93
94 WHEN OTHERS THEN
95 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','create_acc_group');
96 -- store SQL error message on message stack for caller
97 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
98 ,p_count => x_msg_count
99 ,p_data => x_msg_data);
100 -- notify caller of an UNEXPECTED error
101 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
102
103
104 END create_acc_group;
105
106
107
108 PROCEDURE create_acc_ccid(p_api_version IN NUMBER
109 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
110 ,x_return_status OUT NOCOPY VARCHAR2
111 ,x_msg_count OUT NOCOPY NUMBER
112 ,x_msg_data OUT NOCOPY VARCHAR2
113 ,p_agcv_rec IN agcv_rec_type
114 ,x_agcv_rec OUT NOCOPY agcv_rec_type) IS
115
116 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
117 l_api_name CONSTANT VARCHAR2(30) := 'create_acc_ccid';
118 l_agcv_rec agcv_rec_type := p_agcv_rec;
119
120
121
122 BEGIN
123
124 SAVEPOINT create_acc_ccid;
125 x_return_status := FND_API.G_RET_STS_SUCCESS;
126
127
128 -- customer pre-processing
129
130
131
132
133
134 -- vertical industry-preprocessing
135
136
137
138
139
140
141 -- call complex entity API
142
143 okl_acc_group_pvt.create_acc_ccid(p_api_version => p_api_version
144 ,p_init_msg_list => p_init_msg_list
145 ,x_return_status => l_return_status
146 ,x_msg_count => x_msg_count
147 ,x_msg_data => x_msg_data
148 ,p_agcv_rec => l_agcv_rec
149 ,x_agcv_rec => x_agcv_rec);
150
151
152
153 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
154 RAISE FND_API.G_EXC_ERROR;
155 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
156 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
157 END IF;
158
159 l_agcv_rec := x_agcv_rec;
160
161 -- vertical industry-post-processing
162
163
164
165
166
167
168 -- customer post-processing
169
170
171
172
173
174
175 EXCEPTION
176
177 WHEN FND_API.G_EXC_ERROR THEN
178 ROLLBACK TO create_acc_ccid;
179 x_return_status := FND_API.G_RET_STS_ERROR;
180
181 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
182 ,p_count => x_msg_count
183 ,p_data => x_msg_data);
184
185 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
186 ROLLBACK TO create_acc_ccid;
187 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
188 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
189 ,p_count => x_msg_count
190 ,p_data => x_msg_data);
191
192 WHEN OTHERS THEN
193 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','create_acc_ccid');
194 -- store SQL error message on message stack for caller
195 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
196 ,p_count => x_msg_count
197 ,p_data => x_msg_data);
198 -- notify caller of an UNEXPECTED error
199 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
200
201 END create_acc_ccid;
202
203
204
205 PROCEDURE create_acc_ccid(p_api_version IN NUMBER
206 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
207 ,x_return_status OUT NOCOPY VARCHAR2
208 ,x_msg_count OUT NOCOPY NUMBER
209 ,x_msg_data OUT NOCOPY VARCHAR2
210 ,p_agcv_tbl IN agcv_tbl_type
211 ,x_agcv_tbl OUT NOCOPY agcv_tbl_type) IS
212
213
214 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
215 l_api_name CONSTANT VARCHAR2(30) := 'create_acc_ccid';
216 i NUMBER;
217
218 l_overall_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
219 l_agcv_tbl agcv_tbl_type := p_agcv_tbl;
220
221 BEGIN
222
223 --Initialize the return status
224 SAVEPOINT create_acc_ccid;
225 x_return_status := FND_API.G_RET_STS_SUCCESS;
226
227
228
229 -- customer pre-processing
230
231
232
233
234
235
236 -- vertical industry-preprocessing
237
238
239
240
241
242
243 IF (l_agcv_tbl.COUNT > 0) THEN
244
245 i := l_agcv_tbl.FIRST;
246
247 LOOP
248
249 OKL_ACC_GROUP_PUB.create_acc_ccid(
250 p_api_version => p_api_version
251 ,p_init_msg_list => p_init_msg_list
252 ,x_return_status => l_return_status
253 ,x_msg_count => x_msg_count
254 ,x_msg_data => x_msg_data
255 ,p_agcv_rec => l_agcv_tbl(i)
256 ,x_agcv_rec => x_agcv_tbl(i)
257 );
258
259 -- store the highest degree of error
260 IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
261 IF l_overall_status <> FND_API.G_RET_STS_UNEXP_ERROR THEN
262 l_overall_status := l_return_status;
263 END IF;
264 END IF;
265
266 EXIT WHEN (i = l_agcv_tbl.LAST);
267
268 i := l_agcv_tbl.NEXT(i);
269 END LOOP;
270
271 -- return overall status
272 l_return_status := l_overall_status;
273 END IF;
274
275 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
276 RAISE FND_API.G_EXC_ERROR;
277 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
278 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
279 END IF;
280
281 l_agcv_tbl := x_agcv_tbl;
282
283 -- vertical industry-post-processing
284
285
286
287
288
289
290 -- customer post-processing
291
292
293
294
295 EXCEPTION
296
297 WHEN FND_API.G_EXC_ERROR THEN
298 ROLLBACK TO create_acc_ccid;
299 x_return_status := FND_API.G_RET_STS_ERROR;
300
301 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
302 ,p_count => x_msg_count
303 ,p_data => x_msg_data);
304
305 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
306 ROLLBACK TO create_acc_ccid;
307 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
308 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
309 ,p_count => x_msg_count
310 ,p_data => x_msg_data);
311
312 WHEN OTHERS THEN
313 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','create_acc_ccid');
314 -- store SQL error message on message stack for caller
315 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
316 ,p_count => x_msg_count
317 ,p_data => x_msg_data);
318 -- notify caller of an UNEXPECTED error
319 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
320
321
322 END create_acc_ccid;
323
324
325
326 -- Object type procedure for update
327
328 PROCEDURE update_acc_group(p_api_version IN NUMBER,
329 p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE,
330 x_return_status OUT NOCOPY VARCHAR2,
331 x_msg_count OUT NOCOPY NUMBER,
332 x_msg_data OUT NOCOPY VARCHAR2,
333 p_agcv_rec IN agcv_rec_type,
334 p_agbv_tbl IN agbv_tbl_type,
335 x_agcv_rec OUT NOCOPY agcv_rec_type,
336 x_agbv_tbl OUT NOCOPY agbv_tbl_type) IS
337
338 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
339 l_api_name CONSTANT VARCHAR2(30) := 'update_acc_ccid';
340 l_agcv_rec agcv_rec_type := p_agcv_rec;
341 l_agbv_tbl agbv_tbl_type := p_agbv_tbl;
342
343
344
345 BEGIN
346
347 SAVEPOINT update_acc_group;
348 x_return_status := FND_API.G_RET_STS_SUCCESS;
349
350
351
352 -- customer pre-processing
353
354
355
356
357
358
359 -- vertical industry-preprocessing
360
361
362
363
364
365 -- call complex entity API
366
367
368
369 okl_acc_group_pvt.update_acc_group(p_api_version => p_api_version
370 ,p_init_msg_list => p_init_msg_list
371 ,x_return_status => x_return_status
372 ,x_msg_count => x_msg_count
373 ,x_msg_data => x_msg_data
374 ,p_agcv_rec => l_agcv_rec
375 ,p_agbv_tbl => l_agbv_tbl
376 ,x_agcv_rec => x_agcv_rec
377 ,x_agbv_tbl => x_agbv_tbl);
378
379 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
380 RAISE FND_API.G_EXC_ERROR;
381 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
382 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
383 END IF;
384
385 l_agcv_rec := x_agcv_rec;
386 l_agbv_tbl := x_agbv_tbl;
387
388 -- vertical industry-post processing
389
390
391
392
393
394 -- customer post-processing
395
396
397
398
399
400
401 EXCEPTION
402
403 WHEN FND_API.G_EXC_ERROR THEN
404 ROLLBACK TO update_acc_group;
405 x_return_status := FND_API.G_RET_STS_ERROR;
406
407 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
408 ,p_count => x_msg_count
409 ,p_data => x_msg_data);
410
411 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
412 ROLLBACK TO update_acc_group;
413 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
414 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
415 ,p_count => x_msg_count
416 ,p_data => x_msg_data);
417
418 WHEN OTHERS THEN
419 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','update_acc_ccid');
420 -- store SQL error message on message stack for caller
421 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
422 ,p_count => x_msg_count
423 ,p_data => x_msg_data);
424 -- notify caller of an UNEXPECTED error
425 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
426
427 END update_acc_group;
428
429
430
431 PROCEDURE validate_acc_group(p_api_version IN NUMBER
432 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
433 ,x_return_status OUT NOCOPY VARCHAR2
434 ,x_msg_count OUT NOCOPY NUMBER
435 ,x_msg_data OUT NOCOPY VARCHAR2
436 ,p_agcv_rec IN agcv_rec_type
437 ,p_agbv_tbl IN agbv_tbl_type) IS
438
439
440
441 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
442 l_api_name CONSTANT VARCHAR2(30) := 'validate_acc_ccid';
443 l_agcv_rec agcv_rec_type := p_agcv_rec;
444 l_agbv_tbl agbv_tbl_type := p_agbv_tbl;
445
446
447
448 BEGIN
449
450 SAVEPOINT validate_acc_group;
451 x_return_status := FND_API.G_RET_STS_SUCCESS;
452
456
453
454
455 -- customer pre-processing
457
458
459
460
461
462 -- vertical industry-preprocessing
463
464
465
466
467
468
469 -- call complex entity API
470
471 okl_acc_group_pvt.validate_acc_group(p_api_version => p_api_version
472 ,p_init_msg_list => p_init_msg_list
473 ,x_return_status => l_return_status
474 ,x_msg_count => x_msg_count
475 ,x_msg_data => x_msg_data
476 ,p_agcv_rec => l_agcv_rec
477 ,p_agbv_tbl => l_agbv_tbl);
478
479
480
481 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
482 RAISE FND_API.G_EXC_ERROR;
483 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
484 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
485 END IF;
486
487
488
489 -- vertical industry-post processing
490
491
492
493
494
495 -- customer post-processing
496
497
498
499
500
501 EXCEPTION
502
503 WHEN FND_API.G_EXC_ERROR THEN
504 ROLLBACK TO validate_acc_group;
505 x_return_status := FND_API.G_RET_STS_ERROR;
506
507 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
508 ,p_count => x_msg_count
509 ,p_data => x_msg_data);
510
511 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
512 ROLLBACK TO validate_acc_group;
513 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
514 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
515 ,p_count => x_msg_count
516 ,p_data => x_msg_data);
517
518 WHEN OTHERS THEN
519 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','validate_acc_group');
520 -- store SQL error message on message stack for caller
521 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
522 ,p_count => x_msg_count
523 ,p_data => x_msg_data);
524 -- notify caller of an UNEXPECTED error
525 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
526
527 END validate_acc_group;
528
529
530
531
532 PROCEDURE lock_acc_ccid(p_api_version IN NUMBER
533 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
534 ,x_return_status OUT NOCOPY VARCHAR2
535 ,x_msg_count OUT NOCOPY NUMBER
536 ,x_msg_data OUT NOCOPY VARCHAR2
537 ,p_agcv_rec IN agcv_rec_type)
538
539 IS
540
541
542 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
543 l_api_name CONSTANT VARCHAR2(30) := 'lock_acc_ccid';
544
545
546
547 BEGIN
548
549 x_return_status := FND_API.G_RET_STS_SUCCESS;
550
551 SAVEPOINT lock_acc_ccid;
552
553
554 okl_acc_group_pvt.lock_acc_ccid(
555 p_api_version => p_api_version
556 ,p_init_msg_list => p_init_msg_list
557 ,x_return_status => l_return_status
558 ,x_msg_count => x_msg_count
559 ,x_msg_data => x_msg_data
560 ,p_agcv_rec => p_agcv_rec);
561
562 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
563 RAISE FND_API.G_EXC_ERROR;
564 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
565 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
566 END IF;
567
568 EXCEPTION
569 WHEN FND_API.G_EXC_ERROR THEN
570 ROLLBACK TO lock_acc_ccid;
571 x_return_status := FND_API.G_RET_STS_ERROR;
572
573 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
574 ,p_count => x_msg_count
575 ,p_data => x_msg_data);
576
577 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
578 ROLLBACK TO lock_acc_ccid;
579 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
580 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
581 ,p_count => x_msg_count
582 ,p_data => x_msg_data);
583
584 WHEN OTHERS THEN
585 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','lock_acc_ccid');
586 -- store SQL error message on message stack for caller
587 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
588 ,p_count => x_msg_count
589 ,p_data => x_msg_data);
590 -- notify caller of an UNEXPECTED error
591 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
592
593 END lock_acc_ccid;
594
595
596
597 PROCEDURE lock_acc_ccid(p_api_version IN NUMBER
598 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
599 ,x_return_status OUT NOCOPY VARCHAR2
600 ,x_msg_count OUT NOCOPY NUMBER
601 ,x_msg_data OUT NOCOPY VARCHAR2
602 ,p_agcv_tbl IN agcv_tbl_type) IS
603
604
605 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
606 l_api_name CONSTANT VARCHAR2(30) := 'lock_acc_ccid';
607 i NUMBER;
608 l_overall_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
609
610
611
612 BEGIN
613
614 --Initialize the return status
615
616 x_return_status := FND_API.G_RET_STS_SUCCESS;
617 SAVEPOINT lock_acc_ccid;
618
619 IF (p_agcv_tbl.COUNT > 0) THEN
620
621 i := p_agcv_tbl.FIRST;
622
623 LOOP
624
625 OKL_ACC_GROUP_PUB.lock_acc_ccid(p_api_version => p_api_version
626 ,p_init_msg_list => p_init_msg_list
627 ,x_return_status => l_return_status
628 ,x_msg_count => x_msg_count
629 ,x_msg_data => x_msg_data
630 ,p_agcv_rec => p_agcv_tbl(i));
631
632 -- store the highest degree of error
633 IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
634 IF l_overall_status <> FND_API.G_RET_STS_UNEXP_ERROR THEN
635 l_overall_status := l_return_status;
636 END IF;
637 END IF;
638
639 EXIT WHEN (i = p_agcv_tbl.LAST);
640
641 i := p_agcv_tbl.NEXT(i);
642
643 END LOOP;
644
645 -- return overall status
646 l_return_status := l_overall_status;
647
648 END IF;
649
650 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
651 RAISE FND_API.G_EXC_ERROR;
652 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
653 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
654 END IF;
655
656 EXCEPTION
657 WHEN FND_API.G_EXC_ERROR THEN
658 ROLLBACK TO lock_acc_ccid;
659 x_return_status := FND_API.G_RET_STS_ERROR;
660
661 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
662 ,p_count => x_msg_count
663 ,p_data => x_msg_data);
664
665 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
666 ROLLBACK TO lock_acc_ccid;
667 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
668 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
669 ,p_count => x_msg_count
670 ,p_data => x_msg_data);
671
672 WHEN OTHERS THEN
673 FND_MSG_PUB.ADD_EXC_MSG('OKL_STREAM_TYPE_PUB','lock_acc_ccid');
674 -- store SQL error message on message stack for caller
675 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
676 ,p_count => x_msg_count
677 ,p_data => x_msg_data);
678 -- notify caller of an UNEXPECTED error
679 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
680
681 END lock_acc_ccid;
682
683
684
685 PROCEDURE update_acc_ccid(p_api_version IN NUMBER
686 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
687 ,x_return_status OUT NOCOPY VARCHAR2
688 ,x_msg_count OUT NOCOPY NUMBER
689 ,x_msg_data OUT NOCOPY VARCHAR2
690 ,p_agcv_rec IN agcv_rec_type
691 ,x_agcv_rec OUT NOCOPY agcv_rec_type) IS
692
693 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
694 l_api_name CONSTANT VARCHAR2(30) := 'update_acc_ccid';
695 l_agcv_rec agcv_rec_type := p_agcv_rec;
696
697 BEGIN
698
699 SAVEPOINT update_acc_ccid;
700 x_return_status := FND_API.G_RET_STS_SUCCESS;
701
702
703 -- customer pre-processing
704
705
706
707
708
709
710 -- vertical industry-preprocessing
711
712
713
714
715
716 -- call complex entity API
717
718 okl_acc_group_pvt.update_acc_ccid(p_api_version => p_api_version
719 ,p_init_msg_list => p_init_msg_list
720 ,x_return_status => l_return_status
721 ,x_msg_count => x_msg_count
722 ,x_msg_data => x_msg_data
723 ,p_agcv_rec => l_agcv_rec
724 ,x_agcv_rec => x_agcv_rec
725 );
726
727 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
728 RAISE FND_API.G_EXC_ERROR;
729 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
730 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
731 END IF;
732
733 l_agcv_rec := x_agcv_rec;
734
735 -- vertical industry-post-processing
736
737
738
739
740
741 -- customer post-processing
742
743
744
745
746 EXCEPTION
747
748 WHEN FND_API.G_EXC_ERROR THEN
749 ROLLBACK TO update_acc_ccid;
750 x_return_status := FND_API.G_RET_STS_ERROR;
751
752 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
753 ,p_count => x_msg_count
754 ,p_data => x_msg_data);
755
756 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
757 ROLLBACK TO update_acc_ccid;
758 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
759 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
760 ,p_count => x_msg_count
761 ,p_data => x_msg_data);
762
763 WHEN OTHERS THEN
764 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','update_acc_ccid');
765 -- store SQL error message on message stack for caller
766 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
767 ,p_count => x_msg_count
768 ,p_data => x_msg_data);
769 -- notify caller of an UNEXPECTED error
770 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
771
772 END update_acc_ccid;
773
774
775
776 PROCEDURE update_acc_ccid(p_api_version IN NUMBER
777 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
778 ,x_return_status OUT NOCOPY VARCHAR2
779 ,x_msg_count OUT NOCOPY NUMBER
780 ,x_msg_data OUT NOCOPY VARCHAR2
781 ,p_agcv_tbl IN agcv_tbl_type
782 ,x_agcv_tbl OUT NOCOPY agcv_tbl_type) IS
783
784 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
785 l_api_name CONSTANT VARCHAR2(30) := 'update_acc_ccid';
786 i NUMBER;
787
788 l_overall_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
789 l_agcv_tbl agcv_tbl_type := p_agcv_tbl;
790
791 BEGIN
792
793 --Initialize the return status
794
795 x_return_status := FND_API.G_RET_STS_SUCCESS;
796 SAVEPOINT update_acc_ccid;
797
798 -- customer pre-processing
799
800
801
802
803
804
805 -- vertical industry-preprocessing
806
807
808
809
810
811
812 IF (l_agcv_tbl.COUNT > 0) THEN
813
814 i := l_agcv_tbl.FIRST;
815
816 LOOP
817
818 update_acc_ccid(
819
820 p_api_version => p_api_version
821
822 ,p_init_msg_list => p_init_msg_list
823
824 ,x_return_status => l_return_status
825
826 ,x_msg_count => x_msg_count
827
828 ,x_msg_data => x_msg_data
829
830 ,p_agcv_rec => l_agcv_tbl(i)
831
832 ,x_agcv_rec => x_agcv_tbl(i)
833
834 );
835 -- store the highest degree of error
836 IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
837 IF l_overall_status <> FND_API.G_RET_STS_UNEXP_ERROR THEN
838 l_overall_status := l_return_status;
839 END IF;
840 END IF;
841
842 EXIT WHEN (i = l_agcv_tbl.LAST);
843
844 i := l_agcv_tbl.NEXT(i);
845
846 END LOOP;
847
848 -- return overall status
849 l_return_status := l_overall_status;
850 END IF;
851
852 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
853 RAISE FND_API.G_EXC_ERROR;
854 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
855 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
856 END IF;
857
858
859 l_agcv_tbl := x_agcv_tbl;
860
861 -- vertical industry-post-processing
862
863
864
865
866
867
868 -- customer post-processing
869
870
871
872
873
874
875 EXCEPTION
876
877 WHEN FND_API.G_EXC_ERROR THEN
878 ROLLBACK TO update_acc_ccid;
879 x_return_status := FND_API.G_RET_STS_ERROR;
880
881 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
882 ,p_count => x_msg_count
883 ,p_data => x_msg_data);
884
885 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
886 ROLLBACK TO update_acc_ccid;
887 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
888 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
889 ,p_count => x_msg_count
890 ,p_data => x_msg_data);
891
892 WHEN OTHERS THEN
893 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','update_acc_ccid');
894 -- store SQL error message on message stack for caller
895 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
896 ,p_count => x_msg_count
897 ,p_data => x_msg_data);
898 -- notify caller of an UNEXPECTED error
899 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
900
901
902
903 END update_acc_ccid;
904
905
906
907 --Put custom code for cascade delete by developer
908
909 PROCEDURE delete_acc_ccid(
910
911 p_api_version IN NUMBER
912
913 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
914
915 ,x_return_status OUT NOCOPY VARCHAR2
916
917 ,x_msg_count OUT NOCOPY NUMBER
918
919 ,x_msg_data OUT NOCOPY VARCHAR2
920
921 ,p_agcv_rec IN agcv_rec_type) IS
922
923 i NUMBER :=0;
924
925 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
926
927 l_api_name CONSTANT VARCHAR2(30) := 'delete_acc_ccid';
928
929 l_agcv_rec agcv_rec_type := p_agcv_rec;
930
931
932
933 BEGIN
934
935 SAVEPOINT delete_acc_ccid;
936 x_return_status := FND_API.G_RET_STS_SUCCESS;
937
938
939
940 -- customer pre-processing
941
942
943
944
945
946
947 -- vertical industry-preprocessing
948
949
950
951
952
953
954 -- call complex entity API
955
956 okl_acc_group_pvt.delete_acc_ccid(
957
958 p_api_version => p_api_version
959
960 ,p_init_msg_list => p_init_msg_list
961
962 ,x_return_status => l_return_status
963
964 ,x_msg_count => x_msg_count
965
966 ,x_msg_data => x_msg_data
967
968 ,p_agcv_rec => l_agcv_rec
969
970 );
971
972
973
974 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
975 RAISE FND_API.G_EXC_ERROR;
976 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
977 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
978 END IF;
979
980
981
982 -- vertical industry-post-processing
983
984
985
986
987
988
989 -- customer post-processing
990
991
992
993
994
995
996 EXCEPTION
997
998 WHEN FND_API.G_EXC_ERROR THEN
999 ROLLBACK TO delete_acc_ccid;
1000 x_return_status := FND_API.G_RET_STS_ERROR;
1001
1002 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1003 ,p_count => x_msg_count
1004 ,p_data => x_msg_data);
1005
1006 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1007 ROLLBACK TO delete_acc_ccid;
1008 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1009 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1010 ,p_count => x_msg_count
1011 ,p_data => x_msg_data);
1012
1013 WHEN OTHERS THEN
1014 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','delete_acc_ccid');
1015 -- store SQL error message on message stack for caller
1016 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1017 ,p_count => x_msg_count
1018 ,p_data => x_msg_data);
1022 END delete_acc_ccid;
1019 -- notify caller of an UNEXPECTED error
1020 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1021
1023
1024
1025
1026 PROCEDURE delete_acc_ccid(
1027
1028 p_api_version IN NUMBER
1029
1030 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1031
1032 ,x_return_status OUT NOCOPY VARCHAR2
1033
1034 ,x_msg_count OUT NOCOPY NUMBER
1035
1036 ,x_msg_data OUT NOCOPY VARCHAR2
1037
1038 ,p_agcv_tbl IN agcv_tbl_type) IS
1039
1040 i NUMBER :=0;
1041
1042 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
1043
1044 l_api_name CONSTANT VARCHAR2(30) := 'delete_acc_ccid';
1045
1046 l_overall_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
1047
1048 l_agcv_tbl agcv_tbl_type := p_agcv_tbl;
1049
1050 BEGIN
1051
1052 --Initialize the return status
1053
1054 x_return_status := FND_API.G_RET_STS_SUCCESS;
1055 SAVEPOINT delete_acc_ccid;
1056
1057 -- customer pre-processing
1058
1059
1060
1061
1062
1063
1064 -- vertical industry-preprocessing
1065
1066
1067
1068
1069
1070
1071 IF (l_agcv_tbl.COUNT > 0) THEN
1072
1073 i := l_agcv_tbl.FIRST;
1074
1075 LOOP
1076
1077 delete_acc_ccid(
1078
1079 p_api_version => p_api_version
1080
1081 ,p_init_msg_list => p_init_msg_list
1082
1083 ,x_return_status => l_return_status
1084
1085 ,x_msg_count => x_msg_count
1086
1087 ,x_msg_data => x_msg_data
1088
1089 ,p_agcv_rec => l_agcv_tbl(i)
1090
1091 );
1092
1093 -- store the highest degree of error
1094 IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1095 IF l_overall_status <> FND_API.G_RET_STS_UNEXP_ERROR THEN
1096 l_overall_status := l_return_status;
1097 END IF;
1098 END IF;
1099
1100 EXIT WHEN (i = l_agcv_tbl.LAST);
1101
1102 i := l_agcv_tbl.NEXT(i);
1103
1104 END LOOP;
1105 -- return overall status
1106 l_return_status := l_overall_status;
1107
1108 END IF;
1109
1110 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1111 RAISE FND_API.G_EXC_ERROR;
1112 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1113 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1114 END IF;
1115
1116
1117
1118 -- vertical industry-post-processing
1119
1120
1121
1122
1123
1124
1125 -- customer post-processing
1126
1127
1128
1129
1130
1131
1132 EXCEPTION
1133
1134 WHEN FND_API.G_EXC_ERROR THEN
1135 ROLLBACK TO delete_acc_ccid;
1136 x_return_status := FND_API.G_RET_STS_ERROR;
1137
1138 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1139 ,p_count => x_msg_count
1140 ,p_data => x_msg_data);
1141
1142 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1143 ROLLBACK TO delete_acc_ccid;
1144 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1145 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1146 ,p_count => x_msg_count
1147 ,p_data => x_msg_data);
1148
1149 WHEN OTHERS THEN
1150 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','delete_acc_ccid');
1151 -- store SQL error message on message stack for caller
1152 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1153 ,p_count => x_msg_count
1154 ,p_data => x_msg_data);
1155 -- notify caller of an UNEXPECTED error
1156 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1157
1158
1159
1160 END delete_acc_ccid;
1161
1162
1163
1164 PROCEDURE validate_acc_ccid(
1165
1166 p_api_version IN NUMBER
1167
1168 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1169
1170 ,x_return_status OUT NOCOPY VARCHAR2
1171
1175
1172 ,x_msg_count OUT NOCOPY NUMBER
1173
1174 ,x_msg_data OUT NOCOPY VARCHAR2
1176 ,p_agcv_rec IN agcv_rec_type) IS
1177
1178 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
1179
1180 l_api_name CONSTANT VARCHAR2(30) := 'validate_acc_ccid';
1181
1182 l_agcv_rec agcv_rec_type := p_agcv_rec;
1183
1184
1185
1186 BEGIN
1187
1188 SAVEPOINT validate_acc_ccid;
1189 x_return_status := FND_API.G_RET_STS_SUCCESS;
1190
1191
1192
1193 -- customer pre-processing
1194
1195
1196
1197
1198
1199
1200 -- vertical industry-preprocessing
1201
1202
1203
1204
1205
1206
1207 -- call complex entity API
1208
1209
1210
1211 okl_acc_group_pvt.validate_acc_ccid(
1212
1213 p_api_version => p_api_version
1214
1215 ,p_init_msg_list => p_init_msg_list
1216
1217 ,x_return_status => l_return_status
1218
1219 ,x_msg_count => x_msg_count
1220
1221 ,x_msg_data => x_msg_data
1222
1223 ,p_agcv_rec => l_agcv_rec
1224
1225 );
1226
1227 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1228 RAISE FND_API.G_EXC_ERROR;
1229 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1230 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1231 END IF;
1232
1233
1234
1235 -- vertical industry-post-processing
1236
1237
1238
1239
1240
1241
1242 -- customer post-processing
1243
1244
1245
1246
1247
1248
1249 EXCEPTION
1250
1251 WHEN FND_API.G_EXC_ERROR THEN
1252 ROLLBACK TO validate_acc_ccid;
1253 x_return_status := FND_API.G_RET_STS_ERROR;
1254
1255 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1256 ,p_count => x_msg_count
1257 ,p_data => x_msg_data);
1258
1259 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1260 ROLLBACK TO validate_acc_ccid;
1261 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1262 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1263 ,p_count => x_msg_count
1264 ,p_data => x_msg_data);
1265
1266 WHEN OTHERS THEN
1267 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','validate_acc_ccid');
1268 -- store SQL error message on message stack for caller
1269 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1270 ,p_count => x_msg_count
1271 ,p_data => x_msg_data);
1272 -- notify caller of an UNEXPECTED error
1273 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1274
1275 END validate_acc_ccid;
1276
1277
1278
1279 PROCEDURE validate_acc_ccid(
1280
1281 p_api_version IN NUMBER,
1282
1286
1283 p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE,
1284
1285 x_return_status OUT NOCOPY VARCHAR2,
1287 x_msg_count OUT NOCOPY NUMBER,
1288
1289 x_msg_data OUT NOCOPY VARCHAR2,
1290
1291 p_agcv_tbl IN agcv_tbl_type) IS
1292
1293 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
1294
1295 l_api_name CONSTANT VARCHAR2(30) := 'validate_acc_ccid';
1296
1297 i NUMBER;
1298
1299 l_overall_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
1300
1301 l_agcv_tbl agcv_tbl_type := p_agcv_tbl;
1302
1303 BEGIN
1304
1305 --Initialize the return status
1306
1307 x_return_status := FND_API.G_RET_STS_SUCCESS;
1308 SAVEPOINT validate_acc_ccid;
1309
1310 -- customer pre-processing
1311
1312
1313
1314
1315
1316
1317 -- vertical industry-preprocessing
1318
1319
1320
1321
1322
1323 IF (l_agcv_tbl.COUNT > 0) THEN
1324
1325 i := l_agcv_tbl.FIRST;
1326
1327 LOOP
1328
1329 validate_acc_ccid(
1330
1331 p_api_version => p_api_version
1332
1333 ,p_init_msg_list => p_init_msg_list
1334
1335 ,x_return_status => l_return_status
1336
1337 ,x_msg_count => x_msg_count
1338
1339 ,x_msg_data => x_msg_data
1340
1341 ,p_agcv_rec => l_agcv_tbl(i)
1342
1343 );
1344 -- store the highest degree of error
1345 IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1346 IF l_overall_status <> FND_API.G_RET_STS_UNEXP_ERROR THEN
1347 l_overall_status := l_return_status;
1348 END IF;
1349 END IF;
1350
1351 EXIT WHEN (i = l_agcv_tbl.LAST);
1352
1353 i := l_agcv_tbl.NEXT(i);
1354
1355 END LOOP;
1356 -- return overall status
1357 l_return_status := l_overall_status;
1358
1359 END IF;
1360
1361 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1362 RAISE FND_API.G_EXC_ERROR;
1363 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1364 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1365 END IF;
1366
1367
1368
1369 -- vertical industry-post-processing
1370
1371
1372
1373
1374
1375
1376 -- customer post-processing
1377
1378
1379
1380
1381
1382
1383 EXCEPTION
1384
1385 WHEN FND_API.G_EXC_ERROR THEN
1386 ROLLBACK TO validate_acc_ccid;
1387 x_return_status := FND_API.G_RET_STS_ERROR;
1388
1389 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1390 ,p_count => x_msg_count
1391 ,p_data => x_msg_data);
1392
1393 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1394 ROLLBACK TO validate_acc_ccid;
1395 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1396 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1397 ,p_count => x_msg_count
1398 ,p_data => x_msg_data);
1399
1400 WHEN OTHERS THEN
1401 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','validate_acc_ccid');
1402 -- store SQL error message on message stack for caller
1403 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1404 ,p_count => x_msg_count
1405 ,p_data => x_msg_data);
1406 -- notify caller of an UNEXPECTED error
1407 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1408
1409
1410 END validate_acc_ccid;
1411
1412
1413
1414 PROCEDURE create_acc_bal(
1415
1416 p_api_version IN NUMBER
1417
1418 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1419
1420 ,x_return_status OUT NOCOPY VARCHAR2
1421
1422 ,x_msg_count OUT NOCOPY NUMBER
1423
1424 ,x_msg_data OUT NOCOPY VARCHAR2
1425
1426 ,p_agbv_rec IN agbv_rec_type
1427
1428 ,x_agbv_rec OUT NOCOPY agbv_rec_type) IS
1429
1430 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
1431
1432 l_api_name CONSTANT VARCHAR2(30) := 'create_acc_bal';
1433
1434 l_agbv_rec agbv_rec_type := p_agbv_rec;
1435
1436 BEGIN
1437
1438 SAVEPOINT create_acc_bal;
1442
1439 x_return_status := FND_API.G_RET_STS_SUCCESS;
1440
1441
1443 -- customer pre-processing
1444
1445
1446
1447
1448
1449
1450 -- vertical industry-preprocessing
1451
1452
1453
1454
1455
1456
1457 -- call complex entity API
1458
1459
1460
1461
1462
1463 okl_acc_group_pvt.create_acc_bal(
1464
1465 p_api_version => p_api_version
1466
1467 ,p_init_msg_list => p_init_msg_list
1468
1469 ,x_return_status => l_return_status
1470
1471 ,x_msg_count => x_msg_count
1472
1473 ,x_msg_data => x_msg_data
1474
1475 ,p_agbv_rec => l_agbv_rec
1476
1477 ,x_agbv_rec => x_agbv_rec
1478
1479 );
1480
1481 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1482 RAISE FND_API.G_EXC_ERROR;
1483 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1484 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1485 END IF;
1486
1487 l_agbv_rec := x_agbv_rec;
1488
1489 -- vertical industry-post-processing
1490
1491
1492
1493
1494
1495
1496 -- customer post-processing
1497
1498
1499
1500
1501
1502
1503 EXCEPTION
1504
1505 WHEN FND_API.G_EXC_ERROR THEN
1506 ROLLBACK TO create_acc_bal;
1507 x_return_status := FND_API.G_RET_STS_ERROR;
1508
1509 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1510 ,p_count => x_msg_count
1511 ,p_data => x_msg_data);
1512
1513 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1514 ROLLBACK TO create_acc_bal;
1515 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1516 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1517 ,p_count => x_msg_count
1518 ,p_data => x_msg_data);
1519
1520 WHEN OTHERS THEN
1521 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','create_acc_bal');
1522 -- store SQL error message on message stack for caller
1523 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1524 ,p_count => x_msg_count
1525 ,p_data => x_msg_data);
1526 -- notify caller of an UNEXPECTED error
1527 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1528
1529 END create_acc_bal;
1530
1531
1532
1533 PROCEDURE create_acc_bal(
1534
1535 p_api_version IN NUMBER
1536
1537 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1538
1539 ,x_return_status OUT NOCOPY VARCHAR2
1540
1541 ,x_msg_count OUT NOCOPY NUMBER
1542
1543 ,x_msg_data OUT NOCOPY VARCHAR2
1544
1545 ,p_agbv_tbl IN agbv_tbl_type
1546
1550
1547 ,x_agbv_tbl OUT NOCOPY agbv_tbl_type) IS
1548
1549 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
1551 l_api_name CONSTANT VARCHAR2(30) := 'create_acc_bal';
1552
1553 i NUMBER;
1554
1555 l_overall_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
1556
1557 l_agbv_tbl agbv_tbl_type := p_agbv_tbl;
1558
1559 BEGIN
1560
1561 --Initialize the return status
1562 SAVEPOINT create_acc_bal;
1563 x_return_status := FND_API.G_RET_STS_SUCCESS;
1564
1565
1566
1567 -- customer pre-processing
1568
1569
1570
1571
1572
1573
1574 -- vertical industry-preprocessing
1575
1576
1577
1578
1579
1580
1581 IF (l_agbv_tbl.COUNT > 0) THEN
1582
1583 i := l_agbv_tbl.FIRST;
1584
1585 LOOP
1586
1587 create_acc_bal(
1588
1589 p_api_version => p_api_version
1590
1591 ,p_init_msg_list => p_init_msg_list
1592
1593 ,x_return_status => l_return_status
1594
1595 ,x_msg_count => x_msg_count
1596
1597 ,x_msg_data => x_msg_data
1598
1599 ,p_agbv_rec => l_agbv_tbl(i)
1600
1601 ,x_agbv_rec => x_agbv_tbl(i)
1602
1603 );
1604 -- store the highest degree of error
1605 IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1606 IF l_overall_status <> FND_API.G_RET_STS_UNEXP_ERROR THEN
1607 l_overall_status := l_return_status;
1608 END IF;
1609 END IF;
1610
1611 EXIT WHEN (i = l_agbv_tbl.LAST);
1612
1613 i := l_agbv_tbl.NEXT(i);
1614
1615 END LOOP;
1616 -- return overall status
1617 l_return_status := l_overall_status;
1618
1619 END IF;
1620
1621 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1622 RAISE FND_API.G_EXC_ERROR;
1623 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1624 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1625 END IF;
1626
1627
1628 l_agbv_tbl := x_agbv_tbl;
1629
1630 -- vertical industry-post-processing
1631
1632
1633
1634
1635
1636
1637 -- customer post-processing
1638
1639
1640
1641
1642
1643
1644 EXCEPTION
1645
1646 WHEN FND_API.G_EXC_ERROR THEN
1647 ROLLBACK TO create_acc_bal;
1648 x_return_status := FND_API.G_RET_STS_ERROR;
1649
1650 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1651 ,p_count => x_msg_count
1652 ,p_data => x_msg_data);
1653
1654 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1655 ROLLBACK TO create_acc_bal;
1656 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1657 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1658 ,p_count => x_msg_count
1662 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','create_acc_bal');
1659 ,p_data => x_msg_data);
1660
1661 WHEN OTHERS THEN
1663 -- store SQL error message on message stack for caller
1664 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1665 ,p_count => x_msg_count
1666 ,p_data => x_msg_data);
1667 -- notify caller of an UNEXPECTED error
1668 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1669
1670
1671
1672 END create_acc_bal;
1673
1674
1675
1676 PROCEDURE lock_acc_bal(
1677
1678 p_api_version IN NUMBER
1679
1680 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1681
1682 ,x_return_status OUT NOCOPY VARCHAR2
1683
1684 ,x_msg_count OUT NOCOPY NUMBER
1685
1686 ,x_msg_data OUT NOCOPY VARCHAR2
1687
1688 ,p_agbv_rec IN agbv_rec_type) IS
1689
1690 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
1691
1692 l_api_name CONSTANT VARCHAR2(30) := 'lock_acc_bal';
1693
1694 BEGIN
1695
1696 x_return_status := FND_API.G_RET_STS_SUCCESS;
1697 SAVEPOINT lock_acc_bal;
1698
1699 okl_acc_group_pvt.lock_acc_bal(
1700
1701 p_api_version => p_api_version
1702
1703 ,p_init_msg_list => p_init_msg_list
1704
1705 ,x_return_status => l_return_status
1706
1707 ,x_msg_count => x_msg_count
1708
1709 ,x_msg_data => x_msg_data
1710
1711 ,p_agbv_rec => p_agbv_rec
1712
1713 );
1714
1715 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1716 RAISE FND_API.G_EXC_ERROR;
1717 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1718 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1719 END IF;
1720
1721 EXCEPTION
1722 WHEN FND_API.G_EXC_ERROR THEN
1723 ROLLBACK TO lock_acc_bal;
1724 x_return_status := FND_API.G_RET_STS_ERROR;
1725
1726 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1727 ,p_count => x_msg_count
1728 ,p_data => x_msg_data);
1729
1730 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1731 ROLLBACK TO lock_acc_bal;
1732 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1733 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1734 ,p_count => x_msg_count
1735 ,p_data => x_msg_data);
1736
1737 WHEN OTHERS THEN
1738 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','lock_acc_bal');
1739 -- store SQL error message on message stack for caller
1740 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1741 ,p_count => x_msg_count
1742 ,p_data => x_msg_data);
1743 -- notify caller of an UNEXPECTED error
1744 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1748
1745
1746 END lock_acc_bal;
1747
1749
1750 PROCEDURE lock_acc_bal(
1751
1752 p_api_version IN NUMBER
1753
1754 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1755
1756 ,x_return_status OUT NOCOPY VARCHAR2
1757
1758 ,x_msg_count OUT NOCOPY NUMBER
1759
1760 ,x_msg_data OUT NOCOPY VARCHAR2
1761
1762 ,p_agbv_tbl IN agbv_tbl_type) IS
1763
1764 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
1765
1766 l_api_name CONSTANT VARCHAR2(30) := 'lock_acc_bal';
1767
1768 i NUMBER;
1769
1770 l_overall_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
1771
1772
1773 BEGIN
1774
1775 --Initialize the return status
1776
1777 x_return_status := FND_API.G_RET_STS_SUCCESS;
1778 SAVEPOINT lock_acc_bal;
1779
1780 IF (p_agbv_tbl.COUNT > 0) THEN
1781
1782 i := p_agbv_tbl.FIRST;
1783
1784 LOOP
1785
1786 lock_acc_bal(
1787
1788 p_api_version => p_api_version
1789
1790 ,p_init_msg_list => p_init_msg_list
1791
1792 ,x_return_status => l_return_status
1793
1794 ,x_msg_count => x_msg_count
1795
1796 ,x_msg_data => x_msg_data
1797
1798 ,p_agbv_rec => p_agbv_tbl(i)
1799
1800 );
1801 -- store the highest degree of error
1802 IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1803 IF l_overall_status <> FND_API.G_RET_STS_UNEXP_ERROR THEN
1804 l_overall_status := l_return_status;
1805 END IF;
1806 END IF;
1807
1808 EXIT WHEN (i = p_agbv_tbl.LAST);
1809
1810 i := p_agbv_tbl.NEXT(i);
1811
1812 END LOOP;
1813
1814 -- return overall status
1815 l_return_status := l_overall_status;
1816
1817 END IF;
1818
1819 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1820 RAISE FND_API.G_EXC_ERROR;
1821 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1822 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1823 END IF;
1824
1825 EXCEPTION
1826 WHEN FND_API.G_EXC_ERROR THEN
1827 ROLLBACK TO lock_acc_bal;
1828 x_return_status := FND_API.G_RET_STS_ERROR;
1829
1830 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1831 ,p_count => x_msg_count
1832 ,p_data => x_msg_data);
1833
1834 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1835 ROLLBACK TO lock_acc_bal;
1836 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1837 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1838 ,p_count => x_msg_count
1839 ,p_data => x_msg_data);
1840
1841 WHEN OTHERS THEN
1842 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','lock_acc_bal');
1843 -- store SQL error message on message stack for caller
1847 -- notify caller of an UNEXPECTED error
1844 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1845 ,p_count => x_msg_count
1846 ,p_data => x_msg_data);
1848 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1849
1850 END lock_acc_bal;
1851
1852
1853
1854 PROCEDURE update_acc_bal(
1855
1856 p_api_version IN NUMBER
1857
1858 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1859
1860 ,x_return_status OUT NOCOPY VARCHAR2
1861
1862 ,x_msg_count OUT NOCOPY NUMBER
1863
1864 ,x_msg_data OUT NOCOPY VARCHAR2
1865
1866 ,p_agbv_rec IN agbv_rec_type
1867
1868 ,x_agbv_rec OUT NOCOPY agbv_rec_type) IS
1869
1870 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
1871
1872 l_api_name CONSTANT VARCHAR2(30) := 'update_acc_bal';
1873
1874 l_agbv_rec agbv_rec_type := p_agbv_rec;
1875
1876 BEGIN
1877
1878 SAVEPOINT update_acc_bal;
1879 x_return_status := FND_API.G_RET_STS_SUCCESS;
1880
1881
1882
1883 -- customer pre-processing
1884
1885
1886
1887
1888
1889
1890 -- vertical industry-preprocessing
1891
1892
1893
1894
1895
1896
1897 -- call complex entity API
1898
1899 okl_acc_group_pvt.update_acc_bal(
1900
1901 p_api_version => p_api_version
1902
1903 ,p_init_msg_list => p_init_msg_list
1904
1905 ,x_return_status => l_return_status
1906
1907 ,x_msg_count => x_msg_count
1908
1909 ,x_msg_data => x_msg_data
1910
1911 ,p_agbv_rec => l_agbv_rec
1912
1913 ,x_agbv_rec => x_agbv_rec
1914
1915 );
1916
1917 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1918 RAISE FND_API.G_EXC_ERROR;
1919 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1920 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1921 END IF;
1922
1923 l_agbv_rec := x_agbv_rec;
1924
1925 -- vertical industry-post-processing
1926
1927
1928
1929
1930
1931
1932 -- customer post-processing
1933
1934
1935
1936
1937
1938
1939 EXCEPTION
1940
1941 WHEN FND_API.G_EXC_ERROR THEN
1942 ROLLBACK TO update_acc_bal;
1943 x_return_status := FND_API.G_RET_STS_ERROR;
1944
1945 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1946 ,p_count => x_msg_count
1947 ,p_data => x_msg_data);
1948
1949 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1950 ROLLBACK TO update_acc_bal;
1951 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1952 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1956 WHEN OTHERS THEN
1953 ,p_count => x_msg_count
1954 ,p_data => x_msg_data);
1955
1957 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','update_acc_bal');
1958 -- store SQL error message on message stack for caller
1959 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
1960 ,p_count => x_msg_count
1961 ,p_data => x_msg_data);
1962 -- notify caller of an UNEXPECTED error
1963 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1964
1965 END update_acc_bal;
1966
1967
1968
1969 PROCEDURE update_acc_bal(
1970
1971 p_api_version IN NUMBER
1972
1973 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1974
1975 ,x_return_status OUT NOCOPY VARCHAR2
1976
1977 ,x_msg_count OUT NOCOPY NUMBER
1978
1979 ,x_msg_data OUT NOCOPY VARCHAR2
1980
1981 ,p_agbv_tbl IN agbv_tbl_type
1982
1983 ,x_agbv_tbl OUT NOCOPY agbv_tbl_type) IS
1984
1985 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
1986
1987 l_api_name CONSTANT VARCHAR2(30) := 'update_acc_bal';
1988
1989 i NUMBER;
1990
1991 l_overall_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
1992
1993 l_agbv_tbl agbv_tbl_type := p_agbv_tbl;
1994
1995 BEGIN
1996
1997 --Initialize the return status
1998 SAVEPOINT update_acc_bal;
1999 x_return_status := FND_API.G_RET_STS_SUCCESS;
2000
2001
2002
2003 -- customer pre-processing
2004
2005
2006
2007
2008
2009
2010 -- vertical industry-preprocessing
2011
2012
2013
2014
2015
2016
2017 IF (l_agbv_tbl.COUNT > 0) THEN
2018
2019 i := l_agbv_tbl.FIRST;
2020
2021 LOOP
2022
2023 update_acc_bal(
2024
2025 p_api_version => p_api_version
2026
2027 ,p_init_msg_list => p_init_msg_list
2028
2029 ,x_return_status => l_return_status
2030
2031 ,x_msg_count => x_msg_count
2032
2033 ,x_msg_data => x_msg_data
2034
2035 ,p_agbv_rec => l_agbv_tbl(i)
2036
2037 ,x_agbv_rec => x_agbv_tbl(i)
2038
2039 );
2040 -- store the highest degree of error
2041 IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2042 IF l_overall_status <> FND_API.G_RET_STS_UNEXP_ERROR THEN
2043 l_overall_status := l_return_status;
2044 END IF;
2045 END IF;
2046
2047 EXIT WHEN (i = l_agbv_tbl.LAST);
2048
2049 i := l_agbv_tbl.NEXT(i);
2050
2051 END LOOP;
2052 -- return overall status
2053 l_return_status := l_overall_status;
2054
2055 END IF;
2056
2057 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2058 RAISE FND_API.G_EXC_ERROR;
2059 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2060 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2061 END IF;
2062
2063 l_agbv_tbl := x_agbv_tbl;
2064
2065 -- vertical industry-post-processing
2066
2067
2068
2069
2070
2071
2072 -- customer post-processing
2073
2074
2075
2076
2077
2078
2079 EXCEPTION
2080
2084
2081 WHEN FND_API.G_EXC_ERROR THEN
2082 ROLLBACK TO update_acc_bal;
2083 x_return_status := FND_API.G_RET_STS_ERROR;
2085 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
2086 ,p_count => x_msg_count
2087 ,p_data => x_msg_data);
2088
2089 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2090 ROLLBACK TO update_acc_bal;
2091 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2092 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
2093 ,p_count => x_msg_count
2094 ,p_data => x_msg_data);
2095
2096 WHEN OTHERS THEN
2097 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','update_acc_bal');
2098 -- store SQL error message on message stack for caller
2099 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
2100 ,p_count => x_msg_count
2101 ,p_data => x_msg_data);
2102 -- notify caller of an UNEXPECTED error
2103 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2104
2105
2106
2107 END update_acc_bal;
2108
2109
2110
2111 --Put custom code for cascade delete by developer
2112
2113 PROCEDURE delete_acc_bal(
2114
2115 p_api_version IN NUMBER
2116
2117 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
2118
2119 ,x_return_status OUT NOCOPY VARCHAR2
2120
2121 ,x_msg_count OUT NOCOPY NUMBER
2122
2123 ,x_msg_data OUT NOCOPY VARCHAR2
2124
2125 ,p_agbv_rec IN agbv_rec_type) IS
2126
2127 i NUMBER :=0;
2128
2129 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
2130
2131 l_api_name CONSTANT VARCHAR2(30) := 'delete_acc_bal';
2132
2133 l_agbv_rec agbv_rec_type := p_agbv_rec;
2134
2135 BEGIN
2136
2137 SAVEPOINT delete_acc_bal;
2138 x_return_status := FND_API.G_RET_STS_SUCCESS;
2139
2140
2141
2142 -- customer pre-processing
2143
2144
2145
2146
2147
2148
2149 -- vertical industry-preprocessing
2150
2151
2152
2153
2154
2155
2156 -- call complex entity API
2157
2158
2159
2160 okl_acc_group_pvt.delete_acc_bal(
2161
2162 p_api_version => p_api_version
2163
2164 ,p_init_msg_list => p_init_msg_list
2165
2166 ,x_return_status => l_return_status
2167
2168 ,x_msg_count => x_msg_count
2169
2170 ,x_msg_data => x_msg_data
2171
2172 ,p_agbv_rec => l_agbv_rec);
2173
2174 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2175 RAISE FND_API.G_EXC_ERROR;
2176 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2177 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2178 END IF;
2179
2180
2181
2182 -- vertical industry-post-processing
2183
2184
2185
2186
2187
2188
2189 -- customer post-processing
2190
2191
2192
2193
2194
2195
2196 EXCEPTION
2197
2198 WHEN FND_API.G_EXC_ERROR THEN
2199 ROLLBACK TO delete_acc_bal;
2200 x_return_status := FND_API.G_RET_STS_ERROR;
2201
2202 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
2203 ,p_count => x_msg_count
2204 ,p_data => x_msg_data);
2205
2206 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2207 ROLLBACK TO delete_acc_bal;
2211 ,p_data => x_msg_data);
2208 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2209 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
2210 ,p_count => x_msg_count
2212
2213 WHEN OTHERS THEN
2214 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','delete_acc_bal');
2215 -- store SQL error message on message stack for caller
2216 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
2217 ,p_count => x_msg_count
2218 ,p_data => x_msg_data);
2219 -- notify caller of an UNEXPECTED error
2220 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2221
2222 END delete_acc_bal;
2223
2224
2225
2226 PROCEDURE delete_acc_bal(
2227
2228 p_api_version IN NUMBER
2229
2230 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
2231
2232 ,x_return_status OUT NOCOPY VARCHAR2
2233
2234 ,x_msg_count OUT NOCOPY NUMBER
2235
2236 ,x_msg_data OUT NOCOPY VARCHAR2
2237
2238 ,p_agbv_tbl IN agbv_tbl_type) IS
2239
2240
2241
2242 i NUMBER :=0;
2243
2244 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
2245
2246 l_api_name CONSTANT VARCHAR2(30) := 'delete_acc_bal';
2247
2248 l_overall_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
2249
2250 l_agbv_tbl agbv_tbl_type := p_agbv_tbl;
2251
2252 BEGIN
2253
2254 --Initialize the return status
2255 SAVEPOINT delete_acc_bal;
2256 x_return_status := FND_API.G_RET_STS_SUCCESS;
2257
2258
2259
2260 -- customer pre-processing
2261
2262
2263
2264
2265
2266
2267 -- vertical industry-preprocessing
2268
2269
2270
2271
2272
2273
2274 IF (l_agbv_tbl.COUNT > 0) THEN
2275
2276 i := l_agbv_tbl.FIRST;
2277
2278 LOOP
2279
2280 delete_acc_bal(
2281
2282 p_api_version => p_api_version
2283
2284 ,p_init_msg_list => p_init_msg_list
2285
2286 ,x_return_status => l_return_status
2287
2288 ,x_msg_count => x_msg_count
2289
2290 ,x_msg_data => x_msg_data
2291
2292 ,p_agbv_rec => l_agbv_tbl(i));
2293 -- store the highest degree of error
2294 IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2295 IF l_overall_status <> FND_API.G_RET_STS_UNEXP_ERROR THEN
2296 l_overall_status := l_return_status;
2297 END IF;
2298 END IF;
2299
2300 EXIT WHEN (i = l_agbv_tbl.LAST);
2301
2302 i := l_agbv_tbl.NEXT(i);
2303
2304 END LOOP;
2305 -- return overall status
2306 l_return_status := l_overall_status;
2307
2308 END IF;
2309
2310 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2311 RAISE FND_API.G_EXC_ERROR;
2312 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2313 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2314 END IF;
2315
2316
2317
2318 -- vertical industry-post-processing
2319
2320
2321
2322
2323
2324
2325 -- customer post-processing
2326
2327
2328
2329
2330
2331
2332 EXCEPTION
2333
2334 WHEN FND_API.G_EXC_ERROR THEN
2335 ROLLBACK TO delete_acc_bal;
2336 x_return_status := FND_API.G_RET_STS_ERROR;
2337
2341
2338 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
2339 ,p_count => x_msg_count
2340 ,p_data => x_msg_data);
2342 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2343 ROLLBACK TO delete_acc_bal;
2344 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2345 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
2346 ,p_count => x_msg_count
2347 ,p_data => x_msg_data);
2348
2349 WHEN OTHERS THEN
2350 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','delete_acc_bal');
2351 -- store SQL error message on message stack for caller
2352 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
2353 ,p_count => x_msg_count
2354 ,p_data => x_msg_data);
2355 -- notify caller of an UNEXPECTED error
2356 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2357
2358 END delete_acc_bal;
2359
2360
2361
2362 PROCEDURE validate_acc_bal(
2363
2364 p_api_version IN NUMBER
2365
2366 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
2367
2368 ,x_return_status OUT NOCOPY VARCHAR2
2369
2370 ,x_msg_count OUT NOCOPY NUMBER
2371
2372 ,x_msg_data OUT NOCOPY VARCHAR2
2373
2374 ,p_agbv_rec IN agbv_rec_type) IS
2375
2376 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
2377
2378 l_api_name CONSTANT VARCHAR2(30) := 'validate_acc_bal';
2379
2380 l_agbv_rec agbv_rec_type := p_agbv_rec;
2381
2382 BEGIN
2383
2384 SAVEPOINT validate_acc_bal;
2385 x_return_status := FND_API.G_RET_STS_SUCCESS;
2386
2387
2388
2389 -- customer pre-processing
2390
2391
2392
2393
2394
2395
2396 -- vertical industry-preprocessing
2397
2398
2399
2400
2401
2402
2403 -- call complex entity API
2404
2405
2406
2407 okl_acc_group_pvt.validate_acc_bal(
2408
2409 p_api_version => p_api_version
2410
2411 ,p_init_msg_list => p_init_msg_list
2412
2413 ,x_return_status => l_return_status
2414
2415 ,x_msg_count => x_msg_count
2416
2417 ,x_msg_data => x_msg_data
2418
2419 ,p_agbv_rec => l_agbv_rec
2420
2421 );
2422
2423 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2424 RAISE FND_API.G_EXC_ERROR;
2425 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2426 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2427 END IF;
2428
2429
2430
2431 -- vertical industry-post-processing
2432
2433
2434
2435
2436
2437
2438 -- customer post-processing
2439
2440
2441
2442
2443
2444
2445 EXCEPTION
2446
2447 WHEN FND_API.G_EXC_ERROR THEN
2448 ROLLBACK TO validate_acc_bal;
2452 ,p_count => x_msg_count
2449 x_return_status := FND_API.G_RET_STS_ERROR;
2450
2451 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
2453 ,p_data => x_msg_data);
2454
2455 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2456 ROLLBACK TO validate_acc_bal;
2457 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2458 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
2459 ,p_count => x_msg_count
2460 ,p_data => x_msg_data);
2461
2462 WHEN OTHERS THEN
2463 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','validate_acc_bal');
2464 -- store SQL error message on message stack for caller
2465 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
2466 ,p_count => x_msg_count
2467 ,p_data => x_msg_data);
2468 -- notify caller of an UNEXPECTED error
2469 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2470
2471 END validate_acc_bal;
2472
2473
2474
2475 PROCEDURE validate_acc_bal(
2476
2477 p_api_version IN NUMBER
2478
2479 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
2480
2481 ,x_return_status OUT NOCOPY VARCHAR2
2482
2483 ,x_msg_count OUT NOCOPY NUMBER
2484
2485 ,x_msg_data OUT NOCOPY VARCHAR2
2486
2487 ,p_agbv_tbl IN agbv_tbl_type) IS
2488
2489 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
2490
2491 l_api_name CONSTANT VARCHAR2(30) := 'validate_acc_bal';
2492
2493 i NUMBER;
2494
2495 l_overall_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
2496
2497 l_agbv_tbl agbv_tbl_type := p_agbv_tbl;
2498
2499 BEGIN
2500
2501 --Initialize the return status
2502 SAVEPOINT validate_acc_bal;
2503 x_return_status := FND_API.G_RET_STS_SUCCESS;
2504
2505
2506
2507 -- customer pre-processing
2508
2509
2510
2511
2512
2513
2514 -- vertical industry-preprocessing
2515
2516
2517
2518
2519
2520
2521 IF (l_agbv_tbl.COUNT > 0) THEN
2522
2523 i := l_agbv_tbl.FIRST;
2524
2525 LOOP
2526
2527 validate_acc_bal(
2528
2529 p_api_version => p_api_version
2530
2531 ,p_init_msg_list => p_init_msg_list
2532
2533 ,x_return_status => l_return_status
2534
2535 ,x_msg_count => x_msg_count
2536
2537 ,x_msg_data => x_msg_data
2538
2539 ,p_agbv_rec => l_agbv_tbl(i)
2540
2541 );
2542 -- store the highest degree of error
2543 IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2544 IF l_overall_status <> FND_API.G_RET_STS_UNEXP_ERROR THEN
2545 l_overall_status := l_return_status;
2546 END IF;
2547 END IF;
2548
2549 EXIT WHEN (i = l_agbv_tbl.LAST);
2550
2551 i := l_agbv_tbl.NEXT(i);
2552
2553 END LOOP;
2554 -- return overall status
2555 l_return_status := l_overall_status;
2556
2557 END IF;
2558
2559 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2560 RAISE FND_API.G_EXC_ERROR;
2561 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2562 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2563 END IF;
2564
2565
2566 -- vertical industry-post-processing
2567
2568
2569
2573 -- customer post-processing
2570
2571
2572
2574
2575
2576
2577
2578
2579
2580 EXCEPTION
2581
2582 WHEN FND_API.G_EXC_ERROR THEN
2583 ROLLBACK TO validate_acc_bal;
2584 x_return_status := FND_API.G_RET_STS_ERROR;
2585
2586 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
2587 ,p_count => x_msg_count
2588 ,p_data => x_msg_data);
2589
2590 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2591 ROLLBACK TO validate_acc_bal;
2592 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2593 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
2594 ,p_count => x_msg_count
2595 ,p_data => x_msg_data);
2596
2597 WHEN OTHERS THEN
2598 FND_MSG_PUB.ADD_EXC_MSG('OKL_ACC_GROUP_PUB','validate_acc_bal');
2599 -- store SQL error message on message stack for caller
2600 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE
2601 ,p_count => x_msg_count
2602 ,p_data => x_msg_data);
2603 -- notify caller of an UNEXPECTED error
2604 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2605
2606 END validate_acc_bal;
2607
2608
2609
2610 END OKL_ACC_GROUP_PUB;
2611