[Home] [Help]
PACKAGE BODY: APPS.BOM_REF_DESIGNATOR_UTIL
Source
1 PACKAGE BODY BOM_Ref_Designator_Util AS
2 /* $Header: BOMURFDB.pls 120.3.12000000.2 2007/02/23 05:50:17 pgandhik ship $ */
3 /****************************************************************************
4 --
5 -- Copyright (c) 1996 Oracle Corporation, Redwood Shores, CA, USA
6 -- All rights reserved.
7 --
8 -- FILENAME
9 --
10 -- BOMURFDB.pls
11 --
12 -- DESCRIPTION
13 --
14 -- Body of package BOM_Ref_Designator_Util
15 --
16 -- NOTES
17 --
18 -- HISTORY
19 --
20 -- 19-JUL-1999 Rahul Chitko Initial Creation
21 --
22 -- 06-May-05 Abhishek Rudresh Common BOM Attrs update
23 ****************************************************************************/
24 G_PKG_NAME CONSTANT VARCHAR2(30) := 'BOM_Ref_Designator_Util';
25 G_CONTROL_REC BOM_BO_PUB.Control_Rec_Type;
26
27 -- Procedure Clear_Dependent_Attr
28
29 PROCEDURE Clear_Dependent_Attr
30 ( p_attr_id IN NUMBER := FND_API.G_MISS_NUM
31 , p_ref_designator_rec IN Bom_Bo_Pub.Ref_Designator_Rec_Type
32 , p_old_ref_designator_rec IN Bom_Bo_Pub.Ref_Designator_Rec_Type :=
33 Bom_Bo_Pub.G_MISS_REF_DESIGNATOR_REC
34 , x_ref_designator_rec IN OUT NOCOPY Bom_Bo_Pub.Ref_Designator_Rec_Type
35 )
36 IS
37 BEGIN
38 -- Load out record
39
40 x_ref_designator_rec := p_ref_designator_rec;
41
42 END Clear_Dependent_Attr;
43
44 -- Procedure Apply_Attribute_Changes
45
46 PROCEDURE Apply_Attribute_Changes
47 ( p_ref_designator_rec IN Bom_Bo_Pub.Ref_Designator_Rec_Type
48 , p_old_ref_designator_rec IN Bom_Bo_Pub.Ref_Designator_Rec_Type :=
49 Bom_Bo_Pub.G_MISS_REF_DESIGNATOR_REC
50 , x_ref_designator_rec IN OUT NOCOPY Bom_Bo_Pub.Ref_Designator_Rec_Type
51 )
52 IS
53 BEGIN
54 -- Load out record
55
56 x_ref_designator_rec := p_ref_designator_rec;
57
58 END Apply_Attribute_Changes;
59
60 -- Function Convert_Miss_To_Null
61
62 FUNCTION Convert_Miss_To_Null
63 ( p_ref_designator_rec IN Bom_Bo_Pub.Ref_Designator_Rec_Type
64 ) RETURN Bom_Bo_Pub.Ref_Designator_Rec_Type
65 IS
66 l_ref_designator_rec Bom_Bo_Pub.Ref_Designator_Rec_Type :=
67 p_ref_designator_rec;
68 BEGIN
69
70 IF l_ref_designator_rec.Reference_Designator_Name = FND_API.G_MISS_CHAR THEN
71 l_ref_designator_rec.Reference_Designator_Name := NULL;
72 END IF;
73
74 IF l_ref_designator_rec.attribute_category = FND_API.G_MISS_CHAR THEN
75 l_ref_designator_rec.attribute_category := NULL;
76 END IF;
77
78 IF l_ref_designator_rec.attribute1 = FND_API.G_MISS_CHAR THEN
79 l_ref_designator_rec.attribute1 := NULL;
80 END IF;
81
82 IF l_ref_designator_rec.attribute2 = FND_API.G_MISS_CHAR THEN
83 l_ref_designator_rec.attribute2 := NULL;
84 END IF;
85
86 IF l_ref_designator_rec.attribute3 = FND_API.G_MISS_CHAR THEN
87 l_ref_designator_rec.attribute3 := NULL;
88 END IF;
89
90 IF l_ref_designator_rec.attribute4 = FND_API.G_MISS_CHAR THEN
91 l_ref_designator_rec.attribute4 := NULL;
92 END IF;
93
94 IF l_ref_designator_rec.attribute5 = FND_API.G_MISS_CHAR THEN
95 l_ref_designator_rec.attribute5 := NULL;
96 END IF;
97
98 IF l_ref_designator_rec.attribute6 = FND_API.G_MISS_CHAR THEN
99 l_ref_designator_rec.attribute6 := NULL;
100 END IF;
101
102 IF l_ref_designator_rec.attribute7 = FND_API.G_MISS_CHAR THEN
103 l_ref_designator_rec.attribute7 := NULL;
104 END IF;
105
106 IF l_ref_designator_rec.attribute8 = FND_API.G_MISS_CHAR THEN
107 l_ref_designator_rec.attribute8 := NULL;
108 END IF;
109
110 IF l_ref_designator_rec.attribute9 = FND_API.G_MISS_CHAR THEN
111 l_ref_designator_rec.attribute9 := NULL;
112 END IF;
113
114 IF l_ref_designator_rec.attribute10 = FND_API.G_MISS_CHAR THEN
115 l_ref_designator_rec.attribute10 := NULL;
116 END IF;
117
118 IF l_ref_designator_rec.attribute11 = FND_API.G_MISS_CHAR THEN
119 l_ref_designator_rec.attribute11 := NULL;
120 END IF;
121
122 IF l_ref_designator_rec.attribute12 = FND_API.G_MISS_CHAR THEN
123 l_ref_designator_rec.attribute12 := NULL;
124 END IF;
125
126 IF l_ref_designator_rec.attribute13 = FND_API.G_MISS_CHAR THEN
127 l_ref_designator_rec.attribute13 := NULL;
128 END IF;
129
130 IF l_ref_designator_rec.attribute14 = FND_API.G_MISS_CHAR THEN
131 l_ref_designator_rec.attribute14 := NULL;
132 END IF;
133
134 IF l_ref_designator_rec.attribute15 = FND_API.G_MISS_CHAR THEN
135 l_ref_designator_rec.attribute15 := NULL;
136 END IF;
137
138 RETURN l_ref_designator_rec;
139
140 END Convert_Miss_To_Null;
141
142 /********************************************************************
143 *
144 * Procedure : Update_Row
145 * Parameters IN : Reference Designator Record as given by the User
146 * Reference Designator Unexposed Record
147 * Parameters OUT: Return_Status - Indicating success or faliure
148 * Mesg_Token_Tbl - Filled with any errors or warnings
149 * Purpose : Will update the Reference Designator record and
150 * if unable to update then return with a status
151 * and Error Message table filled with the message
152 *
153 ********************************************************************/
154
155 PROCEDURE Update_Row
156 ( p_ref_designator_rec IN Bom_Bo_Pub.Ref_Designator_Rec_Type
157 , p_Ref_Desg_Unexp_Rec IN Bom_Bo_Pub.Ref_Desg_Unexposed_Rec_Type
158 , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
159 , x_Return_Status IN OUT NOCOPY VARCHAR2
160 )
161 IS
162 l_return_status varchar2(80);
163 l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
164 l_ref_designator_rec Bom_Bo_Pub.Ref_Designator_Rec_Type;
165 l_Token_Tbl Error_Handler.Token_Tbl_Type;
166 l_BO_Id VARCHAR2(3) := Bom_Globals.Get_Bo_Identifier;
167 BEGIN
168 --bug:3254815 Update request id, prog id, prog appl id and prog update date.
169 UPDATE BOM_REFERENCE_DESIGNATORS
170 SET COMPONENT_REFERENCE_DESIGNATOR =
171 DECODE(p_ref_designator_rec.new_reference_designator,
172 NULL,p_ref_designator_rec.Reference_Designator_Name,
173 FND_API.G_MISS_CHAR,
174 p_ref_designator_rec.Reference_Designator_Name,
175 p_ref_designator_rec.new_reference_designator
176 )
177 , LAST_UPDATE_DATE = SYSDATE
178 , LAST_UPDATED_BY = Bom_Globals.Get_User_Id
179 , LAST_UPDATE_LOGIN = Bom_Globals.Get_User_Id
180 , REF_DESIGNATOR_COMMENT =
181 DECODE( p_ref_designator_rec.ref_designator_comment
182 , FND_API.G_MISS_CHAR
183 , NULL
184 , p_ref_designator_rec.ref_designator_comment
185 )
186 , ATTRIBUTE_CATEGORY = p_ref_designator_rec.attribute_category
187 , ATTRIBUTE1 = p_ref_designator_rec.attribute1
188 , ATTRIBUTE2 = p_ref_designator_rec.attribute2
189 , ATTRIBUTE3 = p_ref_designator_rec.attribute3
190 , ATTRIBUTE4 = p_ref_designator_rec.attribute4
191 , ATTRIBUTE5 = p_ref_designator_rec.attribute5
192 , ATTRIBUTE6 = p_ref_designator_rec.attribute6
193 , ATTRIBUTE7 = p_ref_designator_rec.attribute7
194 , ATTRIBUTE8 = p_ref_designator_rec.attribute8
195 , ATTRIBUTE9 = p_ref_designator_rec.attribute9
196 , ATTRIBUTE10 = p_ref_designator_rec.attribute10
197 , ATTRIBUTE11 = p_ref_designator_rec.attribute11
198 , ATTRIBUTE12 = p_ref_designator_rec.attribute12
199 , ATTRIBUTE13 = p_ref_designator_rec.attribute13
200 , ATTRIBUTE14 = p_ref_designator_rec.attribute14
201 , ATTRIBUTE15 = p_ref_designator_rec.attribute15
202 , Original_System_Reference =
203 p_ref_designator_rec.Original_System_Reference
204 , REQUEST_ID = Fnd_Global.Conc_Request_Id
205 , PROGRAM_ID = Fnd_Global.Conc_Program_Id
206 , PROGRAM_APPLICATION_ID = Fnd_Global.Prog_Appl_Id
207 , PROGRAM_UPDATE_DATE = SYSDATE
208 WHERE COMPONENT_REFERENCE_DESIGNATOR =
209 p_ref_designator_rec.Reference_Designator_Name
210 AND COMPONENT_SEQUENCE_ID =
211 p_Ref_Desg_Unexp_Rec.component_sequence_id
212 AND ( ( l_BO_Id = Bom_Globals.G_ECO_BO AND
213 ACD_TYPE = p_Ref_Designator_Rec.acd_type
214 ) OR
215 ( l_BO_Id = Bom_Globals.G_BOM_BO AND
216 (acd_type IS NULL or acd_type = 1)
217 /* Bug 5726557; The code is modified to modify the refernce designators
218 when implemneted through an ECO */
219 )
220 );
221
222 BOMPCMBM.Update_Related_Ref_Desg(p_component_sequence_id => p_Ref_Desg_Unexp_Rec.component_sequence_id
223 , p_old_ref_desg => p_ref_designator_rec.Reference_Designator_Name
224 , p_new_ref_desg => nvl(p_ref_designator_rec.new_reference_designator,
225 p_ref_designator_rec.Reference_Designator_Name)
226 , p_acd_type => p_Ref_Designator_Rec.acd_type
227 , x_Mesg_Token_Tbl => x_Mesg_Token_Tbl
228 , x_Return_Status => x_Return_Status);
229 --x_Return_Status := FND_API.G_RET_STS_SUCCESS;
230
231 EXCEPTION
232 WHEN OTHERS THEN
233
234 IF G_CONTROL_REC.caller_type = 'FORM'
235 THEN
236 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
237 RAISE;
238 END IF;
239
240 Error_Handler.Add_Error_Token
241 ( p_Message_Name => NULL
242 , p_Message_Text => 'ERROR in Update Row (Ref Desgs)' ||
243 substr(SQLERRM, 1, 100) || ' ' ||
244 to_char(SQLCODE)
245 , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
246 , x_Mesg_Token_Tbl => x_Mesg_Token_Tbl);
247
248 x_Return_Status := FND_API.G_RET_STS_UNEXP_ERROR;
249
250 END Update_Row;
251
252 /********************************************************************
253 *
254 * Procedure : Insert_Row
255 * Parameters IN : Reference Designator Record as given by the User
256 * Reference Designator Unexposed Record
257 * Parameters OUT: Return_Status - Indicating success or faliure
258 * Mesg_Token_Tbl - Filled with any errors or warnings
259 * Purpose : Insert Reference Designator record and if unable to
260 * to insert then return with an error_status and
261 * Error message filled in the Message Token Table.
262 *
263 ********************************************************************/
264
265 PROCEDURE Insert_Row
266 ( p_ref_designator_rec IN Bom_Bo_Pub.Ref_Designator_Rec_Type
267 , p_Ref_Desg_Unexp_Rec IN Bom_Bo_Pub.Ref_Desg_Unexposed_Rec_Type
268 , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
269 , x_Return_Status IN OUT NOCOPY VARCHAR2
270 )
271 IS
272 l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
273 BEGIN
274
275 INSERT INTO BOM_REFERENCE_DESIGNATORS
276 ( COMPONENT_REFERENCE_DESIGNATOR
277 , LAST_UPDATE_DATE
278 , LAST_UPDATED_BY
279 , CREATION_DATE
280 , CREATED_BY
281 , LAST_UPDATE_LOGIN
282 , REF_DESIGNATOR_COMMENT
283 , CHANGE_NOTICE
284 , COMPONENT_SEQUENCE_ID
285 , ACD_TYPE
286 , REQUEST_ID
287 , PROGRAM_APPLICATION_ID
288 , PROGRAM_ID
289 , PROGRAM_UPDATE_DATE
290 , ATTRIBUTE_CATEGORY
291 , ATTRIBUTE1
292 , ATTRIBUTE2
293 , ATTRIBUTE3
294 , ATTRIBUTE4
295 , ATTRIBUTE5
296 , ATTRIBUTE6
297 , ATTRIBUTE7
298 , ATTRIBUTE8
299 , ATTRIBUTE9
300 , ATTRIBUTE10
301 , ATTRIBUTE11
302 , ATTRIBUTE12
303 , ATTRIBUTE13
304 , ATTRIBUTE14
305 , ATTRIBUTE15
306 , Original_System_Reference
307 )
308 VALUES
309 ( p_ref_designator_rec.Reference_Designator_Name
310 , SYSDATE
311 , Bom_Globals.Get_User_Id
312 , SYSDATE
313 , Bom_Globals.Get_User_Id
314 , Bom_Globals.Get_User_Id
315 , DECODE( p_ref_designator_rec.ref_designator_comment
316 , FND_API.G_MISS_CHAR
317 , NULL
318 , p_ref_designator_rec.ref_designator_comment )
319 , p_ref_designator_rec.Eco_Name
320 , p_Ref_Desg_Unexp_Rec.component_sequence_id
321 , p_ref_designator_rec.acd_type
322 , Fnd_Global.Conc_Request_Id /* Request Id */
323 , Bom_Globals.Get_Prog_AppId
324 , Bom_Globals.Get_Prog_Id
325 , SYSDATE
326 , p_ref_designator_rec.attribute_category
327 , p_ref_designator_rec.attribute1
328 , p_ref_designator_rec.attribute2
329 , p_ref_designator_rec.attribute3
330 , p_ref_designator_rec.attribute4
331 , p_ref_designator_rec.attribute5
332 , p_ref_designator_rec.attribute6
333 , p_ref_designator_rec.attribute7
334 , p_ref_designator_rec.attribute8
335 , p_ref_designator_rec.attribute9
336 , p_ref_designator_rec.attribute10
337 , p_ref_designator_rec.attribute11
338 , p_ref_designator_rec.attribute12
339 , p_ref_designator_rec.attribute13
340 , p_ref_designator_rec.attribute14
341 , p_ref_designator_rec.attribute15
342 , p_ref_designator_rec.Original_System_Reference
343 );
344 BOMPCMBM.Insert_Related_Ref_Desg(p_component_sequence_id => p_Ref_Desg_Unexp_Rec.component_sequence_id
345 , p_ref_desg => p_ref_designator_rec.Reference_Designator_Name
346 , x_Mesg_Token_Tbl => x_Mesg_Token_Tbl
347 , x_Return_Status => x_return_status);
348 --x_return_status := FND_API.G_RET_STS_SUCCESS;
349 EXCEPTION
350
351 WHEN OTHERS THEN
352 IF G_CONTROL_REC.caller_type = 'FORM'
353 THEN
354 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
355 RAISE;
356 END IF;
357
358 Error_Handler.Add_Error_Token
359 ( p_Message_Name => NULL
360 , p_Message_Text => 'ERROR in Insert Row (Ref Desgs)' ||
361 substr(SQLERRM, 1, 100) || ' ' ||
362 to_char(SQLCODE)
363 , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
364 , x_Mesg_Token_Tbl => x_Mesg_Token_Tbl
365 );
366
367 IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('ERROR in Insert Row (Ref Desgs)' || substr(SQLERRM, 1, 100) || ' ' || to_char(SQLCODE)); END IF;
368
369 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
370
371 END Insert_Row;
372
373 /********************************************************************
374 *
375 * Procedure : Delete_Row
376 * Parameters IN : Reference Designator Key
377 * Parameters OUT: Return_Status - Indicating success or faliure
378 * Mesg_Token_Tbl - Filled with any errors or warnings
379 * Purpose : Insert Reference Designator record and if unable to
380 * to insert then return with an error_status and
381 * Error message filled in the Message Token Table.
382 *
383 ********************************************************************/
384
385 PROCEDURE Delete_Row
386 ( p_ref_designator IN VARCHAR2
387 , p_component_sequence_id IN NUMBER
388 , p_acd_type IN NUMBER
389 , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
390 , x_Return_Status IN OUT NOCOPY VARCHAR2
391 )
392 IS
393 l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
394 l_BO_Id VARCHAR2(3) := Bom_Globals.Get_Bo_Identifier;
395
396 BEGIN
397
398 DELETE FROM BOM_REFERENCE_DESIGNATORS
399 WHERE COMPONENT_REFERENCE_DESIGNATOR = p_ref_designator
400 AND COMPONENT_SEQUENCE_ID = p_component_sequence_id
401 AND ( ( l_BO_Id = Bom_Globals.G_ECO_BO AND
402 ACD_TYPE = p_acd_type
403 ) OR
404 ( l_BO_Id = Bom_Globals.G_BOM_BO AND
405 acd_type IS NULL
406 )
407 );
408 BOMPCMBM.Delete_Related_Ref_Desg(p_src_comp_seq => p_component_sequence_id
409 , p_ref_desg => p_ref_designator
410 , x_return_status => x_return_status);
411
412 --x_Return_Status := FND_API.G_RET_STS_SUCCESS;
413
414 EXCEPTION
415 WHEN OTHERS THEN
416
417 IF G_CONTROL_REC.caller_type = 'FORM'
418 THEN
419 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
420 RAISE;
421 END IF;
422
423 Error_Handler.Add_Error_Token
424 ( p_Message_Name => NULL
425 , p_Message_Text => 'ERROR in Delete Row (Ref Desgs)' ||
426 substr(SQLERRM, 1, 100) || ' ' ||
427 to_char(SQLCODE)
428 , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
429 , x_Mesg_Token_Tbl => x_Mesg_Token_Tbl
430 );
431 x_Return_Status := FND_API.G_RET_STS_UNEXP_ERROR;
432
433 END Delete_Row;
434
435 /********************************************************************
436 *
437 * Procedure : Query_Row
438 * Parameters IN : Reference Designator Key
439 * Parameters OUT: Reference Designator Record of exposed columns
440 * Reference Designator Record of Unexposed Columns
441 * Return_Status - Indicating success or faliure
442 * Mesg_Token_Tbl - Filled with any errors or warnings
443 * Purpose : Query Row procedure will query a database record
444 * seperate the values into the exposed and the un-
445 * exposed record and return the values.
446 * If the query fails then the Error Token table will
447 * be filled in with the error message and returned with
448 * and error status otherwise a success
449 ********************************************************************/
450
451 PROCEDURE Query_Row
452 ( p_ref_designator IN VARCHAR2
453 , p_component_sequence_id IN NUMBER
454 , p_acd_type IN NUMBER
455 , x_Ref_Designator_Rec IN OUT NOCOPY Bom_Bo_Pub.Ref_Designator_Rec_Type
456 , x_Ref_Desg_Unexp_Rec IN OUT NOCOPY Bom_Bo_Pub.Ref_Desg_Unexposed_Rec_Type
457 , x_Return_Status IN OUT NOCOPY VARCHAR2
458 )
459 IS
460 l_ref_designator_rec Bom_Bo_Pub.Ref_Designator_Rec_Type;
461 l_Ref_Desg_Unexp_Rec Bom_Bo_Pub.Ref_Desg_Unexposed_Rec_Type;
462 l_err_text VARCHAR2(2000);
463 BEGIN
464
465 SELECT COMPONENT_REFERENCE_DESIGNATOR
466 , REF_DESIGNATOR_COMMENT
467 , CHANGE_NOTICE
468 , COMPONENT_SEQUENCE_ID
469 , ACD_TYPE
470 , ATTRIBUTE_CATEGORY
471 , ATTRIBUTE1
472 , ATTRIBUTE2
473 , ATTRIBUTE3
474 , ATTRIBUTE4
475 , ATTRIBUTE5
476 , ATTRIBUTE6
477 , ATTRIBUTE7
478 , ATTRIBUTE8
479 , ATTRIBUTE9
480 , ATTRIBUTE10
481 , ATTRIBUTE11
482 , ATTRIBUTE12
483 , ATTRIBUTE13
484 , ATTRIBUTE14
485 , ATTRIBUTE15
486 INTO l_ref_designator_rec.Reference_Designator_Name
487 , l_ref_designator_rec.ref_designator_comment
488 , l_ref_designator_rec.Eco_Name
489 , l_Ref_Desg_Unexp_Rec.component_sequence_id
490 , l_ref_designator_rec.acd_type
491 , l_ref_designator_rec.attribute_category
492 , l_ref_designator_rec.attribute1
493 , l_ref_designator_rec.attribute2
494 , l_ref_designator_rec.attribute3
495 , l_ref_designator_rec.attribute4
496 , l_ref_designator_rec.attribute5
497 , l_ref_designator_rec.attribute6
498 , l_ref_designator_rec.attribute7
499 , l_ref_designator_rec.attribute8
500 , l_ref_designator_rec.attribute9
501 , l_ref_designator_rec.attribute10
502 , l_ref_designator_rec.attribute11
503 , l_ref_designator_rec.attribute12
504 , l_ref_designator_rec.attribute13
505 , l_ref_designator_rec.attribute14
506 , l_ref_designator_rec.attribute15
507 FROM BOM_REFERENCE_DESIGNATORS
508 WHERE COMPONENT_REFERENCE_DESIGNATOR = p_ref_designator
509 AND COMPONENT_SEQUENCE_ID = p_component_sequence_id
510 AND NVL(DECODE(ACD_TYPE, FND_API.G_MISS_NUM, null, acd_type), 1) =
511 NVL(DECODE(p_acd_type, FND_API.G_MISS_NUM, null, p_acd_type), 1)
512 /* Bug 5726557; The code is modified to modify the refernce designators
513 when implemneted through an ECO */
514 ;
515
516 x_Ref_Designator_Rec := l_ref_designator_rec;
517 x_Ref_Desg_Unexp_Rec := l_Ref_Desg_Unexp_Rec;
518 x_Return_Status := Bom_Globals.G_RECORD_FOUND;
519
520 EXCEPTION
521
522 WHEN NO_DATA_FOUND THEN
523 x_Return_Status := Bom_Globals.G_RECORD_NOT_FOUND;
524
525 WHEN OTHERS THEN
526 x_Return_Status := FND_API.G_RET_STS_UNEXP_ERROR;
527
528 END Query_Row;
529
530 PROCEDURE Perform_Writes
531 ( p_ref_designator_rec IN Bom_Bo_Pub.Ref_Designator_rec_Type
532 , p_ref_desg_unexp_rec IN Bom_Bo_Pub.Ref_Desg_Unexposed_Rec_Type
533 , p_control_rec IN BOM_BO_PUB.Control_Rec_Type
534 := BOM_BO_PUB.G_DEFAULT_CONTROL_REC
535 , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
536 , x_return_status IN OUT NOCOPY VARCHAR2
537 )
538 IS
539 l_mesg_token_tbl Error_Handler.Mesg_Token_Tbl_Type;
540 l_return_status VARCHAR2(1);
541 BEGIN
542 l_return_status := FND_API.G_RET_STS_SUCCESS;
543
544 IF p_ref_designator_rec.transaction_type = Bom_Globals.G_OPR_CREATE
545 THEN
546 Insert_Row( p_ref_designator_rec =>
547 p_ref_designator_rec
548 , p_ref_desg_unexp_rec =>
549 p_ref_desg_unexp_rec
550 , x_mesg_token_tbl => l_mesg_token_tbl
551 , x_return_status => l_return_status
552 );
553 ELSIF p_ref_designator_rec.transaction_type = Bom_Globals.G_OPR_UPDATE
554 THEN
555 Update_Row( p_ref_designator_rec =>
556 p_ref_designator_rec
557 , p_ref_desg_unexp_rec =>
558 p_ref_desg_unexp_rec
559 , x_mesg_token_tbl =>
560 l_mesg_token_tbl
561 , x_return_status =>
562 l_return_status
563 );
564 ELSIF p_ref_designator_rec.transaction_type = Bom_Globals.G_OPR_DELETE
565 THEN
566 Delete_Row
567 ( p_ref_designator =>
568 p_ref_designator_rec.reference_designator_name
569 , p_component_sequence_id =>
570 p_ref_desg_unexp_rec.component_sequence_id
571 , p_acd_type =>
572 p_ref_designator_rec.acd_type
573 , x_Mesg_Token_Tbl => l_mesg_token_tbl
574 , x_Return_Status => l_return_status
575 );
576 END IF;
577
578 x_return_status := l_return_status;
579 x_mesg_token_tbl := l_mesg_token_tbl;
580
581 END Perform_Writes;
582
583 /*
584 ** Procedure definitions for BOM Business Object
585 */
586 FUNCTION Convert_Miss_To_Null
587 ( p_bom_ref_designator_rec IN Bom_Bo_Pub.Bom_Ref_Designator_Rec_Type
588 ) RETURN Bom_Bo_Pub.Bom_Ref_Designator_Rec_Type
589 IS
590 l_ref_designator_rec Bom_Bo_Pub.Ref_Designator_Rec_Type;
591 l_ref_desg_unexp_rec Bom_Bo_Pub.Ref_Desg_Unexposed_Rec_Type;
592 l_bom_ref_designator_rec Bom_Bo_Pub.Bom_Ref_Designator_Rec_Type;
593 l_bom_ref_desg_unexp_rec Bom_Bo_Pub.Bom_Ref_Desg_Unexp_Rec_Type;
594 BEGIN
595 --
596 -- Convert the BOM Record to ECO
597 --
598 Bom_Bo_Pub.Convert_BomDesg_To_EcoDesg
599 ( p_bom_ref_designator_rec => p_bom_ref_designator_rec
600 , x_ref_designator_rec => l_ref_designator_rec
601 , x_ref_desg_unexp_rec => l_ref_desg_unexp_rec
602 );
603
604 -- Call Conver Missing to Null
605
606 l_ref_designator_rec :=
607 Convert_Miss_To_Null
608 ( p_ref_designator_rec => l_ref_designator_rec);
609
610 --
611 -- Convert ECO record back to BOM
612 --
613 Bom_Bo_Pub.Convert_EcoDesg_To_BomDesg
614 ( p_ref_designator_rec => l_ref_designator_rec
615 , x_bom_ref_designator_rec => l_bom_ref_designator_rec
616 , x_bom_ref_desg_unexp_rec => l_bom_ref_desg_unexp_rec
617 );
618
619 RETURN l_bom_ref_designator_rec;
620
621 END Convert_Miss_To_Null;
622
623 -- Function Query_Row
624
625 PROCEDURE Query_Row
626 ( p_bom_ref_designator IN VARCHAR2
627 , p_component_sequence_id IN NUMBER
628 , p_acd_type IN NUMBER
629 , x_bom_Ref_Designator_Rec IN OUT NOCOPY Bom_Bo_Pub.Bom_Ref_Designator_Rec_Type
630 , x_bom_Ref_Desg_Unexp_Rec IN OUT NOCOPY Bom_Bo_Pub.Bom_Ref_Desg_Unexp_Rec_Type
631 , x_Return_Status IN OUT NOCOPY VARCHAR2
632 )
633 IS
634 l_ref_designator_rec Bom_Bo_Pub.Ref_Designator_Rec_Type;
635 l_ref_desg_unexp_rec Bom_Bo_Pub.Ref_Desg_Unexposed_Rec_Type;
636 BEGIN
637
638 Bom_Ref_Designator_Util.Query_Row
639 ( p_ref_designator => p_bom_ref_designator
640 , p_component_sequence_id => p_component_sequence_id
641 , p_acd_type => p_acd_type
642 , x_ref_designator_rec => l_ref_designator_rec
643 , x_ref_desg_unexp_rec => l_ref_desg_unexp_rec
644 , x_return_status => x_return_status
645 );
646
647 -- Convert the ECO record to BOm for return
648
649 Bom_Bo_Pub.Convert_Ecodesg_To_BomDesg
650 ( p_ref_designator_rec => l_ref_designator_rec
651 , p_ref_desg_unexp_rec => l_ref_Desg_unexp_rec
652 , x_bom_ref_designator_rec => x_bom_ref_designator_rec
653 , x_bom_ref_desg_unexp_rec => x_bom_ref_desg_unexp_Rec
654 );
655
656 END Query_Row;
657
658 PROCEDURE Perform_Writes
659 ( p_bom_ref_designator_rec IN Bom_Bo_Pub.Bom_Ref_Designator_rec_Type
660 , p_bom_ref_desg_unexp_rec IN Bom_Bo_Pub.Bom_Ref_Desg_Unexp_Rec_Type
661 , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
662 , x_return_status IN OUT NOCOPY VARCHAR2
663 )
664 IS
665 l_ref_designator_rec Bom_Bo_Pub.Ref_Designator_Rec_Type;
666 l_ref_desg_unexp_rec Bom_Bo_Pub.Ref_Desg_Unexposed_Rec_Type;
667 BEGIN
668 --
669 -- Convert Bom Recor to ECO
670 --
671 Bom_Bo_Pub.Convert_BomDesg_To_EcoDesg
672 ( p_bom_ref_designator_rec => p_bom_ref_designator_rec
673 , p_bom_ref_desg_unexp_rec => p_bom_ref_desg_unexp_rec
674 , x_ref_designator_rec => l_ref_designator_rec
675 , x_ref_desg_unexp_rec => l_ref_desg_unexp_rec
676 );
677
678 -- Call Perform Writes
679 Bom_Ref_Designator_Util.Perform_Writes
680 ( p_ref_designator_rec => l_ref_designator_rec
681 , p_ref_desg_unexp_rec => l_ref_desg_unexp_rec
682 , x_return_status => x_return_status
683 , x_mesg_token_tbl => x_mesg_token_tbl
684 );
685
686 END Perform_Writes;
687
688
689 END BOM_Ref_Designator_Util;