1 PACKAGE wms_txnrsn_actions_pub AS
2 /* $Header: WMSTRSAS.pls 120.1.12000000.2 2007/10/23 04:10:00 anagupta ship $ */
3
4 /* Procedure Inadequate_qty */
5 -- Purpose:
6 -- This procedure is meant to be called whenever there is a discrepancy and the
7 -- user chooses InadequateQty as the reason code. This procedure calls the
8 -- Suggest_new_location procedure which will update the existing MMTT line
9 -- with the new qty and redetail the MO line for the remaining qty. The new
10 -- task(s) are then inserted into WMS_DISPATCHED_TASKS for the userID being
11 -- passed in, if appropriate. It then calls the Log_exception API to insert
12 -- a row in WMS_EXCEPTIONS
13 --
14 --
15 -- Input Parameters:
16 -- p_api_version
17 -- API version number (current version is 1.0)
18 -- p_init_msg_list (optional, default FND_API.G_FALSE)
19 -- Valid values: FND_API.G_FALSE or FND_API.G_TRUE.
20 -- if set to FND_API.G_TRUE
21 -- initialize error message list
22 -- if set to FND_API.G_FALSE - not initialize error -- message list
23 -- p_commit (optional, default FND_API.G_FALSE)
24 -- whether or not to commit the changes to database
25 -- p_organization_id Organization Id - Required Value
26 -- p_mmtt_id Transaction Temp ID from MMTT - Required Value
27 -- p_inventory_item_id Inventory Item ID - Required Value since
28 -- currently cycle COUNT can only be done FOR a
29 -- specific item (AND optionally, locator)
30 -- p_subinventory_code Subinventory Code - Required Value
31 -- p_locator_id Location for Cycle Count - Required Value
32 -- p_qty_picked Qty already picked - Defaults to 0
33 -- p_carton_id LPN ID of the carton being picked - Optional, defaults
34 -- to null
35 -- p_user_id Id for the user performing the task - Required Value
36 -- p_reason_id - Required Value Reason_ID from MTL_Transaction_reasons
37 -- for Reason chosen by user
38
39 --
40 -- Output Parameters
41 -- x_return_status
42 -- if the Generate_LPN API succeeds, the value is
43 -- fnd_api.g_ret_sts_success;
44 -- if there is an expected error, the value is
45 -- fnd_api.g_ret_sts_error;
46 -- if there is an unexpected error, the value is
47 -- fnd_api.g_ret_sts_unexp_error;
48 -- x_msg_count
49 -- if there is one or more errors, the number of error messages
50 -- in the buffer
51 -- x_msg_data
52 -- if there is one and only one error, the error message
53 -- (See fnd_api package for more details about the above output parameters)
54 PROCEDURE Inadequate_Qty
55 (
56 p_api_version_number IN NUMBER
57 , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
58 , p_commit IN VARCHAR2 := FND_API.G_FALSE
59 , x_return_status OUT NOCOPY VARCHAR2
60 , x_msg_count OUT NOCOPY NUMBER
61 , x_msg_data OUT NOCOPY VARCHAR2
62 , p_organization_id IN NUMBER
63 , p_task_id IN NUMBER
64 , p_qty_picked IN NUMBER:=0
65 , p_qty_uom IN VARCHAR2
66 , p_carton_id IN VARCHAR2:= NULL
67 , p_user_id IN VARCHAR2
68 , p_reason_id IN NUMBER
69 );
70 --
71
72 /* Procedure Suggest_alternate_location */
73 -- Purpose:
74 -- This procedure will update missing qty column in the existing MMTT line
75 -- with the originalqty-p_qty_picked. It will then re detail the Mo
76 -- line. This in turn will create a cycle count reservation for the missing
77 -- qty.It will update the neww mmtt line with a carton id, if one has
78 -- been passed
79 -- It will then insert the new task(s) created into wms_dispatched_tasks
80 -- for the user id passed in
81 -- Input Parameters:
82 -- p_api_version
83 -- API version number (current version is 1.0)
84 -- p_init_msg_list (optional, default FND_API.G_FALSE)
85 -- Valid values: FND_API.G_FALSE or FND_API.G_TRUE.
86 -- if set to FND_API.G_TRUE
87 -- initialize error message list
88 -- if set to FND_API.G_FALSE - not initialize error -- message list
89 -- p_commit (optional, default FND_API.G_FALSE)
90 -- whether or not to commit the changes to database
91 -- p_organization_id Organization Id - Required Value
92 -- p_mmtt_id Transaction Temp ID from MMTT - Required Value
93 -- p_subinventory_code Subinventory Code - Required Value
94 -- p_locator_id Location for Cycle Count - Required Value
95 -- p_carton_id LPN ID of the carton being picked - Optional, defaults
96 -- to null
97 -- p_user_id Id for the user performing the task - Required Value
98 -- p_qty_picked Qty already picked - Required value
99 -- Output Parameters
100 -- x_return_status
101 -- if the Generate_LPN API succeeds, the value is
102 -- fnd_api.g_ret_sts_success;
103 -- if there is an expected error, the value is
104 -- fnd_api.g_ret_sts_error;
105 -- if there is an unexpected error, the value is
106 -- fnd_api.g_ret_sts_unexp_error;
107 -- x_msg_count
108 -- if there is one or more errors, the number of error messages
109 -- in the buffer
110 -- x_msg_data
111 -- if there is one and only one error, the error message
112 -- (See fnd_api package for more details about the above output parameters)
113
114 PROCEDURE Suggest_alternate_location
115 (
116 p_api_version_number IN NUMBER
117 , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
118 , p_commit IN VARCHAR2 := FND_API.G_FALSE
119 , x_return_status OUT NOCOPY VARCHAR2
120 , x_msg_count OUT NOCOPY NUMBER
121 , x_msg_data OUT NOCOPY VARCHAR2
122 , p_organization_id IN NUMBER
123 , p_mmtt_id IN NUMBER
124 , p_task_id IN NUMBER
125 , p_subinventory_code IN VARCHAR2
126 , p_locator_id IN NUMBER
127 , p_carton_id IN VARCHAR2:= NULL
128 , p_user_id IN VARCHAR2
129 , p_qty_picked IN NUMBER
130 , p_line_num IN NUMBER
131 );
132
133
134
135 /* Procedure Log_exception */
136 -- Purpose:
137 -- This procedure will insert a line into WMS_EXCEPTIONS with the values
138 -- being passed in
139 -- Input Parameters:
140 -- p_api_version
141 -- API version number (current version is 1.0)
142 -- p_init_msg_list (optional, default FND_API.G_FALSE)
143 -- Valid values: FND_API.G_FALSE or FND_API.G_TRUE.
144 -- if set to FND_API.G_TRUE
145 -- initialize error message list
146 -- if set to FND_API.G_FALSE - not initialize error -- message list
147 -- p_commit (optional, default FND_API.G_FALSE)
148 -- whether or not to commit the changes to database
149 -- p_organization_id Organization Id - Required Value
150 -- p_mmtt_id Transaction Temp ID from MMTT - Required Value
151 -- p_reason_id - Required Value Reason_ID from MTL_Transaction_reasons
152 -- for Reason chosen by user
153 -- p_subinventory_code Subinventory Code - Required Value
154 -- p_locator_id Location for Cycle Count - Required Value
155 -- p_carton_id LPN ID of the carton being picked - Optional, defaults
156 -- to null
157 -- p_user_id Id f the user performing the task - Required Value
158 -- p_discrepancy_type - Required Value. Discrepancy TYpe from
159 -- lookup WMS_Discrepancy_types
160 -- Output Parameters
161 -- x_return_status
162 -- if the Generate_LPN API succeeds, the value is
163 -- fnd_api.g_ret_sts_success;
164 -- if there is an expected error, the value is
165 -- fnd_api.g_ret_sts_error;
166 -- if there is an unexpected error, the value is
167 -- fnd_api.g_ret_sts_unexp_error;
168 -- x_msg_count
169 -- if there is one or more errors, the number of error messages
170 -- in the buffer
171 -- x_msg_data
172 -- if there is one and only one error, the error message
173 -- (See fnd_api package for more details about the above output parameters)
174
175
176 PROCEDURE Log_exception
177 (
178 p_api_version_number IN NUMBER
179 , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
180 , p_commit IN VARCHAR2 := FND_API.G_FALSE
181 , x_return_status OUT NOCOPY VARCHAR2
182 , x_msg_count OUT NOCOPY NUMBER
183 , x_msg_data OUT NOCOPY VARCHAR2
184 , p_organization_id IN NUMBER
185 , p_mmtt_id IN NUMBER
186 , p_task_id IN NUMBER
187 , p_reason_id IN NUMBER
188 , p_subinventory_code IN VARCHAR2
189 , p_locator_id IN NUMBER
190 , p_discrepancy_type IN NUMBER
191 , p_user_id IN VARCHAR2
192 , p_item_id IN NUMBER:=NULL
193 , p_revision IN VARCHAR2:=NULL
194 , p_lot_number IN VARCHAR2:=NULL
195 , p_lpn_id IN NUMBER:=NULL
196 , p_is_loc_desc IN BOOLEAN := FALSE --Added bug 3989684
197 );
198
199
200 /* Will be called for
201 1. PICK NONE exception - from PickLoad page directly
202 2. CURTAIL PICK - confirm qty < requested_qty
203 -- cleanup task will be called for each temp_id with this case..usually only one
204 EXCEPT in case of BULK, there will be multiple MMTTs selected for the given temp_id
205 -- it should be called only for qty exceptions where picked quantity < suggested quantity
206 -- and not for overpicked qty
207 3. CURTAIL PICK for all children of BULK- */
208
209 PROCEDURE cleanup_task(
210 p_temp_id IN NUMBER
211 , p_qty_rsn_id IN NUMBER
212 , p_user_id IN NUMBER
213 , p_employee_id IN NUMBER
214 , x_return_status OUT NOCOPY VARCHAR2
215 , x_msg_count OUT NOCOPY NUMBER
216 , x_msg_data OUT NOCOPY VARCHAR2);
217
218
219 -- Parses the exception string and logs the exceptions to wms_exceptions
220 PROCEDURE process_exceptions
221 (p_organization_id IN NUMBER,
222 p_employee_id IN NUMBER,
223 p_effective_start_date IN DATE,
224 p_effective_end_date IN DATE,
225 p_inventory_item_id IN NUMBER,
226 p_revision IN VARCHAR2,
227 p_discrepancies IN VARCHAR2,
228 x_return_status OUT nocopy VARCHAR2,
229 x_msg_count OUT nocopy NUMBER,
230 x_msg_data OUT nocopy VARCHAR2);
231
232 --Bug 6278066 Wrapper for log_exception
233 PROCEDURE Log_exception
234 (x_return_status OUT NOCOPY VARCHAR2
235 , x_msg_count OUT NOCOPY NUMBER
236 , x_msg_data OUT NOCOPY VARCHAR2
237 , p_organization_id IN NUMBER
238 , p_mmtt_id IN NUMBER
239 , p_task_id IN NUMBER
240 , p_reason_id IN NUMBER
241 , p_subinventory_code IN VARCHAR2
242 , p_locator_id IN NUMBER
243 , p_discrepancy_type IN NUMBER
244 , p_user_id IN VARCHAR2
245 , p_item_id IN NUMBER:=NULL
246 , p_revision IN VARCHAR2:=NULL
247 , p_lot_number IN VARCHAR2:=NULL
248 , p_lpn_id IN NUMBER:=NULL
249 , p_is_loc_desc IN VARCHAR2
250 );
251
252 END wms_txnrsn_actions_pub;
253
254