1 PACKAGE inv_lpn_trx_pub AS
2 /* $Header: INVTRXWS.pls 120.2.12010000.1 2008/07/24 01:49:34 appldev ship $ */
3
4 --
5 -- Name: PROCESS_LPN_TRX
6 --
7 -- Input parameters:
8 --
9 -- p_trx_hdr_id Transaction Header Id identified a batch
10 -- of records in MTL_MATERIAL_TRANSACTIONS_TEMP
11 -- p_commit default fnd_api.g_false
12 -- whether to commit the changes to DB.
13 -- Note that if the batch specified has records with
14 -- multiple transaction_group_ids then this API would
15 -- automatically commit. This is to prevent deadlock
16 -- on MOQD as MOQD is locked before updating.
17 -- p_proc_mode Processing Mode. This argument is generally NULL,
18 -- in which case the TP:INV* profiles are
19 -- used to determine how to process this transaction
20 -- record.
21 -- p_process_trx Should the transaction be completely processed OR only
22 -- the LPN-pre-processing be done. Default value is to
23 -- completely process the transaction records. When this
24 -- API is called from the ProC Manager (inltpu) only
25 -- LPN-pre-processing is done.
26 -- p_atomic Should all the rows in MMTT with the same transaction_
27 -- header_id be processed as one holistic unit or should
28 -- each row be treated as separate. When set to fnd_api.true
29 -- an error in one of the rows will result in aborting
30 -- the processing of all further rows in a batch.
31 --
32 --
33 -- Output parameters:
34 -- x_proc_msg Error Message from the Process-Manager
35 -- return_status 0 on Success, 1 on Error
36 --
37 -- Functions:
38 -- This API is used to process a batch of LPN based transactions.
39 -- The records comprising the batch should be present in
40 -- MTL_MATERIAL_TRANSACTIONS_TEMP and possibly the lot and
41 -- serial temp tables before invoking this API. The batch of
42 -- records are identified by the value of TRANSACTION_HEADER_ID column
43 -- in MTL_MATERIAL_TRANSACTIONS_TEMP. This API packs/unpack items/LPNs,
44 -- updates status of LPNs and calls the Inventory Transaction Manager
45 -- to update the quantity.
46 -- Note:
47 -- To support LPN functionality, 3 new fields have been added to
48 -- MTL_MATERIAL_TRANSACTIONS_TEMP table.
49 -- * CONTENT_LPN_ID : If the transaction involves a complete LPN
50 -- then this field is filled with that LPN's ID.
51 -- In this case, the INVENTORY_ITEM_ID should be -1.
52 -- * LPN_ID : If the transaction involved unpacking 'FROM' an
53 -- LPN, then field is populated with that LPN's ID.
54 -- In this case, the INVENTORY_ITEM_ID or CONTENT_LPN_ID should
55 -- have the ID of item or LPN that is to be UNPACKED.
56 -- * TRANSFER_LPN_ID : If the transaction involves 'PACKING'
57 -- an item or LPN to another LPN, then field should have the
58 -- ID of the LPN to which it is PACKed.
59 --
60 --
61 --
62 FUNCTION process_lpn_trx(
63 p_trx_hdr_id IN NUMBER
64 , p_commit IN VARCHAR2 := fnd_api.g_false
65 , x_proc_msg OUT NOCOPY VARCHAR2
66 , p_proc_mode IN NUMBER := NULL
67 , p_process_trx IN VARCHAR2 := fnd_api.g_true
68 , p_atomic IN VARCHAR2 := fnd_api.g_false
69 , p_business_flow_code IN NUMBER := NULL
70 )
71 RETURN NUMBER;
72
73 -- For BUG 2919763, the message stack is initialized only if the new parameter
74 -- p_init_msg_list is true.
75 FUNCTION process_lpn_trx(
76 p_trx_hdr_id IN NUMBER
77 , p_commit IN VARCHAR2 := fnd_api.g_false
78 , x_proc_msg OUT NOCOPY VARCHAR2
79 , p_proc_mode IN NUMBER := NULL
80 , p_process_trx IN VARCHAR2 := fnd_api.g_true
81 , p_atomic IN VARCHAR2 := fnd_api.g_false
82 , p_business_flow_code IN NUMBER := NULL
83 , p_init_msg_list IN BOOLEAN
84 )
85 RETURN NUMBER;
86
87 --
88 -- Name : PROCESS_LPN_TRX
89 -- Description : This procedure encapsulates all the operations that need
90 -- to be done related to LPNs in a transaction record.
91 -- The operations are grouped based on the transaction_action
92 -- and the contents of the columsn CONTENT_LPN_ID, LPN_ID
93 -- and TRANSFER_LPN_ID. This procedure is called from
94 -- BaseTransaction.java and is called in the context of
95 -- processing one transaction record in MMTT
96 --
97 PROCEDURE process_lpn_trx_line(
98 x_return_status OUT NOCOPY VARCHAR2
99 , x_proc_msg OUT NOCOPY VARCHAR2
100 , p_transaction_temp_id IN NUMBER
101 , p_business_flow_code IN NUMBER := NULL
102 , p_transaction_source_type_id IN NUMBER
103 , p_transaction_action_id IN NUMBER
104 , p_lpn_id IN NUMBER := NULL
105 , p_content_lpn_id IN NUMBER := NULL
106 , p_transfer_lpn_id IN NUMBER := NULL
107 , p_organization_id IN NUMBER
108 , p_subinventory_code IN VARCHAR2
109 , p_locator_id IN NUMBER := NULL
110 , p_transfer_organization IN NUMBER := NULL
111 , p_transfer_subinventory IN VARCHAR2 := NULL
112 , p_transfer_to_location IN NUMBER := NULL
113 , p_primary_quantity IN NUMBER
114 , p_primary_uom IN VARCHAR2 := NULL
115 , p_transaction_quantity IN NUMBER
116 , p_transaction_uom IN VARCHAR2
117 , p_secondary_trx_quantity IN NUMBER := NULL
118 , p_secondary_uom_code IN VARCHAR2 := NULL
119 , p_inventory_item_id IN NUMBER
120 , p_revision IN VARCHAR2 := NULL
121 , p_lot_number IN VARCHAR2 := NULL
122 , p_cost_group_id IN NUMBER
123 , p_transfer_cost_group_id IN NUMBER := NULL
124 , p_rcv_transaction_id IN NUMBER := NULL
125 , p_shipment_number IN VARCHAR2 := NULL
126 , p_transaction_source_id IN NUMBER := NULL
127 , p_trx_source_line_id IN NUMBER := NULL
128 , p_serial_control_code IN NUMBER := NULL
129 , p_po_dest_expense IN NUMBER := NULL
130 , p_manual_receipt_expense IN VARCHAR2 := NULL
131 , p_source_transaction_id IN NUMBER := NULL
132 );
133 END inv_lpn_trx_pub;