DBA Data[Home] [Help]

PACKAGE: APPS.WMS_RE_CUSTOM_PUB

Source


1 package WMS_RE_Custom_PUB AUTHID CURRENT_USER as
2 /* $Header: WMSPPPUS.pls 120.6.12020000.2 2013/01/31 22:00:28 sahmahes ship $ */
3 
4   -- File        : WMSPPPUS.pls
5   -- Content     : WNS_RE_Custom_PUB package specification
6   -- Description : Customizable stub procedures and functions called during
7   --               WMS rules engine run.
8   -- Notes       :
9   -- Modified    : 02/08/99 mzeckzer created
10 
11   -- Local copies of fnd globals to prevent pragma violations of api functions
12   g_miss_num  constant number      := fnd_api.g_miss_num;
13   g_miss_char constant varchar2(1) := fnd_api.g_miss_char;
14   g_miss_date constant date        := fnd_api.g_miss_date;
15 
16   -- Start of comments
17   -- API name    : GetTotalLocationCapacity
18   -- Type        : Public
19   -- Function    : Calculates and returns the total capacity of a location
20   --               ( sub or sub/locator ) in a customer-specific manner
21   --               This function is made available to be used within put away
22   --               rule setup.
23   -- Pre-reqs    : none
24   -- Parameters  :
25   --  p_organization_id      in  number   required default = fnd_api.g_miss_num
26   --  p_subinventory_code    in  varchar2 required default = fnd_api.g_miss_char
27   --  p_locator_id           in  number   optional default = null
28   --  p_inventory_item_id    in  number   required default = fnd_api.g_miss_num
29   --  p_transaction_uom      in  varchar2 required default = fnd_api.g_miss_char
30   --  return value           out number
31   -- Version     : not tracked
32   -- Notes       : capacity should be returned as measured in txn UOM
33   -- End of comments
34 
35   function GetTotalLocationCapacity (
36            p_organization_id          number      := g_miss_num
37           ,p_subinventory_code        varchar2    := g_miss_char
38           ,p_locator_id               number      := null
39           ,p_inventory_item_id        number      := g_miss_num
40           ,p_transaction_uom          varchar2    := g_miss_char
41                                 ) return number;
42   pragma restrict_references(GetTotalLocationCapacity, WNDS, WNPS);
43 
44   -- Start of comments
45   -- API name    : GetOccupiedLocationCapacity
46   -- Type        : Public
47   -- Function    : Calculates and returns the occupied capacity of a location
48   --               ( sub or sub/locator ) in a customer-specific manner
49   --               This function is made available to be used within put away
50   --               rule setup.
51   -- Pre-reqs    : none
52   -- Parameters  :
53   --  p_organization_id      in  number   required default = fnd_api.g_miss_num
54   --  p_subinventory_code    in  varchar2 required default = fnd_api.g_miss_char
55   --  p_locator_id           in  number   optional default = null
56   --  p_inventory_item_id    in  number   required default = fnd_api.g_miss_num
57   --  p_transaction_uom      in  varchar2 required default = fnd_api.g_miss_char
58   --  return value           out number
59   -- Version     : not tracked
60   -- Notes       : capacity should be returned as measured in txn UOM
61   -- End of comments
62 
63   function GetOccupiedLocationCapacity (
64            p_organization_id          number      := g_miss_num
65           ,p_subinventory_code        varchar2    := g_miss_char
66           ,p_locator_id               number      := null
67           ,p_inventory_item_id        number      := g_miss_num
68           ,p_transaction_uom          varchar2    := g_miss_char
69                                    ) return number;
70   pragma restrict_references(GetOccupiedLocationCapacity, WNDS, WNPS);
71 
72   -- Start of comments
73   -- API name    : GetAvailableLocationCapacity
74   -- Type        : Public
75   -- Function    : Calculates and returns the available capacity of a location
76   --               ( sub or sub/locator ) in a customer-specific manner
77   --               This function is made available to be used within put away
78   --               rule setup.
79   -- Pre-reqs    : none
80   -- Parameters  :
81   --  p_organization_id      in  number   required default = fnd_api.g_miss_num
82   --  p_subinventory_code    in  varchar2 required default = fnd_api.g_miss_char
83   --  p_locator_id           in  number   optional default = null
84   --  p_inventory_item_id    in  number   required default = fnd_api.g_miss_num
85   --  p_transaction_quantity in  number   required default = fnd_api.g_miss_num
86   --  p_transaction_uom      in  varchar2 required default = fnd_api.g_miss_char
87   --  return value           out number
88   -- Version     : not tracked
89   -- Notes       : capacity must be returned as measured in txn UOM
90   -- End of comments
91 
92   function GetAvailableLocationCapacity (
93            p_organization_id          number      := g_miss_num
94           ,p_subinventory_code        varchar2    := g_miss_char
95           ,p_locator_id               number      := null
96           ,p_inventory_item_id        number      := g_miss_num
97           ,p_transaction_quantity     number      := g_miss_num
98           ,p_transaction_uom          varchar2    := g_miss_char
99                                     ) return number;
100   pragma restrict_references(GetAvailableLocationCapacity, WNDS, WNPS);
101 
102   -- Start of comments
103   -- API name    : GetRemainingLocationCapacity
104   -- Type        : Public
105   -- Function    : Calculates and returns the occupied capacity of a location
106   --               ( sub or sub/locator ) in a customer-specific manner
107   --               This function is made available to be used within put away
108   --               rule setup.
109   -- Pre-reqs    : none
110   -- Parameters  :
111   --  p_organization_id      in  number   required default = fnd_api.g_miss_num
112   --  p_subinventory_code    in  varchar2 required default = fnd_api.g_miss_char
113   --  p_locator_id           in  number   optional default = null
114   --  p_inventory_item_id    in  number   required default = fnd_api.g_miss_num
115   --  p_transaction_quantity in  number   required default = fnd_api.g_miss_num
116   --  p_transaction_uom      in  varchar2 required default = fnd_api.g_miss_char
117   --  return value           out number
118   -- Version     : not tracked
119   -- Notes       : capacity should be returned as measured in txn UOM
120   -- End of comments
121 
122   function GetRemainingLocationCapacity (
123            p_organization_id          number      := g_miss_num
124           ,p_subinventory_code        varchar2    := g_miss_char
125           ,p_locator_id               number      := null
126           ,p_inventory_item_id        number      := g_miss_num
127           ,p_transaction_quantity     number      := g_miss_num
128           ,p_transaction_uom          varchar2    := g_miss_char
129                                     ) return number;
130   pragma restrict_references(GetRemainingLocationCapacity, WNDS, WNPS);
131 
132   -- Start of comments
133   -- API name    : SearchForStrategy
134   -- Type        : Public
135   -- Function    : Searches for a pick or put away strategy assignment to a
136   --               customer-defined business object in a customer-specific
137   --               manner.
138   --               This procedure gets called just before the standard algorithm
139   --               which searches for strategy assignments to system-defined
140   --               business objects.
141   -- Pre-reqs    : transaction record in WMS_STRATEGY_MAT_TXN_TMP_V uniquely
142   --                identified by parameters p_transaction_temp_id and
143   --                p_type_code ( already validated by calling procedure )
144   --               set up strategy assignment in WMS_STRATEGY_ASSIGNMENTS
145   -- Parameters  :
146   --  p_init_msg_list        in  varchar2 optional default = fnd_api.g_false
147   --  x_return_status        out varchar2(1)
148   --  x_msg_count            out number
149   --  x_msg_data             out varchar2(2000)
150   --  p_transaction_temp_id  in  number   required default = fnd_api.g_miss_num
151   --  p_type_code            in  number   required default = fnd_api.g_miss_num
152   --  x_strategy_id          out number
153   -- Version     : not tracked
154   -- Notes       : type code of returned strategy has to match type code
155   --               parameter
156   -- End of comments
157 
158   procedure SearchForStrategy (
159             p_init_msg_list        in   varchar2 := fnd_api.g_false
160            ,x_return_status        out NOCOPY varchar2
161            ,x_msg_count            out NOCOPY  number
162            ,x_msg_data             out NOCOPY varchar2
163            ,p_transaction_temp_id  in   number   := fnd_api.g_miss_num
164            ,p_type_code            in   number   := fnd_api.g_miss_num
165            ,x_strategy_id          out NOCOPY  number
166            );
167 
168    /**
169 
170     API name    : SearchForStrategy
171     Type        : Public
172     Function    : Searches for a wms strategy/rule/value assignment to a
173                   customer-defined business object in a customer-specific
174                   manner.
175     Pre-reqs    : transaction record in WMS_STRATEGY_MAT_TXN_TMP_V uniquely
176                    identified by parameters p_transaction_temp_id and
177                    p_type_code ( already validated by calling procedure )
178                   set up strategy assignment in WMS_STRATEGY_ASSIGNMENTS
179     Parameters  :
180      p_init_msg_list        in  varchar2 optional default = fnd_api.g_false
181      x_return_status        out varchar2(1)
182      x_msg_count            out number
183      x_msg_data             out varchar2(2000)
184      p_transaction_temp_id  in  number   required default = fnd_api.g_miss_num
185      p_type_code            in  number   required default = fnd_api.g_miss_num
186      x_return_type          out  varchar2 'V' for Value , 'R' for Rule , 'S' for strategy
187     ,x_return_type_id       out  number
188       Notes       : type code of returned strategy has to match type code
189                   parameter
190   */
191   procedure SearchForStrategy (
192             p_init_msg_list        in   varchar2 := fnd_api.g_false
193            ,x_return_status        out NOCOPY varchar2
194            ,x_msg_count            out NOCOPY number
195            ,x_msg_data             out NOCOPY varchar2
196            ,p_transaction_temp_id  in   number   := fnd_api.g_miss_num
197            ,p_type_code            in   number   := fnd_api.g_miss_num
198            ,x_return_type          out  NOCOPY varchar2 -- 'V' for Value , 'R' for Rule , 'S' for strategy
199            ,x_return_type_id       out  NOCOPY number
200            );
201 
202 	--BUG12681832 Begin
203 	-- Start of comments
204 	-- Function Name: PutawayPartialDetailedLPN
205 	-- Type         : Public
206 	-- Function     : Returns boolean and is to be used for Putaway (Move Any LPN) logic implementaion
207 	-- Parameters   : p_lpn_id is a IN parameter that which as illustrated in below example would be lpn_id of LPN1.
208 	-- Function logic
209 	/*
210 	The following Function PutawayPartialDetailedLPN is used to determine if we are to continue with putaway of LPN that has partial allocations.
211 	Eg. LPN1 is parent LPN and has LPN2 + LPN3 inside it. If Putaway suggestions for all LPNs are found then user can proceed with transaction to putaway the LPN.
212 	If Putaway suggestions fail to find a destination locator for one or more inner LPN's and/or their contents then Putaway would be stopped.
213 	If you want to proceed with Putaway of partial LPN then PutawayPartialDetailedLPN function needs to return TRUE in place of FALSE that is currently returned.
214 	If you enable PutawayPartialDetailedLPN then custom logic can be written for scenarios to handle combinations of nested LPNs with partial allocations.
215 	_________________
216 	|	|------|----|-------->Has allocation(Based on WMS Rules the suggestions PUB found a place to Putaway the LPN/material in this LPN)
217 	|	|_LPN2_|	|
218 	|				|-------->LPN1 (just has 2 nested LPN's in this example) There can be cases where there is material even in outer LPN
219 	|	|------|	|
220 	|	|_LPN3_|----|-------->Does not have allocation or maybe valid locator is found but destination found to putaway is same as source locator
221 	|_______________|		 (Based on WMS Rules the suggestions PUB could not find a place to Putaway the LPN/material in this LPN)
222 	To do implementaion of any custom code the outermost LPN's (LPN1 in ex) lpn_id being passed can be used to get all relevant details.
223 	Current code would stop the putaway in case of LPN1 mentioned above. Custom code can be written to allow partial LPN putaway.
224 	*/
225 	--End of Comments
226 
230 
227 	FUNCTION PutawayPartialDetailedLPN(p_lpn_id  number)
228 	RETURN BOOLEAN;
229 	--BUG12681832 End
231 
232   -- Start of comments
233   -- API name    : set_dualuom_alloc_prefs
234   -- Type        : Public
235   -- Function    : Allows customers to set preferences for material allocation
236   --               of dual UOM items.  This API is called once for each
237   --               move order line being allocated.
238   -- Pre-reqs    : none
239   --
240   -- Parameters  :
241   --   p_organization_id     - Organization ID
242   --   p_inventory_item_id   - Item ID
243   --   p_move_order_type     - Numeric code indicating move order type
244   --                           (see lookup type MOVE_ORDER_TYPE)
245   --   p_transaction_type_id - Transaction type ID
246   --                           (see table MTL_TRANSACTION_TYPES)
247   --   p_move_order_line_id  - Move Order Line ID
248   --
249   -- Return parameters:
250   --   x_sec_qty_round_mode  - Ensure that integer secondary quantities are
251   --                           allocated.  (Can be used only if OM indivisible
252   --                           flag on the item is unchecked - 'N')
253   --
254   --                           Indicate preference for how rounding should
255   --                           occur, using one of the following:
256   --
257   --     'F': Allocate the largest integer secondary quantity possible without exceeding
258   --          the primary requested quantity (uses the FLOOR() function)
259   --
260   --     'C': Allocate the smallest integer secondary quantity that meets or
261   --          exceeds the primary requested quantity (uses the CEIL() function)
262   --
263   --     'R': Round secondary quantity to nearest integer and minimize deviation
264   --          from the primary requested quantity (uses the ROUND() function)
265   --
266   --     Note: for allocation based on secondary, only 'F' (floor) is supported
267   --
268   --
269   --   x_target_uom  - Whether to allocate based on primary requested quantity (P)
270   --                   (the default), or secondary requested quantity (S)
271   --
272   --                   Allocation based on secondary is typically used when
273   --                   the demand document was created in secondary UOM
274   --                   and deviation is allowed between primary and secondary
275   --                   quantities.
276   --
277   --                   In such cases the primary quantity specified on the
278   --                   move order line would have been derived based on the
279   --                   standard UOM conversion from the secondary requested
280   --                   quantity, and if used as the basis for allocation,
281   --                   would result in either over-allocation or
282   --                   under-allocation of the secondary requested quantity
283   --                   (as a result of quantity deviation).
284   --
285   --                   By setting the fulfillment basis (x_target_uom) parameter
286   --                   one can ensure that the requested secondary quantity is
287   --                   correctly allocated.
288   --
289   --
290   -- Version     : not tracked
291   -- End of comments
292 
293   PROCEDURE set_dualuom_alloc_prefs(
294      p_organization_id      IN          NUMBER
295    , p_inventory_item_id    IN          NUMBER
296    , p_move_order_type      IN          NUMBER
297    , p_transaction_type_id  IN          NUMBER
298    , p_move_order_line_id   IN          NUMBER
299    , x_return_status        OUT NOCOPY  VARCHAR2
300    , x_msg_count            OUT NOCOPY  NUMBER
301    , x_msg_data             OUT NOCOPY  VARCHAR
302    , x_sec_qty_round_mode   OUT NOCOPY  VARCHAR2
303    , x_target_uom           OUT NOCOPY  VARCHAR2
304    );
305 
306   /*
307 	Custom Hook API to validate the SKU being picked for the picking task. Bug#13361151
308   */
309   -- Start of comments
310   -- API name    : custom_validate_picking_sku
311   -- Type        : Public
312   -- Function    : Allows customers do further validation (beyind picking rule) on the LPN being allocated
313   --               with the visibility of each partial allocation , if any .
314   -- Pre-reqs    : none
315   --
316   -- Parameters  :
317   --   p_organization_id                - Organization ID
318   --   p_inventory_item_id              - Item ID
319   --   p_revision                       - Item revision
320   --   p_subinventory_code              - Subinventory name where the allocation is being done.
321   --   p_locator_id                     - Locator ID from where the allocation is being done.
322   --   p_lot_number                     - Lot number which is being allocated.
323   --   p_cost_group_id                  - Cost Group ID of onhand that is being allocated.
324   --   p_lpn_id                         - LPN ID from where the allocation is being done.
325   --   p_rule_id                        - WMS Picking Rule ID used for allocation.
326   --   p_move_order_line_id             - Move Order Line ID
327   --   p_needed_primary_quantity        - Quantity left to be allocated at the moment.
328   --                                      ( MO quantity - sum(quantity already allocated)  ) .
329   --   p_needed_secondary_quantity      - Secondary Quantity left to be allocated at the moment.
330   --   p_picking_primary_quantity       - Quantity thats is being allocated from this LPN/SKU
331   --   p_picking_secondary_quantity     - Secondary Quantity thats is being allocated from this LPN/SKU
332   --   p_lpn_available_primary_qty      - Total Quantity availble in this LPN thats is being allocated.
333   --   p_lpn_available_secondary_qty    - Total Secondary Quantity availble in this LPN thats is being allocated.
334   --   p_already_allocated_pri_qty      - Total primary quantity that is already allocated for this move order line in this current execution
335   --   p_already_allocated_sec_qty      - Total secondary quantity that is already allocated for this move order line in this current execution
336   --
337   -- Return parameters:
338   --     The function returns boolean  TRUE or FALSE
339   --
340   --     'TRUE' : Allocation Engine will proceed and create a picking suggestion
341   --     'FALSE': Allocation Engine will not pick this SKU . It will skip this LPN and proceed to find the next one
342   --
343   -- Version     : not tracked
344   -- End of comments
345 
346    FUNCTION custom_validate_picking_sku (
347           p_organization_id             number,
348           p_inventory_item_id           number,
349           p_revision                    varchar2,
350           p_subinventory_code           varchar2,
351           p_locator_id                  number,
352           p_lot_number                  varchar2,
353           p_cost_group_id               number,
354           p_lpn_id                      number,
355 	  p_rule_id                     number,
356 	  p_move_order_line_id          number,
357 	  p_needed_primary_quantity     number,
358           p_needed_secondary_quantity   number,
359           p_picking_primary_quantity    number,
360           p_picking_secondary_quantity  number,
361           p_lpn_available_primary_qty   number,
362 	  p_lpn_available_secondary_qty number ,
363 	  p_already_allocated_pri_qty   number,
364 	  p_already_allocated_sec_qty   number )
365           return boolean ;
366 
367 end WMS_RE_Custom_PUB;