[Home] [Help]
PACKAGE BODY: APPS.OKL_ARINTF_PUB
Source
1 PACKAGE BODY OKL_ARINTF_PUB AS
2 /* $Header: OKLPAINB.pls 120.4.12010000.2 2008/11/05 15:04:52 gboomina ship $ */
3
4 ---------------------------------------------------------------------------
5 -- PROCEDURE Get_REC_FEEDER
6 ---------------------------------------------------------------------------
7 PROCEDURE Get_REC_FEEDER( p_api_version IN NUMBER,
8 p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE,
9 x_return_status OUT NOCOPY VARCHAR2,
10 x_msg_count OUT NOCOPY NUMBER,
11 x_msg_data OUT NOCOPY VARCHAR2,
12 p_trx_date_from IN DATE DEFAULT NULL,
13 p_trx_date_to IN DATE DEFAULT NULL,
14 p_assigned_process IN VARCHAR2) IS
15
16
17 l_xsiv_rec xsiv_rec_type;
18 l_data VARCHAR2(100);
19 l_api_name CONSTANT VARCHAR2(30) := 'Get_REC_FEEDER';
20 l_count NUMBER ;
21 l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
22 l_trx_date_from DATE;
23 l_trx_date_to DATE;
24
25 BEGIN
26 x_return_status := FND_API.G_RET_STS_SUCCESS;
27
28 -- l_xsiv_rec := p_xsiv_rec;
29 l_trx_date_from := p_trx_date_from;
30 l_trx_date_to := p_trx_date_to;
31
32
33
34 -- call main process api to load the AR Interface Table
35
36 okl_ARIntf_pvt.Get_REC_FEEDER(p_api_version => p_api_version,
37 p_init_msg_list => p_init_msg_list,
38 x_return_status => l_return_status,
39 x_msg_count => x_msg_count,
40 x_msg_data => x_msg_data,
41 p_trx_date_from => l_trx_date_from,
42 p_trx_date_to => l_trx_date_to,
43 p_assigned_process => p_assigned_process);
44
45 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
46 RAISE FND_API.G_EXC_ERROR;
47 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
48 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
49 END IF;
50
51 /* re-assign local record structure using output record from pvt api */
52 -- l_xsiv_rec := x_xsiv_rec;
53
54
55
56 EXCEPTION
57 WHEN FND_API.G_EXC_ERROR THEN
58 FND_FILE.put_line(fnd_file.log,'ERROR (OKL_ARIntf_PUB.Get_REC_FEEDER): '||SQLERRM );
59 -- -------------------------------------------
60 -- Purge data from the Parallel process Table
61 -- -------------------------------------------
62 IF p_assigned_process IS NOT NULL THEN
63 DELETE okl_parallel_processes
64 WHERE assigned_process = p_assigned_process;
65 COMMIT;
66 END IF;
67
68 -- notify caller of an UNEXPECTED error
69 x_return_status := FND_API.G_RET_STS_ERROR;
70
71 -- store SQL error message on message stack for caller
72 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE,
73 p_count => x_msg_count,
74 p_data => x_msg_data);
75
76 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
77
78 FND_FILE.put_line(fnd_file.log,'ERROR (OKL_ARIntf_PUB.Get_REC_FEEDER): '||SQLERRM );
79 -- -------------------------------------------
80 -- Purge data from the Parallel process Table
81 -- -------------------------------------------
82 IF p_assigned_process IS NOT NULL THEN
83 DELETE okl_parallel_processes
84 WHERE assigned_process = p_assigned_process;
85 COMMIT;
86 END IF;
87
88 -- notify caller of an UNEXPECTED error
89 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
90
91 -- store SQL error message on message stack for caller
92 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE,
93 p_count => x_msg_count,
94 p_data => x_msg_data);
95
96 WHEN OTHERS THEN
97
98 FND_FILE.put_line(fnd_file.log,'ERROR (OKL_ARIntf_PUB.Get_REC_FEEDER): '||SQLERRM );
99 -- -------------------------------------------
100 -- Purge data from the Parallel process Table
101 -- -------------------------------------------
102 IF p_assigned_process IS NOT NULL THEN
103 DELETE okl_parallel_processes
104 WHERE assigned_process = p_assigned_process;
105 COMMIT;
106 END IF;
107
108 -- notify caller of an UNEXPECTED error
109 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
110 FND_MSG_PUB.ADD_EXC_MSG('OKL_ARIntf_PUB','Get_REC_FEEDER');
111
112 -- store SQL error message on message stack for caller
113 FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE,
114 p_count => x_msg_count,
115 p_data => x_msg_data);
116 END Get_REC_FEEDER;
117
118 PROCEDURE Get_REC_FEEDER_CONC
119 ( errbuf OUT NOCOPY VARCHAR2
120 , retcode OUT NOCOPY NUMBER
121 , p_trx_date_from IN VARCHAR2
122 , p_trx_date_to IN VARCHAR2
123 , p_assigned_process IN VARCHAR2
124 ) is
125
126 l_api_vesrions NUMBER := 1;
127 lx_msg_count NUMBER;
128 l_trx_date_from DATE;
129 l_trx_date_to DATE;
130 l_count1 NUMBER;
131 l_count2 NUMBER;
132 l_count NUMBER;
133 lx_return_status VARCHAR2(1);
134
135 BEGIN
136
137 IF p_trx_date_from IS NOT NULL THEN
138 l_trx_date_from := FND_DATE.CANONICAL_TO_DATE(p_trx_date_from);
139 END IF;
140
141 IF p_trx_date_to IS NOT NULL THEN
142 l_trx_date_to := FND_DATE.CANONICAL_TO_DATE(p_trx_date_to);
143 END IF;
144
145 FND_FILE.put_line(fnd_file.log,'p_trx_date_from'||p_trx_date_from );
146 FND_FILE.put_line(fnd_file.log,'p_trx_date_to'||p_trx_date_to );
147 FND_FILE.put_line(fnd_file.log,'p_assigned_process'||p_assigned_process);
148
149 IF p_assigned_process IS NOT NULL THEN
150 Get_REC_FEEDER( p_api_version => l_api_vesrions,
151 p_init_msg_list => OKC_API.G_FALSE,
152 x_return_status => lx_return_status,
153 x_msg_count => lx_msg_count,
154 x_msg_data => errbuf,
155 p_trx_date_from => l_trx_date_from ,
156 p_trx_date_to => l_trx_date_to,
157 p_assigned_process => p_assigned_process);
158
159 ELSE
160 FND_FILE.put_line(fnd_file.log,'*** ============================================================ ***' );
161 FND_FILE.put_line(fnd_file.log,'*** Please Submit Receivables Invoice Transfer - Master Program. ***' );
162 FND_FILE.put_line(fnd_file.log,'*** ============================================================ ***' );
163 END IF;
164
165 EXCEPTION
166 WHEN OTHERS THEN
167 FND_FILE.put_line(fnd_file.log,'ERROR (OKL_ARIntf_PUB.Get_REC_FEEDER_CONC): '||SQLERRM );
168 -- -------------------------------------------
169 -- Purge data from the Parallel process Table
170 -- -------------------------------------------
171 IF p_assigned_process IS NOT NULL THEN
172 DELETE okl_parallel_processes
173 WHERE assigned_process = p_assigned_process;
174 COMMIT;
175 END IF;
176
177 END Get_REC_FEEDER_CONC;
178
179
180
181 END OKL_ARIntf_PUB;