DBA Data[Home] [Help]

PACKAGE: APPS.INV_MISSING_QTY_ACTIONS_ENGINE

Source


1 PACKAGE inv_missing_qty_actions_engine AS
2   /* $Header: INVMQAES.pls 120.0 2005/05/25 06:04:10 appldev noship $ */
3 
4   /** Missing Qty Actions (Lookups - INV_MISSING_QTY_ACTIONS) */
5   /** Decreases the Reservation - Equal to No Action */
6   g_action_backorder        CONSTANT NUMBER := 1;
7   /** Split the Allocation into two */
8   g_action_split_allocation CONSTANT NUMBER := 2;
9   /** Create Cycle Count Reservations */
10   g_action_cycle_count      CONSTANT NUMBER := 3;
11 
12   /**
13     * The procedure backups the allocations of a Move Order Line identified
14     * either by Move Order Line ID or Transaction Temp ID by populating the
15     * table MTL_ALLOCATIONS_GTMP.
16     * <p>
17     * The API populates the table MTL_ALLOCATIONS_GTMP (Global Temporary Table)
18     * by querying MMTT for the allocations. The table will be populated only for <br>
19     *   1. Lot Controlled            - Lot Info is captured from MTLT <br>
20     *   2. Serial Controlled         - Serial Info is captured from MSN <br>
21     *   3. Lot and Serial Controlled - Lot and Serial Info is captured from MTLT and MSN <br>
22     * <br>
23     * Before populating the table, all the records that are inserted into the temp
24     * table by this Session are deleted.
25     * <p>
26     * If Transaction Temp ID is passed, then only the Allocation identified by
27     * Transaction Temp ID is inserted into the Table. <br>
28     * If Transaction Temp ID is not passed, then Move Order Line ID has to be
29     * passed, in which case all the Allocations identified by Move Order Line ID
30     * are inserted into the Table. <br>
31     * Lot and Serial Control Codes are not mandatory. If not passed, they will be
32     * determined by the API. <br>
33     * <p>
34     * @param x_return_status        Return Status
35     * @param x_msg_data             Message is the Count of Messages is 1
36     * @param x_msg_count            Count of Messages in the Stack
37     * @param p_transaction_temp_id  Transaction Temp ID
38     * @param p_mo_line_id           Move Order Line ID
39     * @param p_lot_control_code     Lot Control Code
40     * @param p_serial_control_code  Serial Control Code
41     **/
42   PROCEDURE populate_table(
43     x_return_status       OUT NOCOPY VARCHAR2
44   , x_msg_data            OUT NOCOPY VARCHAR2
45   , x_msg_count           OUT NOCOPY NUMBER
46   , p_transaction_temp_id            NUMBER
47   , p_mo_line_id                     NUMBER
48   , p_lot_control_code               NUMBER DEFAULT NULL
49   , p_serial_control_code            NUMBER DEFAULT NULL
50   );
51 
52   /**
53     * The procedure proceeds with the processing required for the chosen Missing
54     * Qty Action.
55     * <p>
56     * The API first removes all the Confirmed Lots and Serials and updates the
57     * table MTL_ALLOCATIONS_GTMP (Global Temporary Table) so that it contains only
58     * the Non Confirmed Lots and Serials. <br>
59     * If the Missing Qty Action is <br>
60     * Backorder Only (Action ID #1):<br>
61     *   Decreases the Reservation if any by the passed Missing Qty. <p>
62     * Split Allocation (Action ID #2): <br>
63     *   Splits the current Allocation to create a new one for the Remaining Qty
64     *   passed till Lot and Serial level. <p>
65     * Cycle Count (Action ID #3): <br>
66     *   Creates a (or Transfer the existing reservation) Cycle Count Reservation
67     *   for the Missing Quantity passed till Lot Level. <br>
68     *   Then Creates a Cycle Count Reservation on the Remaining Availability of
69     *   the item for that Revision, Lot, Subinventory and Locator identified by
70     *   the Allocation.
71     * <p>
72     * Lot and Serial Control Codes are not mandatory. If not passed, they will be
73     * determined by the API. <br>
74     * <p>
75     * @param x_return_status        Return Status
76     * @param x_msg_data             Message is the Count of Messages is 1
77     * @param x_msg_count            Count of Messages in the Stack
78     * @param x_new_record_id        ID of the new Record.
79     * @param p_action               Missing Qty Action (Either 1, 2 or 3)
80     * @param p_transaction_temp_id  Transaction Temp ID
81     * @param p_remaining_quantity   Remaining Quantity (Non Confirmed Qty)
82     * @param p_lot_control_code     Lot Control Code
83     * @param p_serial_control_code  Serial Control Code
84     **/
85   PROCEDURE process_action(
86     x_return_status       OUT NOCOPY VARCHAR2
87   , x_msg_data            OUT NOCOPY VARCHAR2
88   , x_msg_count           OUT NOCOPY NUMBER
89   , x_new_record_id       OUT NOCOPY NUMBER
90   , p_action                         NUMBER
91   , p_transaction_temp_id            NUMBER
92   , p_remaining_quantity             NUMBER
93   , p_remaining_secondary_quantity   NUMBER DEFAULT NULL  --INVCONV KKILLALMS
94   , p_lot_control_code               NUMBER DEFAULT NULL
95   , p_serial_control_code            NUMBER DEFAULT NULL
96   );
97 
98 
99 PROCEDURE update_allocation_qty
100    (
101     x_return_status       OUT NOCOPY VARCHAR2
102   , x_msg_data            OUT NOCOPY VARCHAR2
103   , x_msg_count           OUT NOCOPY NUMBER
104   , p_transaction_temp_id            NUMBER
105   , p_confirmed_quantity             NUMBER
106   , p_transaction_uom                VARCHAR2
107    --INVCONV kkillams
108   , p_sec_confirmed_quantity         NUMBER   DEFAULT NULL
109   , p_secondary_uom_code             VARCHAR2 DEFAULT NULL
110    --INVCONV kkillams
111   );
112 
113 END inv_missing_qty_actions_engine;