DBA Data[Home] [Help]

PACKAGE BODY: APPS.OKL_AM_PROCESS_RV_TRX_PUB

Source


1 PACKAGE BODY OKL_AM_PROCESS_RV_TRX_PUB AS
2 /* $Header: OKLPRVPB.pls 115.3 2004/04/13 11:03:58 rnaik noship $ */
3 
4 
5 PROCEDURE process_transactions_wrap(    ERRBUF                  OUT 	NOCOPY VARCHAR2,
6                                         RETCODE                 OUT     NOCOPY VARCHAR2 ,
7                                         p_api_version           IN  	NUMBER,
8            			                    p_init_msg_list         IN  	VARCHAR2 DEFAULT OKC_API.G_FALSE,
9                                         p_khr_id                IN      NUMBER   DEFAULT NULL,
10                                         p_kle_id                IN      VARCHAR2 DEFAULT NULL) AS
11 
12     l_api_version                   NUMBER ;
13     l_init_msg_list                 VARCHAR2(1) ;
14 
15     lp_khr_id                       NUMBER;
16     lp_kle_id                       NUMBER;
17     lx_errbuf                       VARCHAR2(2000);
18     lx_retcode                      VARCHAR2(2000);
19 BEGIN
20 SAVEPOINT trx_process_transactions_wrap;
21 l_api_version := p_api_version ;
22 l_init_msg_list := p_init_msg_list ;
23 
24 
25 lp_khr_id                      := p_khr_id;
26 lp_kle_id                      := p_kle_id;
27 lx_errbuf                      := ERRBUF;
28 lx_retcode                     := RETCODE;
29 
30 -- call the insert of pvt
31 	OKL_AM_PROCESS_RV_TRX_PVT.process_transactions_wrap(
32                                         ERRBUF                   => lx_errbuf,
33                                         RETCODE                  => lx_retcode,
34                                         p_api_version            => l_api_version,
35            			                    p_init_msg_list          => l_init_msg_list,
36                                         p_khr_id                 => lp_khr_id,
37                                         p_kle_id                 => lp_kle_id);
38 
39     IF ( lx_retcode <> 0 )  THEN
40 		RAISE FND_API.G_EXC_ERROR;
41 	END IF;
42 --Assign value to OUT variables
43 ERRBUF := lx_errbuf ;
44 RETCODE := lx_retcode;
45 
46 EXCEPTION
47     WHEN FND_API.G_EXC_ERROR THEN
48       ROLLBACK TO trx_process_transactions_wrap;
49 
50 
51     WHEN OTHERS THEN
52       ROLLBACK TO trx_process_transactions_wrap;
53 
54 END process_transactions_wrap;
55 
56 
57 
58 PROCEDURE process_transactions(   p_api_version           IN   NUMBER,
59                              p_init_msg_list         IN   VARCHAR2 DEFAULT OKC_API.G_FALSE,
60                              x_return_status         OUT  NOCOPY VARCHAR2,
61                              x_msg_count             OUT  NOCOPY NUMBER,
62                              x_msg_data              OUT  NOCOPY VARCHAR2,
63                              p_khr_id    	         IN   NUMBER DEFAULT NULL,
64                              p_kle_id                IN   NUMBER DEFAULT NULL,
65                              x_total_count           OUT  NOCOPY NUMBER,
66                              x_processed_count       OUT  NOCOPY NUMBER,
67                              x_error_count           OUT  NOCOPY NUMBER) AS
68 
69     l_api_version                   NUMBER ;
70     l_init_msg_list                 VARCHAR2(1) ;
71     l_return_status                 VARCHAR2(1);
72     l_msg_count                     NUMBER ;
73     l_msg_data                      VARCHAR2(2000);
74     lp_khr_id                       NUMBER;
75     lp_kle_id                       NUMBER;
76     lx_total_count                  NUMBER;
77     lx_processed_count              NUMBER;
78     lx_error_count                  NUMBER;
79 
80 BEGIN
81 SAVEPOINT trx_process_transactions;
82 l_api_version := p_api_version ;
83 l_init_msg_list := p_init_msg_list ;
84 l_return_status := x_return_status ;
85 l_msg_count := x_msg_count ;
86 l_msg_data := x_msg_data ;
87 
88 lp_khr_id                      := p_khr_id;
89 lp_kle_id                      := p_kle_id;
90 lx_total_count                 := x_total_count;
91 lx_processed_count             := x_processed_count;
92 lx_error_count                 := x_error_count;
93 
94 -- call the insert of pvt
95 	OKL_AM_PROCESS_RV_TRX_PVT.process_transactions(
96                                                   p_api_version     => l_api_version,
97                                                   p_init_msg_list   => l_init_msg_list
98 	                                             ,x_msg_data        => l_msg_data
99 	                                             ,x_msg_count       => l_msg_count
100 	                                             ,x_return_status   => l_return_status
101 	                                              ,p_khr_id         => lp_khr_id,
102                                                   p_kle_id          => lp_kle_id,
103                                                   x_total_count     => lx_total_count,
104                                                   x_processed_count => lx_processed_count,
105                                                   x_error_count     => lx_error_count) ;
106 IF ( l_return_status = FND_API.G_RET_STS_ERROR )  THEN
107 	RAISE FND_API.G_EXC_ERROR;
108 ELSIF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR ) THEN
109 	RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
110 END IF;
111 --Assign value to OUT variables
112 x_return_status := l_return_status ;
113 x_msg_count := l_msg_count ;
114 x_msg_data := l_msg_data ;
115 x_total_count := lx_total_count;
116 x_processed_count := lx_processed_count;
117 x_error_count := lx_error_count;
118 
119 EXCEPTION
120     WHEN FND_API.G_EXC_ERROR THEN
121       ROLLBACK TO trx_process_transactions;
122       x_return_status := FND_API.G_RET_STS_ERROR;
123       x_msg_count := l_msg_count ;
124       x_msg_data := l_msg_data ;
125       FND_MSG_PUB.count_and_get(
126              p_count   => x_msg_count
127             ,p_data    => x_msg_data);
128     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
129       ROLLBACK TO trx_process_transactions;
130       x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
131       x_msg_count := l_msg_count ;
132       x_msg_data := l_msg_data ;
133       FND_MSG_PUB.count_and_get(
134              p_count   => x_msg_count
135             ,p_data    => x_msg_data);
136     WHEN OTHERS THEN
137       ROLLBACK TO trx_process_transactions;
138       x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
139       x_msg_count := l_msg_count ;
140       x_msg_data := l_msg_data ;
141       FND_MSG_PUB.ADD_EXC_MSG('OKL_AM_PROCESS_ASSET_TRX_PUB','process_transactions');
142       FND_MSG_PUB.count_and_get(
143              p_count   => x_msg_count
144             ,p_data    => x_msg_data);
145 END process_transactions;
146 END OKL_AM_PROCESS_RV_TRX_PUB;