DBA Data[Home] [Help]

PACKAGE: APPS.WIP_AUTOLOTPROC_PRIV

Source


1 package wip_autoLotProc_priv AUTHID CURRENT_USER as
2  /* $Header: wiplotps.pls 120.1 2007/09/17 21:12:42 kboonyap ship $ */
3 
4   ------------------------------------------------------------------------------------------------
5   --This package will do lot defaulting. The deriveLots() procedure is the heart of the package.
6   --It will take an object of items and then derive lots for those items. The deriveLotsFromMMTT
7   --and deriveLotsFromMTI procedures are wrappers on top of deriveLots() that select items from
8   --MMTT, derive the lots for lot controlled items, and do various serial number checks for
9   --serial controlled items. Lots can be derived as follows:
10   --
11   --Issues: A quantity tree is built to query the amount of onhand lot quantities in the given
12   --        backflush location. This procedure uses the lot derivation parameters (FIFO,FEFO) to
13   --        pick lots.
14   --
15   --Negative Issues: Lots can not be derived for this transaction type. This is because neg issues
16   --                 are similar to assembly completions: A new item is being created, so none of
17   --                 the wip derivation rules are applicable.
18   --
19   --Returns/Negative Returns: Past transactions are queried to obtain the lots that were used in
20   --                          previous issues. These are the lots that are defaulted for these 2
21   --                          transaction types.
22   ------------------------------------------------------------------------------------------------
23 
24   --------------------------------------------------------------------------------------------------------
25   --deriveLots. This procedure will derive lots for all the items in the x_compLots structure.
26   --parameters:
27   --  + x_compLots: This parameter contains all the items that need lot derivation on input.
28   --                On output, derived lots are added to the object appropriately.
29   --  + p_orgID: The organization.
30   --  + p_wipEntityID: Only needed for returns. Used to query past transactions for this entity. Pass
31   --                   null for completion transactions.
32   --  + p_initMsgList: Initialize the message list?
33   --    --fnd_api.g_true   to initialize the message list
34   --    --fnd_api.g_false  to preserve the existing messages
35   --  + p_endDebug: Clean up the log file?
36   --    --fnd_api.g_true   unless you plan to call wip_logger.cleanUp() later.
37   --    --fnd_api.g_false  if you wish to close the log file.
38   --  + p_destroyTrees: Destroy the quantity trees after they are used?
39   --    --fnd_api.g_true   to destroy trees on procedure exit.
40   --    --fnd_api.g_false  to retain trees in memory for later manipulation by caller.
41   --  + p_treeMode: which mode to open the tree in. See inv_quantity_tree_pvt package spec.
42   --                wip normally uses inv_quantity_tree_pvt.g_reservation_mode.
43   --  + p_treeSrcName: Name of the tree. Use if the tree needs to be later identified (Only makes
44   --                   sense if p_destroyTrees is false).if p_destroyTrees is true, any value can
45   --                   be passed (including null).
46   --  + x_returnStatus: return status of the procedure (tri-state)
47   --    -- fnd_api.g_ret_sts_success      if all lot information was derived.
48   --    -- fnd_api.g_ret_sts_error        if some lot information could not be derived.
49   --    -- fnd_api.g_ret_sts_unexp_error  if an unexpected error occurred.
50   --------------------------------------------------------------------------------------------------------
51   procedure deriveLots(x_compLots  IN OUT NOCOPY system.wip_lot_serial_obj_t,
52                        p_orgID         IN NUMBER,
53                        p_wipEntityID   IN NUMBER,
54                        p_initMsgList   IN VARCHAR2,
55                        p_endDebug      IN VARCHAR2,
56                        p_destroyTrees  IN VARCHAR2,
57                        p_treeMode      IN NUMBER,
58                        p_treeSrcName   IN VARCHAR2,
59                        x_returnStatus OUT NOCOPY VARCHAR2);
60 
61   ---------------------------------------------------------------------------------------------------------
62   --deriveLotsFromMMTT. This procedure will derive lots for all the items in MMTT for the given identifier.
63   --It will also check if serial information is missing.
64   --parameters:
65   --  + p_cplTxnID: Query mmtt rows by completion_transaction_id if this parameter is not null.
66   --  + p_movTxnID: Query mmtt rows by move_transaction_id if this parameter is not null.
67   --  + p_orgID: The organization.
68   --  + p_wipEntityID: Only needed for returns. Used to query past transactions for this entity. Pass
69   --                   null for completions
70   --  + p_initMsgList: Initialize the message list?
71   --    --fnd_api.g_true   to initialize the message list
72   --    --fnd_api.g_false  to preserve the existing messages
73   --  + p_endDebug: Clean up the log file?
74   --    --fnd_api.g_true   unless you plan to call wip_logger.cleanUp() later.
75   --    --fnd_api.g_false  if you wish to close the log file.
76   --  + x_returnStatus: return status of the procedure (tri-state)
77   --    --fnd_api.g_ret_sts_success     if all lot information was derived.
78   --    --fnd_api.g_ret_sts_error       if some lot information could not be derived or some
79   --                                    items are under serial control.
80   --    --fnd_api.g_ret_sts_unexp_error if an unexpected error occurred.
81   ---------------------------------------------------------------------------------------------------------
82 /*  procedure deriveLotsFromMMTT(p_cplTxnID IN NUMBER,
83                                p_movTxnID IN NUMBER,
84                                p_orgID    IN NUMBER,
85                                p_wipEntityID IN NUMBER, --populate for returns
86                                p_initMsgList IN VARCHAR2,
87                                p_endDebug     IN VARCHAR2,
88                                x_returnStatus OUT NOCOPY VARCHAR2);
89 */
90   ---------------------------------------------------------------------------------------------------------
91   --deriveLotsFromMTI. This procedure will derive lots for all the items in MTI for the given identifier.
92   --It will also check if serial information is missing.
93   --parameters:
94   --  + p_orgID: The organization.
95   --  + p_wipEntityID: Only needed for returns. Used to query past transactions for this entity. Pass
96   --                   null for completions.
97   --  + p_parentID: Query MTI rows by parent_id.
98   --  + p_initMsgList: Initialize the message list?
99   --    --fnd_api.g_true   to initialize the message list
100   --    --fnd_api.g_false  to preserve the existing messages
101   --  + p_endDebug: Clean up the log file?
102   --    --fnd_api.g_true   unless you plan to call wip_logger.cleanUp() later.
103   --    --fnd_api.g_false  if you wish to close the log file.
104   --  + x_returnStatus: return status of the procedure (tri-state)
105   --    --fnd_api.g_ret_sts_success     if all lot information was derived.
106   --    --fnd_api.g_ret_sts_error       if some lot information could not be derived or some
107   --                                    items are under serial control.
108   --    --fnd_api.g_ret_sts_unexp_error if an unexpected error occurred.
109   ---------------------------------------------------------------------------------------------------------
110   procedure deriveLotsFromMTI(p_orgID    IN NUMBER,
111                               p_wipEntityID IN NUMBER, --populate for returns
112                               p_txnHdrID IN NUMBER,
113                               p_cplTxnID IN NUMBER := null,
114                               p_movTxnID IN NUMBER := null,
115                               p_childMovTxnID IN NUMBER := null,
116                               p_initMsgList IN VARCHAR2,
117                               p_endDebug     IN VARCHAR2,
118                               x_returnStatus OUT NOCOPY VARCHAR2);
119 
120 /******************************************************************************
121  * This procedure will do lots derivation. It will take an object of items
122  * and then derive lots for those items based on the genealogy built for
123  * assembly. Lots can be derived as follows:
124  *
125  * Return           : Lot will be derived based on genealogy build from issue
126  *                    transaction.
127  *
128  * Issues           : Lot cannot be derived for this transaction type
129  *                    because no genealogy have been built yet.
130  *
131  * Negative Return/ : Lot cannot be derived for these transaction types
132  * Negative Issue     because no genealogy have been built for these txns
133  *
134  * parameters:
135  * x_compLots        This parameter contains all the items that need to be
136  *                   unbackflushed. On output, derived lot are added to
137  *                   the object appropriately.
138  * p_objectID        Object_id of the parent serial(assembly). Used to derive
139  *                   all the child lot number
140  * p_orgID           Organization ID
141  * p_initMsgList     Initialize the message list?
142  * x_returnStatus    fnd_api.g_ret_sts_success if success without any errors.
143  *                   Otherwise return fnd_api.g_ret_sts_unexp_error.
144  *****************************************************************************/
145   PROCEDURE deriveLotsFromMOG(
146               x_compLots  IN OUT NOCOPY system.wip_lot_serial_obj_t,
147               p_orgID         IN        NUMBER,
148               p_objectID      IN        NUMBER,
149               p_initMsgList   IN        VARCHAR2,
150               x_returnStatus OUT NOCOPY VARCHAR2);
151 
152 end wip_autoLotProc_priv;