DBA Data[Home] [Help]

PACKAGE BODY: APPS.CSI_T_TXN_SYSTEMS_GRP

Source


1 PACKAGE BODY csi_t_txn_systems_grp AS
2 /* $Header: csigtsyb.pls 115.7 2004/01/08 23:54:15 rmamidip ship $ */
3 -- Start of Comments
4 -- Package name     : csi_t_txn_systems_grp
5 -- Purpose          :
6 -- History          :
7 -- NOTE             :
8 -- END of Comments
9 
10 
11 G_PKG_NAME CONSTANT VARCHAR2(30):= 'CSI_T_TXN_SYSTEMS_GRP';
12 G_FILE_NAME CONSTANT VARCHAR2(12) := 'csigtsyb.pls';
13 
14 PROCEDURE create_txn_system(
15     p_api_version                IN     NUMBER,
16     p_commit                     IN     VARCHAR2     := fnd_api.g_false,
17     p_init_msg_list              IN     VARCHAR2     := fnd_api.g_false,
18     p_validation_level           IN     NUMBER       := fnd_api.g_valid_level_full,
19     p_txn_system_rec             IN     csi_t_datastructures_grp.txn_system_rec,
20     x_txn_system_id              OUT NOCOPY    NUMBER,
21     x_return_status              OUT NOCOPY    VARCHAR2,
22     x_msg_count                  OUT NOCOPY    NUMBER,
23     x_msg_data                   OUT NOCOPY    VARCHAR2
24     )
25  IS
26 l_api_name                CONSTANT VARCHAR2(30) := 'create_txn_system';
27 l_api_version             CONSTANT NUMBER       := 1.0;
28 l_return_status_full               VARCHAR2(1);
29 l_access_flag                      VARCHAR2(1);
30 l_line_count                       NUMBER;
31 l_flag                             VARCHAR2(1)  :='N';
32 l_debug_level                      NUMBER;
33 
34 
35  BEGIN
36       -- standard start of api savepoint
37       SAVEPOINT csi_t_txn_systems_grp;
38 
39       -- standard call to check for call compatibility.
40       IF NOT fnd_api.compatible_api_call ( l_api_version,
41                                            p_api_version,
42                                            l_api_name,
43                                            g_pkg_name)
44       THEN
45           RAISE fnd_api.g_exc_unexpected_error;
46       END IF;
47 
48 
49       -- initialize message list IF p_init_msg_list is set to true.
50       IF fnd_api.to_boolean( p_init_msg_list )
51       THEN
52           fnd_msg_pub.initialize;
53       END IF;
54 
55 
56 
57       -- initialize api return status to success
58       x_return_status := fnd_api.g_ret_sts_success;
59 
60      --debug messages
61         csi_t_gen_utility_pvt.dump_api_info(
62                                             p_pkg_name => g_pkg_name,
63                                             p_api_name => l_api_name);
64 
65     IF csi_t_gen_utility_pvt.g_debug_level > 1 then
66 
67        csi_t_gen_utility_pvt.add(p_api_version          ||'-'||
68                                  p_commit               ||'-'||
69                                  p_init_msg_list        ||'-'||
70                                  p_validation_level);
71 
72        csi_t_gen_utility_pvt.dump_txn_systems_rec(
73         p_txn_systems_rec => p_txn_system_rec);
74 
75     END IF;
76 
77 
78     /**** Commented for Bug 3304439
79     -- check for the profile option and enable trace
80     l_flag:=csi_gen_utility_pvt.enable_trace(l_trace_flag => l_flag);
81     -- end enable trace
82     ****/
83 
84     --
85     -- This procedure check if the installed base is active, If not active
86     -- populates the error message in the message queue and raises the
87     -- fnd_api.g_exc_error exception
88     --
89 
90     csi_utility_grp.check_ib_active;
91 
92     -- calling private package: create_system
93     -- hint: primary key needs to be returned
94 
95 
96 
97       csi_t_txn_systems_pvt.create_txn_system(
98         p_api_version                => p_api_version,
99         p_commit                     => p_commit,
100         p_init_msg_list              => p_init_msg_list,
101         p_validation_level           => p_validation_level,
102         p_txn_system_rec             => p_txn_system_rec,
103         x_txn_system_id              => x_txn_system_id,
104         x_return_status              => x_return_status,
105         x_msg_count                  => x_msg_count,
106         x_msg_data                   => x_msg_data
107      );
108 
109 
110 
111       -- check return status from the above procedure call
112       IF x_return_status = fnd_api.g_ret_sts_error THEN
113           RAISE fnd_api.g_exc_error;
114       ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
115           RAISE fnd_api.g_exc_unexpected_error;
116       END IF;
117 
118       --
119       -- END of api body.
120       --
121 
122       -- standard check for p_commit
123       IF fnd_api.to_boolean( p_commit )
124       THEN
125           COMMIT WORK;
126       END IF;
127 
128 
129         IF (l_flag = 'Y') THEN
130             dbms_session.set_sql_trace(false);
131         END IF;
132 
133       -- standard call to get message count AND IF count is 1, get message info.
134       fnd_msg_pub.count_and_get
135       (  p_count          =>   x_msg_count,
136          p_data           =>   x_msg_data
137       );
138 
139       EXCEPTION
140           WHEN fnd_api.g_exc_error THEN
141                 ROLLBACK TO csi_t_txn_systems_grp;
142                 x_return_status := fnd_api.g_ret_sts_error ;
143                 fnd_msg_pub.count_and_get
144                         (p_count => x_msg_count ,
145                          p_data => x_msg_data
146                         );
147 
148           WHEN fnd_api.g_exc_unexpected_error THEN
149                 ROLLBACK TO csi_t_txn_systems_grp;
150                 x_return_status := fnd_api.g_ret_sts_unexp_error ;
151                 fnd_msg_pub.count_and_get
152                         (p_count => x_msg_count ,
153                          p_data => x_msg_data
154                          );
155 
156           WHEN OTHERS THEN
157                 ROLLBACK TO csi_t_txn_systems_grp;
158                 x_return_status := fnd_api.g_ret_sts_unexp_error ;
159                   IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
160                          fnd_msg_pub.add_exc_msg(g_pkg_name ,l_api_name);
161                   END IF;
162                 fnd_msg_pub.count_and_get
163                         (p_count => x_msg_count ,
164                          p_data => x_msg_data
165                         );
166 
167 END create_txn_system;
168 
169 
170 PROCEDURE update_txn_system(
171     p_api_version                IN     NUMBER,
172     p_commit                     IN     VARCHAR2     := fnd_api.g_false,
173     p_init_msg_list              IN     VARCHAR2     := fnd_api.g_false,
174     p_validation_level           IN     NUMBER       := fnd_api.g_valid_level_full,
175     p_txn_system_rec             IN     csi_t_datastructures_grp.txn_system_rec,
176     x_return_status              OUT NOCOPY    VARCHAR2,
177     x_msg_count                  OUT NOCOPY    NUMBER,
178     x_msg_data                   OUT NOCOPY    VARCHAR2
179     )
180 IS
181 l_api_name                   CONSTANT VARCHAR2(30) := 'update_txn_system';
182 l_api_version                CONSTANT NUMBER       := 1.0;
183 -- local variables
184 l_rowid  rowid;
185 l_flag                                VARCHAR2(1)  :='N';
186 l_debug_level                         NUMBER;
187 
188 
189 BEGIN
190       -- standard start of api savepoint
191       SAVEPOINT update_txn_system_grp;
192 
193       -- standard call to check for call compatibility.
194       IF NOT fnd_api.compatible_api_call ( l_api_version,
195                                            p_api_version,
196                                            l_api_name,
197                                            g_pkg_name)
198       THEN
199           RAISE fnd_api.g_exc_unexpected_error;
200       END IF;
201 
202 
203       -- initialize message list IF p_init_msg_list is set to true.
204       IF fnd_api.to_boolean( p_init_msg_list )
205       THEN
206           fnd_msg_pub.initialize;
207       END IF;
208 
209 
210       -- initialize api return status to success
211       x_return_status := fnd_api.g_ret_sts_success;
212 
213        --debug messages
214         csi_t_gen_utility_pvt.dump_api_info(
215                                             p_pkg_name => g_pkg_name,
216                                             p_api_name => l_api_name);
217 
218     IF csi_t_gen_utility_pvt.g_debug_level > 1 THEN
219 
220        csi_t_gen_utility_pvt.add(p_api_version          ||'-'||
221                                  p_commit               ||'-'||
222                                  p_init_msg_list        ||'-'||
223                                  p_validation_level);
224 
225        csi_t_gen_utility_pvt.dump_txn_systems_rec(
226         p_txn_systems_rec => p_txn_system_rec);
227 
228     END IF;
229 
230     /**** Commented for Bug 3304439
231     -- check for the profile option and enable trace
232     l_flag:=csi_gen_utility_pvt.enable_trace(l_trace_flag => l_flag);
233     -- end enable trace
234     ****/
235 
236     --
237     -- This procedure check if the installed base is active, If not active
238     -- populates the error message in the message queue and raises the
239     -- fnd_api.g_exc_error exception
240     --
241 
242     csi_utility_grp.check_ib_active;
243 
244     -- calling private package: update_system
245     csi_t_txn_systems_pvt.update_txn_system(
246         p_api_version                => p_api_version,
247         p_commit                     => p_commit,
248         p_init_msg_list              => p_init_msg_list,
249         p_validation_level           => p_validation_level,
250         p_txn_system_rec             => p_txn_system_rec,
251         x_return_status              => x_return_status,
252         x_msg_count                  => x_msg_count,
253         x_msg_data                   => x_msg_data
254         );
255 
256 
257 
258 
259       -- check return status from the above procedure call
260       IF x_return_status = fnd_api.g_ret_sts_error THEN
261           RAISE fnd_api.g_exc_error;
262       ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
263           RAISE fnd_api.g_exc_unexpected_error;
264       END IF;
265 
266       --
267       -- end of api body
268       --
269 
270       -- standard check for p_commit
271       IF fnd_api.to_boolean( p_commit )
272       THEN
273           COMMIT WORK;
274       END IF;
275 
276       IF (l_flag = 'Y') THEN
277             dbms_session.set_sql_trace(false);
278       END IF;
279 
280       -- standard call to get message count and if count is 1, get message info.
281       fnd_msg_pub.count_and_get
282       (  p_count          =>   x_msg_count,
283          p_data           =>   x_msg_data
284       );
285 
286       EXCEPTION
287           WHEN fnd_api.g_exc_error THEN
288                 ROLLBACK TO update_txn_system_grp;
289                 x_return_status := fnd_api.g_ret_sts_error ;
290                 fnd_msg_pub.count_and_get
291                         (p_count => x_msg_count ,
292                          p_data => x_msg_data
293                         );
294 
295           WHEN fnd_api.g_exc_unexpected_error THEN
296                 ROLLBACK TO update_txn_system_grp;
297                 x_return_status := fnd_api.g_ret_sts_unexp_error ;
298                 fnd_msg_pub.count_and_get
299                         (p_count => x_msg_count ,
300                          p_data => x_msg_data
301                         );
302 
303           WHEN OTHERS THEN
307                          fnd_msg_pub.add_exc_msg(g_pkg_name ,l_api_name);
304                 ROLLBACK TO update_txn_system_grp;
305                 x_return_status := fnd_api.g_ret_sts_unexp_error ;
306                   IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
308                   END IF;
309                 fnd_msg_pub.count_and_get
310                         (p_count => x_msg_count ,
311                          p_data => x_msg_data
312                         );
313 END update_txn_system;
314 
315 PROCEDURE delete_txn_system
316  (
317      p_api_version                 IN     NUMBER,
318      p_commit                      IN     VARCHAR2   := fnd_api.g_false,
319      p_init_msg_list               IN     VARCHAR2   := fnd_api.g_false,
320      p_validation_level            IN     NUMBER     := fnd_api.g_valid_level_full,
321      p_txn_system_id               IN     NUMBER,
322      x_return_status               OUT NOCOPY    VARCHAR2,
323      x_msg_count                   OUT NOCOPY    NUMBER,
324      x_msg_data                    OUT NOCOPY    VARCHAR2
325  )
326  IS
327 l_api_name                   CONSTANT VARCHAR2(30) := 'delete_txn_system';
328 l_api_version                CONSTANT NUMBER       := 1.0;
329 -- local variables
330 l_rowid  rowid;
331 l_flag                                VARCHAR2(1)  :='N';
332 l_debug_level                         NUMBER;
333 
334 
335 BEGIN
336       -- standard start of api savepoint
337       SAVEPOINT delete_txn_system_grp;
338 
339       -- standard call to check for call compatibility.
340       IF NOT fnd_api.compatible_api_call ( l_api_version,
341                                            p_api_version,
342                                            l_api_name,
343                                            g_pkg_name)
344       THEN
345           RAISE fnd_api.g_exc_unexpected_error;
346       END IF;
347 
348 
349       -- initialize message list IF p_init_msg_list is set to true.
350       IF fnd_api.to_boolean( p_init_msg_list )
351       THEN
352           fnd_msg_pub.initialize;
353       END IF;
354 
355 
356       -- initialize api return status to success
357       x_return_status := fnd_api.g_ret_sts_success;
358 
359      --debug messages
360         csi_t_gen_utility_pvt.dump_api_info(
361                                             p_pkg_name => g_pkg_name,
362                                             p_api_name => l_api_name);
363 
364     IF csi_t_gen_utility_pvt.g_debug_level > 1 then
365 
366        csi_t_gen_utility_pvt.add(p_api_version          ||'-'||
367                                  p_commit               ||'-'||
368                                  p_init_msg_list        ||'-'||
369                                  p_validation_level     ||'-'||
370                                  p_txn_system_id );
371 
372     END IF;
373 
374     /**** Commented for Bug 3304439
375     -- check for the profile option and enable trace
376     l_flag:=csi_gen_utility_pvt.enable_trace(l_trace_flag => l_flag);
377     -- END enable trace
378     ****/
379 
380     --
381     -- This procedure check if the installed base is active, If not active
382     -- populates the error message in the message queue and raises the
383     -- fnd_api.g_exc_error exception
384     --
385 
386     csi_utility_grp.check_ib_active;
387 
388     -- calling private package: delete_system
389     csi_t_txn_systems_pvt.delete_txn_system(
390         p_api_version                => p_api_version,
391         p_commit                     => p_commit,
392         p_init_msg_list              => p_init_msg_list,
393         p_validation_level           => p_validation_level,
394         p_txn_system_id              => p_txn_system_id,
395         x_return_status              => x_return_status,
396         x_msg_count                  => x_msg_count,
397         x_msg_data                   => x_msg_data
398         );
399 
400 
401 
402 
403       -- check return status from the above procedure call
404       IF x_return_status = fnd_api.g_ret_sts_error THEN
405           RAISE fnd_api.g_exc_error;
406       ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
407           RAISE fnd_api.g_exc_unexpected_error;
408       END IF;
409 
410       --
411       -- END of api body
412       --
413 
414       -- standard check for p_commit
415       IF fnd_api.to_boolean( p_commit )
416       THEN
417           COMMIT WORK;
418       END IF;
419 
420       IF (l_flag = 'Y') THEN
421             dbms_session.set_sql_trace(false);
422         END IF;
423 
424       -- standard call to get message count AND IF count is 1, get message info.
425       fnd_msg_pub.count_and_get
426       (  p_count          =>   x_msg_count,
427          p_data           =>   x_msg_data
428       );
429 
430       EXCEPTION
431           WHEN fnd_api.g_exc_error THEN
432                 ROLLBACK TO delete_txn_system_grp;
433                 x_return_status := fnd_api.g_ret_sts_error ;
434                 fnd_msg_pub.count_and_get
435                         (p_count => x_msg_count ,
436                          p_data => x_msg_data
437                         );
438 
439           WHEN fnd_api.g_exc_unexpected_error THEN
440                 ROLLBACK TO delete_txn_system_grp;
441                 x_return_status := fnd_api.g_ret_sts_unexp_error ;
442                 fnd_msg_pub.count_and_get
443                         (p_count => x_msg_count ,
444                          p_data => x_msg_data
445                         );
446 
447           WHEN OTHERS THEN
448                 ROLLBACK TO delete_txn_system_grp;
449                 x_return_status := fnd_api.g_ret_sts_unexp_error ;
450                   IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
451                          fnd_msg_pub.add_exc_msg(g_pkg_name ,l_api_name);
452                   END IF;
453                 fnd_msg_pub.count_and_get
454                         (p_count => x_msg_count ,
455                          p_data => x_msg_data
456                         );
457 
458  END delete_txn_system;
459 
460 
461 
462 
463 END csi_t_txn_systems_grp;