1 PACKAGE BODY WMS_XDOCK_CUSTOM_APIS_PUB AS
2 /* $Header: WMSXDCAB.pls 120.1 2005/06/24 14:20:22 appldev noship $ */
3
4
5 -- Global constants holding the package name and package version
6 g_pkg_name CONSTANT VARCHAR2(30) := 'WMS_XDOCK_CUSTOM_APIS_PUB';
7 g_pkg_version CONSTANT VARCHAR2(100) := '$Header: WMSXDCAB.pls 120.1 2005/06/24 14:20:22 appldev noship $';
8
9
10 -- Procedure to print debug messages.
11 -- We will rely on the caller to this procedure to determine if debug logging
12 -- should be done or not instead of querying for the profile value every time.
13 PROCEDURE print_debug(p_debug_msg IN VARCHAR2)
14 IS
15 BEGIN
16 inv_mobile_helper_functions.tracelog
17 (p_err_msg => p_debug_msg,
18 p_module => 'WMS_XDOCK_CUSTOM_APIS_PUB',
19 p_level => 4);
20 END;
21
22
23 PROCEDURE Get_Crossdock_Criteria
24 (p_wdd_release_record IN WSH_PR_CRITERIA.relRecTyp,
25 x_return_status OUT NOCOPY VARCHAR2,
26 x_msg_count OUT NOCOPY NUMBER,
27 x_msg_data OUT NOCOPY VARCHAR2,
28 x_api_is_implemented OUT NOCOPY BOOLEAN,
29 x_crossdock_criteria_id OUT NOCOPY NUMBER)
30 IS
31 l_api_name CONSTANT VARCHAR2(30) := 'Get_Crossdock_Criteria';
32 l_progress VARCHAR2(10);
33 l_debug NUMBER := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
34
35 BEGIN
36 IF (l_debug = 1) THEN
37 print_debug('***Calling Get_Crossdock_Criteria with the following parameters***');
38 print_debug('Package Version: => ' || g_pkg_version);
39 END IF;
40
41 -- Set the savepoint
42 SAVEPOINT Get_Crossdock_Criteria_sp;
43 l_progress := '10';
44
45 -- Initialize message list to clear any existing messages
46 fnd_msg_pub.initialize;
47 l_progress := '20';
48
49 -- Initialize API return status to success
50 x_return_status := fnd_api.g_ret_sts_success;
51 l_progress := '30';
52
53 -- If the custom API is not implemented, return a value of FALSE for the output
54 -- variable 'x_api_is_implemented'. When custom logic is implemented, the line below
55 -- should be modified to return a TRUE value instead.
56 x_api_is_implemented := FALSE;
57
58 -- <Insert custom logic here>
59
60
61 IF (l_debug = 1) THEN
62 print_debug('***End of Get_Crossdock_Criteria***');
63 END IF;
64
65 EXCEPTION
66 WHEN FND_API.G_EXC_ERROR THEN
67 ROLLBACK TO Get_Crossdock_Criteria_sp;
68 x_return_status := fnd_api.g_ret_sts_error;
69 fnd_msg_pub.count_and_get(p_count => x_msg_count,
70 p_data => x_msg_data);
71 IF (l_debug = 1) THEN
72 print_debug('Exiting Get_Crossdock_Criteria - Execution error: ' ||
73 l_progress ||' '|| TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:DD:SS'));
74 END IF;
75
76 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
77 ROLLBACK TO Get_Crossdock_Criteria_sp;
78 x_return_status := fnd_api.g_ret_sts_unexp_error;
79 fnd_msg_pub.count_and_get(p_count => x_msg_count,
80 p_data => x_msg_data);
81 IF (l_debug = 1) THEN
82 print_debug('Exiting Get_Crossdock_Criteria - Unexpected error: ' ||
83 l_progress ||' '|| TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:DD:SS'));
84 END IF;
85
86 WHEN OTHERS THEN
87 ROLLBACK TO Get_Crossdock_Criteria_sp;
88 x_return_status := fnd_api.g_ret_sts_unexp_error;
89 IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
90 fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
91 END IF;
92 fnd_msg_pub.count_and_get(p_count => x_msg_count,
93 p_data => x_msg_data);
94 IF (l_debug = 1) THEN
95 print_debug('Exiting Get_Crossdock_Criteria - Others exception: ' ||
96 l_progress ||' '|| TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:DD:SS'));
97 END IF;
98
99 END Get_Crossdock_Criteria;
100
101
102 PROCEDURE Get_Expected_Time
103 (p_source_type_id IN NUMBER,
104 p_source_header_id IN NUMBER,
105 p_source_line_id IN NUMBER,
106 p_source_line_detail_id IN NUMBER,
107 p_supply_or_demand IN NUMBER,
108 p_crossdock_criterion_id IN NUMBER,
109 p_dock_schedule_method IN NUMBER,
110 x_return_status OUT NOCOPY VARCHAR2,
111 x_msg_count OUT NOCOPY NUMBER,
112 x_msg_data OUT NOCOPY VARCHAR2,
113 x_api_is_implemented OUT NOCOPY BOOLEAN,
114 x_dock_start_time OUT NOCOPY DATE,
115 x_dock_mean_time OUT NOCOPY DATE,
116 x_dock_end_time OUT NOCOPY DATE,
117 x_expected_time OUT NOCOPY DATE)
118 IS
119 l_api_name CONSTANT VARCHAR2(30) := 'Get_Expected_Time';
120 l_progress VARCHAR2(10);
121 l_debug NUMBER := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
122
123 BEGIN
124 IF (l_debug = 1) THEN
125 print_debug('***Calling Custom Get_Expected_Time with the following parameters***');
126 print_debug('Package Version: ==========> ' || g_pkg_version);
127 END IF;
128
129 -- Set the savepoint
130 SAVEPOINT Get_Expected_Time_sp;
131 l_progress := '10';
132
133 -- Initialize message list to clear any existing messages
134 fnd_msg_pub.initialize;
135 l_progress := '20';
136
137 -- Initialize API return status to success
138 x_return_status := fnd_api.g_ret_sts_success;
139 l_progress := '30';
140
141 -- If the custom API is not implemented, return a value of FALSE for the output
142 -- variable 'x_api_is_implemented'. When custom logic is implemented, the line below
143 -- should be modified to return a TRUE value instead.
144 x_api_is_implemented := FALSE;
145
146 -- <Insert custom logic here>
147
148
149 IF (l_debug = 1) THEN
150 print_debug('***End of Get_Expected_Time***');
151 END IF;
152
153 EXCEPTION
154 WHEN FND_API.G_EXC_ERROR THEN
155 ROLLBACK TO Get_Expected_Time_sp;
156 x_return_status := fnd_api.g_ret_sts_error;
157 fnd_msg_pub.count_and_get(p_count => x_msg_count,
158 p_data => x_msg_data);
159 IF (l_debug = 1) THEN
160 print_debug('Exiting Get_Expected_Time - Execution error: ' ||
161 l_progress ||' '|| TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:DD:SS'));
162 END IF;
163
164 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
165 ROLLBACK TO Get_Expected_Time_sp;
166 x_return_status := fnd_api.g_ret_sts_unexp_error;
167 fnd_msg_pub.count_and_get(p_count => x_msg_count,
168 p_data => x_msg_data);
169 IF (l_debug = 1) THEN
170 print_debug('Exiting Get_Expected_Time - Unexpected error: ' ||
171 l_progress ||' '|| TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:DD:SS'));
172 END IF;
173
174 WHEN OTHERS THEN
175 ROLLBACK TO Get_Expected_Time_sp;
176 x_return_status := fnd_api.g_ret_sts_unexp_error;
177 IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
178 fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
179 END IF;
180 fnd_msg_pub.count_and_get(p_count => x_msg_count,
181 p_data => x_msg_data);
182 IF (l_debug = 1) THEN
183 print_debug('Exiting Get_Expected_Time - Others exception: ' ||
184 l_progress ||' '|| TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:DD:SS'));
185 END IF;
186
187 END Get_Expected_Time;
188
189
190 PROCEDURE Get_Expected_Delivery_Time
191 (p_delivery_id IN NUMBER,
192 p_crossdock_criterion_id IN NUMBER,
193 p_dock_schedule_method IN NUMBER,
194 x_return_status OUT NOCOPY VARCHAR2,
195 x_msg_count OUT NOCOPY NUMBER,
196 x_msg_data OUT NOCOPY VARCHAR2,
197 x_api_is_implemented OUT NOCOPY BOOLEAN,
198 x_dock_appointment_id OUT NOCOPY NUMBER,
199 x_dock_start_time OUT NOCOPY DATE,
200 x_dock_end_time OUT NOCOPY DATE,
201 x_expected_time OUT NOCOPY DATE)
202 IS
203 l_api_name CONSTANT VARCHAR2(30) := 'Get_Expected_Delivery_Time';
204 l_progress VARCHAR2(10);
205 l_debug NUMBER := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
206
207 BEGIN
208 IF (l_debug = 1) THEN
209 print_debug('***Calling Get_Expected_Delivery_Time with the following parameters***');
210 print_debug('Package Version: ==========> ' || g_pkg_version);
211 END IF;
212
213 -- Set the savepoint
214 SAVEPOINT Get_Expected_Delivery_Time_sp;
215 l_progress := '10';
216
217 -- Initialize message list to clear any existing messages
218 fnd_msg_pub.initialize;
219 l_progress := '20';
220
221 -- Initialize API return status to success
222 x_return_status := fnd_api.g_ret_sts_success;
223 l_progress := '30';
224
225 -- If the custom API is not implemented, return a value of FALSE for the output
226 -- variable 'x_api_is_implemented'. When custom logic is implemented, the line below
227 -- should be modified to return a TRUE value instead.
228 x_api_is_implemented := FALSE;
229
230 -- <Insert custom logic here>
231
232
233 IF (l_debug = 1) THEN
234 print_debug('***End of Get_Expected_Delivery_Time***');
235 END IF;
236
237 EXCEPTION
238 WHEN FND_API.G_EXC_ERROR THEN
239 ROLLBACK TO Get_Expected_Delivery_Time_sp;
240 x_return_status := fnd_api.g_ret_sts_error;
241 fnd_msg_pub.count_and_get(p_count => x_msg_count,
242 p_data => x_msg_data);
243 IF (l_debug = 1) THEN
244 print_debug('Exiting Get_Expected_Delivery_Time - Execution error: ' ||
245 l_progress ||' '|| TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:DD:SS'));
246 END IF;
247
248 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
249 ROLLBACK TO Get_Expected_Delivery_Time_sp;
250 x_return_status := fnd_api.g_ret_sts_unexp_error;
251 fnd_msg_pub.count_and_get(p_count => x_msg_count,
252 p_data => x_msg_data);
253 IF (l_debug = 1) THEN
254 print_debug('Exiting Get_Expected_Delivery_Time - Unexpected error: ' ||
255 l_progress ||' '|| TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:DD:SS'));
256 END IF;
257
258 WHEN OTHERS THEN
259 ROLLBACK TO Get_Expected_Delivery_Time_sp;
260 x_return_status := fnd_api.g_ret_sts_unexp_error;
261 IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
262 fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
263 END IF;
264 fnd_msg_pub.count_and_get(p_count => x_msg_count,
265 p_data => x_msg_data);
266 IF (l_debug = 1) THEN
267 print_debug('Exiting Get_Expected_Delivery_Time - Others exception: ' ||
268 l_progress ||' '|| TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:DD:SS'));
269 END IF;
270
271 END Get_Expected_Delivery_Time;
272
273
274 PROCEDURE Sort_Supply_Lines
275 (p_wdd_release_record IN WSH_PR_CRITERIA.relRecTyp,
276 p_prioritize_documents IN NUMBER,
277 p_shopping_basket_tb IN WMS_XDock_Pegging_Pub.shopping_basket_tb,
278 x_return_status OUT NOCOPY VARCHAR2,
279 x_msg_count OUT NOCOPY NUMBER,
280 x_msg_data OUT NOCOPY VARCHAR2,
281 x_api_is_implemented OUT NOCOPY BOOLEAN,
282 x_sorted_order_tb OUT NOCOPY WMS_XDock_Pegging_Pub.sorted_order_tb)
283 IS
284 l_api_name CONSTANT VARCHAR2(30) := 'Sort_Supply_Lines';
285 l_progress VARCHAR2(10);
286 l_debug NUMBER := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
287
288 BEGIN
289 IF (l_debug = 1) THEN
290 print_debug('***Calling Sort_Supply_Lines with the following parameters***');
291 print_debug('Package Version: ==========> ' || g_pkg_version);
292 END IF;
293
294 -- Set the savepoint
295 SAVEPOINT Sort_Supply_Lines_sp;
296 l_progress := '10';
297
298 -- Initialize message list to clear any existing messages
299 fnd_msg_pub.initialize;
300 l_progress := '20';
301
302 -- Initialize API return status to success
303 x_return_status := fnd_api.g_ret_sts_success;
304 l_progress := '30';
305
306 -- If the custom API is not implemented, return a value of FALSE for the output
307 -- variable 'x_api_is_implemented'. When custom logic is implemented, the line below
308 -- should be modified to return a TRUE value instead.
309 x_api_is_implemented := FALSE;
310
311 -- <Insert custom logic here>
312
313
314 IF (l_debug = 1) THEN
315 print_debug('***End of Sort_Supply_Lines***');
316 END IF;
317
318 EXCEPTION
319 WHEN FND_API.G_EXC_ERROR THEN
320 ROLLBACK TO Sort_Supply_Lines_sp;
321 x_return_status := fnd_api.g_ret_sts_error;
322 fnd_msg_pub.count_and_get(p_count => x_msg_count,
323 p_data => x_msg_data);
324 IF (l_debug = 1) THEN
325 print_debug('Exiting Sort_Supply_Lines - Execution error: ' ||
326 l_progress ||' '|| TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:DD:SS'));
327 END IF;
328
329 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
330 ROLLBACK TO Sort_Supply_Lines_sp;
331 x_return_status := fnd_api.g_ret_sts_unexp_error;
332 fnd_msg_pub.count_and_get(p_count => x_msg_count,
333 p_data => x_msg_data);
334 IF (l_debug = 1) THEN
335 print_debug('Exiting Sort_Supply_Lines - Unexpected error: ' ||
336 l_progress ||' '|| TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:DD:SS'));
337 END IF;
338
339 WHEN OTHERS THEN
340 ROLLBACK TO Sort_Supply_Lines_sp;
341 x_return_status := fnd_api.g_ret_sts_unexp_error;
342 IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
343 fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
344 END IF;
345 fnd_msg_pub.count_and_get(p_count => x_msg_count,
346 p_data => x_msg_data);
347 IF (l_debug = 1) THEN
348 print_debug('Exiting Sort_Supply_Lines - Others exception: ' ||
349 l_progress ||' '|| TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:DD:SS'));
350 END IF;
351
352 END Sort_Supply_Lines;
353
354
355 PROCEDURE Sort_Demand_Lines
356 (p_move_order_line_id IN NUMBER,
357 p_prioritize_documents IN NUMBER,
358 p_shopping_basket_tb IN WMS_XDock_Pegging_Pub.shopping_basket_tb,
359 x_return_status OUT NOCOPY VARCHAR2,
360 x_msg_count OUT NOCOPY NUMBER,
361 x_msg_data OUT NOCOPY VARCHAR2,
362 x_api_is_implemented OUT NOCOPY BOOLEAN,
363 x_sorted_order_tb OUT NOCOPY WMS_XDock_Pegging_Pub.sorted_order_tb)
364 IS
365 l_api_name CONSTANT VARCHAR2(30) := 'Sort_Demand_Lines';
366 l_progress VARCHAR2(10);
367 l_debug NUMBER := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
368
369 BEGIN
370 IF (l_debug = 1) THEN
371 print_debug('***Calling Sort_Demand_Lines with the following parameters***');
372 print_debug('Package Version: ==========> ' || g_pkg_version);
373 END IF;
374
375 -- Set the savepoint
376 SAVEPOINT Sort_Demand_Lines_sp;
377 l_progress := '10';
378
379 -- Initialize message list to clear any existing messages
380 fnd_msg_pub.initialize;
381 l_progress := '20';
382
383 -- Initialize API return status to success
384 x_return_status := fnd_api.g_ret_sts_success;
385 l_progress := '30';
386
387 -- If the custom API is not implemented, return a value of FALSE for the output
388 -- variable 'x_api_is_implemented'. When custom logic is implemented, the line below
389 -- should be modified to return a TRUE value instead.
390 x_api_is_implemented := FALSE;
391
392 -- <Insert custom logic here>
393
394
395 IF (l_debug = 1) THEN
396 print_debug('***End of Sort_Demand_Lines***');
397 END IF;
398
399 EXCEPTION
400 WHEN FND_API.G_EXC_ERROR THEN
401 ROLLBACK TO Sort_Demand_Lines_sp;
402 x_return_status := fnd_api.g_ret_sts_error;
403 fnd_msg_pub.count_and_get(p_count => x_msg_count,
404 p_data => x_msg_data);
405 IF (l_debug = 1) THEN
406 print_debug('Exiting Sort_Demand_Lines - Execution error: ' ||
407 l_progress ||' '|| TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:DD:SS'));
408 END IF;
409
410 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
411 ROLLBACK TO Sort_Demand_Lines_sp;
412 x_return_status := fnd_api.g_ret_sts_unexp_error;
413 fnd_msg_pub.count_and_get(p_count => x_msg_count,
414 p_data => x_msg_data);
415 IF (l_debug = 1) THEN
416 print_debug('Exiting Sort_Demand_Lines - Unexpected error: ' ||
417 l_progress ||' '|| TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:DD:SS'));
418 END IF;
419
420 WHEN OTHERS THEN
421 ROLLBACK TO Sort_Demand_Lines_sp;
422 x_return_status := fnd_api.g_ret_sts_unexp_error;
423 IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
424 fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
425 END IF;
426 fnd_msg_pub.count_and_get(p_count => x_msg_count,
427 p_data => x_msg_data);
428 IF (l_debug = 1) THEN
429 print_debug('Exiting Sort_Demand_Lines - Others exception: ' ||
430 l_progress ||' '|| TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:DD:SS'));
431 END IF;
432
433 END Sort_Demand_Lines;
434
435
436 END WMS_XDOCK_CUSTOM_APIS_PUB;
437