DBA Data[Home] [Help]

PACKAGE: APPS.WMS_PUTAWAY_SUGGESTIONS

Source


1 PACKAGE wms_putaway_suggestions AS
2 /* $Header: WMSPRGES.pls 120.2.12010000.1 2008/07/28 18:36:05 appldev ship $ */
3 --
4 /*===========================================================================+
5  | Procedure:                                                                |
6  |    conc_pre_generate                                                      |
7  |                                                                           |
8  | Description:                                                              |
9  |    This is a wrapper API that calls WMS_PUTAWAY_SUGGESTIONS.PRE_GENERATE  |
10  | API. It has the necessary parameters required for being a concurrent      |
11  | program.                                                                  |
12  |                                                                           |
13  | Input Parameters:                                                         |
14  |       p_organization_id                                                   |
15  |         Mandatory parameter. Organization where putaway suggestions have  |
16  |         to be pre-generated.                                              |
17  |       p_lpn_id                                                            |
18  |         Optional parameter. LPN for which suggestions have to be created. |
19  |                                                                           |
20  | Output Parameters:                                                        |
21  |        x_retcode                                                          |
22  |          Standard Concurrent program parameter - Normal, Warning, Error.  |
23  |        x_errorbuf                                                         |
24  |          Standard Concurrent program parameter - Holds error message.     |
25  |                                                                           |
26  | API Used:                                                                 |
27  |     PRE_GENERATE API to generate the putaway suggestions.                 |
28  +===========================================================================*/
29 
30 --Return values for x_retcode(standard for concurrent programs)
31 
32 RETCODE_SUCCESS         CONSTANT     VARCHAR2(1)  := '0';
33 RETCODE_WARNING         CONSTANT     VARCHAR2(1)  := '1';
34 RETCODE_ERROR           CONSTANT     VARCHAR2(1)  := '2';
35 
36 PROCEDURE conc_pre_generate(
37     x_errorbuf         OUT  NOCOPY VARCHAR2,
38     x_retcode          OUT  NOCOPY VARCHAR2,
39     p_organization_id   IN  NUMBER,
40     p_lpn_id            IN  NUMBER,
41     p_is_srs_call       IN VARCHAR2 DEFAULT NULL
42     );
43 
44 -- Procedure called by receiving. The procedure submits a request to start
45 --the concurrent program
46 
47 PROCEDURE start_pregenerate_program
48   (p_org_id               IN   NUMBER,
49    p_lpn_id               IN   NUMBER,
50    x_return_status        OUT NOCOPY VARCHAR2,
51    x_msg_count            OUT NOCOPY NUMBER,
52    x_msg_data             OUT NOCOPY VARCHAR2
53    );
54 
55 
56 --
57 /*===========================================================================+
58  | Procedure:                                                                |
59  |     pre_generate                                                          |
60  |                                                                           |
61  | Description:                                                              |
62  |    This API polls receipts table for receipts yet to be put away and      |
63  | create suggestions for their put away.                                    |
64  |                                                                           |
65  | Input Parameters:                                                         |
66  |       p_from_conc_pgm                                                     |
67  |         Mandatory parameter. Default 'Y'. Indicates if the caller is      |
68  |         concurrent program or otherwise. This is needed to know if        |
69  |         messages have to be logged in a file.                             |
70  |       p_commit                                                            |
71  |         Mandatory parameter. Default 'Y'. Indicates if commit has to      |
72  |         happen.                                                           |
73  |       p_organization_id                                                   |
74  |         Mandatory parameter. Organization where putaway suggestions have  |
75  |         to be pre-generated.                                              |
76  |       p_lpn_id                                                            |
77  |         Optional parameter. LPN for which suggestions have to be created. |
78  |                                                                           |
79  | Output Parameters:                                                        |
80  |        x_return_status                                                    |
81  |          Standard API return status - Success, Error, Unexpected Error.   |
82  |        x_msg_count                                                        |
83  |          Number of messages in the message queue                          |
84  |        x_msg_data                                                         |
85  |          If the number of messages in the message queue is one,           |
86  |          x_msg_data has the message text.                                 |
87  |        x_partial_success                                                  |
88  |          Indicates if one or more lpns errored out.                       |
89  |        x_lpn_line_error_tbl                                               |
90  |          Plsql table to hold the errored out lpn_id and line ids.         |
91  |                                                                           |
92  | Tables Used:                                                              |
93  |        1. mtl_txn_request_headers                                         |
94  |        2. mtl_txn_request_lines                                           |
95  +===========================================================================*/
96 --lpn_tbl and line_tbl are plsql tables to hold the errored lpn_id, line_id
97 
98 /* Start of fix for bug # 4964866 */
99 
100 /*-- Bug# 4178478: Fix Begin
101 TYPE l_lpn_table_type IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
102 -- Bug# 4178478: Fix End */
103 
104 TYPE mmtt_type_rec is RECORD
105 (
106    lpn_id                         NUMBER
107  , organization_id                NUMBER
108  , subinventory_code              VARCHAR2(10)
109  , locator_id                     NUMBER
110  );
111 
112 TYPE mmtt_table_type IS TABLE OF mmtt_type_rec INDEX BY BINARY_INTEGER;
113 
114 /* End of fix for bug # 4964866 */
115 
116 TYPE lpn_line_rec IS RECORD (
117      lpn_id NUMBER,
118      line_id NUMBER);
119 TYPE lpn_line_error_tbl IS TABLE OF lpn_line_rec INDEX BY BINARY_INTEGER;
120 
121 PROCEDURE pre_generate(
122     x_return_status         OUT NOCOPY VARCHAR2,
123     x_msg_count             OUT NOCOPY NUMBER,
124     x_msg_data              OUT NOCOPY VARCHAR2,
125     x_partial_success  	    OUT NOCOPY VARCHAR2,
126     x_lpn_line_error_tbl    OUT NOCOPY lpn_line_error_tbl,
127     p_from_conc_pgm          IN  VARCHAR2,
128     p_commit                 IN  VARCHAR2,
129     p_organization_id        IN  NUMBER,
130     p_lpn_id                 IN  NUMBER,
131     p_is_srs_call            IN  VARCHAR2 DEFAULT NULL
132     );
133 
134 PROCEDURE cleanup_suggestions
135   (p_org_id                       IN  NUMBER,
136    p_lpn_id                       IN  NUMBER,
137    x_return_status                OUT NOCOPY VARCHAR2,
138    x_msg_count                    OUT NOCOPY NUMBER,
139    x_msg_data                     OUT NOCOPY VARCHAR2,
140    p_move_order_line_id           IN NUMBER DEFAULT NULL  --added for ATF_J2
141    );
142 
143 /*===========================================================================+
144  | Procedure:                                                                |
145  |     print_message                                                         |
146  |                                                                           |
147  | Description:                                                              |
148  |    Writes message text in log files.                                      |
149  |                                                                           |
150  | Input Parameters:                                                         |
151  |        None                                                               |
152  |                                                                           |
153  | Output Parameters:                                                        |
154  |        None                                                               |
155  |                                                                           |
156  | Tables Used:                                                              |
157  |        None                                                               |
158  +===========================================================================*/
159 
160 PROCEDURE print_message(dummy IN VARCHAR2 DEFAULT NULL);
161 
162 END wms_putaway_suggestions;