1 PACKAGE bom_copy_routing AS
2 /* $Header: BOMCPYRS.pls 120.10 2006/05/17 21:07:41 earumuga noship $ */
3 /*#
4 * This API contains the methods for copying Routing.
5 * @rep:scope private
6 * @rep:product BOM
7 * @rep:displayname Routing Copy
8 * @rep:lifecycle active
9 * @rep:category BUSINESS_ENTITY BOM_MFG_ROUTING
10 */
11 /*==========================================================================+
12 | Copyright (c) 1995 Oracle Corporation, California, USA |
13 | All rights reserved. |
14 +===========================================================================+
15 | |
16 | File Name : BOMCPYRS.pls |
17 | Description : Routing copy package specification |
18 | Created By : Manu Chadha |
19 | |
20 | from_org_id Copy from org id |
21 | to_org_id Copy to org id |
22 | from_sequence_id Copy from routing sequence id |
23 | to_sequence_id Copy to routing sequence id |
24 | display_option copy option |
25 | 1 - all (not supported from form) |
26 | 2 - current |
27 | 3 - current + future |
28 | user_id user id |
29 | to_item_id Copy to item id |
30 | direction direction of copy |
31 | 1 - BOM to BOM |
32 | 2 - BOM to ENG |
33 | 3 - ENG to ENG |
34 | 2 - ENG to BOM |
35 | to_alternate Copy to alternate designator |
36 | rev_date Revision date to copy |
37 | err_msg Error message |
38 | error_code Error code |
39 | |
40 | 30-Jun-2005 Ezhilarasan Added new overloaded procedure to support |
41 | copy routing in context of eco |
42 +==========================================================================*/
43 /*#
44 * copy_routing will copy a routing for a given item to the item id supplied.
45 * @param to_sequence_id Destination Sequence Id to which routing will be copied
46 * @param from_sequence_id Source Sequence Id from which routing will be copied
47 * @param from_org_id Source Organization Id from which routing will be copied
48 * @param to_org_id Destination Organization Id to which routing will be copied
49 * @param display_option Effectivity Filter criteria for routing operations (all, current, current+future)
50 * @param user_id user id
51 * @param to_item_id item id to which routing is copied
52 * @param direction direction of copy (BOM to BOM, BOM to ENG,ENG to BOM,ENG to ENG)
53 * @param to_alternate Copy to alternate designator
54 * @param rev_date Revision date to copy
55 * @rep:scope private
56 * @rep:lifecycle active
57 * @rep:displayname Copy Routing
58 */
59 PROCEDURE copy_routing (
60 to_sequence_id IN NUMBER,
61 from_sequence_id IN NUMBER,
62 from_org_id IN NUMBER,
63 to_org_id IN NUMBER,
64 display_option IN NUMBER DEFAULT 2,
65 user_id IN NUMBER DEFAULT -1,
66 to_item_id IN NUMBER,
67 direction IN NUMBER,
68 to_alternate IN VARCHAR2,
69 rev_date DATE
70 );
71
72 /*#
73 * switch_to_primary_rtg will set alternate routing designator in bom_operational_routings.
74 * @param p_org_id Organization id
75 * @param p_ass_itm_id Assembly Item Id
76 * @param p_alt_rtg_desg Alternate Routings Designator
77 * @param p_alt_desg_for_prim_rtg Alternate Routings Designator for primary routing
78 * @rep:scope private
79 * @rep:lifecycle active
80 * @rep:displayname Switch To Primary Routing
81 */
82 PROCEDURE switch_to_primary_rtg (
83 p_org_id IN NUMBER,
84 p_ass_itm_id IN NUMBER,
85 p_alt_rtg_desg IN VARCHAR2,
86 p_alt_desg_for_prim_rtg IN VARCHAR2
87 );
88 /*#
89 * switch_rtg_validate will set alternate routing designator in bom_operational_routings.
90 * @param p_org_id Organization id
91 * @param p_ass_itm_id Assembly Item Id
92 * @param p_alt_rtg_desg Alternate Routings Designator
93 * @param p_alt_desg_for_prim_rtg Alternate Routings Designator for primary routing
94 * @param x_return_status Indicating success or faliure
95 * @param x_message_name Message
96 * @rep:scope private
97 * @rep:lifecycle active
98 * @rep:displayname Switch Routing Validate
99 */
100 /*** Added as part of Patchset I enhancement - 2544075 ***/
101 PROCEDURE switch_rtg_validate (
102 p_org_id IN NUMBER,
103 p_ass_itm_id IN NUMBER,
104 p_alt_rtg_desg IN VARCHAR2,
105 p_alt_desg_for_prim_rtg IN VARCHAR2,
106 x_return_status IN OUT NOCOPY VARCHAR2,
107 x_message_name IN OUT NOCOPY VARCHAR2
108 );
109 /*#
110 * switch_to_primary_rtg will set alternate routing designator in bom_operational_routings.
111 * @param p_org_id Organization id
112 * @param p_ass_itm_id Assembly Item Id
113 * @param p_alt_rtg_desg Alternate Routings Designator
114 * @param p_alt_desg_for_prim_rtg Alternate Routings Designator for primary routing
115 * @param x_return_status Return Status to be returned back
116 * @param x_message_name Message to be passed back
117 * @rep:scope private
118 * @rep:lifecycle active
119 * @rep:displayname Switch To Primary Routing
120 */
121 PROCEDURE switch_to_primary_rtg (
122 p_org_id IN NUMBER,
123 p_ass_itm_id IN NUMBER,
124 p_alt_rtg_desg IN VARCHAR2,
125 p_alt_desg_for_prim_rtg IN VARCHAR2,
126 x_return_status IN OUT NOCOPY VARCHAR2,
127 x_message_name IN OUT NOCOPY VARCHAR2
128 );
129 -- Start of comments
130 -- API name : copy_routing
131 -- Type : private
132 -- Pre-reqs : None.
133 -- Function : Copies routing source sequence id to target sequence id
134 -- Parameters :
135 -- IN : to_sequence_id IN NUMBER Required
136 -- Routing sequence Id of the target item
137 -- from_sequence_id IN NUMBER Required
138 -- Routing sequence Id of the source item
139 -- from_org_id IN NUMBER Required
140 -- Source item's organization id
141 -- to_org_id IN NUMBER Required
142 -- Target item's organization id
143 -- display_option IN NUMBER Optional
144 -- Effectivity Filter criteria for routing operations
145 -- user_id IN NUMBER Optional
146 -- User Id of the user who launches this process
147 -- to_item_id IN NUMBER Required
148 -- Target routing's Item Id
149 -- direction IN NUMBER Optional
150 -- Specifies the type of source and target routing combination
151 -- to_alternate IN VARCHAR2 Required
152 -- Target item's routing alternate name
153 -- rev_date IN DATE Required
154 -- Date from which source item's operation needs to filterd
155 -- p_e_change_notice IN VARCHANR2 Optional
156 -- Change Notice Name
157 -- p_rev_item_seq_id IN NUMBER Optional
158 -- Revised Item Sequence Id of Target Structure's Item
159 -- p_routing_or_eco IN NUMBER Optional
160 -- Copy operation needs to create a structure or eco
161 -- p_eco_eff_date IN DATE Optional
162 -- Effectivity Date for operations if copy operation creates eco
163 -- p_contex_eco IN VARCHAR2 Optional
164 -- ECO context from which the source item's operations are filtered
165 -- p_log_errors IN VARCHAR2 Optional
166 -- Flag which specifies whethere errors needs to be logged in mtl_interface_errors
167 -- p_copy_request_id IN VARCHAR2 Optional
168 -- To group the errors which have been logged in mtl_interface_errors
169 -- End of comments
170 /*#
171 * copy_routing Copies routing source sequence id to target sequence id.
172 * @param to_sequence_id Destination Sequence Id to which routing will be copied
173 * @param from_sequence_id Source Sequence Id from which routing will be copied
174 * @param from_org_id Source Organization Id from which routing will be copied
175 * @param to_org_id Destination Organization Id to which routing will be copied
176 * @param display_option Effectivity Filter criteria for routing operations (all, current, current+future)
177 * @param user_id user id
178 * @param to_item_id item id to which routing is copied
179 * @param direction direction of copy (BOM to BOM, BOM to ENG,ENG to BOM,ENG to ENG)
180 * @param to_alternate Copy to alternate designator
181 * @param rev_date Revision date to copy
182 * @param p_e_change_notice Change Notice Name
183 * @param p_rev_item_seq_id Revised Item Sequence Id of Target Structure's Item
184 * @param p_routing_or_eco Copy operation needs to create a structure or eco
185 * @param p_trgt_eff_date Target Effectivity Date for operations
186 * @param p_eco_eff_date Effectivity Date for operations if copy operation creates eco
187 * @param p_context_eco ECO context from which the source item's operations are filtered
188 * @param p_log_errors Flag which specifies whethere errors needs to be logged in mtl_interface_errors
189 * @param p_copy_request_id To group the errors which have been logged in mtl_interface_errors
190 * @param p_cpy_disable_fields Flag to copy disable fields
191 * @rep:scope private
192 * @rep:lifecycle active
193 * @rep:displayname Copy Routing
194 */
195 PROCEDURE copy_routing (
196 to_sequence_id IN NUMBER,
197 from_sequence_id IN NUMBER,
198 from_org_id IN NUMBER,
199 to_org_id IN NUMBER,
200 display_option IN NUMBER DEFAULT 2,
201 user_id IN NUMBER DEFAULT -1,
202 to_item_id IN NUMBER,
203 direction IN NUMBER,
204 to_alternate IN VARCHAR2,
205 rev_date DATE,
206 p_e_change_notice IN VARCHAR2,
207 p_rev_item_seq_id IN NUMBER,
208 p_routing_or_eco IN NUMBER DEFAULT 1,
209 p_trgt_eff_date IN DATE,
210 p_eco_eff_date IN DATE,
211 p_context_eco IN VARCHAR2,
212 p_log_errors IN VARCHAR2 DEFAULT 'N',
213 p_copy_request_id IN NUMBER DEFAULT NULL,
214 p_cpy_disable_fields IN VARCHAR2 DEFAULT 'N'
215 );
216
217 -- Start of comments
218 -- API name : GET_MESSAGE
219 -- Type : private
220 -- Pre-reqs : None.
221 -- Function : Gets message with tokens set
222 -- Parameters :
223 -- IN : p_msg_name IN VARCHAR2 Required
224 -- Name of the message
225 -- p_op_seq_num IN NUMBER Required
226 -- Operation Sequence Number which is being processed
227 -- End of comments
228 FUNCTION GET_MESSAGE (p_msg_name IN VARCHAR2, p_op_seq_num IN NUMBER)
229 RETURN VARCHAR2;
230
231 -- Start of comments
232 -- API name : GET_MESSAGE
233 -- Type : private
234 -- Pre-reqs : None.
235 -- Function : Gets message with tokens set
236 -- Parameters :
237 -- IN : p_msg_name IN VARCHAR2 Required
238 -- Name of the message
239 -- p_op_seq_num IN NUMBER Required
240 -- Operation Sequence Number which is being processed
241 -- p_oper_type IN VARCHAR2 Required
242 -- Operation Type
243 -- End of comments
244 FUNCTION GET_MESSAGE (p_msg_name IN VARCHAR2, p_op_seq_num IN NUMBER,
245 p_oper_type IN VARCHAR2)
246 RETURN VARCHAR2;
247
248 -- Start of comments
249 -- API name : GET_MESSAGE
250 -- Type : private
251 -- Pre-reqs : None.
252 -- Function : Gets message with tokens set
253 -- Parameters :
254 -- IN : p_msg_name IN VARCHAR2 Required
255 -- Name of the message
256 -- p_op_seq_num IN NUMBER Required
257 -- Operation Sequence Number which is being processed
258 -- p_entity_name IN VARCHAR2 Required
259 -- Entity Name for which the error has occured
260 -- p_type IN VARCHAR2 Required
261 -- Entity type to find out the token name.
262 -- End of comments
263 FUNCTION GET_MESSAGE (p_msg_name IN VARCHAR2, p_op_seq_num IN NUMBER,
264 p_entity_name IN VARCHAR2, p_type IN VARCHAR2)
265 RETURN VARCHAR2;
266
267 PROCEDURE switch_common_to_primary_rtg ( -- BUG 4712488
268 p_org_id IN NUMBER,
269 p_ass_itm_id IN NUMBER,
270 p_alt_rtg_desg IN VARCHAR2,
271 p_alt_desg_for_prim_rtg IN VARCHAR2
272 );
273
274 PROCEDURE switch_common_to_alternate_rtg ( -- BUG 4712488
275 p_org_id IN NUMBER,
276 p_ass_itm_id IN NUMBER,
277 p_alt_desg_for_prim_rtg IN VARCHAR2,
278 p_rtg_seq_id IN NUMBER
279 );
280
281 -- Start of comments
282 -- API name : copy_routing_for_revised_item
283 -- Type : private
284 -- Pre-reqs : None.
285 -- Function : Copies routing source sequence id to target sequence id
286 -- for a specific revised item
287 -- Parameters :
288 -- IN : to_sequence_id IN NUMBER Required
289 -- Routing sequence Id of the target item
290 -- from_sequence_id IN NUMBER Required
291 -- Routing sequence Id of the source item
292 -- from_org_id IN NUMBER Required
293 -- Source item's organization id
294 -- to_org_id IN NUMBER Required
295 -- Target item's organization id
296 -- user_id IN NUMBER Optional
297 -- User Id of the user who launches this process
298 -- to_item_id IN NUMBER Required
299 -- Target routing's Item Id
300 -- direction IN NUMBER Optional
301 -- Specifies the type of source and target routing combination
302 -- to_alternate IN VARCHAR2 Required
303 -- Target item's routing alternate name
304 -- rev_date IN DATE Required
305 -- Date from which source item's operation needs to filterd
306 -- p_e_change_notice IN VARCHANR2 Optional
307 -- Change Notice Name
308 -- p_rev_item_seq_id IN NUMBER Optional
309 -- Revised Item Sequence Id of Target Structure's Item
310 -- p_routing_or_eco IN NUMBER Optional
311 -- Copy operation needs to create a structure or eco
312 -- p_eco_eff_date IN DATE Optional
313 -- Effectivity Date for operations if copy operation creates eco
314 -- p_contex_eco IN VARCHAR2 Optional
315 -- ECO context from which the source item's operations are filtered
316 -- p_log_errors IN VARCHAR2 Optional
317 -- Flag which specifies whethere errors needs to be logged in mtl_interface_errors
318 -- p_copy_request_id IN VARCHAR2 Optional
319 -- To group the errors which have been logged in mtl_interface_errors
320 -- End of comments
321 /*#
322 * copy_routing Copies routing source sequence id to target sequence id.
323 * @param to_sequence_id Destination Sequence Id to which routing will be copied
324 * @param from_sequence_id Source Sequence Id from which routing will be copied
325 * @param from_org_id Source Organization Id from which routing will be copied
326 * @param to_org_id Destination Organization Id to which routing will be copied
327 * @param user_id user id
328 * @param to_item_id item id to which routing is copied
329 * @param direction direction of copy (BOM to BOM, BOM to ENG,ENG to BOM,ENG to ENG)
330 * @param to_alternate Copy to alternate designator
331 * @param rev_date Revision date to copy
332 * @param p_e_change_notice Change Notice Name
333 * @param p_rev_item_seq_id Revised Item Sequence Id of Target Structure's Item
334 * @param p_routing_or_eco Copy operation needs to create a structure or eco
335 * @param p_trgt_eff_date Target Effectivity Date for operations
336 * @param p_eco_eff_date Effectivity Date for operations if copy operation creates eco
337 * @param p_context_eco ECO context from which the source item's operations are filtered
338 * @param p_log_errors Flag which specifies whethere errors needs to be logged in mtl_interface_errors
339 * @param p_copy_request_id To group the errors which have been logged in mtl_interface_errors
340 * @param p_cpy_disable_fields Flag to copy disable fields
341 * @rep:scope private
342 * @rep:lifecycle active
343 * @rep:displayname Copy Routing For Revised Item
344 */
345 PROCEDURE copy_routing_for_revised_item (
346 to_sequence_id IN NUMBER,
347 from_sequence_id IN NUMBER,
348 from_org_id IN NUMBER,
349 to_org_id IN NUMBER,
350 user_id IN NUMBER DEFAULT -1,
351 to_item_id IN NUMBER,
352 direction IN NUMBER,
353 to_alternate IN VARCHAR2,
354 rev_date DATE,
355 p_e_change_notice IN VARCHAR2,
356 p_rev_item_seq_id IN NUMBER,
357 p_routing_or_eco IN NUMBER DEFAULT 1,
358 p_trgt_eff_date IN DATE,
359 p_eco_eff_date IN DATE,
360 p_context_eco IN VARCHAR2,
361 p_log_errors IN VARCHAR2 DEFAULT 'N',
362 p_copy_request_id IN NUMBER DEFAULT NULL,
363 p_cpy_disable_fields IN VARCHAR2 DEFAULT 'N'
364 );
365
366 PROCEDURE copy_attachments(p_from_sequence_id IN NUMBER,
367 p_to_sequence_id IN NUMBER,
368 p_user_id IN NUMBER);
369 PROCEDURE update_last_updated_by ( p_user_id IN NUMBER
370 ,p_to_sequence_id IN NUMBER );
371
372
373
374 END bom_copy_routing;