1 PACKAGE BODY BOM_RTG_Globals AS
2 /* $Header: BOMRGLBB.pls 120.1 2006/06/14 06:10:00 abbhardw noship $ */
3 /**********************************************************************
4 --
5 -- Copyright (c) 2000 Oracle Corporation, Redwood Shores, CA, USA
6 -- All rights reserved.
7 --
8 -- FILENAME
9 --
10 -- RTGSGLBB.pls
11 --
12 -- DESCRIPTION
13 --
14 -- Body of package BOM_RTG_Globals
15 --
16 -- NOTES
17 --
18 -- HISTORY
19 --
20 -- 04-AUG-2000 Biao Zhang Initial Creation
21 --
22 **********************************************************************/
23
24 G_PKG_NAME CONSTANT VARCHAR2(30) := 'BOM_Rtg_Globals';
25
26 -- Global variable holding ECO workflow approval process name
27
28 G_PROCESS_NAME VARCHAR2(30) := NULL;
29 G_System_Information System_Information_Rec_Type;
30 G_Temp_Op_Rec_Tbl Temp_Op_Rec_Tbl_Type;
31
32 PROCEDURE Init_System_Info_Rec
33 ( x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
34 , x_return_status IN OUT NOCOPY VARCHAR2
35 )
36 IS
37 BEGIN
38 BOM_Rtg_Globals.Set_user_id( p_user_id => FND_GLOBAL.user_id);
39 BOM_Rtg_Globals.Set_login_id( p_login_id => FND_GLOBAL.login_id);
40 BOM_Rtg_Globals.Set_prog_id( p_prog_id => FND_GLOBAL.conc_program_id);
41 BOM_Rtg_Globals.Set_prog_appid( p_prog_appid => FND_GLOBAL.prog_appl_id);
42 BOM_Rtg_Globals.Set_request_id( p_request_id => FND_GLOBAL.conc_request_id);
43
44 END Init_System_Info_Rec;
45
46 /****************************************************************************
47 * The following procedures and functions are the get and set routines for the
48 * system_information_record.
49 * Numeric attributes of the record have Get functions with a naming convention
50 * of Get_<Attribute_Name> ex. Get_Bill_Sequence_Id
51 * For attributes of type Boolean the convention is IS_<Boolean_Attribute_Name>
52 * Ex. Is_Eco_Impl will return value of the boolean attribute Eco_Impl.
53 * Similarly the set procedures will have the convention of Set_<Attribute_Name>
54 * with the respective attribute Type variable as an input.
55 * There are also two routines which get and set the entire record as a whole.
56 *****************************************************************************/
57
58 /**************************************************************************
59 * Function : Get_System_Information
60 * Returns : System_Information Record
61 * Parameters IN : None
62 * Parameters OUT: None
63 * Purpose : This procedure will return the value of the system information
64 * record.
65 ****************************************************************************/
66 FUNCTION Get_System_Information RETURN BOM_Rtg_Globals.System_Information_Rec_Type
67 IS
68 BEGIN
69 RETURN G_System_Information;
70
71 END Get_System_Information;
72
73
74 /***************************************************************************
75 * Procedure : Set_System_Information
76 * Returns : None
77 * Parameters IN : System_Information_Record
78 * Parameters OUT: None
79 * Purpose : This procedure will set the value of the system information
80 * record.
81 ****************************************************************************/
82 PROCEDURE Set_System_Information
83 ( p_system_information_rec IN
84 BOM_Rtg_Globals.System_Information_Rec_Type)
85 IS
86 BEGIN
87 G_System_Information := p_system_information_rec;
88
89 END Set_System_Information;
90
91
92 PROCEDURE Check_Approved_For_Process
93 ( p_change_notice IN VARCHAR2
94 , p_organization_id IN NUMBER
95 , x_processed IN OUT NOCOPY BOOLEAN
96 , x_err_text IN OUT NOCOPY VARCHAR2
97 )
98 IS
99 l_process_name VARCHAR2(30) := NULL;
100 l_approval_status_type NUMBER;
101 BEGIN
102 x_processed := FALSE;
103 -- Get Workflow Process name
104 l_process_name := BOM_Rtg_Globals.Get_Process_Name;
105 SELECT approval_status_type
106 INTO l_approval_status_type
107 FROM eng_engineering_changes
108 WHERE change_notice = p_change_notice
109 AND organization_id = p_organization_id;
110
111 -- ECO w/ Process is Approved
112
113 IF l_approval_status_type = 5 AND
114 l_process_name is NOT NULL
115 THEN
116 x_processed := TRUE;
117 END IF;
118
119 EXCEPTION
120 WHEN NO_DATA_FOUND THEN
121 x_processed := FALSE;
122 WHEN OTHERS THEN
123 IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
124 THEN
125 x_err_text := G_PKG_NAME || '(Check_Approved_For_Process) - '
126 || 'ECO Header' || substrb(SQLERRM,1,60);
127 END IF;
128 RAISE FND_API.G_EXC_ERROR;
129
130 END Check_Approved_For_Process;
131
132 PROCEDURE Set_Request_For_Approval
133 ( p_change_notice IN VARCHAR2
134 , p_organization_id IN NUMBER
135 , x_err_text IN OUT NOCOPY VARCHAR2
136 )
137 IS
138 BEGIN
139 -- Set ECO to 'Not Submitted For Approval'
140
141 UPDATE eng_engineering_changes
142 SET approval_status_type = 1,
143 approval_request_date = null,
144 approval_date = null,
145 last_update_date = SYSDATE,
146 last_updated_by = FND_GLOBAL.USER_ID,
147 last_update_login = FND_GLOBAL.LOGIN_ID
148 WHERE organization_id = p_organization_id
149 AND change_notice = p_change_notice;
150
151 -- Set all "Scheduled" revised items to "Open"
152
153 UPDATE eng_revised_items
154 SET status_type = 1,
155 last_update_date = SYSDATE,
156 last_updated_by = FND_GLOBAL.USER_ID,
157 last_update_login = FND_GLOBAL.LOGIN_ID
158 WHERE organization_id = p_organization_id
159 AND change_notice = p_change_notice
160 AND status_type = 4;
161
162 -- Issue warning
163 IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
164 THEN
165 NULL;
166 END IF;
167
168 EXCEPTION
169 WHEN OTHERS THEN
170 IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
171 THEN
172 x_err_text := G_PKG_NAME || '(Set_Request_For_Approval) -
173 ECO Header and Revised Items' || substrb(SQLERRM,1,60);
174 END IF;
175
176 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
177
178 END Set_Request_For_Approval;
179
180 PROCEDURE Init_Process_Name
181 ( p_change_order_type_id IN NUMBER
182 , p_priority_code IN VARCHAR2
183 , p_organization_id IN NUMBER
184 )
185 IS
186 l_process_name VARCHAR2(30) := NULL;
187 BEGIN
188
189 IF p_change_order_type_id IS NULL THEN
190 G_PROCESS_NAME := NULL;
191 END IF;
192
193 SELECT process_name
194 INTO l_process_name
195 FROM eng_change_type_processes
196 WHERE change_order_type_id = p_change_order_type_id
197 AND ( p_priority_code is NOT NULL
198 AND eng_change_priority_code = p_priority_code
199 AND organization_id = p_organization_id)
200 OR
201 (p_priority_code is NULL
202 AND eng_change_priority_code is NULL);
203
204 G_PROCESS_NAME := l_process_name;
205
206 EXCEPTION
207 WHEN NO_DATA_FOUND THEN
208
209 G_PROCESS_NAME := NULL;
210
211 END Init_Process_Name;
212
213 FUNCTION Get_Process_Name
214 RETURN VARCHAR2
215 IS
216 BEGIN
217 RETURN G_PROCESS_NAME;
218 END Get_Process_Name;
219
220 /*****************************************************************************
221 * Procedure : Set_Routing_Sequence_Id
222 * Returns : None
223 * Parameters IN : Routing_Sequence_Id
224 * Parameters OUT: None
225 * Purpose : This procedure will set the routing_sequence_id value in the
226 * system_information record.
227 *
228 *****************************************************************************/
229 PROCEDURE Set_Routing_Sequence_id
230 ( p_routing_sequence_id IN NUMBER)
231 IS
232 BEGIN
233 G_System_Information.routing_sequence_id := p_routing_sequence_id;
234 END Set_Routing_Sequence_id ;
235
236 /*****************************************************************************
237 * Procedure : Set_Common_Rtg_Seq_Id
238 * Returns : None
239 * Parameters IN : Routing_Sequence_Id
240 * Parameters OUT: None
241 * Purpose : This procedure will set common_routing_sequence_id in the
242 * system_information record.
243 *
244 *****************************************************************************/
245 PROCEDURE Set_Common_Rtg_Seq_Id
246 ( p_common_rtg_seq_id IN NUMBER)
247 IS
248 BEGIN
249 G_System_Information.common_rtg_seq_id := p_common_rtg_seq_id;
250 END Set_Common_Rtg_Seq_Id ;
251
252
253 /***************************************************************************
254 * Function : Get_Routing_Sequence_Id
255 * Returns : Number
256 * Parameters IN : None
257 * Parameters OUT: None
258 * Purpose : This function will return the routing_sequence_id value in the
259 * system_information record.
260 ******************************************************************************/
261 FUNCTION Get_Routing_Sequence_Id RETURN NUMBER
262 IS
263 BEGIN
264 RETURN G_System_Information.routing_sequence_id;
265
266 END Get_Routing_Sequence_Id;
267
268 /***************************************************************************
269 * Function : Get_Common_Rtg_Seq_Id
270 * Returns : Number
271 * Parameters IN : None
272 * Parameters OUT: None
273 * Purpose : This function will return the common_routing_sequence_id value in the
274 * system_information record.
275 ******************************************************************************/
276 FUNCTION Get_Common_Rtg_Seq_id RETURN NUMBER
277 IS
278 BEGIN
279 RETURN G_System_Information.common_rtg_seq_id;
280
281 END Get_Common_Rtg_Seq_id ;
282
283 /*****************************************************************************
284 * Procedure : Set_Entity
285 * Returns : None
286 * Parameters IN : Entity Name
287 * Parameter OUT : None
288 * Purpose : Will set the entity name in the System Information Record.
289 *
290 ******************************************************************************/
291 PROCEDURE Set_Entity
292 ( p_entity IN VARCHAR2)
293 IS
294 BEGIN
295 G_System_information.entity := p_entity;
296 END Set_Entity;
297
298 /****************************************************************************
299 * Function : Get_Entity
300 * Returns : VARCHAR2
301 * Parameters IN : None
302 * Parameter OUT : None
303 * Purpose : Will return the entity name in the System Information Record.
304 *
305 *****************************************************************************/
306 FUNCTION Get_Entity RETURN VARCHAR2
307 IS
308 BEGIN
309 RETURN G_System_Information.entity;
310 END Get_Entity;
311
312 /****************************************************************************
313 * Procedure : Set_Org_Id
314 * Returns : None
315 * Parameters IN : Organization_Id
316 * Parameters OUT: None
317 * Purpose : Will set the org_id attribute of the sytem_information_record
318 *
319 *****************************************************************************/
320 PROCEDURE Set_Org_Id
321 ( p_org_id IN NUMBER)
322 IS
323 BEGIN
324 G_System_Information.org_id := p_org_id;
325
326 END Set_Org_Id;
327
328 /***************************************************************************
329 * Function : Get_Org_id
330 * Returns : Number
331 * Parameters IN : None
332 * Parameters OUT: None
333 * Purpose : Will return the org_id attribute of the
334 * sytem_information_record
335 *****************************************************************************/
336 FUNCTION Get_Org_id RETURN NUMBER
337 IS
338 BEGIN
339 RETURN G_System_Information.org_id;
340
341 END Get_Org_Id;
342
343 /****************************************************************************
344 * Procedure : Set_Eco_Name
345 * Returns : None
346 * Parameters IN : Eco_Name
347 * Parameters OUT: None
348 * Purpose : Will set the Eco_Name attribute of the
349 * system_information record
350 ******************************************************************************/
351 PROCEDURE Set_Eco_Name
352 ( p_eco_name IN VARCHAR2)
353 IS
354 BEGIN
355 G_System_Information.eco_name := p_eco_name;
356
357 END Set_Eco_Name;
358
359 /****************************************************************************
360 * Function : Get_Eco_Name
361 * Returns : VARCHAR2
362 * Parameters IN : None
363 * Parameters OUT: None
364 * Purpose : Will return the Eco_Name attribute of the
365 * system_information record
366 *****************************************************************************/
367 FUNCTION Get_Eco_Name RETURN VARCHAR2
368 IS
369 BEGIN
370 RETURN G_System_Information.eco_name;
371
372 END Get_Eco_Name;
373
374 /*****************************************************************************
375 * Procedure : Set_User_Id
376 * Returns : None
377 * Parameters IN : User ID
378 * Parameters OUT: None
379 * Purpose : Will set the user ID attribute of the
380 * system_information_record
381 *****************************************************************************/
382 PROCEDURE Set_User_Id
383 ( p_user_id IN NUMBER)
384 IS
385 BEGIN
386 G_System_Information.user_id := p_user_id;
387
388 END Set_User_Id;
389
390 /***************************************************************************
391 * Function : Get_User_Id
392 * Returns : Number
393 * Parameters IN : None
394 * Parameters OUT: None
395 * Purpose : Will return the user_id attribute from the
396 * system_information_record
397 *****************************************************************************/
398 FUNCTION Get_User_ID RETURN NUMBER
399 IS
400 BEGIN
401 RETURN G_System_Information.user_id;
402
403 END Get_User_id;
404
405
406 /****************************************************************************
407 * Procedure : Set_Login_Id
408 * Returns : None
409 * Paramaters IN : p_login_id
410 * Parameters OUT: None
411 * Purpose : Will set the login ID attribute of the system information
412 * record.
413 *****************************************************************************/
414 PROCEDURE Set_Login_Id
415 ( p_login_id IN NUMBER )
416 IS
417 BEGIN
418 G_System_Information.login_id := p_login_id;
419
420 END Set_Login_Id;
421
422 /****************************************************************************
426 * Parameters OUT: None
423 * Function : Get_Login_Id
424 * Returns : Number
425 * Paramaters IN : None
427 * Purpose : Will retun the login ID attribute of the system information
428 * record.
429 *****************************************************************************/
430 FUNCTION Get_Login_Id RETURN NUMBER
431 IS
432 BEGIN
433 RETURN G_System_Information.Login_Id;
434 END;
435
436 /***************************************************************************
437 * Procedure : Set_Prog_AppId
438 * Returns : None
439 * Parameters IN : p_prog_appid
440 * Parameters OUT: None
441 * Purpose : Will set the Program Application Id attribute of the
442 * System Information Record.
443 *****************************************************************************/
444 PROCEDURE Set_Prog_AppId
445 ( p_prog_Appid IN NUMBER )
446 IS
447 BEGIN
448 G_System_Information.prog_appid := p_prog_appid;
449
450 END Set_Prog_AppId;
451
452 /***************************************************************************
453 * Function : Get_Prog_AppId
454 * Returns : Number
455 * Parameters IN : None
456 * Parameters OUT: None
457 * Purpose : Will return the Program Application Id (prog_appid)
458 * attribute of the system information record.
459 *****************************************************************************/
460 FUNCTION Get_Prog_AppId RETURN NUMBER
461 IS
462 BEGIN
463 RETURN G_System_Information.prog_AppId;
464
465 END Get_Prog_AppId;
466
467
468 /***************************************************************************
469 * Procedure : Set_Prog_Id
470 * Returns : None
471 * Parameters IN : p_prog_id
472 * Parameters OUT: None
473 * Purpose : Will set the Program Id attribute of the system information
474 * record.
475 *****************************************************************************/
476 PROCEDURE Set_Prog_Id
477 ( p_prog_id IN NUMBER )
478 IS
479 BEGIN
480 G_System_Information.prog_id := p_prog_id;
481
482 END Set_Prog_Id;
483
484 /***************************************************************************
485 * Function : Get_Prog_Id
486 * Returns : NUMBER
487 * Parameters IN : None
488 * Parameters OUT: None
489 * Purpose : Function will return the Prog_Id attribute of the System
490 * information record.
491 *****************************************************************************/
492 FUNCTION Get_Prog_Id RETURN NUMBER
493 IS
494 BEGIN
495 RETURN G_System_Information.prog_id;
496
497 END Get_Prog_Id;
498
499 /***************************************************************************
500 * Procedure : Set_Request_Id
501 * Returns : None
502 * Parameters IN : p_request_id
503 * Parameters OUT: None
504 * Purpose : Procedure will set the request_id attribute of the
505 * system information record.
506 *****************************************************************************/
507 PROCEDURE Set_Request_Id
508 ( p_request_id IN NUMBER )
509 IS
510 BEGIN
511 G_System_Information.request_id := p_request_id;
512 END;
513
514
515 /***************************************************************************
516 * Function : Get_Request_Id
517 * Returns : NUMBER
518 * Parameters IN : None
519 * Parameters OUT: None
520 * Purpose : Function will return the value of the request_id attribute
521 * of the system information record.
522 *****************************************************************************/
523 FUNCTION Get_Request_id RETURN NUMBER
524 IS
525 BEGIN
526 RETURN G_System_Information.request_id;
527
528 END Get_Request_Id;
529
530 /***************************************************************************
531 * Procedure : Set_Eco_Impl
532 * Returns : None
533 * Parameters IN : p_eco_impl
534 * Parameters OUT: None
535 * Purpose : Will set the attribute Eco_Impl of system information record
536 * to true or false based on the implemented status of the ECO
537 *****************************************************************************/
538 PROCEDURE Set_Eco_Impl
539 ( p_eco_impl IN BOOLEAN )
540 IS
541 BEGIN
542 G_System_Information.eco_impl := p_eco_impl;
543
544 END Set_Eco_Impl;
545
546 /***************************************************************************
547 * Function : Is_Eco_Impl
548 * Returns : BOOLEAN
549 * Parameters IN : None
550 * Parameters OUT: None
551 * Purpose : Function will true or false value of the system information
552 * record's attribute Eco_Impl. True if ECO is implemented and
553 * false otherwise.
554 *****************************************************************************/
555 FUNCTION Is_Eco_Impl RETURN BOOLEAN
556 IS
557 BEGIN
558 RETURN G_System_Information.eco_impl;
559
560 END Is_Eco_Impl;
561
562 /***************************************************************************
566 * Parameters OUT: None
563 * Procedure : Set_Eco_Cancl
564 * Returns : None
565 * Parameters IN : p_eco_cancl
567 * Purpose : Procedure will set the value of the system information
568 * record attribute, Eco_Cancl. True if the Eco is canceled
569 * and false otherwise.
570 *****************************************************************************/
571 PROCEDURE Set_Eco_Cancl
572 ( p_eco_cancl IN BOOLEAN )
573 IS
574 BEGIN
575 G_System_Information.eco_cancl := p_eco_cancl;
576
577 END Set_Eco_Cancl;
578
579 /***************************************************************************
580 * Function : Is_Eco_Cancl
581 * Returns : BOOLEAN
582 * Parameters IN : None
583 * Parameters OUT: None
584 * Purpose : Function will return true or false value of the system
585 * information record's attribute Eco_Cancl.
586 *****************************************************************************/
587 FUNCTION Is_Eco_Cancl RETURN BOOLEAN
588 IS
589 BEGIN
590 RETURN G_System_Information.eco_cancl;
591
592 END Is_Eco_Cancl;
593
594
595 /***************************************************************************
596 * Procedure : Set_Wkfl_Process
597 * Returns : None
598 * Parameters IN : p_wkfl_process
599 * Parameters OUT: None
600 * Purpose : Procedure will set a true or false value in the attribute
601 * WKFL_Process of the system information record.
602 *****************************************************************************/
603 PROCEDURE Set_Wkfl_Process
604 ( p_wkfl_process IN BOOLEAN )
605 IS
606 BEGIN
607 G_System_Information.wkfl_process := p_wkfl_process;
608
609 END Set_Wkfl_Process;
610
611 /***************************************************************************
612 * Function : Is_Wkfl_Process
613 * Returns : BOOLEAN
614 * Parameters IN : None
615 * Parameters OUT: None
616 * Purpose : Function will return the value of the system information
617 * record attribute Wkfl_Process. True if a Workflow process
618 * exists the ECO and false otherwise.
619 *****************************************************************************/
620 FUNCTION Is_Wkfl_Process RETURN BOOLEAN
621 IS
622 BEGIN
623 RETURN G_System_Information.wkfl_process;
624
625 END Is_Wkfl_Process;
626
627
628 /***************************************************************************
629 * Procedure : Set_Eco_Access
630 * Returns : None
631 * Parameters IN : p_eco_access
632 * Parameters OUT: None
633 * Purpose : Procedure will set the value of the system information record
634 * attribute Eco_Access. True if the user has access to the ECO
635 * and false otherwise.
636 *****************************************************************************/
637 PROCEDURE Set_Eco_Access
638 ( p_eco_access IN BOOLEAN )
639 IS
640 BEGIN
641 G_System_Information.eco_access := p_eco_access;
642
643 END Set_Eco_Access;
644
645 /***************************************************************************
646 * Function : Is_Eco_Access
647 * Returns : BOOLEAN
648 * Parameters IN : None
649 * Parameters OUT: None
650 * Purpose : Function will return true if the Eco_Access is True and
651 * false otherwise.
652 *****************************************************************************/
653 FUNCTION Is_Eco_Access RETURN BOOLEAN
654 IS
655 BEGIN
656 RETURN G_System_Information.eco_access;
657
658 END Is_Eco_Access;
659
660 /***************************************************************************
661 * Procedure : Set_RItem_Impl
662 * Returns : None
663 * Parameters IN : p_ritem_impl
664 * Parameters OUT: None
665 * Purpose : Procedure will set the value of system iformation record
666 * attribute RItem_Impl.
667 *****************************************************************************/
668 PROCEDURE Set_RItem_Impl
669 ( p_ritem_impl IN BOOLEAN )
670 IS
671 BEGIN
672 G_System_Information.ritem_impl := p_ritem_impl;
673
674 END Set_RItem_Impl;
675
676 /***************************************************************************
677 * Function : Is_RItem_Impl
678 * Returns : BOOLEAN
679 * Parameters IN : None
680 * Parameters OUT: None
681 * Purpose : Function will answer true or false to the question
682 * Is Revised Item Implemented ?
683 *****************************************************************************/
684 FUNCTION Is_RItem_Impl RETURN BOOLEAN
685 IS
686 BEGIN
687 RETURN G_System_Information.RItem_Impl;
688
689 END Is_RItem_Impl;
690
691 /***************************************************************************
692 * Procedure : Set_RItem_Cancl
693 * Returns : None
694 * Parameters IN : p_ritem_cancl
695 * Parameters OUT: None
696 * Purpose : Procedure will set the value of system information record
697 * attribute RItem_cancl.
698 *****************************************************************************/
702 BEGIN
699 PROCEDURE Set_RItem_Cancl
700 ( p_ritem_cancl IN BOOLEAN )
701 IS
703 G_System_Information.ritem_cancl := p_ritem_cancl;
704
705 END Set_RItem_Cancl;
706
707 /***************************************************************************
708 * Function : Is_RItem_Cancl
709 * Returns : BOOLEAN
710 * Parameters IN : None
711 * Parameters OUT: None
712 * Purpose : Function will answer true or false to the question
713 * Is Revised Item Canceled?
714 *****************************************************************************/
715 FUNCTION Is_RItem_Cancl RETURN BOOLEAN
716 IS
717 BEGIN
718 RETURN G_System_Information.ritem_cancl;
719
720 END Is_RItem_Cancl;
721
722 /***************************************************************************
723 * Procedure : Set_RComp_Cancl
724 * Returns : None
725 * Parameters IN : p_Comp_Cancl
726 * Parameters OUT: None
727 * Purpose : Procedure will set the value of system iformation record
728 * attribute RComp_Cancl.
729 *****************************************************************************/
730 PROCEDURE Set_RComp_Cancl
731 ( p_rcomp_cancl IN BOOLEAN )
732 IS
733 BEGIN
734 G_System_Information.rcomp_cancl := p_rcomp_cancl;
735
736 END Set_RComp_Cancl;
737
738 /***************************************************************************
739 * Function : Is_RComp_Cancl
740 * Returns : BOOLEAN
741 * Parameters IN : None
742 * Parameters OUT: None
743 * Purpose : Function will answer true or false to the question
744 * Is Revised Revised Component canceled ?
745 *****************************************************************************/
746 FUNCTION Is_RComp_Cancl RETURN BOOLEAN
747 IS
748 BEGIN
749 RETURN G_System_Information.rcomp_cancl;
750
751 END Is_rcomp_cancl;
752
753
754 /***************************************************************************
755 * Added by MK on 09/01/2000
756 * Procedure : Set_ROp_Cancl
757 * Returns : None
758 * Parameters IN : p_rop_cancl
759 * Parameters OUT: None
760 * Purpose : Procedure will set the value of system iformation record
761 * attribute ROp_Cancl.
762 *****************************************************************************/
763 PROCEDURE Set_ROp_Cancl
764 ( p_rcomp_cancl IN BOOLEAN )
765 IS
766 BEGIN
767 G_System_Information.rcomp_cancl := p_rcomp_cancl;
768
769 END Set_ROp_Cancl;
770
771
772 /***************************************************************************
773 * Added by MK on 09/01/2000
774 * Function : Is_ROp_Cancl
775 * Returns : BOOLEAN
776 * Parameters IN : None
777 * Parameters OUT: None
778 * Purpose : Function will answer true or false to the question
779 * Is Revised Operation canceled ?
780 *****************************************************************************/
781 FUNCTION Is_ROp_Cancl RETURN BOOLEAN
782 IS
783 BEGIN
784 RETURN G_System_Information.ROp_cancl;
785
786 END Is_ROp_cancl;
787
788
789
790 /***************************************************************************
791 * Procedure : Set_Std_Item_Access
792 * Returns : None
793 * Parameters IN : p_std_item_access
794 * Parameters OUT: None
795 * Purpose : Will set the value of the attribute STD_Item_Access in the
796 * system information record.
797 *****************************************************************************/
798 PROCEDURE Set_Std_Item_Access
799 ( p_std_item_access IN NUMBER )
800 IS
801 BEGIN
802 G_System_Information.std_item_access := p_std_item_access;
803
804 END Set_Std_Item_Access;
805
806 /**************************************************************************
807 * Function : Get_Std_Item_Access
808 * Returns : NUMBER
809 * Parameters IN : None
810 * Parameters OUT: None
811 * Purpose : Will return the value of the Standard Item Access attribute
812 * Std_Item_Access from the system information record.
813 ***************************************************************************/
814 FUNCTION Get_Std_Item_Access RETURN NUMBER
815 IS
816 BEGIN
817 RETURN G_System_Information.std_item_access;
818
819 END Get_Std_Item_Access;
820
821 /***************************************************************************
822 * Procedure : Set_Mdl_Item_Access
823 * Returns : None
824 * Parameters IN : p_Mdl_item_access
825 * Parameters OUT: None
826 * Purpose : Will set the value of the attribute Mdl_Item_Access in the
827 * system information record.
828 *****************************************************************************/
829 PROCEDURE Set_Mdl_Item_Access
830 ( p_mdl_item_access IN NUMBER )
831 IS
832 BEGIN
833 G_System_Information.mdl_item_access := p_mdl_item_access;
834
835 END Set_Mdl_Item_Access;
836
837 /**************************************************************************
838 * Function : Get_Mdl_Item_Access
842 * Purpose : Will return the value of the Model Item Access attribute
839 * Returns : NUMBER
840 * Parameters IN : None
841 * Parameters OUT: None
843 * Mdl_Item_Access from the system information record.
844 ***************************************************************************/
845 FUNCTION Get_Mdl_Item_Access RETURN NUMBER
846 IS
847 BEGIN
848 RETURN G_System_Information.mdl_item_access;
849
850 END Get_Mdl_Item_Access;
851
852
853 /***************************************************************************
854 * Procedure : Set_Pln_Item_Access
855 * Returns : None
856 * Parameters IN : p_Pln_item_access
857 * Parameters OUT: None
858 * Purpose : Will set the value of the attribute Pln_Item_Access in the
859 * system information record.
860 *****************************************************************************/
861 PROCEDURE Set_Pln_Item_Access
862 ( p_Pln_item_access IN NUMBER )
863 IS
864 BEGIN
865 G_System_Information.pln_item_access := p_pln_item_access;
866
867 END Set_Pln_Item_Access;
868
869 /**************************************************************************
870 * Function : Get_Pln_Item_Access
871 * Returns : NUMBER
872 * Parameters IN : None
873 * Parameters OUT: None
874 * Purpose : Will return the value of the Planning Item Access attribute
875 * Pln_Item_Access from the system information record.
876 ***************************************************************************/
877 FUNCTION Get_Pln_Item_Access RETURN NUMBER
878 IS
879 BEGIN
880 RETURN G_System_Information.Pln_item_access;
881
882 END Get_Pln_Item_Access;
883
884 /***************************************************************************
885 * Procedure : Set_OC_Item_Access
886 * Returns : None
887 * Parameters IN : p_OC_item_access
888 * Parameters OUT: None
889 * Purpose : Will set the value of the attribute OC_Item_Access in the
890 * system information record.
891 *****************************************************************************/
892 PROCEDURE Set_OC_Item_Access
893 ( p_oc_item_access IN NUMBER )
894 IS
895 BEGIN
896 G_System_Information.oc_item_access := p_oc_item_access;
897
898 END Set_OC_Item_Access;
899
900 /**************************************************************************
901 * Function : Get_OC_Item_Access
902 * Returns : NUMBER
903 * Parameters IN : None
904 * Parameters OUT: None
905 * Purpose : Will return value of the Option Class Item Access attribute
906 * OC_Item_Access from the system information record.
907 ***************************************************************************/
908 FUNCTION Get_OC_Item_Access RETURN NUMBER
909 IS
910 BEGIN
911 RETURN G_System_Information.oc_item_access;
912
913 END Get_OC_Item_Access;
914
915 /***************************************************************************
916 * Procedure : Set_Unit_Effectivity
917 * Returns : None
918 * Parameters IN : p_Unit_Effectivity
919 * Parameters OUT: None
920 * Purpose : Will set the value of the attribute Unit_Effectivity in the
921 * system information record.
922 *****************************************************************************/
923 PROCEDURE Set_Unit_Effectivity
924 ( p_Unit_Effectivity IN BOOLEAN )
925 IS
926 BEGIN
927 G_System_Information.unit_effectivity := p_unit_effectivity;
928
929 END Set_Unit_Effectivity;
930
931 /**************************************************************************
932 * Function : Get_Unit_Effectivity
933 * Returns : NUMBER
934 * Parameters IN : None
935 * Parameters OUT: None
936 * Purpose : Will return value of the unit effective item attribute
937 * Unit_Effectivity from the system information record.
938 ***************************************************************************/
939 FUNCTION Get_Unit_Effectivity RETURN BOOLEAN
940 IS
941 BEGIN
942 RETURN G_System_Information.Unit_Effectivity;
943
944 END Get_Unit_Effectivity;
945
946 /***************************************************************************
947 * Procedure : Set_Unit_Controlled_Item
948 * Returns : None
949 * Parameters IN : p_Unit_Controlled_Item
950 * Parameters OUT: None
951 * Purpose : Will set the value of the attribute Unit_Controlled_Item in
952 * system information record.
953 *****************************************************************************/
954 PROCEDURE Set_Unit_Controlled_Item
955 ( p_Unit_Controlled_Item IN BOOLEAN)
956 IS
957 BEGIN
958 G_System_Information.unit_controlled_item := p_unit_controlled_item;
959
960 END Set_Unit_Controlled_Item;
961
962 PROCEDURE Set_Unit_Controlled_Item
963 ( p_inventory_item_id IN NUMBER
964 , p_organization_id IN NUMBER
965 )
966 IS
967 Cursor Unit_Controlled_Item IS
968 SELECT effectivity_control
969 FROM mtl_system_items
970 WHERE inventory_item_id = p_inventory_item_id
971 AND organization_id = p_organization_id;
972 BEGIN
976 THEN
973 FOR Unit_Cont_Item IN Unit_Controlled_Item
974 LOOP
975 IF Unit_Cont_Item.Effectivity_Control = 2
977 G_System_Information.unit_controlled_item := TRUE;
978 ELSIF Unit_Cont_Item.Effectivity_Control = 1
979 THEN
980 G_System_Information.unit_controlled_item := FALSE;
981 END IF;
982 END LOOP;
983 END Set_Unit_Controlled_Item;
984
985 /**************************************************************************
986 * Function : Get_Unit_Controlled_Item
987 * Returns : NUMBER
988 * Parameters IN : None
989 * Parameters OUT: None
990 * Purpose : Will return value of the unit effective item attribute
991 * Unit_Controlled_Item from the system information record.
992 ***************************************************************************/
993 FUNCTION Get_Unit_Controlled_Item RETURN BOOLEAN
994 IS
995 BEGIN
996 RETURN G_System_Information.Unit_Controlled_Item;
997
998 END Get_Unit_Controlled_Item;
999
1000 /***************************************************************************
1001 * Procedure : Set_Unit_Controlled_Component
1002 * Returns : None
1003 * Parameters IN : p_Unit_Controlled_Component
1004 * Parameters OUT: None
1005 * Purpose : Will set the value of the attribute Unit_Controlled_Component
1006 * in the system information record.
1007 *****************************************************************************/
1008 PROCEDURE Set_Unit_Controlled_Component
1009 ( p_Unit_Controlled_Component IN BOOLEAN)
1010 IS
1011 BEGIN
1012 G_System_Information.unit_controlled_component
1013 := p_unit_controlled_component;
1014
1015 END Set_Unit_Controlled_Component;
1016
1017 PROCEDURE Set_Unit_Controlled_Component
1018 ( p_inventory_item_id IN NUMBER
1019 , p_organization_id IN NUMBER
1020 )
1021 IS
1022 Cursor Unit_Controlled_Item IS
1023 SELECT effectivity_control
1024 FROM mtl_system_items
1025 WHERE inventory_item_id = p_inventory_item_id
1026 AND organization_id = p_organization_id;
1027 BEGIN
1028 FOR Unit_Cont_Item IN Unit_Controlled_Item
1029 LOOP
1030 IF Unit_Cont_Item.Effectivity_Control = 2
1031 THEN
1032 G_System_Information.unit_controlled_component := TRUE;
1033 ELSIF Unit_Cont_Item.Effectivity_Control = 1
1034 THEN
1035 G_System_Information.unit_controlled_component := FALSE;
1036 END IF;
1037 END LOOP;
1038 END Set_Unit_Controlled_Component;
1039
1040 /**************************************************************************
1041 * Function : Get_Unit_Controlled_Component
1042 * Returns : NUMBER
1043 * Parameters IN : None
1044 * Parameters OUT: None
1045 * Purpose : Will return value of the unit effective component attribute
1046 * Unit_Controlled_Component from the system information record.
1047 ***************************************************************************/
1048 FUNCTION Get_Unit_Controlled_Component RETURN BOOLEAN
1049 IS
1050 BEGIN
1051 RETURN G_System_Information.Unit_Controlled_Component;
1052
1053 END Get_Unit_Controlled_Component;
1054
1055 /***************************************************************************
1056 * Procedure : Set_Require_Item_Rev
1057 * Returns : None
1058 * Parameters IN : p_Require_Rev
1059 * Parameters OUT: None
1060 * Purpose : Will set the value of the attribute Require_Item_Rev
1061 * in the system information record.
1062 *****************************************************************************/
1063 PROCEDURE Set_Require_Item_Rev
1064 ( p_Require_Rev IN NUMBER )
1065 IS
1066 BEGIN
1067 G_System_Information.Require_Item_Rev
1068 := p_Require_Rev;
1069 END Set_Require_Item_Rev;
1070
1071 /**************************************************************************
1072 * Function : Is_Item_Rev_Required
1073 * Returns : NUMBER
1074 * Parameters IN : None
1075 * Parameters OUT: None
1076 * Purpose : Will return value of the Require_Item_Rev attribute
1077 * from the system information record.
1078 ***************************************************************************/
1079 FUNCTION Is_Item_Rev_Required RETURN NUMBER
1080 IS
1081 BEGIN
1082 RETURN G_System_Information.Require_Item_Rev;
1083
1084 END Is_Item_Rev_Required;
1085
1086 /***************************************************************************
1087 * Procedure : Set_Current_Revision
1088 * Returns : None
1089 * Parameters IN : p_current_revision
1090 * Parameters OUT: None
1091 * Purpose : Procedure will set the current revision attribute of the
1092 * system information record.
1093 *****************************************************************************/
1094 PROCEDURE Set_Current_Revision
1095 ( p_current_revision IN VARCHAR2 )
1096 IS
1097 BEGIN
1098 G_System_Information.current_revision := p_current_revision;
1099
1100 END Set_Current_Revision;
1101
1102 /***************************************************************************
1103 * Function : Get_Current_Revision
1107 * Purpose : Function will return the value of current revision attribute
1104 * Returns : VARCHAR2(3)
1105 * Parameters IN : None
1106 * Parameters OUT: None
1108 * of the system information record.
1109 *****************************************************************************/
1110 FUNCTION Get_Current_Revision RETURN VARCHAR2
1111 IS
1112 BEGIN
1113 RETURN G_System_Information.current_revision;
1114
1115 END Get_Current_Revision;
1116
1117 /***************************************************************************
1118 * Procedure : Set_BO_Identifier
1119 * Returns : None
1120 * Parameters IN : p_bo_identifier
1121 * Parameters OUT: None
1122 * Purpose : Procedure will set the Business object identifier attribute
1123 * BO_Identifier of the system information record.
1124 *****************************************************************************/
1125 PROCEDURE Set_BO_Identifier
1126 ( p_bo_identifier IN VARCHAR2 )
1127 IS
1128 BEGIN
1129 G_System_Information.bo_identifier := p_bo_identifier;
1130 Error_Handler.Set_Bo_Identifier(p_bo_identifier);
1131
1132 END Set_BO_Identifier;
1133
1134 /***************************************************************************
1135 * Function : Get_BO_Identifier
1136 * Returns : VARCHAR2
1137 * Parameters IN : None
1138 * Parameters OUT: None
1139 * Purpose : Function will return the value of the business object
1140 * identifier attribute BO_Identifier from the system
1141 * information record.
1142 *****************************************************************************/
1143 FUNCTION Get_BO_Identifier RETURN VARCHAR2
1144 IS
1145 BEGIN
1146 RETURN G_System_Information.bo_identifier;
1147
1148 END Get_BO_Identifier;
1149
1150 /***************************************************************************
1151 * Procedure : Set_CFM_Rtg_Flag
1152 * Returns : None
1153 * Parameters IN : CFM_Rtng_Type
1154 * Parameters OUT: None
1155 * Purpose : Procedure will set the Business object identifier
1156 * CFM_Routing_Type as follows:
1157 * CFM_Routing_flag = 1: flowing routing type
1158 * 2: Standard routing type
1159 * 3: Lot Based routing type
1160 * BO_Identifier of the system information record.
1161 *****************************************************************************/
1162 PROCEDURE Set_CFM_Rtg_Flag
1163 ( p_cfm_rtg_type IN NUMBER
1164 )
1165 IS
1166 BEGIN
1167 G_System_Information.cfm_rtg_flag := p_cfm_rtg_type;
1168 END Set_CFM_Rtg_Flag;
1169
1170 /***************************************************************************
1171 * Fuction : Get_CFM_Rtg_Flag
1172 * Returns : Number
1173 * Parameters IN : None
1174 * Parameters OUT: None
1175 * Purpose : Function will gset the Business object identifier
1176 * CFM_Routing_Type as follows
1177 * CFM_Routing_flag = 1: flowing routing type
1178 * 2: Standard routing type
1179 * 3: Lot Based routing type
1180 * BO_Identifier of the system information record.
1181 *****************************************************************************/
1182 FUNCTION Get_CFM_Rtg_Flag
1183 RETURN NUMBER
1184 IS
1185 BEGIN
1186 RETURN G_System_Information.cfm_rtg_flag;
1187 END Get_CFM_Rtg_flag;
1188
1189 /***************************************************************************
1190 * Procedure : Set_Lot_Number
1191 * Returns : None
1192 * Parameters IN : p_lot_number
1193 * Parameters OUT: None
1194 * Purpose : Procedure will set the Lot Number attribute
1195 * of the system information record.
1196 *****************************************************************************/
1197 PROCEDURE Set_Lot_Number
1198 ( p_lot_number IN VARCHAR2 )
1199 IS
1200 BEGIN
1201 G_System_Information.lot_number := p_lot_number;
1202
1203 END Set_Lot_Number;
1204
1205 /***************************************************************************
1206 * Function : Get_Lot_Number
1207 * Returns : VARCHAR2
1208 * Parameters IN : None
1209 * Parameters OUT: None
1210 * Purpose : Function will return the value of Lot Number
1211 * from the system information record.
1212 *****************************************************************************/
1213 FUNCTION Get_Lot_Number RETURN VARCHAR2
1214 IS
1215 BEGIN
1216 RETURN G_System_Information.lot_number;
1217
1218 END Get_Lot_Number;
1219
1220 /***************************************************************************
1221 * Procedure : Set_From_Wip_Entity_Id
1222 * Returns : None
1223 * Parameters IN : p_from_wip_entity_id
1224 * Parameters OUT: None
1225 * Purpose : Procedure will set the from wip entity id attribute
1226 * of the system information record.
1227 *****************************************************************************/
1228 PROCEDURE Set_From_Wip_Entity_Id
1229 ( p_from_wip_entity_id IN NUMBER)
1230 IS
1231 BEGIN
1232 G_System_Information.from_wip_entity_id := p_from_wip_entity_id;
1233
1237 /***************************************************************************
1234 END Set_From_Wip_Entity_Id;
1235
1236
1238 * Function : Get_From_Wip_Entity_Id
1239 * Returns : NUMBER
1240 * Parameters IN : None
1241 * Parameters OUT: None
1242 * Purpose : Function will return the value of from wip entity id
1243 * from the system information record.
1244 *****************************************************************************/
1245 FUNCTION Get_From_Wip_Entity_Id RETURN NUMBER
1246 IS
1247 BEGIN
1248 RETURN G_System_Information.from_wip_entity_id;
1249
1250 END Get_From_Wip_Entity_Id;
1251
1252 /***************************************************************************
1253 * Procedure : Set_To_Wip_Entity_Id
1254 * Returns : None
1255 * Parameters IN : p_to_wip_entity_id
1256 * Parameters OUT: None
1257 * Purpose : Procedure will set the to wip entity id attribute
1258 * of the system information record.
1259 *****************************************************************************/
1260
1261 PROCEDURE Set_To_Wip_Entity_Id
1262 ( p_to_wip_entity_id IN NUMBER)
1263 IS
1264 BEGIN
1265 G_System_Information.to_wip_entity_id := p_to_wip_entity_id;
1266
1267 END Set_To_Wip_Entity_Id;
1268
1269 /***************************************************************************
1270 * Function : Get_To_Wip_Entity_Id
1271 * Returns : NUMBER
1272 * Parameters IN : None
1273 * Parameters OUT: None
1274 * Purpose : Function will return the value of to wip entity id
1275 * from the system information record.
1276 *****************************************************************************/
1277 FUNCTION Get_To_Wip_Entity_Id RETURN NUMBER
1278 IS
1279 BEGIN
1280 RETURN G_System_Information.to_wip_entity_id;
1281
1282 END Get_To_Wip_Entity_Id;
1283
1284 /***************************************************************************
1285 * Procedure : Set_From_Cum_Qty
1286 * Returns : None
1287 * Parameters IN : p_from_cum_qty
1288 * Parameters OUT: None
1289 * Purpose : Procedure will set the From Cum Qty attribute
1290 * of the system information record.
1291 *****************************************************************************/
1292 PROCEDURE Set_From_Cum_Qty
1293 ( p_from_cum_qty IN NUMBER)
1294 IS
1295 BEGIN
1296 G_System_Information.from_cum_qty := p_from_cum_qty;
1297
1298 END Set_From_Cum_Qty;
1299
1300 /***************************************************************************
1301 * Function : Get_From_Cum_Qty
1302 * Returns : NUMBER
1303 * Parameters IN : None
1304 * Parameters OUT: None
1305 * Purpose : Function will return the value of From Cum Qty
1306 * from the system information record.
1307 *****************************************************************************/
1308 FUNCTION Get_From_Cum_Qty RETURN NUMBER
1309 IS
1310 BEGIN
1311 RETURN G_System_Information.from_cum_qty;
1312
1313 END Get_From_Cum_Qty;
1314
1315 /***************************************************************************
1316 * Procedure : Set_Eco_For_Production
1317 * Returns : None
1318 * Parameters IN : p_eco_for_production
1319 * Parameters OUT: None
1320 * Purpose : Procedure will set the Eco For Production attribute
1321 * of the system information record.
1322 *****************************************************************************/
1323 PROCEDURE Set_Eco_For_Production
1324 ( p_eco_for_production IN NUMBER)
1325 IS
1326 BEGIN
1327 G_System_Information.eco_for_production := p_eco_for_production;
1328
1329 END Set_Eco_For_Production;
1330
1331 /***************************************************************************
1332 * Function : Get_Eco_For_Production
1333 * Returns : NUMBER
1334 * Parameters IN : None
1335 * Parameters OUT: None
1336 * Purpose : Function will return the value of Eco For Production
1337 * from the system information record.
1338 *****************************************************************************/
1339 FUNCTION Get_Eco_For_Production RETURN NUMBER
1340 IS
1341 BEGIN
1342 RETURN G_System_Information.eco_for_production;
1343
1344 END Get_Eco_For_Production;
1345
1346 /***************************************************************************
1347 * Procedure : Set_New_Routing_Revision
1348 * Returns : None
1349 * Parameters IN : p_new_routing_revision
1350 * Parameters OUT: None
1351 * Purpose : Procedure will set the routing revision attribute
1352 * of the system information record.
1353 *****************************************************************************/
1354 PROCEDURE Set_New_Routing_Revision
1355 ( p_new_routing_revision IN VARCHAR2 )
1356 IS
1357 BEGIN
1358 G_System_Information.new_routing_revision := p_new_routing_revision;
1359
1360 END Set_New_Routing_Revision;
1361
1362 /***************************************************************************
1363 * Function : Get_New_Routing_Revision
1364 * Returns : VARCHAR2
1365 * Parameters IN : None
1366 * Parameters OUT: None
1370 FUNCTION Get_New_Routing_Revision RETURN VARCHAR2
1367 * Purpose : Function will return the value of routing revision
1368 * from the system information record.
1369 *****************************************************************************/
1371 IS
1372 BEGIN
1373 RETURN G_System_Information.new_routing_revision;
1374
1375 END Get_New_Routing_Revision;
1376
1377
1378 -- Added for eAM enhancement
1379 /***************************************************************************
1380 * Procedure : Set_Eam_Item_Type
1381 * Returns : None
1382 * Parameters IN : p_eam_item_type
1383 * Parameters OUT: None
1384 * Purpose : Procedure will set the eam item type attribute
1385 * of the system information record.
1386 *****************************************************************************/
1387 PROCEDURE Set_Eam_Item_Type
1388 ( p_eam_item_type IN NUMBER )
1389 IS
1390 BEGIN
1391 G_System_Information.eam_item_type := p_eam_item_type ;
1392
1393 END Set_Eam_Item_Type ;
1394
1395 /***************************************************************************
1396 * Function : Get_Eam_Item_TYpe
1397 * Returns : NUMBER
1398 * Parameters IN : None
1399 * Parameters OUT: None
1400 * Purpose : Function will return the value of eam item type
1401 * from the system information record.
1402 *****************************************************************************/
1403 FUNCTION Get_Eam_Item_Type RETURN NUMBER
1404 IS
1405 BEGIN
1406 RETURN G_System_Information.eam_item_type ;
1407
1408 END Get_Eam_Item_TYpe ;
1409
1410
1411 /**************************************************************************
1412 * Procedure : Transaction_Type_Validity
1413 * Parameters IN : Transaction Type
1414 * Entity Name
1415 * Entity ID, so that it can be used in a meaningful message
1416 * Parameters OUT: Valid flag
1417 * Message Token Table
1418 * Purpose : This procedure will check if the transaction type is valid
1419 * for a particular entity.
1420 **************************************************************************/
1421 PROCEDURE Transaction_Type_Validity
1422 ( p_transaction_type IN VARCHAR2
1423 , p_entity IN VARCHAR2
1424 , p_entity_id IN VARCHAR2
1425 , x_valid IN OUT NOCOPY BOOLEAN
1426 , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
1427 )
1428 IS
1429 l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
1430 l_Token_Tbl Error_Handler.Token_Tbl_Type;
1431 BEGIN
1432 l_token_tbl(1).token_name := 'ENTITY_ID';
1433 l_token_tbl(1).token_value := p_entity_id;
1434
1435 x_valid := TRUE;
1436
1437 IF (p_entity IN ('Routing_Header','Routing_Revision','Op_Seq',
1438 'Op_Res', 'Sub_Op_Res', 'Op_Network')
1439 AND
1440 NVL(p_transaction_type, FND_API.G_MISS_CHAR)
1441 NOT IN ('CREATE', 'UPDATE', 'DELETE')
1442 )
1443 -- OR
1444 -- ( p_entity ='Bom_Rev' AND
1445 -- NVL(p_transaction_type, FND_API.G_MISS_CHAR)
1446 -- NOT IN ('CREATE', 'UPDATE')
1447 -- )
1448 THEN
1449 IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
1450 THEN
1451 IF p_entity = 'Routing_Header'
1452 THEN
1453 Error_Handler.Add_Error_Token
1454 ( p_Message_Name => 'BOM_RTG_TRANS_TYPE_INVALID'
1455 , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1456 , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1457 );
1458 ELSIF p_entity = 'Routing_Revision'
1459 THEN
1460 Error_Handler.Add_Error_Token
1461 ( p_Message_Name => 'BOM_RTG_REV_TRANS_TYPE_INVALID'
1462 , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1463 , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1464 );
1465 ELSIF p_entity = 'Op_Seq'
1466 THEN
1467 Error_Handler.Add_Error_Token
1468 ( p_Message_Name => 'BOM_OP_TRANS_TYPE_INVALID'
1469 , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1470 , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1471 );
1472 ELSIF p_entity = 'Op_Res'
1473 THEN
1474 Error_Handler.Add_Error_Token
1475 ( p_Message_Name => 'BOM_RES_TRANS_TYPE_INVALID'
1476 , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1477 , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1478 );
1479 ELSIF p_entity = 'Sub_Op_Res'
1480 THEN
1481 Error_Handler.Add_Error_Token
1482 ( p_Message_Name => 'BOM_SUB_RES_TRANS_TYPE_INVALID'
1483 , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1484 , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1485 );
1486 ELSIF p_entity = 'Op_Network'
1487 THEN
1488 Error_Handler.Add_Error_Token
1489 ( p_Message_Name => 'BOM_OP_NWK_TRANS_TYPE_INVALID'
1493 END IF;
1490 , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1491 , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1492 );
1494 END IF;
1495
1496 x_Mesg_Token_Tbl := l_Mesg_Token_Tbl;
1497 x_valid := FALSE;
1498 END IF;
1499
1500 END Transaction_Type_Validity;
1501
1502 PROCEDURE Set_Debug
1503 ( p_debug_flag IN VARCHAR2 )
1504 IS
1505 BEGIN
1506 G_System_Information.debug_flag := p_debug_flag;
1507 Error_Handler.Set_Debug(p_debug_flag => p_debug_flag); -- added for bug 3478148
1508 END Set_Debug;
1509
1510 FUNCTION Get_Debug RETURN VARCHAR2
1511 IS
1512 BEGIN
1513 RETURN G_System_Information.debug_flag;
1514 END;
1515
1516 /***************************************************************************
1517 * Procedure : Set_Osfm_NW_Calc_Flag
1518 * Returns : None
1519 * Parameters IN : p_nw_calc_flag
1520 * Parameters OUT: None
1521 * Purpose : For OSFM, we have to get some data at the start for the
1522 * entire Routing. But because of technical difficulties
1523 * we had to put the data inside the loop for network records
1524 * So we have this flag to have the code run only once
1525 *****************************************************************************/
1526 PROCEDURE Set_Osfm_NW_Calc_Flag
1527 ( p_nw_calc_flag IN BOOLEAN )
1528 IS
1529 BEGIN
1530 G_System_Information.Osfm_NW_Calc_Flag := p_nw_calc_flag;
1531
1532 END Set_Osfm_NW_Calc_Flag;
1533
1534 /***************************************************************************
1535 * Function : Is_Osfm_NW_Calc_Flag
1536 * Returns : BOOLEAN
1537 * Parameters IN : None
1538 * Parameters OUT: None
1539 * Purpose : returns the value for OSFM Network
1540 *****************************************************************************/
1541 FUNCTION Is_Osfm_NW_Calc_Flag RETURN BOOLEAN
1542 IS
1543 BEGIN
1544 RETURN G_System_Information.Osfm_NW_Calc_Flag;
1545
1546 END Is_Osfm_NW_Calc_Flag;
1547
1548 /*****************************************************************************
1549 * Procedure : Set_Osfm_NW_Count
1550 * Returns : None
1551 * Parameters IN : p_nw_count
1552 * Parameters OUT: None
1553 * Purpose : For OSFM, At the end of the netowrk Records LOOP,
1554 * we need to compare the results before and after the network
1555 * insert/update. But we need to differ this comparision
1556 * till we process last network link. So we increment this
1557 * counter as we process the records and then compare it
1558 * with Netowkr table count
1559 *****************************************************************************/
1560 PROCEDURE Set_Osfm_NW_Count
1561 ( p_nw_count IN NUMBER)
1562 IS
1563 BEGIN
1564 G_System_Information.Osfm_NW_Count := p_nw_count;
1565 END Set_Osfm_NW_Count;
1566
1567 /*****************************************************************************
1568 * Procedure : Add_Osfm_NW_Count
1569 * Returns : None
1570 * Parameters IN : p_nw_number
1571 * Parameters OUT: None
1572 * Purpose : Increments the counter
1573 *
1574 *****************************************************************************/
1575 PROCEDURE Add_Osfm_NW_Count
1576 ( p_nw_number IN NUMBER)
1577 IS
1578 BEGIN
1579 G_System_Information.Osfm_NW_Count :=
1580 G_System_Information.Osfm_NW_Count + p_nw_number;
1581 END Add_Osfm_NW_Count;
1582
1583
1584 /***************************************************************************
1585 * Function : Get_Osfm_NW_Count
1586 * Returns : Number
1587 * Parameters IN : None
1588 * Parameters OUT: None
1589 * Purpose : returns count
1590 ******************************************************************************/
1591 FUNCTION Get_Osfm_NW_Count RETURN NUMBER
1592 IS
1593 BEGIN
1594 RETURN G_System_Information.Osfm_NW_Count;
1595
1596 END Get_Osfm_NW_Count;
1597
1598
1599 /***BEGIN 1838261***/
1600 /***************************************************************************
1601 * Function : Get_Temp_Op_Rec
1602 * Returns : Boolean
1603 * Parameters IN : p_op_seq_num
1604 * Parameters OUT: p_temp_op_rec
1605 * Purpose : returns the required record from the temporary pl/sql table which
1606 stores the changed operation sequence numbers and effectivity date
1607 ******************************************************************************/
1608 FUNCTION Get_Temp_Op_Rec
1609 ( p_op_seq_num IN NUMBER
1610 , p_temp_op_rec IN OUT NOCOPY Temp_Op_Rec_Type)
1611 RETURN BOOLEAN
1612 IS
1613 l_cnt NUMBER;
1614 BEGIN
1615 FOR l_cnt IN 1..G_Temp_Op_Rec_Tbl.COUNT LOOP
1616 IF G_Temp_Op_Rec_Tbl(l_cnt).old_op_seq_num = p_op_seq_num THEN
1617 p_temp_op_rec := G_Temp_Op_Rec_Tbl(l_cnt);
1618 RETURN TRUE;
1619 END IF;
1620 END LOOP;
1621 RETURN FALSE;
1622 END Get_Temp_Op_Rec;
1623
1624 FUNCTION Get_Temp_Op_Rec1
1625 ( p_op_seq_num IN NUMBER
1626 , p_eff_date IN DATE
1627 , p_temp_op_rec IN OUT NOCOPY Temp_Op_Rec_Type)
1628 RETURN BOOLEAN
1629 IS
1630 l_cnt NUMBER;
1631 BEGIN
1632
1633 FOR l_cnt IN 1..G_Temp_Op_Rec_Tbl.COUNT LOOP
1634 IF G_Temp_Op_Rec_Tbl(l_cnt).old_op_seq_num = p_op_seq_num
1635 AND trunc(G_Temp_Op_Rec_Tbl(l_cnt).new_start_eff_date) <= trunc(p_eff_date) THEN --truncated date to adjust for sysdate issues with osfm routings
1636 p_temp_op_rec := G_Temp_Op_Rec_Tbl(l_cnt);
1637 RETURN TRUE;
1638 END IF;
1639 END LOOP;
1640 RETURN FALSE;
1641 END Get_Temp_Op_Rec1;
1642
1643
1644 /***************************************************************************
1648 * Parameters OUT: None
1645 * Procedure : Set_Temp_Op_Tbl
1646 * Returns : None
1647 * Parameters IN : p_temp_op_rec_tbl
1649 * Purpose : Sets the temporary pl/sql table which stores the changed
1650 operation sequence numbers and the effectivity date
1651 ******************************************************************************/
1652 PROCEDURE Set_Temp_Op_Tbl
1653 ( p_temp_op_rec_tbl IN Temp_Op_Rec_Tbl_Type)
1654 IS
1655 BEGIN
1656 G_Temp_Op_Rec_Tbl.DELETE;
1657 G_Temp_Op_Rec_Tbl := p_temp_op_rec_tbl;
1658 END Set_Temp_Op_Tbl;
1659 /***END 1838261***/
1660
1661
1662 /***BUG 5330942***/
1663 /***************************************************************************
1664 * Function : Get_Routing_Header_ECN
1665 * Returns : Varchar2
1666 * Parameters IN : p_routing_seq_id
1667 * Parameters OUT: Pending From ECN
1668 * Purpose : returns the value of Pending From ECN for the Routing header
1669 ****************************************************************************/
1670 FUNCTION Get_Routing_Header_ECN
1671 ( p_routing_seq_id IN NUMBER ) RETURN VARCHAR2
1672 IS
1673 l_pend_from_ecn BOM_OPERATIONAL_ROUTINGS.pending_from_ecn%TYPE;
1674 BEGIN
1675 SELECT pending_from_ecn
1676 INTO l_pend_from_ecn
1677 FROM bom_operational_routings
1678 WHERE routing_sequence_id = p_routing_seq_id;
1679 IF l_pend_from_ecn IS NOT NULL THEN
1680 RETURN l_pend_from_ecn;
1681 ELSE
1682 RETURN NULL;
1683 END IF;
1684 EXCEPTION
1685 WHEN NO_DATA_FOUND THEN
1686 RETURN NULL;
1687 END Get_Routing_Header_ECN;
1688
1689
1690 END BOM_RTG_Globals;