1 PACKAGE wma_move AUTHID CURRENT_USER AS
2 /* $Header: wmapmovs.pls 120.1 2007/09/17 21:21:11 kboonyap ship $ */
3
4 /**
5 * This is the set of parameters that will be passed from the Mobile Apps
6 * Move form to the process procedure for processing the transaction.
7 * The list contains all displayed fields as well as hidden fields
8 * (derived from the LOV). All fields will be initialized to
9 * FND_API initialization values. For boolean values, they will be
10 * initailized to false. The lengths for the strings are derived from
11 * those defined in WIP_CONSTANTS package.
12 */
13 TYPE MoveParam IS RECORD
14 (
15 environment wma_common.environment,
16 txnMode NUMBER,
17 txnID NUMBER,
18 childTxnID NUMBER,
19 mtl_header_id NUMBER,
20 wipEntityID NUMBER,
21 wipEntityName VARCHAR2(241),
22 itemID NUMBER,
23 itemName VARCHAR2(241),
24 fmOpSeqNum NUMBER,
25 fmStepType NUMBER,
26 toOpSeqNum NUMBER,
27 toStepType NUMBER,
28 overcompleteQty NUMBER,
29 availableQty NUMBER,
30 transactionQty NUMBER,
31 transactionUOM VARCHAR2(4),
32 minTransferQty NUMBER,
33 qualityID NUMBER,
34 reasonID NUMBER,
35 projectID NUMBER,
36 taskID NUMBER,
37 -- new param added for scrap account and easy complete/return project
38 scrapAcctID NUMBER,
39 txnType NUMBER,
40 mtlTxnTypeID NUMBER,
41 mtlTxnIntID NUMBER,
42 cmpTxnID NUMBER,
43 kanbanID NUMBER,
44 locatorID NUMBER,
45 locatorName VARCHAR2(241),
46 subinv VARCHAR2(11),
47 -- new param added for serial txns project
48 serial VARCHAR2(30),
49 serialOp NUMBER,
50 isFromSerializedPage NUMBER
51 );
52
53 /**
54 * This is the record type for the record to be inserted into
55 * WIP_MOVE_TXN_INTERFACE table.
56 */
57 TYPE MoveTxnRec IS RECORD (row wip_move_txn_interface%ROWTYPE);
58
59 PROCEDURE process(parameters IN OUT NOCOPY MoveParam,
60 status OUT NOCOPY NUMBER,
61 errMessage OUT NOCOPY VARCHAR2);
62
63 /**
64 * This procedure is a wrapper on top of wip_bflProc_priv.processRequirements
65 * and wip_autoLotProc_priv.deriveLots. This procedure should be called to
66 * check whether we need to gather more lot/serial info from the user or not
67 *
68 * parameters
69 * p_childMoveID pass -1 for regular txns, and pass value generated from
70 * wip_transactions_s for overmove/overcomplete
71 * p_ocQty pass 0 for regular txns, and pass value for overmove
72 * p_cmpTxnID pass value generated from mtl_material_transactions_s
73 * for EZ Complete/Return and processing mode is
74 * online. Otherwise pass -1.
75 * p_objectID pass -1 for non-serialized txns, and pass gen_object_id
76 * for serialized txns.
77 */
78 PROCEDURE backflush(p_jobID IN NUMBER,
79 p_orgID IN NUMBER,
80 p_childMoveID IN NUMBER,
81 p_moveID IN NUMBER,
82 p_ocQty IN NUMBER,
83 p_moveQty IN NUMBER,
84 p_txnDate IN DATE,
85 p_txnHdrID IN NUMBER,
86 p_fm_op IN NUMBER,
87 p_fm_step IN NUMBER,
88 p_to_op IN NUMBER,
89 p_to_step IN NUMBER,
90 p_cmpTxnID IN NUMBER,
91 p_txnType IN NUMBER,
92 p_objectID IN NUMBER,
93 x_lotEntryType OUT NOCOPY NUMBER,
94 x_compInfo OUT NOCOPY system.wip_lot_serial_obj_t,
95 x_returnStatus OUT NOCOPY VARCHAR2,
96 x_errMessage OUT NOCOPY VARCHAR2);
97
98 /**
99 * This function take fm_op, fm_step, to_op, to_step and check whether do we
100 * need to call backflush or not. If backflush required, this function will
101 * return the first_operation, last_operation, and backflush quantity that
102 * the user can pass to wip_bflProc_priv.processRequirements. The caller
103 * should check the original value of x_first_bf_op and compare with the one
104 * that this procedure return. If it is the same value, it mean no backflush
105 * require because this routine will only set the value when backflush is
106 * require. If the x_bf_qty is positive, it is component issue transaction.
107 * Otherwise, it is component return transaction.
108 *
109 * NOTE:
110 * This routine support for both regulare move and scrap transaction. However,
111 * this routine only concern abot Operation Pull components. For scrap txns
112 * we need to backflush Assembly Pull components too. Please read assy_pull_bf
113 * procedure for more info
114 */
115
116 PROCEDURE bf_require(p_jobID IN NUMBER,
117 p_fm_op IN NUMBER,
118 p_fm_step IN NUMBER,
119 p_to_op IN NUMBER,
120 p_to_step IN NUMBER,
121 p_moveQty IN NUMBER,
122 x_first_bf_op OUT NOCOPY NUMBER,
123 x_last_bf_op OUT NOCOPY NUMBER,
124 x_bf_qty OUT NOCOPY NUMBER,
125 x_returnStatus OUT NOCOPY VARCHAR2,
126 x_errMessage OUT NOCOPY VARCHAR2);
127
128 /**
129 * This function is only use for scrap transaction. It takes fm_op, fm_step,
130 * to_op, to_step and check which operation that we need to issue/return
131 * assembly pull components to/from inventory. If the transaction is not
132 * scrap txn, this routine will not set anything.
133 * This function will return the first_operation, last_operation,
134 * and backflush quantity that the user can pass to
135 * wip_bflProc_priv.processRequirements. The caller should check the
136 * original value of x_first_bf_op and compare with the one
137 * that this procedure return. If it is the same value, it mean no backflush
138 * require because this routine will only set the value when backflush is
139 * require.
140 *
141 * NOTE:
142 * This routine only concern abot Assembly Pull components for scrap txns.
143 * For Operation Pull component, please use bf_require procedure instead.
144 */
145
146 PROCEDURE assy_pull_bf(p_jobID IN NUMBER,
147 p_fm_op IN NUMBER,
148 p_fm_step IN NUMBER,
149 p_to_op IN NUMBER,
150 p_to_step IN NUMBER,
151 p_moveQty IN NUMBER,
152 x_first_bf_op OUT NOCOPY NUMBER,
153 x_last_bf_op OUT NOCOPY NUMBER,
154 x_bf_qty OUT NOCOPY NUMBER,
155 x_returnStatus OUT NOCOPY VARCHAR2,
156 x_errMessage OUT NOCOPY VARCHAR2);
157
158 /**
159 * This procedure validates the overcompletion tolerance, shop floor status
160 * , and do OSP validation
161 */
162 PROCEDURE validate(p_userID IN NUMBER,
163 p_orgID IN NUMBER,
164 p_jobID IN NUMBER,
165 p_fmOp IN NUMBER,
166 p_fmStep IN NUMBER,
167 p_toOp IN NUMBER,
168 p_toStep IN NUMBER,
169 p_overcomplQty IN NUMBER,
170 x_returnStatus OUT NOCOPY VARCHAR2,
171 x_errMessage OUT NOCOPY VARCHAR2);
172
173 /**
174 * This function derives and validates the values necessary for executing the
175 * move transaction. Given the form parameters, it populates moveRecord
176 * preparing it to be inserted into the interface table.
177 */
178 FUNCTION derive(moveRecord IN OUT NOCOPY MoveTxnRec,
179 parameters IN MoveParam,
180 errMessage IN OUT NOCOPY VARCHAR2) RETURN BOOLEAN;
181
182 /**
183 * Inserts a populated MoveTxnRec into WIP_MOVE_TXN_INTERFACE
184 */
185 FUNCTION put(moveRecord IN MoveTxnRec,
186 errMessage IN OUT NOCOPY VARCHAR2) RETURN BOOLEAN;
187 /**
188 * This function inserts into the WIP_SERIAL_MOVE_INTERFACE table with values
189 * selected from wip_move_txn_interface table
190 *
191 * Parameters:
192 * groupID The group_id in wip_move_txn_interface table
193 * transactionID The transaction_id in wip_move_txn_interface table
194 * serialNumber The serial number
195 * Return:
196 * boolean A flag indicating whether update successful or not.
197 */
198 FUNCTION insertSerial(groupID IN NUMBER,
199 transactionID IN NUMBER,
200 serialNumber IN VARCHAR2,
201 errMessage IN OUT NOCOPY VARCHAR2) RETURN BOOLEAN;
202
203 END wma_move;