[Home] [Help]
Skip to content
PACKAGE BODY: APPS.FUN_NET_CONC_PROG_PKG
Source
1 PACKAGE BODY FUN_NET_CONC_PROG_PKG AS
2 /* $Header: funntcpb.pls 120.2.12010000.2 2008/08/06 07:46:35 makansal ship $ */
3
4 PROCEDURE Create_Net_Batch(
5 errbuf OUT NOCOPY VARCHAR2,
6 retcode OUT NOCOPY VARCHAR2,
7 p_batch_id IN fun_net_batches_all.batch_id%TYPE) IS
8
9 l_return_status VARCHAR2(1);
10 l_msg_count NUMBER;
11 l_msg_data VARCHAR2(2000);
12
13 BEGIN
14 fun_net_util.log_string(1,'fun_net_conc_prog_pkg.create_net_batch','Before calling create batch API');
15 FUN_NET_ARAP_PKG.create_net_batch(
16 p_init_msg_list => FND_API.G_TRUE,
17 p_commit => FND_API.G_TRUE,
18 x_return_status => l_return_status,
19 x_msg_count => l_msg_count,
20 x_msg_data => l_msg_data,
21 p_batch_id => p_batch_id);
22 fun_net_util.log_string(1,'fun_net_conc_prog_pkg.create_net_batch','return from create batch API');
23 IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
24 fun_net_util.log_string(1,'fun_net_conc_prog_pkg.create_net_batch','Success');
25 retcode := 0;
26 ELSE
27 fun_net_util.log_string(1,'fun_net_conc_prog_pkg.create_net_batch','Error');
28 retcode := 2;
29 END IF;
30 EXCEPTION
31 WHEN OTHERS THEN
32 retcode := 2;
33 errbuf := sqlerrm;
34 END Create_Net_Batch;
35
36 PROCEDURE Submit_Net_Batch(
37 errbuf OUT NOCOPY VARCHAR2,
38 retcode OUT NOCOPY VARCHAR2,
39 p_batch_id IN fun_net_batches_all.batch_id%TYPE) IS
40
41 l_return_status VARCHAR2(1);
42 l_msg_count NUMBER;
43 l_msg_data VARCHAR2(2000);
44
45 BEGIN
46 retcode := 0;
47 FUN_NET_ARAP_PKG.submit_net_batch (
48 p_init_msg_list => FND_API.G_FALSE,
49 p_commit => FND_API.G_FALSE,
50 x_return_status => l_return_status,
51 x_msg_count => l_msg_count,
52 x_msg_data => l_msg_data,
53 p_batch_id => p_batch_id);
54 IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
55 retcode := 0;
56 RETURN;
57 ELSE
58 LOOP
59 errbuf := FND_MESSAGE.GET;
60 IF errbuf IS NULL THEN
61 EXIT;
62 ELSE
63 FND_FILE.PUT_LINE(FND_FILE.LOG,errbuf);
64 FND_FILE.NEW_LINE(FND_FILE.LOG,1);
65 END IF;
66 END LOOP;
67
68 retcode := 2;
69 RETURN;
70 END IF;
71
72 EXCEPTION
73 WHEN OTHERS THEN
74 retcode := 2;
75 errbuf := sqlerrm;
76 END Submit_Net_Batch;
77
78 PROCEDURE Settle_Net_Batch(
79 errbuf OUT NOCOPY VARCHAR2,
80 retcode OUT NOCOPY VARCHAR2,
81 p_batch_id IN fun_net_batches_all.batch_id%TYPE) IS
82
83 l_return_status VARCHAR2(1);
84 l_msg_count NUMBER;
85 l_msg_data VARCHAR2(2000);
86 BEGIN
87 retcode := 0;
88 FUN_NET_ARAP_PKG.settle_net_batch (
89 -- ***** Standard API Parameters *****
90 p_init_msg_list => FND_API.G_TRUE,
91 p_commit => FND_API.G_TRUE,
92 x_return_status => l_return_status,
93 x_msg_count => l_msg_count,
94 x_msg_data => l_msg_data,
95 -- ***** Netting batch input parameters *****
96 p_batch_id => p_batch_id);
97
98 IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
99 retcode := 0;
100 RETURN;
101 ELSE
102 LOOP
103 errbuf := FND_MESSAGE.GET;
104 IF errbuf IS NULL THEN
105 EXIT;
106 ELSE
107 FND_FILE.PUT_LINE(FND_FILE.LOG,errbuf);
108 FND_FILE.NEW_LINE(FND_FILE.LOG,1);
109 END IF;
110 END LOOP;
111
112 retcode := 2;
113 RETURN;
114 END IF;
115
116 EXCEPTION
117 WHEN OTHERS THEN
118 retcode := 2;
119 errbuf := sqlerrm;
120 END Settle_Net_Batch;
121
122 PROCEDURE Reverse_Net_Batch(
123 errbuf OUT NOCOPY VARCHAR2,
124 retcode OUT NOCOPY VARCHAR2,
125 p_batch_id IN fun_net_batches_all.batch_id%TYPE) IS
126
127 l_return_status VARCHAR2(1);
128 l_msg_count NUMBER;
129 l_msg_data VARCHAR2(2000);
130 BEGIN
131 retcode := 0;
132 FUN_NET_CANCEL_PKG.reverse_net_batch (
133 -- ***** Standard API Parameters *****
134 p_init_msg_list => FND_API.G_TRUE,
135 p_commit => FND_API.G_TRUE,
136 x_return_status => l_return_status,
137 x_msg_count => l_msg_count,
138 x_msg_data => l_msg_data,
139 -- ***** Netting batch input parameters *****
140 p_batch_id => p_batch_id);
141
142 IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
143 retcode := 0;
144 RETURN;
145 ELSE
146 LOOP
147 errbuf := FND_MESSAGE.GET;
148 IF errbuf IS NULL THEN
149 EXIT;
150 ELSE
151 FND_FILE.PUT_LINE(FND_FILE.LOG,errbuf);
152 FND_FILE.NEW_LINE(FND_FILE.LOG,1);
153 END IF;
154 END LOOP;
155
156 retcode := 2;
157 RETURN;
158 END IF;
159
160 EXCEPTION
161 WHEN OTHERS THEN
162 retcode := 2;
163 errbuf := sqlerrm;
164 END Reverse_Net_Batch;
165 END FUN_NET_CONC_PROG_PKG;