DBA Data[Home] [Help]

PACKAGE BODY: APPS.BOM_RTG_PUB

Source


1 PACKAGE BODY Bom_Rtg_Pub AS
2 /* $Header: BOMBRTGB.pls 120.7.12020000.2 2012/08/06 22:49:26 umajumde ship $*/
3 /***************************************************************************
4 --
5 --  Copyright (c) 2000 Oracle Corporation, Redwood Shores, CA, USA
6 --  All rights reserved.
7 --
8 --  FILENAME
9 --
10 --      BOMBRTGB.pls
11 --
12 --  DESCRIPTION
13 --
14 --      Body of package Bom_Rtg_Pub
15 --
16 --  NOTES
17 --
18 --  HISTORY
19 --
20 --  02-AUG-00   Biao Zhang   Initial Creation
21 
22 --
23 -- Conversion from Routing BO Entity to Eco BO Entity
24 -- Conversion from Eco BO Entity to Routing BO Entity
25 --
26 ***************************************************************************/
27 
28         -- Operation Entity
29         /*****************************************************************
30         * Procedure     : Convert_RtgOp_To_ComOp
31         * Parameters IN : Operation Exposed Column Record
32         *                 Operation Unexposed Column Record
33         * Parameters OUT: Common Operation Exposed Exposed Column Record
34         *                 Common operation Unexposed Column Record
35         * Purpose       : This procedure will simply take the operation
36         *                 record and copy its values into the common operation
37         *                 record. Since the record definitions of ECO and routig
38         *                 records is different, this has to done on a field
39         *                 by field basis.
40         ******************************************************************/
41         -- From Routing To Common
42        PROCEDURE Convert_RtgOp_To_ComOp
43        (  p_rtg_operation_rec  IN  Bom_Rtg_Pub.Operation_Rec_Type
44         , p_rtg_op_unexp_rec   IN  Bom_Rtg_Pub.Op_Unexposed_Rec_Type
45         , x_com_operation_rec  IN OUT NOCOPY Bom_Rtg_Pub.Com_Operation_Rec_Type
46         , x_com_op_unexp_rec   IN OUT NOCOPY Bom_Rtg_Pub.Com_Op_Unexposed_Rec_Type
47        )
48        IS
49        BEGIN
50                 x_com_operation_rec.Eco_Name                   := NULL;
51                 x_com_operation_rec.Organization_Code          :=
52                                    p_rtg_operation_rec.Organization_Code;
53                 x_com_operation_rec.Revised_Item_Name          :=
54                                    p_rtg_operation_rec.Assembly_Item_Name;
55                 x_com_operation_rec.New_Revised_Item_Revision  := NULL;
56                 x_com_operation_rec.New_Routing_Revision       := NULL; -- Added by MK on 11/02/00
57                 x_com_operation_rec.From_End_Item_Unit_Number  := NULL; -- Added by MK on 11/02/00
58                 x_com_operation_rec.ACD_Type                   := NULL;
59                 x_com_operation_rec.Alternate_Routing_Code     :=
60                                    p_rtg_operation_rec.Alternate_Routing_Code;
61                 x_com_operation_rec.Operation_Sequence_Number  :=
62                                    p_rtg_operation_rec.Operation_Sequence_Number;
63                 x_com_operation_rec.Operation_Type             :=
64                                    p_rtg_operation_rec.Operation_Type;
65                 x_com_operation_rec.Start_Effective_Date       :=
66                                    p_rtg_operation_rec.Start_Effective_Date;
67                 x_com_operation_rec.New_Operation_Sequence_Number:=
68                              p_rtg_operation_rec.New_Operation_Sequence_Number;
69                 x_com_operation_rec.New_Start_Effective_Date   :=
70                                    p_rtg_operation_rec.New_Start_Effective_Date;
71                 x_com_operation_rec.Old_Operation_Sequence_Number := NULL;
72                 x_com_operation_rec.Old_Start_Effective_Date   := NULL;
73                 x_com_operation_rec.Standard_Operation_Code    :=
74                                    p_rtg_operation_rec.Standard_Operation_Code;
75                 x_com_operation_rec.Department_Code             :=
76                                    p_rtg_operation_rec.Department_Code;
77                 x_com_operation_rec.Op_Lead_Time_Percent       :=
78                                    p_rtg_operation_rec.Op_Lead_Time_Percent;
79                 x_com_operation_rec.Minimum_Transfer_Quantity  :=
80                                  p_rtg_operation_rec.Minimum_Transfer_Quantity;
81                 x_com_operation_rec.Count_Point_Type           :=
82                                    p_rtg_operation_rec.Count_Point_Type;
83                 x_com_operation_rec.Operation_Description      :=
84                                    p_rtg_operation_rec.Operation_Description;
85                 x_com_operation_rec.Disable_Date               :=
86                                    p_rtg_operation_rec.Disable_Date;
87                 x_com_operation_rec.Backflush_Flag             :=
88                                    p_rtg_operation_rec.Backflush_Flag;
89                 x_com_operation_rec.Option_Dependent_Flag      :=
90                                    p_rtg_operation_rec.Option_Dependent_Flag;
91                 x_com_operation_rec.Reference_Flag             :=
92                                    p_rtg_operation_rec.Reference_Flag;
93                 x_com_operation_rec.Process_Seq_Number         :=
94                                    p_rtg_operation_rec.Process_Seq_Number;
95                 x_com_operation_rec.Process_Code               :=
96                                    p_rtg_operation_rec.Process_Code;
97                 x_com_operation_rec.Line_Op_Seq_Number         :=
98                                    p_rtg_operation_rec.Line_Op_Seq_Number;
99                 x_com_operation_rec.Line_Op_Code               :=
100                                    p_rtg_operation_rec.Line_Op_Code;
101                 x_com_operation_rec.Yield                      :=
102                                    p_rtg_operation_rec.Yield ;
103                 x_com_operation_rec.Cumulative_Yield           :=
104                                    p_rtg_operation_rec.Cumulative_Yield;
105                 x_com_operation_rec.Reverse_CUM_Yield          :=
106                                    p_rtg_operation_rec.Reverse_CUM_Yield;
107                 --
108                 -- Following op calculated time columns are no longer used
109                 -- x_com_operation_rec.Calculated_Labor_Time      :=
110                 --                    p_rtg_operation_rec.Calculated_Labor_Time;
111                 -- x_com_operation_rec.Calculated_Machine_Time:=
112                 --                   p_rtg_operation_rec.Calculated_Machine_Time;
113                 -- x_com_operation_rec.Calculated_Elapsed_Time    :=
114                 --                   p_rtg_operation_rec.Calculated_Elapsed_Time;
115 
116                 x_com_operation_rec.User_Labor_Time            :=
117                                    p_rtg_operation_rec.User_Labor_Time;
118                 x_com_operation_rec.User_Machine_Time          :=
119                                    p_rtg_operation_rec.User_Machine_Time;
120                 x_com_operation_rec.Net_Planning_Percent       :=
121                                    p_rtg_operation_rec.Net_Planning_Percent;
122                 x_com_operation_rec.Include_In_Rollup          :=
123                                    p_rtg_operation_rec.Include_In_Rollup;
124                 x_com_operation_rec.Op_Yield_Enabled_Flag      :=
125                                    p_rtg_operation_rec.Op_Yield_Enabled_Flag;
126                 x_com_operation_rec.Cancel_Comments            := NULL;
127                 x_com_operation_rec.Attribute_category         :=
128                                    p_rtg_operation_rec.Attribute_category;
129                 x_com_operation_rec.Attribute1                 :=
130                                    p_rtg_operation_rec.Attribute1;
131                 x_com_operation_rec.Attribute2                 :=
132                                    p_rtg_operation_rec.Attribute2;
133                 x_com_operation_rec.Attribute3                 :=
134                                    p_rtg_operation_rec.Attribute3;
135                 x_com_operation_rec.Attribute4                 :=
136                                    p_rtg_operation_rec.Attribute4;
137                 x_com_operation_rec.Attribute5                 :=
138                                    p_rtg_operation_rec.Attribute5;
139                 x_com_operation_rec.Attribute6                 :=
140                                    p_rtg_operation_rec.Attribute6 ;
141                 x_com_operation_rec.Attribute7                 :=
142                                    p_rtg_operation_rec.Attribute7;
143                 x_com_operation_rec.Attribute8                 :=
144                                    p_rtg_operation_rec.Attribute8;
145                 x_com_operation_rec.Attribute9                 :=
146                                    p_rtg_operation_rec.Attribute9;
147                 x_com_operation_rec.Attribute10                :=
148                                    p_rtg_operation_rec.Attribute10;
149                 x_com_operation_rec.Attribute11                :=
150                                    p_rtg_operation_rec.Attribute11;
151                 x_com_operation_rec.Attribute12                :=
152                                    p_rtg_operation_rec.Attribute12;
153                 x_com_operation_rec.Attribute13                :=
154                                    p_rtg_operation_rec.Attribute13;
155                 x_com_operation_rec.Attribute14                :=
156                                    p_rtg_operation_rec.Attribute14;
157                 x_com_operation_rec.Attribute15                :=
158                                    p_rtg_operation_rec.Attribute15;
159                 x_com_operation_rec.Original_System_Reference  :=
160                            p_rtg_operation_rec.Original_System_Reference;
161                 x_com_operation_rec.Transaction_Type           :=
162                                    p_rtg_operation_rec.Transaction_Type;
163                 x_com_operation_rec.Return_Status              :=
164                                             p_rtg_operation_rec.Return_Status;
165                 x_com_operation_rec.Delete_Group_Name          :=
166                                    p_rtg_operation_rec.Delete_Group_Name;
167                 x_com_operation_rec.DG_Description             :=
168                                    p_rtg_operation_rec.DG_Description;
169                 -- Added by MK 04/10/2001 for eAM changes
170                 x_com_operation_rec.Shutdown_Type               :=
171                                    p_rtg_operation_rec.Shutdown_Type ;
172 		-- Added by deepu for Long description project
173 		x_com_operation_rec.Long_description            :=
174                                    p_rtg_operation_rec.Long_Description;
175 
176 
177 
178                 -- Similarly copy the unexposed record values into an ECO BO
179                 -- compatible record
180 
181                 x_com_op_unexp_rec.Revised_Item_Sequence_Id    := NULL;
182                 x_com_op_unexp_rec.Operation_Sequence_Id       :=
183                                     p_rtg_op_unexp_rec.Operation_Sequence_Id;
184                 x_com_op_unexp_rec.Old_Operation_Sequence_Id   :=NULL;
185                 x_com_op_unexp_rec.Routing_Sequence_Id         :=
186                                     p_rtg_op_unexp_rec.Routing_Sequence_Id;
187                 x_com_op_unexp_rec.Revised_Item_Id             :=
188                                     p_rtg_op_unexp_rec.Assembly_Item_Id;
189                 x_com_op_unexp_rec.Organization_Id             :=
190                                     p_rtg_op_unexp_rec.Organization_Id;
191                 x_com_op_unexp_rec.Standard_Operation_Id       :=
192                                     p_rtg_op_unexp_rec.Standard_Operation_Id;
193                 x_com_op_unexp_rec.Department_Id               :=
194                                     p_rtg_op_unexp_rec.Department_Id;
195                 x_com_op_unexp_rec.Process_Op_Seq_Id           :=
196                                     p_rtg_op_unexp_rec.Process_Op_Seq_Id;
197                 x_com_op_unexp_rec.Line_Op_Seq_Id              :=
198                                     p_rtg_op_unexp_rec.Line_Op_Seq_Id;
199                 x_com_op_unexp_rec.DG_Sequence_Id              :=
200                                     p_rtg_op_unexp_rec.DG_Sequence_Id;
201                 x_com_op_unexp_rec.DG_Description              :=
202                                     p_rtg_op_unexp_rec.DG_Description;
203                 x_com_op_unexp_rec.DG_New                      :=
204                                     p_rtg_op_unexp_rec.DG_New;
205 
206                 x_com_op_unexp_rec.Lowest_acceptable_yield         :=	-- Added for MES Enhancement
207                                     p_rtg_op_unexp_rec.Lowest_acceptable_yield;
208                 x_com_op_unexp_rec.Use_org_settings                :=
209                                     p_rtg_op_unexp_rec.Use_org_settings;
210                 x_com_op_unexp_rec.Queue_mandatory_flag            :=
211                                     p_rtg_op_unexp_rec.Queue_mandatory_flag;
212                 x_com_op_unexp_rec.Run_mandatory_flag              :=
213                                     p_rtg_op_unexp_rec.Run_mandatory_flag;
214                 x_com_op_unexp_rec.To_move_mandatory_flag          :=
215                                     p_rtg_op_unexp_rec.To_move_mandatory_flag;
216                 x_com_op_unexp_rec.Show_next_op_by_default         :=
217                                     p_rtg_op_unexp_rec.Show_next_op_by_default;
218                 x_com_op_unexp_rec.Show_scrap_code                 :=
219                                     p_rtg_op_unexp_rec.Show_scrap_code;
220                 x_com_op_unexp_rec.Show_lot_attrib                 :=
221                                     p_rtg_op_unexp_rec.Show_lot_attrib;
222                 x_com_op_unexp_rec.Track_multiple_res_usage_dates  :=
223                                     p_rtg_op_unexp_rec.Track_multiple_res_usage_dates;	-- End of MES Changes
224 
225                 -- Moved from exp record
226                 x_com_op_unexp_rec.User_Elapsed_Time          :=
227                                     p_rtg_op_unexp_rec.User_Elapsed_Time;
228 
229 
230        END Convert_RtgOp_To_ComOp;
231 
232         /*****************************************************************
233         * Procedure     : Convert_ComOp_To_RtgOp
234         * Parameters IN : Common Operation Exposed Column Record
235         *                 Common Operation Unexposed Column Record
236         * Parameters OUT: Operation Exposed Exposed Column Record
237         *                 Operation Unexposed Column Record
238         * Purpose       : This procedure will simply take the common operation
239         *                 record and copy its values into the operation record.
240         *                 Since the record definitions of ECO and routig
241         *                 records is different, this has to done on a field
242         *                 by field basis.
243         ******************************************************************/
244         -- From Common To Routing
245         PROCEDURE Convert_ComOp_To_RtgOp
246         ( p_com_operation_rec  IN  Bom_Rtg_Pub.Com_Operation_Rec_Type
247         , p_com_op_unexp_rec   IN  Bom_Rtg_Pub.Com_Op_Unexposed_Rec_Type
248         , x_rtg_operation_rec  IN OUT NOCOPY Bom_Rtg_Pub.Operation_Rec_Type
249         , x_rtg_op_unexp_rec   IN OUT NOCOPY Bom_Rtg_Pub.Op_Unexposed_Rec_Type
250         )
251         IS
252         BEGIN
253 
254                 x_rtg_operation_rec.Organization_Code          :=
255                                    p_com_operation_rec.Organization_Code;
256                 x_rtg_operation_rec.Assembly_Item_Name         :=
257                                    p_com_operation_rec.Revised_Item_Name;
258                 x_rtg_operation_rec.Alternate_Routing_Code     :=
259                                    p_com_operation_rec.Alternate_Routing_Code;
260                 x_rtg_operation_rec.Operation_Sequence_Number  :=
261                                    p_com_operation_rec.Operation_Sequence_Number;
262                 x_rtg_operation_rec.Operation_Type             :=
263                                    p_com_operation_rec.Operation_Type;
264                 x_rtg_operation_rec.Start_Effective_Date       :=
265                                    p_com_operation_rec.Start_Effective_Date;
266                 x_rtg_operation_rec.New_Operation_Sequence_Number:=
267                                    p_com_operation_rec.New_Operation_Sequence_Number;
268                 x_rtg_operation_rec.New_Start_Effective_Date   :=
269                                    p_com_operation_rec.New_Start_Effective_Date;
270                 x_rtg_operation_rec.Standard_Operation_Code    :=
271                                    p_com_operation_rec.Standard_Operation_Code;
272                 x_rtg_operation_rec.Department_Code            :=
273                                    p_com_operation_rec.Department_Code;
274                 x_rtg_operation_rec.Op_Lead_Time_Percent       :=
275                                    p_com_operation_rec.Op_Lead_Time_Percent;
276                 x_rtg_operation_rec.Minimum_Transfer_Quantity  :=
277                                    p_com_operation_rec.Minimum_Transfer_Quantity;
278                 x_rtg_operation_rec.Count_Point_Type           :=
279                                    p_com_operation_rec.Count_Point_Type;
280                 x_rtg_operation_rec.Operation_Description      :=
281                                    p_com_operation_rec.Operation_Description;
282                 x_rtg_operation_rec.Disable_Date               :=
283                                    p_com_operation_rec.Disable_Date;
284                 x_rtg_operation_rec.Backflush_Flag             :=
285                                    p_com_operation_rec.Backflush_Flag;
286                 x_rtg_operation_rec.Option_Dependent_Flag      :=
287                                    p_com_operation_rec.Option_Dependent_Flag;
288                 x_rtg_operation_rec.Reference_Flag             :=
289                                    p_com_operation_rec.Reference_Flag;
290                 x_rtg_operation_rec.Process_Seq_Number         :=
291                                    p_com_operation_rec.Process_Seq_Number;
292                 x_rtg_operation_rec.Process_Code               :=
293                                    p_com_operation_rec.Process_Code;
294                 x_rtg_operation_rec.Line_Op_Seq_Number         :=
295                                    p_com_operation_rec.Line_Op_Seq_Number;
296                 x_rtg_operation_rec.Line_Op_Code               :=
297                                    p_com_operation_rec.Line_Op_Code;
298                 x_rtg_operation_rec.Yield                      :=
299                                    p_com_operation_rec.Yield ;
300                 x_rtg_operation_rec.Cumulative_Yield           :=
301                                    p_com_operation_rec.Cumulative_Yield;
302                 x_rtg_operation_rec.Reverse_CUM_Yield          :=
303                                    p_com_operation_rec.Reverse_CUM_Yield;
304                 --
305                 -- Following op calculated time columns are no longer used
306                 -- x_rtg_operation_rec.Calculated_Labor_Time      :=
307                 --                  p_com_operation_rec.Calculated_Labor_Time;
308                 -- x_rtg_operation_rec.Calculated_Machine_Time    :=
309                 --                  p_com_operation_rec.Calculated_Machine_Time;
310                 -- x_rtg_operation_rec.Calculated_Elapsed_Time    :=
311                 --                   p_com_operation_rec.Calculated_Elapsed_Time;
312 
313                 x_rtg_operation_rec.User_Labor_Time            :=
314                                    p_com_operation_rec.User_Labor_Time;
315                 x_rtg_operation_rec.User_Machine_Time          :=
316                                    p_com_operation_rec.User_Machine_Time;
317                 x_rtg_operation_rec.Net_Planning_Percent       :=
318                                    p_com_operation_rec.Net_Planning_Percent;
319                 x_rtg_operation_rec.Include_In_Rollup          :=
320                                    p_com_operation_rec.Include_In_Rollup;
321                 x_rtg_operation_rec.Op_Yield_Enabled_Flag      :=
322                                    p_com_operation_rec.Op_Yield_Enabled_Flag;
323                 x_rtg_operation_rec.Attribute_category         :=
324                                    p_com_operation_rec.Attribute_category;
325                 x_rtg_operation_rec.Attribute1                 :=
326                                    p_com_operation_rec.Attribute1;
327                 x_rtg_operation_rec.Attribute2                 :=
328                                    p_com_operation_rec.Attribute2;
329                 x_rtg_operation_rec.Attribute3                 :=
330                                    p_com_operation_rec.Attribute3;
331                 x_rtg_operation_rec.Attribute4                 :=
332                                    p_com_operation_rec.Attribute4;
333                 x_rtg_operation_rec.Attribute5                 :=
334                                    p_com_operation_rec.Attribute5;
335                 x_rtg_operation_rec.Attribute6                 :=
336                                    p_com_operation_rec.Attribute6;
337                 x_rtg_operation_rec.Attribute7                 :=
338                                    p_com_operation_rec.Attribute7;
339                 x_rtg_operation_rec.Attribute8                 :=
340                                    p_com_operation_rec.Attribute8;
341                 x_rtg_operation_rec.Attribute9                 :=
342                                    p_com_operation_rec.Attribute9;
343                 x_rtg_operation_rec.Attribute10                :=
344                                    p_com_operation_rec.Attribute10;
345                 x_rtg_operation_rec.Attribute11                :=
346                                    p_com_operation_rec.Attribute11;
347                 x_rtg_operation_rec.Attribute12                :=
348                                    p_com_operation_rec.Attribute12;
349                 x_rtg_operation_rec.Attribute13                :=
350                                    p_com_operation_rec.Attribute13;
351                 x_rtg_operation_rec.Attribute14                :=
352                                    p_com_operation_rec.Attribute14;
353                 x_rtg_operation_rec.Attribute15                :=
354                                    p_com_operation_rec.Attribute15;
355                 x_rtg_operation_rec.Original_System_Reference  :=
356                            p_com_operation_rec.Original_System_Reference;
357                 x_rtg_operation_rec.Transaction_Type           :=
358                                    p_com_operation_rec.Transaction_Type;
359                 x_rtg_operation_rec.Return_Status              :=
360                        p_com_operation_rec.Return_Status;
361                 x_rtg_operation_rec.Delete_Group_Name          :=
362                                    p_com_operation_rec.Delete_Group_Name;
363                 x_rtg_operation_rec.DG_Description             :=
364                                    p_com_operation_rec.DG_Description;
365                 -- Added by MK 04/10/2001 for eAM changes
366                 x_rtg_operation_rec.Shutdown_Type               :=
367                                     p_com_operation_rec.Shutdown_Type ;
368 		-- Added by deepu for Long description project
369                 x_rtg_operation_rec.Long_Description            :=
370                                     p_com_operation_rec.Long_Description;
371 
372                 -- Similarly copy the unexposed record values into an ECO BO
373                 -- compatible record
374 
375                 x_rtg_op_unexp_rec.Operation_Sequence_Id       :=
376                                     p_com_op_unexp_rec.Operation_Sequence_Id;
377                 x_rtg_op_unexp_rec.Routing_Sequence_Id         :=
378                                     p_com_op_unexp_rec.Routing_Sequence_Id;
379                 x_rtg_op_unexp_rec.Assembly_Item_Id             :=
380                                     p_com_op_unexp_rec.Revised_Item_Id;
381                 x_rtg_op_unexp_rec.Organization_Id             :=
382                                     p_com_op_unexp_rec.Organization_Id;
383                 x_rtg_op_unexp_rec.Standard_Operation_Id       :=
384                                     p_com_op_unexp_rec.Standard_Operation_Id;
385                 x_rtg_op_unexp_rec.Department_Id               :=
386                                     p_com_op_unexp_rec.Department_Id;
387                 x_rtg_op_unexp_rec.Process_Op_Seq_Id           :=
388                                     p_com_op_unexp_rec.Process_Op_Seq_Id;
389                 x_rtg_op_unexp_rec.Line_Op_Seq_Id              :=
390                                     p_com_op_unexp_rec.Line_Op_Seq_Id;
391                 x_rtg_op_unexp_rec.DG_Sequence_Id              :=
392                                     p_com_op_unexp_rec.DG_Sequence_Id;
393                 x_rtg_op_unexp_rec.DG_Description              :=
394                                     p_com_op_unexp_rec.DG_Description;
395                 x_rtg_op_unexp_rec.DG_New                      :=
396                                     p_com_op_unexp_rec.DG_New;
397 
398                 x_rtg_op_unexp_rec.Lowest_acceptable_yield         :=	-- Added for MES Enhancement
399                                     p_com_op_unexp_rec.Lowest_acceptable_yield;
400                 x_rtg_op_unexp_rec.Use_org_settings                :=
401                                     p_com_op_unexp_rec.Use_org_settings;
402                 x_rtg_op_unexp_rec.Queue_mandatory_flag            :=
403                                     p_com_op_unexp_rec.Queue_mandatory_flag;
404                 x_rtg_op_unexp_rec.Run_mandatory_flag              :=
405                                     p_com_op_unexp_rec.Run_mandatory_flag;
406                 x_rtg_op_unexp_rec.To_move_mandatory_flag          :=
407                                     p_com_op_unexp_rec.To_move_mandatory_flag;
408                 x_rtg_op_unexp_rec.Show_next_op_by_default         :=
409                                     p_com_op_unexp_rec.Show_next_op_by_default;
410                 x_rtg_op_unexp_rec.Show_scrap_code                 :=
411                                     p_com_op_unexp_rec.Show_scrap_code;
412                 x_rtg_op_unexp_rec.Show_lot_attrib                 :=
413                                     p_com_op_unexp_rec.Show_lot_attrib;
414                 x_rtg_op_unexp_rec.Track_multiple_res_usage_dates  :=
415                                     p_com_op_unexp_rec.Track_multiple_res_usage_dates;	-- End of MES Changes
416 
417                 -- Moved from exp record
418                 x_rtg_op_unexp_rec.User_Elapsed_Time           :=
419                                     p_com_op_unexp_rec.User_Elapsed_Time;
420 
421 
422        END Convert_ComOp_To_RtgOp;
423 
424         /*****************************************************************
425         * Procedure     : Convert_EcoOp_To_ComOp
426         * Parameters IN : ECO Operation Exposed Column Record
427         *                 ECO Operation Unexposed Column Record
428         * Parameters OUT: Common Operation Exposed Exposed Column Record
429         *                 Common operation Unexposed Column Record
430         * Purpose       : This procedure will simply take the ECO operation
431         *                 record and copy its values into the common operation
432         *                 record. Since the record definitions of ECO and routig
433         *                 records is different, this has to done on a field
434         *                 by field basis.
435         ******************************************************************/
436         -- From Eco To Common
437         PROCEDURE Convert_EcoOp_To_ComOp
438         ( p_rev_operation_rec  IN  Bom_Rtg_Pub.Rev_Operation_Rec_Type
439         , p_rev_op_unexp_rec   IN  Bom_Rtg_Pub.Rev_Op_Unexposed_Rec_Type
440         , x_com_operation_rec  IN OUT NOCOPY Bom_Rtg_Pub.Com_Operation_Rec_Type
441         , x_com_op_unexp_rec   IN OUT NOCOPY Bom_Rtg_Pub.Com_Op_Unexposed_Rec_Type
442         )
443         IS
444         BEGIN
445 
446                 x_com_operation_rec.Eco_Name                   :=
447                                    p_rev_operation_rec.Eco_Name;
448                 x_com_operation_rec.Organization_Code          :=
449                                    p_rev_operation_rec.Organization_Code;
450                 x_com_operation_rec.Revised_Item_Name          :=
451                                    p_rev_operation_rec.Revised_Item_Name;
452                 x_com_operation_rec.New_Revised_Item_Revision  :=
453                                    p_rev_operation_rec.New_Revised_Item_Revision;
454                 x_com_operation_rec.New_Routing_Revision       :=
455                                    p_rev_operation_rec.New_Routing_Revision ; -- Added by MK on 11/02/00
456                 x_com_operation_rec.From_End_Item_Unit_Number  :=
457                                    p_rev_operation_rec.From_End_Item_Unit_Number ; -- Added by MK on 11/02/00
458                 x_com_operation_rec.ACD_Type   := p_rev_operation_rec.ACD_Type;
459                 x_com_operation_rec.Alternate_Routing_Code     :=
460                                    p_rev_operation_rec.Alternate_Routing_Code;
461                 x_com_operation_rec.Operation_Sequence_Number  :=
462                                    p_rev_operation_rec.Operation_Sequence_Number;
463                 x_com_operation_rec.Operation_Type             :=
464                                    p_rev_operation_rec.Operation_Type;
465                 x_com_operation_rec.Start_Effective_Date       :=
466                                    p_rev_operation_rec.Start_Effective_Date;
467                 x_com_operation_rec.New_Operation_Sequence_Number:=
468                                    p_rev_operation_rec.New_Operation_Sequence_Number;
469                 x_com_operation_rec.New_Start_Effective_Date   := NULL;
470                 x_com_operation_rec.Old_Operation_Sequence_Number :=
471                                    p_rev_operation_rec.Old_Operation_Sequence_Number;
472                 x_com_operation_rec.Old_Start_Effective_Date   :=
473                                    p_rev_operation_rec.Old_Start_Effective_Date;
474                 x_com_operation_rec.Standard_Operation_Code    :=
475                                    p_rev_operation_rec.Standard_Operation_Code;
476                 x_com_operation_rec.Department_Code             :=
477                                    p_rev_operation_rec.Department_Code;
478                 x_com_operation_rec.Op_Lead_Time_Percent       :=
479                                    p_rev_operation_rec.Op_Lead_Time_Percent;
480                 x_com_operation_rec.Minimum_Transfer_Quantity  :=
481                                    p_rev_operation_rec.Minimum_Transfer_Quantity;
482                 x_com_operation_rec.Count_Point_Type           :=
483                                    p_rev_operation_rec.Count_Point_Type;
484                 x_com_operation_rec.Operation_Description      :=
485                                    p_rev_operation_rec.Operation_Description;
486                 x_com_operation_rec.Disable_Date               :=
487                                    p_rev_operation_rec.Disable_Date;
488                 x_com_operation_rec.Backflush_Flag             :=
489                                    p_rev_operation_rec.Backflush_Flag;
490                 x_com_operation_rec.Option_Dependent_Flag      :=
491                                    p_rev_operation_rec.Option_Dependent_Flag;
492                 x_com_operation_rec.Reference_Flag             :=
493                                    p_rev_operation_rec.Reference_Flag;
494                 x_com_operation_rec.Process_Seq_Number         := NULL;
495                 x_com_operation_rec.Process_Code               := NULL;
496                 x_com_operation_rec.Line_Op_Seq_Number         := NULL;
497                 x_com_operation_rec.Line_Op_Code               := NULL;
498                 x_com_operation_rec.Yield                      :=
499                                    p_rev_operation_rec.Yield ;
500                 x_com_operation_rec.Cumulative_Yield           :=
501                                    p_rev_operation_rec.Cumulative_Yield;
502                 x_com_operation_rec.Reverse_CUM_Yield          := NULL;
503 
504                 --
505                 -- Following op calculated time columns are no longer used
506                 -- x_com_operation_rec.Calculated_Labor_Time      := NULL;
507                 -- x_com_operation_rec.Calculated_Machine_Time    := NULL;
508                 -- x_com_operation_rec.Calculated_Elapsed_Time    := NULL;
509 
510                 x_com_operation_rec.User_Labor_Time            := NULL;
511                 x_com_operation_rec.User_Machine_Time          := NULL;
512                 x_com_operation_rec.Net_Planning_Percent       := NULL;
513                 x_com_operation_rec.Include_In_Rollup          := NULL;
514                 x_com_operation_rec.Op_Yield_Enabled_Flag      := NULL;
515                 x_com_operation_rec.Cancel_Comments            :=
516                                    p_rev_operation_rec.Cancel_Comments ; -- Added by MK on 11/27/00
517                 x_com_operation_rec.Attribute_category         :=
518                                    p_rev_operation_rec.Attribute_category;
519                 x_com_operation_rec.Attribute1                 :=
520                                    p_rev_operation_rec.Attribute1;
521                 x_com_operation_rec.Attribute2                 :=
522                                    p_rev_operation_rec.Attribute2;
523                 x_com_operation_rec.Attribute3                 :=
524                                    p_rev_operation_rec.Attribute3;
525                 x_com_operation_rec.Attribute4                 :=
526                                    p_rev_operation_rec.Attribute4;
527                 x_com_operation_rec.Attribute5                 :=
528                                    p_rev_operation_rec.Attribute5;
529                 x_com_operation_rec.Attribute6                 :=
530                                    p_rev_operation_rec.Attribute6;
531                 x_com_operation_rec.Attribute7                 :=
532                                    p_rev_operation_rec.Attribute7;
533                 x_com_operation_rec.Attribute8                 :=
534                                    p_rev_operation_rec.Attribute8;
535                 x_com_operation_rec.Attribute9                 :=
536                                    p_rev_operation_rec.Attribute9;
537                 x_com_operation_rec.Attribute10                :=
538                                    p_rev_operation_rec.Attribute10;
539                 x_com_operation_rec.Attribute11                :=
540                                    p_rev_operation_rec.Attribute11;
541                 x_com_operation_rec.Attribute12                :=
542                                    p_rev_operation_rec.Attribute12;
543                 x_com_operation_rec.Attribute13                :=
544                                    p_rev_operation_rec.Attribute13;
545                 x_com_operation_rec.Attribute14                :=
546                                    p_rev_operation_rec.Attribute14;
547                 x_com_operation_rec.Attribute15                :=
548                                    p_rev_operation_rec.Attribute15;
549                 x_com_operation_rec.Original_System_Reference  :=
550                            p_rev_operation_rec.Original_System_Reference;
551                 x_com_operation_rec.Transaction_Type           :=
552                                    p_rev_operation_rec.Transaction_Type;
553                 x_com_operation_rec.Return_Status              :=
554                 p_rev_operation_rec.Return_Status;
555                 x_com_operation_rec.Delete_Group_Name          := NULL ;
556                 x_com_operation_rec.DG_Description             := NULL ;
557                 -- Added by MK 04/10/2001 for eAM changes
558                 x_com_operation_rec.Shutdown_Type              := NULL ;
559 		-- Added by deepu for Long description project
560 		x_com_operation_rec.Long_description	       := NULL;
561 
562                 -- Similarly copy the unexposed record values into an ECO BO
563                 -- compatible record
564 
565                 x_com_op_unexp_rec.Revised_Item_Sequence_Id    :=
566                                     p_rev_op_unexp_rec.Revised_Item_Sequence_Id;
567                 x_com_op_unexp_rec.Operation_Sequence_Id       :=
568                                     p_rev_op_unexp_rec.Operation_Sequence_Id;
569                 x_com_op_unexp_rec.Old_Operation_Sequence_Id   :=
570                                    p_rev_op_unexp_rec.Old_Operation_Sequence_Id;
571                 x_com_op_unexp_rec.Routing_Sequence_Id         :=
572                                     p_rev_op_unexp_rec.Routing_Sequence_Id;
573                 x_com_op_unexp_rec.Revised_Item_Id             :=
574                                     p_rev_op_unexp_rec.Revised_Item_Id;
575                 x_com_op_unexp_rec.Organization_Id             :=
576                                     p_rev_op_unexp_rec.Organization_Id;
577                 x_com_op_unexp_rec.Standard_Operation_Id       :=
578                                     p_rev_op_unexp_rec.Standard_Operation_Id;
579                 x_com_op_unexp_rec.Department_Id               :=
580                                     p_rev_op_unexp_rec.Department_Id;
581                 x_com_op_unexp_rec.Process_Op_Seq_Id           := NULL;
582                 x_com_op_unexp_rec.Line_Op_Seq_Id              := NULL;
583                 x_com_op_unexp_rec.DG_Sequence_Id              := NULL;
584                 x_com_op_unexp_rec.DG_Description              := NULL;
585                 x_com_op_unexp_rec.DG_New                      := NULL;
586 
587                 x_com_op_unexp_rec.Lowest_acceptable_yield        := NULL;	-- Added for MES Enhancement
588                 x_com_op_unexp_rec.Use_org_settings               := NULL;
589                 x_com_op_unexp_rec.Queue_mandatory_flag           := NULL;
590                 x_com_op_unexp_rec.Run_mandatory_flag             := NULL;
591                 x_com_op_unexp_rec.To_move_mandatory_flag         := NULL;
592                 x_com_op_unexp_rec.Show_next_op_by_default        := NULL;
593                 x_com_op_unexp_rec.Show_scrap_code                := NULL;
594                 x_com_op_unexp_rec.Show_lot_attrib                := NULL;
595                 x_com_op_unexp_rec.Track_multiple_res_usage_dates := NULL;	-- End of MES Changes
596 
597                 -- Moved from exp rec
598                 x_com_op_unexp_rec.User_Elapsed_Time           := NULL;
599 
600 
601         END Convert_EcoOp_To_ComOp;
602 
603         /*****************************************************************
604         * Procedure     : Convert_ComOp_To_EcoOp
605         * Parameters IN : Common Operation Exposed Column Record
606         *                 Common Operation Unexposed Column Record
607         * Parameters OUT: ECO Operation Exposed Exposed Column Record
608         *                 ECO operation Unexposed Column Record
609         * Purpose       : This procedure will simply take the common operation
610         *                 record and copy its values into the ECO operation
611         *                 record. Since the record definitions of ECO and routig
612         *                 records is different, this has to done on a field
613         *                 by field basis.
614         ******************************************************************/
615         -- From Common To Eco
616         PROCEDURE Convert_ComOp_To_EcoOp
617         ( p_com_operation_rec  IN  Bom_Rtg_Pub.Com_Operation_Rec_Type
618         , p_com_op_unexp_rec   IN  Bom_Rtg_Pub.Com_Op_Unexposed_Rec_Type
619         , x_rev_operation_rec  IN OUT NOCOPY Bom_Rtg_Pub.Rev_Operation_Rec_Type
620         , x_rev_op_unexp_rec   IN OUT NOCOPY Bom_Rtg_Pub.Rev_Op_Unexposed_Rec_Type
621         )
622         IS
623         BEGIN
624 
625                 x_rev_operation_rec.Eco_Name                   :=
626                                    p_com_operation_rec.Eco_Name;
627                 x_rev_operation_rec.Organization_Code          :=
628                                    p_com_operation_rec.Organization_Code;
629                 x_rev_operation_rec.Revised_Item_Name          :=
630                                    p_com_operation_rec.Revised_Item_Name;
631                 x_rev_operation_rec.New_Revised_Item_Revision  :=
632                                    p_com_operation_rec.New_Revised_Item_Revision;
633                 x_rev_operation_rec.New_Routing_Revision       :=
634                                    p_com_operation_rec.New_Routing_Revision ; -- Added by MK on 11/02/00
635                 x_rev_operation_rec.From_End_Item_Unit_Number  :=
636                                    p_com_operation_rec.From_End_Item_Unit_Number ; -- Added by MK on 11/02/00
637                 x_rev_operation_rec.ACD_Type          :=
638                                    p_com_operation_rec.ACD_Type;
639                 x_rev_operation_rec.Alternate_Routing_Code     :=
640                                    p_com_operation_rec.Alternate_Routing_Code;
641                 x_rev_operation_rec.Operation_Sequence_Number  :=
642                                    p_com_operation_rec.Operation_Sequence_Number;
643                 x_rev_operation_rec.Operation_Type             :=
644                                    p_com_operation_rec.Operation_Type;
645                 x_rev_operation_rec.Start_Effective_Date       :=
646                                    p_com_operation_rec.Start_Effective_Date;
647                 x_rev_operation_rec.New_Operation_Sequence_Number:=
648                                    p_com_operation_rec.New_Operation_Sequence_Number;
649                 x_rev_operation_rec.Old_Operation_Sequence_Number:=
650                                    p_com_operation_rec.old_Operation_Sequence_Number;
651                 x_rev_operation_rec.Old_Start_Effective_Date   :=
652                                    p_com_operation_rec.Old_Start_Effective_Date;
653                 x_rev_operation_rec.Standard_Operation_Code    :=
654                                    p_com_operation_rec.Standard_Operation_Code;
655                 x_rev_operation_rec.Department_Code             :=
656                                    p_com_operation_rec.Department_Code;
657                 x_rev_operation_rec.Op_Lead_Time_Percent       :=
658                                    p_com_operation_rec.Op_Lead_Time_Percent;
659                 x_rev_operation_rec.Minimum_Transfer_Quantity  :=
660                                    p_com_operation_rec.Minimum_Transfer_Quantity;
661                 x_rev_operation_rec.Count_Point_Type           :=
662                                    p_com_operation_rec.Count_Point_Type;
663                 x_rev_operation_rec.Operation_Description      :=
664                                    p_com_operation_rec.Operation_Description;
665                 x_rev_operation_rec.Disable_Date               :=
666                                    p_com_operation_rec.Disable_Date;
667                 x_rev_operation_rec.Backflush_Flag             :=
668                                    p_com_operation_rec.Backflush_Flag;
669                 x_rev_operation_rec.Option_Dependent_Flag      :=
670                                    p_com_operation_rec.Option_Dependent_Flag;
671                 x_rev_operation_rec.Reference_Flag             :=
672                                    p_com_operation_rec.Reference_Flag;
673                 x_rev_operation_rec.Yield                      :=
674                                    p_com_operation_rec.Yield ;
675                 x_rev_operation_rec.Cumulative_Yield           :=
676                                    p_com_operation_rec.Cumulative_Yield;
677                 x_rev_operation_rec.cancel_comments      :=
678                                    p_com_operation_rec.cancel_comments;
679                 x_rev_operation_rec.Attribute_category         :=
680                                    p_com_operation_rec.Attribute_category;
681                 x_rev_operation_rec.Attribute1                 :=
682                                    p_com_operation_rec.Attribute1;
683                 x_rev_operation_rec.Attribute2                 :=
684                                    p_com_operation_rec.Attribute2;
685                 x_rev_operation_rec.Attribute3                 :=
686                                    p_com_operation_rec.Attribute3;
687                 x_rev_operation_rec.Attribute4                 :=
688                                    p_com_operation_rec.Attribute4;
689                 x_rev_operation_rec.Attribute5                 :=
690                                    p_com_operation_rec.Attribute5;
691                 x_rev_operation_rec.Attribute6                 :=
692                                    p_com_operation_rec.Attribute6;
693                 x_rev_operation_rec.Attribute7                 :=
694                                    p_com_operation_rec.Attribute7;
695                 x_rev_operation_rec.Attribute8                 :=
696                                    p_com_operation_rec.Attribute8;
697                 x_rev_operation_rec.Attribute9                 :=
698                                    p_com_operation_rec.Attribute9;
699                 x_rev_operation_rec.Attribute10                :=
700                                    p_com_operation_rec.Attribute10;
701                 x_rev_operation_rec.Attribute11                :=
702                                    p_com_operation_rec.Attribute11;
703                 x_rev_operation_rec.Attribute12                :=
704                                    p_com_operation_rec.Attribute12;
705                 x_rev_operation_rec.Attribute13                :=
706                                    p_com_operation_rec.Attribute13;
707                 x_rev_operation_rec.Attribute14                :=
708                                    p_com_operation_rec.Attribute14;
709                 x_rev_operation_rec.Attribute15                :=
710                                    p_com_operation_rec.Attribute15;
711                 x_rev_operation_rec.Original_System_Reference  :=
712                                    p_com_operation_rec.Original_System_Reference;
713                 x_rev_operation_rec.Transaction_Type           :=
714                                    p_com_operation_rec.Transaction_Type;
715                 x_rev_operation_rec.Return_Status              :=
716                                    p_com_operation_rec.Return_Status;
717 
718                 -- Similarly copy the unexposed record values into an ECO BO
719                 -- compatible record
720 
721                 x_rev_op_unexp_rec.Revised_Item_Sequence_Id    :=
722                                     p_com_op_unexp_rec.Revised_Item_Sequence_Id;
723                 x_rev_op_unexp_rec.Operation_Sequence_Id       :=
724                                     p_com_op_unexp_rec.Operation_Sequence_Id;
725                 x_rev_op_unexp_rec.Old_Operation_Sequence_Id   :=
726                                     p_com_op_unexp_rec.Old_Operation_Sequence_Id;
727                 x_rev_op_unexp_rec.Routing_Sequence_Id         :=
728                                     p_com_op_unexp_rec.Routing_Sequence_Id;
729                 x_rev_op_unexp_rec.Revised_Item_Id             :=
730                                    p_com_op_unexp_rec.Revised_Item_Id;
731                 x_rev_op_unexp_rec.Organization_Id             :=
732                                     p_com_op_unexp_rec.Organization_Id;
733                 x_rev_op_unexp_rec.Standard_Operation_Id       :=
734                                     p_com_op_unexp_rec.Standard_Operation_Id;
735                 x_rev_op_unexp_rec.Department_Id               :=
736                                     p_com_op_unexp_rec.Department_Id;
737 
738         END Convert_ComOp_To_EcoOp;
739 
740         /*****************************************************************
741         * Procedure     : Convert_RtgRes_To_EcoRes
742         * Parameters IN : Operation resource Exposed Column Record
743         *                 Operation resource Unexposed Column Record
744         * Parameters OUT: ECO Operation resource Exposed Exposed Column Record
745         *                 ECO Operation resource Unexposed Column Record
746         * Purpose       : This procedure will simply take the operation resource
747         *                 record and copy its values into the ECO resource
748         *                 record. Since the record definitions of ECO and routig
749         *                 records is different, this has to done on a field
750         *                 by field basis.
751         ******************************************************************/
752         -- Operation Resource Entity
753         PROCEDURE Convert_RtgRes_To_EcoRes
754         ( p_rtg_op_resource_rec  IN  Bom_Rtg_Pub.Op_Resource_Rec_Type
755         , p_rtg_op_res_unexp_rec IN  Bom_Rtg_Pub.Op_Res_Unexposed_Rec_Type
756         , x_rev_op_resource_rec  IN OUT NOCOPY Bom_Rtg_Pub.Rev_Op_Resource_Rec_Type
757         , x_rev_op_res_unexp_rec IN OUT NOCOPY Bom_Rtg_Pub.Rev_Op_Res_Unexposed_Rec_Type
758         )
759         IS
760         BEGIN
761                 x_rev_op_resource_rec.Eco_Name                   := p_rtg_op_resource_rec.eco_name; --Bug 14286614
762                 x_rev_op_resource_rec.Organization_Code          :=
763                                    p_rtg_op_resource_rec.Organization_Code;
764                 x_rev_op_resource_rec.Revised_Item_Name          :=
765                                    p_rtg_op_resource_rec.Assembly_Item_Name;
766                 x_rev_op_resource_rec.New_Revised_Item_Revision  := NULL;
767                 x_rev_op_resource_rec.New_Routing_Revision       := NULL;    -- Added by MK on 11/02/00
768                 x_rev_op_resource_rec.From_End_Item_Unit_Number  := NULL;    -- Added by MK on 11/02/00
769                 x_rev_op_resource_rec.ACD_Type                   := p_rtg_op_resource_rec.acd_type; --Bug 14286614
770                 x_rev_op_resource_rec.Alternate_Routing_Code     :=
771                                    p_rtg_op_resource_rec.Alternate_Routing_Code;
772                 x_rev_op_resource_rec.Operation_Sequence_Number  :=
773                                    p_rtg_op_resource_rec.Operation_Sequence_Number;
774                 x_rev_op_resource_rec.Operation_Type             :=
775                                    p_rtg_op_resource_rec.Operation_Type;
776                 x_rev_op_resource_rec.OP_Start_Effective_Date    :=
777                                    p_rtg_op_resource_rec.OP_Start_Effective_Date;
778                 x_rev_op_resource_rec.Resource_Sequence_Number   :=
779                                    p_rtg_op_resource_rec.Resource_Sequence_Number;
780                 x_rev_op_resource_rec.Resource_Code              :=
781                                    p_rtg_op_resource_rec.Resource_Code;
782                 x_rev_op_resource_rec.Activity :=p_rtg_op_resource_rec.Activity;
783                 x_rev_op_resource_rec.Standard_Rate_Flag         :=
784                                    p_rtg_op_resource_rec.Standard_Rate_Flag;
785                 x_rev_op_resource_rec.Assigned_Units             :=
786                                    p_rtg_op_resource_rec.Assigned_Units;
787                 x_rev_op_resource_rec.Usage_Rate_Or_amount       :=
788                                    p_rtg_op_resource_rec.Usage_Rate_Or_amount ;
789                 x_rev_op_resource_rec.Usage_Rate_Or_Amount_Inverse :=
790                                    p_rtg_op_resource_rec.Usage_Rate_Or_Amount_Inverse;
791                 x_rev_op_resource_rec.Basis_Type                 :=
792                                    p_rtg_op_resource_rec.Basis_Type;
793                 x_rev_op_resource_rec.Schedule_Flag              :=
794                                    p_rtg_op_resource_rec.Schedule_Flag;
795                 x_rev_op_resource_rec.Resource_Offset_Percent    :=
796                                    p_rtg_op_resource_rec.Resource_Offset_Percent;
797                 x_rev_op_resource_rec.Autocharge_Type            :=
798                                    p_rtg_op_resource_rec.Autocharge_Type;
799                 x_rev_op_resource_rec.Schedule_Sequence_Number   :=
800                                    p_rtg_op_resource_rec.Schedule_Sequence_Number;
801                 x_rev_op_resource_rec.Principle_Flag             :=
802                                    p_rtg_op_resource_rec.Principle_Flag ;
803                 x_rev_op_resource_rec.Attribute_category         :=
804                                    p_rtg_op_resource_rec.Attribute_category;
805                 x_rev_op_resource_rec.Attribute1                 :=
806                                    p_rtg_op_resource_rec.Attribute1;
807                 x_rev_op_resource_rec.Attribute2                 :=
808                                    p_rtg_op_resource_rec.Attribute2;
809                 x_rev_op_resource_rec.Attribute3                 :=
810                                    p_rtg_op_resource_rec.Attribute3;
811                 x_rev_op_resource_rec.Attribute4                 :=
812                                    p_rtg_op_resource_rec.Attribute4;
813                 x_rev_op_resource_rec.Attribute5                 :=
814                                    p_rtg_op_resource_rec.Attribute5;
815                 x_rev_op_resource_rec.Attribute6                 :=
816                                    p_rtg_op_resource_rec.Attribute6;
817                 x_rev_op_resource_rec.Attribute7                 :=
818                                    p_rtg_op_resource_rec.Attribute7;
819                 x_rev_op_resource_rec.Attribute8                 :=
820                                    p_rtg_op_resource_rec.Attribute8;
821                 x_rev_op_resource_rec.Attribute9                 :=
822                                    p_rtg_op_resource_rec.Attribute9;
823                 x_rev_op_resource_rec.Attribute10                :=
824                                    p_rtg_op_resource_rec.Attribute10;
825                 x_rev_op_resource_rec.Attribute11                :=
826                                    p_rtg_op_resource_rec.Attribute11;
827                 x_rev_op_resource_rec.Attribute12                :=
828                                    p_rtg_op_resource_rec.Attribute12;
829                 x_rev_op_resource_rec.Attribute13                :=
830                                    p_rtg_op_resource_rec.Attribute13;
831                 x_rev_op_resource_rec.Attribute14                :=
832                                    p_rtg_op_resource_rec.Attribute14;
833                 x_rev_op_resource_rec.Attribute15                :=
834                                    p_rtg_op_resource_rec.Attribute15;
835                 x_rev_op_resource_rec.Original_System_Reference  :=
836                            p_rtg_op_resource_rec.Original_System_Reference;
837                 x_rev_op_resource_rec.Transaction_Type           :=
838                                    p_rtg_op_resource_rec.Transaction_Type;
839                 x_rev_op_resource_rec.Return_Status              :=
840                                    p_rtg_op_resource_rec.Return_Status;
841                 x_rev_op_resource_rec.Setup_Type :=
842                                    p_rtg_op_resource_rec.Setup_Type;
843 
844                 -- Similarly copy the unexposed record values into an ECO BO
845                 -- compatible record
846 
847                 x_rev_op_res_unexp_rec.Revised_Item_Sequence_Id    := NULL;
848                 x_rev_op_res_unexp_rec.Operation_Sequence_Id       :=
849                                   p_rtg_op_res_unexp_rec.Operation_Sequence_Id;
850                 x_rev_op_res_unexp_rec.Routing_Sequence_Id         :=
851                                   p_rtg_op_res_unexp_rec.Routing_Sequence_Id;
852                 x_rev_op_res_unexp_rec.Revised_Item_Id             :=
853                                   p_rtg_op_res_unexp_rec.Assembly_Item_Id;
854                 x_rev_op_res_unexp_rec.Organization_Id             :=
855                                   p_rtg_op_res_unexp_rec.Organization_Id;
856                 x_rev_op_resource_rec.Substitute_Group_Number     :=
857                                   p_rtg_op_resource_rec.Substitute_Group_Number;
858                 x_rev_op_res_unexp_rec.Substitute_Group_Number    :=
859                                   x_rev_op_resource_rec.Substitute_Group_Number;
860                 x_rev_op_res_unexp_rec.Resource_Id                 :=
861                                   p_rtg_op_res_unexp_rec.Resource_Id;
862                 x_rev_op_res_unexp_rec.Activity_Id                 :=
863                                   p_rtg_op_res_unexp_rec.Activity_Id;
864                 x_rev_op_res_unexp_rec.Setup_Id                    :=
865                                   p_rtg_op_res_unexp_rec.Setup_Id ;
866 
867         END Convert_RtgRes_To_EcoRes;
868 
869         /*****************************************************************
870         * Procedure     : Convert_EcoRes_To_RtgRes
871         * Parameters IN : ECO Operation Resource Exposed Column Record
872         *                 ECO Operation Resource Unexposed Column Record
873         * Parameters OUT: Operation Resource Exposed Exposed Column Record
874         *                 Operation Resource Unexposed Column Record
875         * Purpose       : This procedure will simply take the ECO  resource
876         *                 record and copy its values into the operation resource
877         *                 record. Since the record definitions of ECO and routig
878         *                 records is different, this has to done on a field
879         *                 by field basis.
880         ******************************************************************/
881         PROCEDURE Convert_EcoRes_To_RtgRes
882         (  p_rev_op_resource_rec  IN  Bom_Rtg_Pub.Rev_Op_Resource_Rec_Type
883          , p_rev_op_res_unexp_rec IN  Bom_Rtg_Pub.Rev_Op_Res_Unexposed_Rec_Type
884          , x_rtg_op_resource_rec  IN OUT NOCOPY Bom_Rtg_Pub.Op_Resource_Rec_Type
885          , x_rtg_op_res_unexp_rec IN OUT NOCOPY Bom_Rtg_Pub.Op_Res_Unexposed_Rec_Type
886         )
887         IS
888         BEGIN
889                 x_rtg_op_resource_rec.Organization_Code          :=
890                                    p_rev_op_resource_rec.Organization_Code;
891                 x_rtg_op_resource_rec.Assembly_item_name         :=
892                                    p_rev_op_resource_rec.Revised_Item_Name;
893                 x_rtg_op_resource_rec.Alternate_Routing_Code     :=
894                                    p_rev_op_resource_rec.Alternate_Routing_Code;
895                 x_rtg_op_resource_rec.Operation_Sequence_Number  :=
896                                    p_rev_op_resource_rec.Operation_Sequence_Number;
897                 x_rtg_op_resource_rec.Operation_Type             :=
898                                    p_rev_op_resource_rec.Operation_Type;
899                 x_rtg_op_resource_rec.Op_Start_Effective_Date    :=
900                                    p_rev_op_resource_rec.OP_start_Effective_Date;
901                 x_rtg_op_resource_rec.acd_type    :=
902                                    p_rev_op_resource_rec.acd_type; --Bug 14286614
903                 x_rtg_op_resource_rec.eco_name    :=
904                                    p_rev_op_resource_rec.eco_name; --Bug 14286614
905                 x_rtg_op_resource_rec.Resource_Sequence_Number   :=
906                                    p_rev_op_resource_rec.Resource_Sequence_Number;
907                 x_rtg_op_resource_rec.Resource_Code              :=
908                                    p_rev_op_resource_rec.Resource_Code ;
909                 x_rtg_op_resource_rec.Activity := p_rev_op_resource_rec.Activity;
910                 x_rtg_op_resource_rec.Standard_Rate_Flag         :=
911                                    p_rev_op_resource_rec.Standard_Rate_Flag;
912                 x_rtg_op_resource_rec.Assigned_Units             :=
913                                    p_rev_op_resource_rec.Assigned_Units;
914                 x_rtg_op_resource_rec.Usage_Rate_Or_amount       :=
915                                    p_rev_op_resource_rec.Usage_Rate_Or_amount ;
916                 x_rtg_op_resource_rec.Usage_Rate_Or_Amount_Inverse :=
917                                    p_rev_op_resource_rec.Usage_Rate_Or_Amount_Inverse;
918                 x_rtg_op_resource_rec.Basis_Type                 :=
919                                    p_rev_op_resource_rec.Basis_Type;
920                 x_rtg_op_resource_rec.Schedule_Flag              :=
921                                    p_rev_op_resource_rec.Schedule_Flag;
922                 x_rtg_op_resource_rec.Resource_Offset_Percent    :=
923                                    p_rev_op_resource_rec.Resource_Offset_Percent;
924                 x_rtg_op_resource_rec.Autocharge_Type            :=
925                                    p_rev_op_resource_rec.Autocharge_Type;
926                 x_rtg_op_resource_rec.Schedule_Sequence_Number   :=
927                                    p_rev_op_resource_rec.Schedule_Sequence_Number;
928                 x_rtg_op_resource_rec.Principle_Flag             :=
929                                    p_rev_op_resource_rec.Principle_Flag ;
930                 x_rtg_op_resource_rec.Attribute_category         :=
931                                    p_rev_op_resource_rec.Attribute_category;
932                 x_rtg_op_resource_rec.Attribute1                 :=
933                                    p_rev_op_resource_rec.Attribute1;
934                 x_rtg_op_resource_rec.Attribute2                 :=
935                                    p_rev_op_resource_rec.Attribute2;
936                 x_rtg_op_resource_rec.Attribute3                 :=
937                                    p_rev_op_resource_rec.Attribute3;
938                 x_rtg_op_resource_rec.Attribute4                 :=
939                                    p_rev_op_resource_rec.Attribute4;
940                 x_rtg_op_resource_rec.Attribute5                 :=
941                                    p_rev_op_resource_rec.Attribute5;
942                 x_rtg_op_resource_rec.Attribute6                 :=
943                                    p_rev_op_resource_rec.Attribute6 ;
944                 x_rtg_op_resource_rec.Attribute7                 :=
945                                    p_rev_op_resource_rec.Attribute7;
946                 x_rtg_op_resource_rec.Attribute8                 :=
947                                    p_rev_op_resource_rec.Attribute8;
948                 x_rtg_op_resource_rec.Attribute9                 :=
949                                    p_rev_op_resource_rec.Attribute9;
950                 x_rtg_op_resource_rec.Attribute10                :=
951                                    p_rev_op_resource_rec.Attribute10;
952                 x_rtg_op_resource_rec.Attribute11                :=
953                                    p_rev_op_resource_rec.Attribute11;
954                 x_rtg_op_resource_rec.Attribute12                :=
955                                    p_rev_op_resource_rec.Attribute12;
956                 x_rtg_op_resource_rec.Attribute13                :=
957                                    p_rev_op_resource_rec.Attribute13;
958                 x_rtg_op_resource_rec.Attribute14                :=
959                                    p_rev_op_resource_rec.Attribute14;
960                 x_rtg_op_resource_rec.Attribute15                :=
961                                    p_rev_op_resource_rec.Attribute15;
962                 x_rtg_op_resource_rec.Original_System_Reference  :=
963                            p_rev_op_resource_rec.Original_System_Reference;
964                 x_rtg_op_resource_rec.Transaction_Type           :=
965                                    p_rev_op_resource_rec.Transaction_Type;
966                 x_rtg_op_resource_rec.Return_Status              :=
967                                    p_rev_op_resource_rec.Return_Status;
968                 x_rtg_op_resource_rec.Setup_Type                 :=
969                                    p_rev_op_resource_rec.Setup_Type ;
970 
971                 -- Similarly copy the unexposed record values into an ECO BO
972                 -- compatible record
973 
974                 x_rtg_op_res_unexp_rec.Operation_Sequence_Id       :=
975                                     p_rev_op_res_unexp_rec.Operation_Sequence_Id;
976                 x_rtg_op_res_unexp_rec.Routing_Sequence_Id         :=
977                                     p_rev_op_res_unexp_rec.Routing_Sequence_Id;
978                 x_rtg_op_res_unexp_rec.Assembly_Item_Id            :=
979                                     p_rev_op_res_unexp_rec.Revised_Item_Id;
980                 x_rtg_op_res_unexp_rec.Organization_Id             :=
981                                     p_rev_op_res_unexp_rec.Organization_Id;
982                 x_rtg_op_resource_rec.Substitute_Group_Number     :=
983                              p_rev_op_resource_rec.Substitute_Group_Number;
984                 x_rtg_op_res_unexp_rec.Substitute_Group_Number    :=
985                              x_rtg_op_resource_rec.Substitute_Group_Number;
986                 x_rtg_op_res_unexp_rec.Resource_Id                 :=
987                                     p_rev_op_res_unexp_rec.Resource_Id;
988                 x_rtg_op_res_unexp_rec.Activity_Id                 :=
989                                     p_rev_op_res_unexp_rec.Activity_Id ;
990                 x_rtg_op_res_unexp_rec.Setup_Id                    :=
991                                     p_rev_op_res_unexp_rec.Setup_Id ;
992 
993         END Convert_EcoRes_To_RtgRes;
994 
995         /*****************************************************************
996         * Procedure     : Convert_RtgSubRes_To_EcoSubRes
997         * Parameters IN : Substitute Resource Exposed Column Record
998         *                 Substitute Resource Unexposed Column Record
999         * Parameters OUT: ECO Substitute Resource Exposed Exposed Column Record
1000         *                 ECO Substitute Resource Unexposed Column Record
1001         * Purpose       : This procedure will simply take the Sub Resource
1002         *                 record and copy its values into the ECO Sub Resource
1003         *                 record. Since the record definitions of ECO and routig
1004         *                 records is different, this has to done on a field
1005         *                 by field basis.
1006         ******************************************************************/
1007         -- Sub Operation Resource Entity
1008         PROCEDURE Convert_RtgSubRes_To_EcoSubRes
1009         ( p_rtg_sub_resource_rec    IN  Bom_Rtg_Pub.Sub_Resource_Rec_Type
1010         , p_rtg_sub_res_unexp_rec   IN  Bom_Rtg_Pub.Sub_Res_Unexposed_Rec_Type
1011         , x_rev_sub_resource_rec    IN OUT NOCOPY Bom_Rtg_Pub.Rev_Sub_Resource_Rec_Type
1012         , x_rev_sub_res_unexp_rec   IN OUT NOCOPY Bom_Rtg_Pub.Rev_Sub_Res_Unexposed_Rec_Type
1013         )
1014         IS
1015         BEGIN
1016 
1017                 x_rev_sub_resource_rec.Eco_Name                   := NULL;
1018                 x_rev_sub_resource_rec.Organization_Code          :=
1019                                 p_rtg_sub_resource_rec.Organization_Code;
1020                 x_rev_sub_resource_rec.Revised_Item_Name          :=
1021                                 p_rtg_sub_resource_rec.Assembly_Item_Name;
1022                 x_rev_sub_resource_rec.New_Revised_Item_Revision  := NULL;
1023                 x_rev_sub_resource_rec.New_Routing_Revision       := NULL;    -- Added by MK on 11/02/00
1024                 x_rev_sub_resource_rec.From_End_Item_Unit_Number  := NULL;    -- Added by MK on 11/02/00
1025                 x_rev_sub_resource_rec.ACD_Type                   := NULL;
1026                 x_rev_sub_resource_rec.Alternate_Routing_Code     :=
1027                                 p_rtg_sub_resource_rec.Alternate_Routing_Code;
1028                 x_rev_sub_resource_rec.Operation_Sequence_Number  :=
1029                                 p_rtg_sub_resource_rec.Operation_Sequence_Number;
1030                 x_rev_sub_resource_rec.Operation_Type             :=
1031                                 p_rtg_sub_resource_rec.Operation_Type;
1032                 x_rev_sub_resource_rec.OP_Start_Effective_Date    :=
1033                                 p_rtg_sub_resource_rec.OP_Start_Effective_Date;
1034                 x_rev_sub_resource_rec.Sub_Resource_code          :=
1035                                 p_rtg_sub_resource_rec.Sub_Resource_code;
1036                 x_rev_sub_resource_rec.New_Sub_Resource_code      :=
1037                                 p_rtg_sub_resource_rec.New_Sub_Resource_code;
1038                 x_rev_sub_resource_rec.Schedule_Sequence_Number   :=
1039                                 p_rtg_sub_resource_rec.Schedule_Sequence_Number ;
1040                 x_rev_sub_resource_rec.Replacement_Group_Number   :=
1041                                 p_rtg_sub_resource_rec.Replacement_Group_Number ;
1042                 x_rev_sub_resource_rec.New_Replacement_Group_Number   := -- bug 3741570
1043                                 p_rtg_sub_resource_rec.New_Replacement_Group_Number ;
1044                 x_rev_sub_resource_rec.Activity :=
1045                                 p_rtg_sub_resource_rec.Activity;
1046                 x_rev_sub_resource_rec.Standard_Rate_Flag         :=
1047                                 p_rtg_sub_resource_rec.Standard_Rate_Flag;
1048                 x_rev_sub_resource_rec.Assigned_Units             :=
1049                                 p_rtg_sub_resource_rec.Assigned_Units;
1050                 x_rev_sub_resource_rec.Usage_Rate_Or_amount       :=
1051                                 p_rtg_sub_resource_rec.Usage_Rate_Or_amount ;
1052                 x_rev_sub_resource_rec.Usage_Rate_Or_Amount_Inverse :=
1053                                 p_rtg_sub_resource_rec.Usage_Rate_Or_Amount_Inverse;
1054                 x_rev_sub_resource_rec.Basis_Type                 :=
1055                                 p_rtg_sub_resource_rec.Basis_Type;
1056                 x_rev_sub_resource_rec.New_Basis_Type             :=
1057                                 p_rtg_sub_resource_rec.New_Basis_Type; /* Added for bug 4689856 */
1058                 x_rev_sub_resource_rec.Schedule_Flag              :=
1059                                 p_rtg_sub_resource_rec.Schedule_Flag;
1060                 x_rev_sub_resource_rec.New_Schedule_Flag          :=
1061  	                                 p_rtg_sub_resource_rec.New_Schedule_Flag; /* Added for bug 13005178 */
1062                 x_rev_sub_resource_rec.Resource_Offset_Percent    :=
1063                                 p_rtg_sub_resource_rec.Resource_Offset_Percent;
1064                 x_rev_sub_resource_rec.Autocharge_Type            :=
1065                                 p_rtg_sub_resource_rec.Autocharge_Type;
1066                 x_rev_sub_resource_rec.Principle_Flag             :=
1067                                 p_rtg_sub_resource_rec.Principle_Flag ;
1068                 x_rev_sub_resource_rec.Attribute_category         :=
1069                                 p_rtg_sub_resource_rec.Attribute_category;
1070                 x_rev_sub_resource_rec.Attribute1                 :=
1071                                 p_rtg_sub_resource_rec.Attribute1;
1072                 x_rev_sub_resource_rec.Attribute2                 :=
1073                                 p_rtg_sub_resource_rec.Attribute2;
1074                 x_rev_sub_resource_rec.Attribute3                 :=
1075                                 p_rtg_sub_resource_rec.Attribute3;
1076                 x_rev_sub_resource_rec.Attribute4                 :=
1077                                 p_rtg_sub_resource_rec.Attribute4;
1078                 x_rev_sub_resource_rec.Attribute5                 :=
1079                                 p_rtg_sub_resource_rec.Attribute5;
1080                 x_rev_sub_resource_rec.Attribute6                 :=
1081                                 p_rtg_sub_resource_rec.Attribute6;
1082                 x_rev_sub_resource_rec.Attribute7                 :=
1083                                 p_rtg_sub_resource_rec.Attribute7;
1084                 x_rev_sub_resource_rec.Attribute8                 :=
1085                                 p_rtg_sub_resource_rec.Attribute8;
1086                 x_rev_sub_resource_rec.Attribute9                 :=
1087                                 p_rtg_sub_resource_rec.Attribute9;
1088                 x_rev_sub_resource_rec.Attribute10                :=
1089                                 p_rtg_sub_resource_rec.Attribute10;
1090                 x_rev_sub_resource_rec.Attribute11                :=
1091                                 p_rtg_sub_resource_rec.Attribute11;
1092                 x_rev_sub_resource_rec.Attribute12                :=
1093                                 p_rtg_sub_resource_rec.Attribute12;
1094                 x_rev_sub_resource_rec.Attribute13                :=
1095                                 p_rtg_sub_resource_rec.Attribute13;
1096                 x_rev_sub_resource_rec.Attribute14                :=
1097                                 p_rtg_sub_resource_rec.Attribute14;
1098                 x_rev_sub_resource_rec.Attribute15                :=
1099                                 p_rtg_sub_resource_rec.Attribute15;
1100                 x_rev_sub_resource_rec.Original_System_Reference  :=
1101                                 p_rtg_sub_resource_rec.Original_System_Reference;
1102                 x_rev_sub_resource_rec.Transaction_Type           :=
1103                                 p_rtg_sub_resource_rec.Transaction_Type;
1104                 x_rev_sub_resource_rec.Return_Status              :=
1105                                 p_rtg_sub_resource_rec.Return_Status;
1106                 x_rev_sub_resource_rec.Setup_Type                 :=
1107                                 p_rtg_sub_resource_rec.Setup_Type ;
1108 
1109                 -- Similarly copy the unexposed record values into an ECO BO
1110                 -- compatible record
1111 
1112                 x_rev_sub_res_unexp_rec.Revised_Item_Sequence_Id    := NULL;
1113                 x_rev_sub_res_unexp_rec.Operation_Sequence_Id       :=
1114                                 p_rtg_sub_res_unexp_rec.Operation_Sequence_Id;
1115                 x_rev_sub_res_unexp_rec.Routing_Sequence_Id         :=
1116                                 p_rtg_sub_res_unexp_rec.Routing_Sequence_Id;
1117                 x_rev_sub_res_unexp_rec.Revised_Item_Id             :=
1118                                 p_rtg_sub_res_unexp_rec.Assembly_Item_Id;
1119                 x_rev_sub_res_unexp_rec.Organization_Id             :=
1120                                 p_rtg_sub_res_unexp_rec.Organization_Id;
1121                 x_rev_sub_resource_rec.Substitute_Group_Number     :=
1122                                 p_rtg_sub_resource_rec.Substitute_Group_Number;
1123                 x_rev_sub_res_unexp_rec.Substitute_Group_Number     :=
1124                                 x_rev_sub_resource_rec.Substitute_Group_Number;
1125                 x_rev_sub_res_unexp_rec.Resource_Id                 :=
1126                                 p_rtg_sub_res_unexp_rec.Resource_Id;
1127                 x_rev_sub_res_unexp_rec.New_Resource_Id             :=
1128                                 p_rtg_sub_res_unexp_rec.New_Resource_Id;
1129                 x_rev_sub_res_unexp_rec.Activity_Id                 :=
1130                                 p_rtg_sub_res_unexp_rec.Activity_Id ;
1131                 x_rev_sub_res_unexp_rec.Setup_Id                    :=
1132                                 p_rtg_sub_res_unexp_rec.Setup_ID ;
1133 
1134         END Convert_RtgSubRes_To_EcoSubRes;
1135 
1136         /*****************************************************************
1137         * Procedure     : Convert_EcoSubRes_To_RtgSubRes
1138         * Parameters IN : ECO Substitute Resource Exposed Column Record
1139         *                 ECO Substitute Resource Unexposed Column Record
1140         * Parameters OUT: Substitute Resource Exposed Exposed Column Record
1141         *                 Substitute Resource Unexposed Column Record
1142         * Purpose       : This procedure will simply take the ECO Sub Resource
1143         *                 record and copy its values into the Sub Resource
1144         *                 record. Since the record definitions of ECO and routig
1145         *                 records is different, this has to done on a field
1146         *                 by field basis.
1147         ******************************************************************/
1148         PROCEDURE Convert_EcoSubRes_To_RtgSubRes
1149         ( p_rev_sub_resource_rec  IN  Bom_Rtg_Pub.Rev_Sub_Resource_Rec_Type
1150         , p_rev_sub_res_unexp_rec IN  Bom_Rtg_Pub.Rev_Sub_Res_Unexposed_Rec_Type
1151         , x_rtg_sub_resource_rec  IN OUT NOCOPY Bom_Rtg_Pub.Sub_Resource_Rec_Type
1152         , x_rtg_sub_res_unexp_rec IN OUT NOCOPY Bom_Rtg_Pub.Sub_Res_Unexposed_Rec_Type
1153         )
1154         IS
1155         BEGIN
1156 
1157                 x_rtg_sub_resource_rec.Organization_Code          :=
1158                                 p_rev_sub_resource_rec.Organization_Code;
1159                 x_rtg_sub_resource_rec.Assembly_Item_Name         :=
1160                                 p_rev_sub_resource_rec.Revised_Item_Name;
1161                 x_rtg_sub_resource_rec.Alternate_Routing_Code     :=
1162                                 p_rev_sub_resource_rec.Alternate_Routing_Code;
1163                 x_rtg_sub_resource_rec.Operation_Sequence_Number  :=
1164                                 p_rev_sub_resource_rec.Operation_Sequence_Number;
1165                 x_rtg_sub_resource_rec.Operation_Type             :=
1166                                 p_rev_sub_resource_rec.Operation_Type;
1167                 x_rtg_sub_resource_rec.OP_Start_Effective_Date    :=
1168                                 p_rev_sub_resource_rec.OP_Start_Effective_Date;
1169                 x_rtg_sub_resource_rec.Sub_Resource_code          :=
1170                                 p_rev_sub_resource_rec.Sub_Resource_code;
1171                 x_rtg_sub_resource_rec.New_Sub_Resource_code      :=
1172                                 p_rev_sub_resource_rec.New_Sub_Resource_code;
1173                 x_rtg_sub_resource_rec.Schedule_Sequence_Number   :=
1174                                 p_rev_sub_resource_rec.Schedule_Sequence_Number ;
1175                 x_rtg_sub_resource_rec.Replacement_Group_Number   :=
1176                                 p_rev_sub_resource_rec.Replacement_Group_Number ;
1177                 x_rtg_sub_resource_rec.New_Replacement_Group_Number   := -- bug 3741570
1178                                 p_rev_sub_resource_rec.New_Replacement_Group_Number;
1179                 x_rtg_sub_resource_rec.Activity                   :=
1180                                 p_rev_sub_resource_rec.Activity;
1181                 x_rtg_sub_resource_rec.Standard_Rate_Flag         :=
1182                                 p_rev_sub_resource_rec.Standard_Rate_Flag;
1183                 x_rtg_sub_resource_rec.Assigned_Units             :=
1184                                 p_rev_sub_resource_rec.Assigned_Units;
1185                 x_rtg_sub_resource_rec.Usage_Rate_Or_amount       :=
1186                                 p_rev_sub_resource_rec.Usage_Rate_Or_amount ;
1187                 x_rtg_sub_resource_rec.Usage_Rate_Or_Amount_Inverse :=
1188                                 p_rev_sub_resource_rec.Usage_Rate_Or_Amount_Inverse;
1189                 x_rtg_sub_resource_rec.Basis_Type                 :=
1190                                 p_rev_sub_resource_rec.Basis_Type;
1191                 x_rtg_sub_resource_rec.New_Basis_Type             :=
1192                                 p_rev_sub_resource_rec.New_Basis_Type; /* Added for bug 4689856 */
1193                 x_rtg_sub_resource_rec.Schedule_Flag              :=
1194                                 p_rev_sub_resource_rec.Schedule_Flag;
1195                 x_rtg_sub_resource_rec.New_Schedule_Flag          :=
1196  	                                 p_rev_sub_resource_rec.New_Schedule_Flag; /* Added for bug 13005178 */
1197                 x_rtg_sub_resource_rec.Resource_Offset_Percent    :=
1198                                 p_rev_sub_resource_rec.Resource_Offset_Percent;
1199                 x_rtg_sub_resource_rec.Autocharge_Type            :=
1200                                 p_rev_sub_resource_rec.Autocharge_Type;
1201                 x_rtg_sub_resource_rec.Principle_Flag             :=
1202                                 p_rev_sub_resource_rec.Principle_Flag ;
1203                 x_rtg_sub_resource_rec.Attribute_category         :=
1204                                 p_rev_sub_resource_rec.Attribute_category;
1205                 x_rtg_sub_resource_rec.Attribute1                 :=
1206                                 p_rev_sub_resource_rec.Attribute1;
1207                 x_rtg_sub_resource_rec.Attribute2                 :=
1208                                 p_rev_sub_resource_rec.Attribute2;
1209                 x_rtg_sub_resource_rec.Attribute3                 :=
1210                                 p_rev_sub_resource_rec.Attribute3;
1211                 x_rtg_sub_resource_rec.Attribute4                 :=
1212                                 p_rev_sub_resource_rec.Attribute4;
1213                 x_rtg_sub_resource_rec.Attribute5                 :=
1214                                 p_rev_sub_resource_rec.Attribute5;
1215                 x_rtg_sub_resource_rec.Attribute6                 :=
1216                                 p_rev_sub_resource_rec.Attribute6 ;
1217                 x_rtg_sub_resource_rec.Attribute7                 :=
1218                                 p_rev_sub_resource_rec.Attribute7;
1219                 x_rtg_sub_resource_rec.Attribute8                 :=
1220                                 p_rev_sub_resource_rec.Attribute8;
1221                 x_rtg_sub_resource_rec.Attribute9                 :=
1222                                 p_rev_sub_resource_rec.Attribute9;
1223                 x_rtg_sub_resource_rec.Attribute10                :=
1224                                 p_rev_sub_resource_rec.Attribute10;
1225                 x_rtg_sub_resource_rec.Attribute11                :=
1226                                 p_rev_sub_resource_rec.Attribute11;
1227                 x_rtg_sub_resource_rec.Attribute12                :=
1228                                 p_rev_sub_resource_rec.Attribute12;
1229                 x_rtg_sub_resource_rec.Attribute13                :=
1230                                 p_rev_sub_resource_rec.Attribute13;
1231                 x_rtg_sub_resource_rec.Attribute14                :=
1232                                 p_rev_sub_resource_rec.Attribute14;
1233                 x_rtg_sub_resource_rec.Attribute15                :=
1234                                 p_rev_sub_resource_rec.Attribute15;
1235                 x_rtg_sub_resource_rec.Original_System_Reference  :=
1236                                 p_rev_sub_resource_rec.Original_System_Reference;
1237                 x_rtg_sub_resource_rec.Transaction_Type           :=
1238                                 p_rev_sub_resource_rec.Transaction_Type;
1239                 x_rtg_sub_resource_rec.Return_Status              :=
1240                                 p_rev_sub_resource_rec.Return_Status;
1241                 x_rtg_sub_resource_rec.Setup_Type                 :=
1242                                 p_rev_sub_resource_rec.Setup_Type;
1243 
1244                 -- Similarly copy the unexposed record values into an ECO BO
1245                 -- compatible record
1246 
1247                 x_rtg_sub_res_unexp_rec.Operation_Sequence_Id      :=
1248                                 p_rev_sub_res_unexp_rec.Operation_Sequence_Id;
1249                 x_rtg_sub_res_unexp_rec.Routing_Sequence_Id        :=
1250                                 p_rev_sub_res_unexp_rec.Routing_Sequence_Id;
1251                 x_rtg_sub_res_unexp_rec.Assembly_Item_Id           :=
1252                                 p_rev_sub_res_unexp_rec.revised_Item_Id;
1253                 x_rtg_sub_res_unexp_rec.Organization_Id            :=
1254                                 p_rev_sub_res_unexp_rec.Organization_Id;
1255                 x_rtg_sub_resource_rec.Substitute_Group_Number    :=
1256                                 p_rev_sub_resource_rec.substitute_Group_Number;
1257                 x_rtg_sub_res_unexp_rec.Substitute_Group_Number    :=
1258                                 x_rtg_sub_resource_rec.Substitute_Group_Number;
1259                 x_rtg_sub_res_unexp_rec.Resource_Id                :=
1260                                 p_rev_sub_res_unexp_rec.Resource_Id;
1261                 x_rtg_sub_res_unexp_rec.New_Resource_Id            :=
1262                                 p_rev_sub_res_unexp_rec.New_Resource_Id;
1263                 x_rtg_sub_res_unexp_rec.Activity_Id                :=
1264                                 p_rev_sub_res_unexp_rec.Activity_Id ;
1265                 x_rtg_sub_res_unexp_rec.Setup_Id                   :=
1266                                 p_rev_sub_res_unexp_rec.Setup_Id ;
1267 
1268 
1269         END Convert_EcoSubRes_To_RtgSubRes ;
1270 
1271 
1272         /********************************************************************
1273         * Function      : Does_Rev_Have_Same_Rtg
1274         * Parameters IN : Routing Revision exposed column record
1275         *                 Assembly Name
1276         *                 Organization Name
1277         * Parameters OUT: N/A
1278         * Purpose       : This function is to check all the records have the
1279         *                 same assembly_item_name and same organization.
1280         *                 This function is callled in the procedure
1281         *                 Check_Records_In_Same_BOM
1282         *********************************************************************/
1283         FUNCTION Does_Rev_Have_Same_Rtg
1284         ( p_rtg_revision_tbl        IN Bom_Rtg_Pub.Rtg_Revision_Tbl_Type
1285         , p_assembly_item_name      IN VARCHAR2
1286         , p_organization_code       IN VARCHAR2
1287         ) RETURN BOOLEAN
1288         IS
1289                 table_index     NUMBER;
1290                 record_count    NUMBER;
1291         BEGIN
1292                 record_count := p_rtg_revision_tbl.COUNT;
1293 
1294                 FOR table_index IN 1..record_count
1295                 LOOP
1296                     IF NVL(p_rtg_revision_tbl(table_index).assembly_item_name,
1297                            FND_API.G_MISS_CHAR) <>
1298                                 NVL(p_assembly_item_name, FND_API.G_MISS_CHAR)
1299                            OR
1300                            NVL(p_rtg_revision_tbl(table_index).organization_code,
1301                                FND_API.G_MISS_CHAR) <>
1302                                 NVL(p_organization_code, FND_API.G_MISS_CHAR)
1303                     THEN
1304                          RETURN FALSE;
1305                     END IF;
1306                 END LOOP;
1307                 RETURN TRUE;
1308         END Does_Rev_Have_Same_Rtg;
1309 
1310         /********************************************************************
1311         * Function      : Does_Op_Have_Same_Rtg
1312         * Parameters IN : Operation exposed column record
1313         *                 Assembly Name
1314         *                 Organization Name
1315         *                 Alternate routing code
1316         * Parameters OUT: N/A
1317         * Purpose       : This function is to check all the records have the
1318         *                 same assembly_item_name and same organization.
1319         *                 This function is callled in the procedure
1320         *                 Check_Records_In_Same_BOM
1321         *********************************************************************/
1322         FUNCTION Does_Op_Have_Same_Rtg
1323         ( p_operation_tbl            IN  Bom_Rtg_Pub.Operation_Tbl_Type
1324         , p_assembly_item_name       IN VARCHAR2
1325         , p_organization_code        IN VARCHAR2
1326         , p_alternate_routing_code   IN VARCHAR2
1327         ) RETURN BOOLEAN
1328         IS
1329                 table_index     NUMBER;
1330                 record_count    NUMBER;
1331         BEGIN
1332                 record_count := p_operation_tbl.COUNT;
1333 
1334                 FOR table_index IN 1..record_count
1335                 LOOP
1336                   IF NVL(p_operation_tbl(table_index).assembly_item_name,
1337                             FND_API.G_MISS_CHAR) <>
1338                               NVL(p_assembly_item_name, FND_API.G_MISS_CHAR)
1339                      OR
1340                      NVL(p_operation_tbl(table_index).organization_code,
1341                            FND_API.G_MISS_CHAR) <>
1342                               NVL(p_organization_code, FND_API.G_MISS_CHAR)
1343                      OR
1344                      NVL(p_operation_tbl(table_index).alternate_routing_code,
1345                               FND_API.G_MISS_CHAR) <>
1346                            NVL(p_alternate_routing_code, FND_API.G_MISS_CHAR)
1347                      AND NVL(p_alternate_routing_code,  FND_API.G_MISS_CHAR)
1348                          <> 'XXXXXXXXXX'
1349                   THEN
1350                     RETURN FALSE;
1351                   END IF;
1352                 END LOOP;
1353 
1354                 RETURN TRUE;
1355         END Does_Op_Have_Same_Rtg;
1356 
1357         /********************************************************************
1358         * Function      : Does_Res_Have_Same_Rtg
1359         * Parameters IN : Operation resource exposed column record
1360         *                 Assembly Name
1361         *                 Organization Name
1362         *                 Alternate routing code
1363         * Parameters OUT: N/A
1364         * Purpose       : This function is to check all the records have the
1365         *                 same assembly_item_name and same organization.
1366         *                 This function is callled in the procedure
1367         *                 Check_Records_In_Same_BOM
1368         *********************************************************************/
1369         FUNCTION Does_Res_Have_Same_Rtg
1370         (p_op_resource_tbl          IN  Bom_Rtg_Pub.Op_Resource_Tbl_Type
1371         , p_assembly_item_name      IN VARCHAR2
1372         , p_organization_code       IN VARCHAR2
1373         , p_alternate_routing_code  IN VARCHAR2
1374         ) RETURN BOOLEAN
1375         IS
1376                 table_index     NUMBER;
1377                 record_count    NUMBER;
1378         BEGIN
1379                 record_count := p_op_resource_tbl .COUNT;
1380 
1381                 FOR table_index IN 1..record_count
1382                 LOOP
1383                      IF NVL(p_op_resource_tbl (table_index).assembly_item_name,
1384                             FND_API.G_MISS_CHAR) <>
1385                             NVL(p_assembly_item_name, FND_API.G_MISS_CHAR)
1386                      OR NVL(p_op_resource_tbl(table_index).organization_code,
1387                             FND_API.G_MISS_CHAR) <>
1388                             NVL(p_organization_code, FND_API.G_MISS_CHAR)
1389                      OR NVL(p_op_resource_tbl(table_index).alternate_routing_code,
1390                             FND_API.G_MISS_CHAR) <>
1391                             NVL(p_alternate_routing_code, FND_API.G_MISS_CHAR)
1392                      AND NVL(p_alternate_routing_code,  FND_API.G_MISS_CHAR)
1393                             <> 'XXXXXXXXXX'
1394                      THEN
1395                          RETURN FALSE;
1396                      END IF;
1397                 END LOOP;
1398 
1399                 RETURN TRUE;
1400         END Does_Res_Have_Same_Rtg;
1401 
1402         /********************************************************************
1403         * Function      : Does_SubRes_Have_Same_Rtg
1404         * Parameters IN : Operation Sub resource exposed column record
1405         *                 Assembly Name
1406         *                 Organization Name
1407         *                 Alternate routing code
1408         * Parameters OUT: N/A
1409         * Purpose       : This function is to check all the records have the
1410         *                 same assembly_item_name and same organization.
1411         *                 This function is callled in the procedure
1412         *                 Check_Records_In_Same_BOM
1413         *********************************************************************/
1414         FUNCTION Does_SubRes_Have_Same_Rtg
1415         ( p_sub_resource_tbl        IN  Bom_Rtg_Pub.Sub_Resource_Tbl_Type
1416         , p_assembly_item_name      IN VARCHAR2
1417         , p_organization_code       IN VARCHAR2
1418         , p_alternate_routing_code  IN VARCHAR2
1419         ) RETURN BOOLEAN
1420         IS
1421                 table_index     NUMBER;
1422                 record_count    NUMBER;
1423         BEGIN
1424                 record_count := p_sub_resource_tbl.COUNT;
1425 
1426                 FOR table_index IN 1..record_count
1427                 LOOP
1428                     IF NVL(p_sub_resource_tbl(table_index).assembly_item_name,
1429                            FND_API.G_MISS_CHAR) <>
1430                            NVL(p_assembly_item_name, FND_API.G_MISS_CHAR)
1431                     OR NVL(p_sub_resource_tbl(table_index).organization_code,
1432                            FND_API.G_MISS_CHAR) <>
1433                            NVL(p_organization_code, FND_API.G_MISS_CHAR)
1434                     OR NVL(p_sub_resource_tbl(table_index).alternate_routing_code,
1435                              FND_API.G_MISS_CHAR) <>
1436                            NVL(p_alternate_routing_code,  FND_API.G_MISS_CHAR)
1437                     AND NVL(p_alternate_routing_code,  FND_API.G_MISS_CHAR)
1438                            <> 'XXXXXXXXXX'
1439                     THEN
1440                        RETURN FALSE;
1441                     END IF;
1442                 END LOOP;
1443 
1444                 RETURN TRUE;
1445         END Does_SubRes_Have_Same_Rtg;
1446 
1447         /********************************************************************
1448         * Function      : Does_OpNw_Have_Same_Rtg
1449         * Parameters IN : Operation Sub resource exposed column record
1450         *                 Assembly Name
1451         *                 Organization Name
1452         *                 Alternate routing code
1453         * Parameters OUT: N/A
1454         * Purpose       : This function is to check all the records have the
1455         *                 same assembly_item_name and same organization.
1456         *                 This function is callled in the procedure
1457         *                 Check_Records_In_Same_BOM
1458         *********************************************************************/
1459         FUNCTION Does_OpNw_Have_Same_Rtg
1460         ( p_op_network_tbl          IN Bom_Rtg_Pub.Op_Network_Tbl_Type
1461         , p_assembly_item_name      IN VARCHAR2
1462         , p_organization_code       IN VARCHAR2
1463         , p_alternate_routing_code  IN VARCHAR2
1464         ) RETURN BOOLEAN
1465         IS
1466                 table_index     NUMBER;
1467                 record_count    NUMBER;
1468         BEGIN
1469                 record_count := p_op_network_tbl.COUNT;
1470                 FOR table_index IN 1..record_count
1471                 LOOP
1472                     IF NVL(p_op_network_tbl(table_index).assembly_item_name,
1473                            FND_API.G_MISS_CHAR) <>
1474                            NVL(p_assembly_item_name, FND_API.G_MISS_CHAR)
1475                     OR NVL(p_op_network_tbl(table_index).organization_code,
1476                            FND_API.G_MISS_CHAR) <>
1477                            NVL(p_organization_code, FND_API.G_MISS_CHAR)
1478                     OR NVL(p_op_network_tbl(table_index).alternate_routing_code,
1479                            FND_API.G_MISS_CHAR) <>
1480                            NVL(p_alternate_routing_code, FND_API.G_MISS_CHAR)
1481                     AND NVL(p_alternate_routing_code,  FND_API.G_MISS_CHAR)
1482                            <> 'XXXXXXXXXX'
1483                     THEN
1484                          RETURN FALSE;
1485                     END IF;
1486                 END LOOP;
1487 
1488                 RETURN TRUE;
1489         END Does_OpNw_Have_Same_Rtg;
1490 
1491 
1492         /********************************************************************
1493         * Procedure     : Check_Records_In_Same_RTG
1494         * Parameters IN : Routing Header exposed column record
1495         *                 Routing revision exposed column table
1496         *                 Operation Exposed Column Table
1497         *                 Resource Exposed Column table
1498         *                 Substitute  Resource Exposed column table
1499         *                 Network Exposed column table
1500         * Parameters OUT: Assembly_item_name
1501         *                 Organization_code
1502         * Purpose       : This procedure is to check all the records have the
1503         *                 same assembly_item_name and same organization.
1504         *                 This procedure is callled in public procedure
1505         *                 Process_Rtg.
1506         *********************************************************************/
1507 
1508         FUNCTION Check_Records_In_Same_RTG
1509         (  p_rtg_header_rec         IN  Bom_Rtg_Pub.Rtg_Header_Rec_Type
1510          , p_rtg_revision_tbl       IN  Bom_Rtg_Pub.Rtg_Revision_Tbl_Type
1511          , p_operation_tbl          IN  Bom_Rtg_Pub.Operation_Tbl_Type
1512          , p_op_resource_tbl        IN  Bom_Rtg_Pub.Op_resource_Tbl_Type
1513          , p_sub_resource_tbl       IN  Bom_Rtg_Pub.Sub_Resource_Tbl_Type
1514          , p_op_network_tbl         IN  Bom_Rtg_Pub.Op_network_Tbl_Type
1515          , x_assembly_item_name     IN OUT NOCOPY VARCHAR2
1516          , x_organization_code      IN OUT NOCOPY VARCHAR2
1517          , x_alternate_routing_code IN OUT NOCOPY VARCHAR2
1518         )
1519         RETURN BOOLEAN
1520         IS
1521                 l_organization_code      VARCHAR2(3);
1522                 l_assembly_item_name     VARCHAR2(81);
1523                 l_alternate_routing_code VARCHAR2(10);
1524                 record_count             NUMBER;
1525         BEGIN
1526 
1527                 ----  if Routing header record exist
1528                 IF (p_rtg_header_rec.assembly_item_name IS NOT NULL AND
1529                     p_rtg_header_rec.assembly_item_name <> FND_API.G_MISS_CHAR)
1530                     OR
1531                     (p_rtg_header_rec.organization_code IS NOT NULL AND
1532                      p_rtg_header_rec.organization_code <> FND_API.G_MISS_CHAR)
1533                     OR
1534                     (p_rtg_header_rec.alternate_routing_code IS NOT NULL AND
1535                      p_rtg_header_rec.alternate_routing_code <>
1536                              FND_API.G_MISS_CHAR)
1537                 THEN
1538                         l_assembly_item_name :=
1539                                         p_rtg_header_rec.assembly_item_name;
1540                         l_organization_code :=
1541                                         p_rtg_header_rec.organization_code;
1542                         l_alternate_routing_code :=
1543                                         p_rtg_header_rec.alternate_routing_code;
1544                         x_assembly_item_name :=
1545                                         p_rtg_header_rec.assembly_item_name;
1546                         x_organization_code :=
1547                                         p_rtg_header_rec.organization_code;
1548                         x_alternate_routing_code :=
1549                                         p_rtg_header_rec.alternate_routing_code;
1550                         IF NOT Does_Rev_Have_Same_Rtg
1551                         ( p_rtg_revision_tbl => p_rtg_revision_tbl
1552                         , p_assembly_item_name => l_assembly_item_name
1553                         , p_organization_code => l_organization_code
1554                         )
1555                         THEN
1556                                 RETURN FALSE;
1557                         END IF;
1558 
1559                         IF NOT Does_Op_Have_Same_Rtg
1560                         ( p_operation_tbl        => p_operation_tbl
1561                         , p_assembly_item_name   => l_assembly_item_name
1562                         , p_organization_code    => l_organization_code
1563                         , p_alternate_routing_code =>
1564                                              l_alternate_routing_code
1565                         )
1566                         THEN
1567                                 RETURN FALSE;
1568                         END IF;
1569 
1570                         IF NOT Does_Res_Have_Same_Rtg
1571                         ( p_op_resource_tbl     => p_op_resource_tbl
1572                         , p_assembly_item_name  => l_assembly_item_name
1573                         , p_organization_code   => l_organization_code
1574                         , p_alternate_routing_code =>
1575                                              l_alternate_routing_code
1576                         )
1577                         THEN
1578                                 RETURN FALSE;
1579                         END IF;
1580 
1581                         IF NOT Does_SubRes_Have_Same_Rtg
1582                         ( p_sub_resource_tbl    => p_sub_resource_tbl
1583                         , p_assembly_item_name  => l_assembly_item_name
1584                         , p_organization_code   => l_organization_code
1585                         , p_alternate_routing_code =>
1586                                              l_alternate_routing_code
1587                         )
1588                         THEN
1589                                 RETURN FALSE;
1590                         END IF;
1591 
1592                         IF NOT Does_OpNw_Have_Same_Rtg
1593                         ( p_op_network_tbl     =>  p_op_network_tbl
1594                         , p_assembly_item_name => l_assembly_item_name
1595                         , p_organization_code  => l_organization_code
1596                         , p_alternate_routing_code =>
1597                                              l_alternate_routing_code
1598                         )
1599                         THEN
1600                                 RETURN FALSE;
1601                         END IF;
1602 
1603 
1604                         RETURN TRUE;
1605 
1606                 END IF;
1607 
1608                 ----  If revision records exist
1609                 record_count := p_rtg_revision_tbl.COUNT;
1610                 IF record_count <> 0
1611                 THEN
1612                         l_assembly_item_name :=
1613                                 p_rtg_revision_tbl(1).assembly_item_name;
1614                         l_organization_code :=
1615                                 p_rtg_revision_tbl(1).organization_code;
1616                         x_assembly_item_name :=
1617                                 p_rtg_revision_tbl(1).assembly_item_name;
1618                         x_organization_code :=
1619                                 p_rtg_revision_tbl(1).organization_code;
1620 
1621                         l_alternate_routing_code := 'XXXXXXXXXX';
1622                         x_alternate_routing_code := 'XXXXXXXXXX';
1623 
1624                         IF record_count > 1
1625                         THEN
1626 
1627                           IF NOT Does_Rev_Have_Same_Rtg
1628                            ( p_rtg_revision_tbl    => p_rtg_revision_tbl
1629                            , p_assembly_item_name  => l_assembly_item_name
1630                            , p_organization_code   => l_organization_code
1631                            )
1632                           THEN
1633                                 RETURN FALSE;
1634                           END IF;
1635                         END IF;
1636 
1637                          IF NOT Does_OP_Have_Same_Rtg
1638                            ( p_operation_tbl       => p_operation_tbl
1639                            , p_assembly_item_name  => l_assembly_item_name
1640                            , p_organization_code   => l_organization_code
1641                            , p_alternate_routing_code =>
1642                                    l_alternate_routing_code
1643                           )
1644                           THEN
1645                                 RETURN FALSE;
1646                           END IF;
1647 
1648                           IF NOT Does_Res_Have_Same_Rtg
1649                            ( p_op_resource_tbl     => p_op_resource_tbl
1650                            , p_assembly_item_name  => l_assembly_item_name
1651                            , p_organization_code   => l_organization_code
1652                            , p_alternate_routing_code =>
1653                                    l_alternate_routing_code
1654                           )
1655                         THEN
1656                                 RETURN FALSE;
1657                         END IF;
1658 
1659                         IF NOT Does_SubRes_Have_Same_Rtg
1660                             ( p_sub_resource_tbl    => p_sub_resource_tbl
1661                             , p_assembly_item_name  => l_assembly_item_name
1662                             , p_organization_code   => l_organization_code
1663                             , p_alternate_routing_code =>
1664                                              l_alternate_routing_code
1665                             )
1666                           THEN
1667                                 RETURN FALSE;
1668                         END IF;
1669 
1670                        IF NOT Does_OpNw_Have_Same_Rtg
1671                         ( p_op_network_tbl     =>  p_op_network_tbl
1672                         , p_assembly_item_name => l_assembly_item_name
1673                         , p_organization_code  => l_organization_code
1674                         , p_alternate_routing_code =>
1675                                              l_alternate_routing_code
1676                         )
1677                         THEN
1678                                 RETURN FALSE;
1679                        END IF;
1680 
1681 
1682                      RETURN TRUE;
1683 
1684 
1685 
1686                 END IF;
1687 
1688                 --  If operation records exist
1689                 record_count := p_operation_tbl.COUNT;
1690                 IF record_count <> 0
1691                 THEN
1692                         l_assembly_item_name :=
1693                                 p_operation_tbl(1).assembly_item_name;
1694                         l_organization_code :=
1695                                 p_operation_tbl(1).organization_code;
1696                         x_assembly_item_name :=
1697                                 p_operation_tbl(1).assembly_item_name;
1698                         x_organization_code :=
1699                                 p_operation_tbl(1).organization_code;
1700 
1701                         l_alternate_routing_code :=
1702                              p_operation_tbl(1).alternate_routing_code;
1703                         x_alternate_routing_code :=
1704                              p_operation_tbl(1).alternate_routing_code;
1705 
1706                         IF record_count > 1
1707                         THEN
1708 
1709                           IF NOT Does_OP_Have_Same_Rtg
1710                            ( p_operation_tbl       => p_operation_tbl
1711                            , p_assembly_item_name  => l_assembly_item_name
1712                            , p_organization_code   => l_organization_code
1713                            , p_alternate_routing_code =>
1714                                    l_alternate_routing_code
1715                           )
1716                           THEN
1717                                 RETURN FALSE;
1718                           END IF;
1719                         END IF;
1720 
1721                         IF NOT Does_Res_Have_Same_Rtg
1722                            ( p_op_resource_tbl     => p_op_resource_tbl
1723                            , p_assembly_item_name  => l_assembly_item_name
1724                            , p_organization_code   => l_organization_code
1725                            , p_alternate_routing_code =>
1726                                    l_alternate_routing_code
1727                           )
1728                         THEN
1729                                 RETURN FALSE;
1730                         END IF;
1731 
1732                         IF NOT Does_SubRes_Have_Same_Rtg
1733                             ( p_sub_resource_tbl    => p_sub_resource_tbl
1734                             , p_assembly_item_name  => l_assembly_item_name
1735                             , p_organization_code   => l_organization_code
1736                             , p_alternate_routing_code =>
1737                                              l_alternate_routing_code
1738                             )
1739                           THEN
1740                                 RETURN FALSE;
1741                         END IF;
1742 
1743                         IF NOT Does_OpNw_Have_Same_Rtg
1744                         ( p_op_network_tbl     =>  p_op_network_tbl
1745                         , p_assembly_item_name => l_assembly_item_name
1746                         , p_organization_code  => l_organization_code
1747                         , p_alternate_routing_code =>
1748                                              l_alternate_routing_code
1749                         )
1750                         THEN
1751                                 RETURN FALSE;
1752                         END IF;
1753 
1754                      RETURN TRUE;
1755 
1756                 END IF;
1757 
1758                 --  If Operation Network records exist
1759                 record_count := p_op_network_tbl.COUNT;
1760                 IF record_count <> 0
1761                 THEN
1762                         l_assembly_item_name :=
1763                                 p_op_network_tbl(1).assembly_item_name;
1764                         l_organization_code :=
1765                                 p_op_network_tbl(1).organization_code;
1766                         x_assembly_item_name :=
1767                                 p_op_network_tbl(1).assembly_item_name;
1768                         x_organization_code :=
1769                                 p_op_network_tbl(1).organization_code;
1770                         l_alternate_routing_code :=
1771                              p_op_network_tbl(1).alternate_routing_code;
1772                         x_alternate_routing_code :=
1773                              p_op_network_tbl(1).alternate_routing_code;
1774 
1775                          IF record_count > 1
1776                          THEN
1777 
1778                           IF NOT Does_OpNw_Have_Same_Rtg
1779                            ( p_op_network_tbl     =>  p_op_network_tbl
1780                            , p_assembly_item_name => l_assembly_item_name
1781                            , p_organization_code  => l_organization_code
1782                            , p_alternate_routing_code =>
1783                            l_alternate_routing_code
1784                           )
1785                           THEN
1786                                 RETURN FALSE;
1787                           END IF;
1788                         END IF;
1789 
1790                         IF NOT Does_OP_Have_Same_Rtg
1791                            ( p_operation_tbl       => p_operation_tbl
1792                            , p_assembly_item_name  => l_assembly_item_name
1793                            , p_organization_code   => l_organization_code
1794                            , p_alternate_routing_code =>
1795                                    l_alternate_routing_code
1796                           )
1797                         THEN
1798                                 RETURN FALSE;
1799                         END IF;
1800 
1801                         IF NOT Does_Res_Have_Same_Rtg
1802                            ( p_op_resource_tbl     => p_op_resource_tbl
1803                            , p_assembly_item_name  => l_assembly_item_name
1804                            , p_organization_code   => l_organization_code
1805                            , p_alternate_routing_code =>
1806                                    l_alternate_routing_code
1807                           )
1808                         THEN
1809                                 RETURN FALSE;
1810                         END IF;
1811 
1812                         IF NOT Does_SubRes_Have_Same_Rtg
1813                             ( p_sub_resource_tbl    => p_sub_resource_tbl
1814                             , p_assembly_item_name  => l_assembly_item_name
1815                             , p_organization_code   => l_organization_code
1816                             , p_alternate_routing_code =>
1817                                              l_alternate_routing_code
1818                             )
1819                         THEN
1820                                 RETURN FALSE;
1821                         END IF;
1822                      RETURN TRUE;
1823 
1824                 END IF;
1825 
1826                 --  If operation resource records exist
1827                 record_count := p_op_resource_tbl.COUNT;
1828                 IF record_count <> 0
1829                 THEN
1830                         l_assembly_item_name :=
1831                                 p_op_resource_tbl(1).assembly_item_name;
1832                         l_organization_code :=
1833                                 p_op_resource_tbl(1).organization_code;
1834                         x_assembly_item_name :=
1835                                 p_op_resource_tbl(1).assembly_item_name;
1836                         x_organization_code :=
1837                                 p_op_resource_tbl(1).organization_code;
1838 
1839                         l_alternate_routing_code :=
1840                              p_op_resource_tbl(1).alternate_routing_code;
1841                         x_alternate_routing_code :=
1842                              p_op_resource_tbl(1).alternate_routing_code;
1843 
1844                         IF NOT Does_Res_Have_Same_Rtg
1845                         ( p_op_resource_tbl     => p_op_resource_tbl
1846                         , p_assembly_item_name  => l_assembly_item_name
1847                         , p_organization_code   => l_organization_code
1848                         , p_alternate_routing_code =>
1849                                              l_alternate_routing_code
1850                         )
1851                         THEN
1852                                 RETURN FALSE;
1853                         END IF;
1854 
1855                         IF record_count > 1
1856                         THEN
1857                           IF NOT Does_Res_Have_Same_Rtg
1858                            ( p_op_resource_tbl     => p_op_resource_tbl
1859                            , p_assembly_item_name  => l_assembly_item_name
1860                            , p_organization_code   => l_organization_code
1861                            , p_alternate_routing_code =>
1862                                    l_alternate_routing_code
1863                           )
1864                           THEN
1865                                 RETURN FALSE;
1866                           END IF;
1867                         END IF;
1868 
1869                          RETURN TRUE;
1870 
1871                 END IF;
1872 
1873 
1874                 --  If operation Substitute resouce records exist
1875                 record_count := p_sub_resource_tbl.COUNT;
1876                 IF record_count <> 0
1877                 THEN
1878                         l_assembly_item_name :=
1879                                 p_sub_resource_tbl(1).assembly_item_name;
1880                         l_organization_code :=
1881                                 p_sub_resource_tbl(1).organization_code;
1882                         x_assembly_item_name :=
1883                                 p_sub_resource_tbl(1).assembly_item_name;
1884                         x_organization_code :=
1885                                 p_sub_resource_tbl(1).organization_code;
1886 
1887                         l_alternate_routing_code :=
1888                              p_sub_resource_tbl(1).alternate_routing_code;
1889                         x_alternate_routing_code :=
1890                              p_sub_resource_tbl(1).alternate_routing_code;
1891 
1892 
1893 
1894                         IF record_count > 1
1895                         THEN
1896                             IF NOT Does_SubRes_Have_Same_Rtg
1897                             ( p_sub_resource_tbl => p_sub_resource_tbl
1898                             , p_assembly_item_name  => l_assembly_item_name
1899                             , p_organization_code   => l_organization_code
1900                             , p_alternate_routing_code =>
1901                                              l_alternate_routing_code
1902                             )
1903                             THEN
1904                                 RETURN FALSE;
1905                             END IF;
1906                         END IF;
1907 
1908                      RETURN TRUE;
1909 
1910                 END IF;
1911 
1912                 --
1913                 -- If nothing to process then return TRUE.
1914                 --
1915                 RETURN TRUE;
1916 
1917         END Check_Records_In_Same_RTG;
1918 
1919 
1920         /********************************************************************
1921         * Procedure     : Process_Rtg
1922         * Parameters IN : Routing Header exposed column record
1923         *                 Routing revision exposed column table
1924         *                 Operation Exposed Column Table
1925         *                 Resource Exposed Column table
1926         *                 Substitute  Resource Exposed column table
1927         *                 Network Exposed column table
1928         * Parameters OUT: Routing Header exposed column record
1929         *                 Routing revision exposed column table
1930         *                 Operation Exposed Column Table
1931         *                 Resource Exposed Column table
1932         *                 Substitute  Resource Exposed column table
1933         *                 Network Exposed column table
1934         * Purpose       : This procedure is the driving procedure of the Rtg
1935         *                 business Obect. It will verify the integrity of the
1936         *                 business object and will call the private API which
1937         *                 further drive the business object to perform business
1938         *                 logic validations.
1939         *********************************************************************/
1940         PROCEDURE Process_Rtg
1941         ( p_bo_identifier           IN  VARCHAR2 := 'RTG'
1942         , p_api_version_number      IN  NUMBER := 1.0
1943         , p_init_msg_list           IN  BOOLEAN := FALSE
1944         , p_rtg_header_rec          IN  Bom_Rtg_Pub.Rtg_Header_Rec_Type
1945                                         :=Bom_Rtg_Pub.G_MISS_RTG_HEADER_REC
1946         , p_rtg_revision_tbl        IN  Bom_Rtg_Pub.Rtg_Revision_Tbl_Type
1947                                         :=Bom_Rtg_Pub.G_MISS_RTG_REVISION_TBL
1948         , p_operation_tbl           IN  Bom_Rtg_Pub.Operation_Tbl_Type
1949                                         :=  Bom_Rtg_Pub.G_MISS_OPERATION_TBL
1950         , p_op_resource_tbl         IN  Bom_Rtg_Pub.Op_Resource_Tbl_Type
1951                                         :=  Bom_Rtg_Pub.G_MISS_OP_RESOURCE_TBL
1952         , p_sub_resource_tbl        IN  Bom_Rtg_Pub.Sub_Resource_Tbl_Type
1953                                        :=  Bom_Rtg_Pub.G_MISS_SUB_RESOURCE_TBL
1954         , p_op_network_tbl          IN  Bom_Rtg_Pub.Op_Network_Tbl_Type
1955                                         :=  Bom_Rtg_Pub.G_MISS_OP_NETWORK_TBL
1956         , x_rtg_header_rec          IN OUT NOCOPY Bom_Rtg_Pub.Rtg_Header_Rec_Type
1957         , x_rtg_revision_tbl        IN OUT NOCOPY Bom_Rtg_Pub.Rtg_Revision_Tbl_Type
1958         , x_operation_tbl           IN OUT NOCOPY Bom_Rtg_Pub.Operation_Tbl_Type
1959         , x_op_resource_tbl         IN OUT NOCOPY Bom_Rtg_Pub.Op_Resource_Tbl_Type
1960         , x_sub_resource_tbl        IN OUT NOCOPY Bom_Rtg_Pub.Sub_Resource_Tbl_Type
1961         , x_op_network_tbl          IN OUT NOCOPY Bom_Rtg_Pub.Op_Network_Tbl_Type
1962         , x_return_status           IN OUT NOCOPY VARCHAR2
1963         , x_msg_count               IN OUT NOCOPY NUMBER
1964         , p_debug                   IN  VARCHAR2 := 'N'
1965         , p_output_dir              IN  VARCHAR2 := NULL
1966         , p_debug_filename          IN  VARCHAR2 := 'RTG_BO_debug.log'
1967         )
1968        IS
1969 
1970        G_EXC_SEV_QUIT_OBJECT       EXCEPTION;
1971        G_EXC_UNEXP_SKIP_OBJECT     EXCEPTION;
1972        l_Mesg_Token_Tbl            Error_Handler.Mesg_Token_Tbl_Type;
1973        l_other_message             VARCHAR2(50);
1974        l_Token_Tbl                 Error_Handler.Token_Tbl_Type;
1975        l_err_text                  VARCHAR2(2000);
1976        l_return_status             VARCHAR2(1);
1977        l_assembly_item_name        VARCHAR2(81);
1978        l_organization_code         VARCHAR2(3);
1979        l_organization_id           NUMBER;
1980        l_alternate_routing_code    VARCHAR2(10);
1981        l_rtg_header_rec            Bom_Rtg_Pub.Rtg_Header_Rec_Type;
1982        l_routing_revision_tbl      Bom_Rtg_Pub.Rtg_Revision_Tbl_Type ;
1983        l_operation_tbl             Bom_Rtg_Pub.Operation_Tbl_Type;
1984        l_op_resource_tbl           Bom_Rtg_Pub.Op_Resource_Tbl_Type ;
1985        l_sub_resource_tbl          Bom_Rtg_Pub.Sub_Resource_Tbl_Type;
1986        l_op_network_tbl            Bom_Rtg_Pub.Op_Network_Tbl_Type;
1987        l_Debug_flag                VARCHAR2(1) := p_debug;
1988 
1989        BEGIN
1990 
1991 --dbms_output.put_line('In Bom_Rtg_Globals . . .' ) ;
1992 --dbms_output.put_line('Set Business Object Idenfier in the System Information. . .' ) ;
1993                 --
1994                 -- Set Business Object Idenfier in the System Information
1995                 -- record.
1996                 --
1997 /* Following code takes care ot setting the desired value after the entry into the Process_Rtg Procedure instead of defaulting the parameters
1998                 IF p_bo_identifier IS NULL THEN
1999                   p_bo_identifier := 'RTG';
2000                 END IF;
2001                 IF p_rtg_header_rec IS NULL THEN
2002                   p_rtg_header_rec := Bom_Rtg_Pub.G_MISS_RTG_HEADER_REC;
2003                 END IF;
2004                 IF p_rtg_revision_tbl IS NULL THEN
2005                   p_rtg_revision_tbl := Bom_Rtg_Pub.G_MISS_RTG_REVISION_TBL;
2006                 END IF;
2007                 IF p_operation_tbl IS NULL THEN
2008                   p_operation_tbl := Bom_Rtg_Pub.G_MISS_OPERATION_TBL;
2009                 END IF;
2010                 IF p_op_resource_tbl IS NULL THEN
2011                   p_op_resource_tbl := Bom_Rtg_Pub.G_MISS_OP_RESOURCE_TBL;
2012                 END IF;
2013                 IF p_sub_resource_tbl IS NULL THEN
2014                   p_sub_resource_tbl := Bom_Rtg_Pub.G_MISS_SUB_RESOURCE_TBL;
2015                 END IF;
2016                 IF p_op_network_tbl IS NULL THEN
2017                   p_op_network_tbl := Bom_Rtg_Pub.G_MISS_OP_NETWORK_TBL;
2018                 END IF;
2019 */
2020                 BOM_Rtg_Globals.Set_Bo_Identifier
2021                             (p_bo_identifier => p_bo_identifier);
2022 
2023 --dbms_output.put_line('End of Setting Business Object Idenfier in the System Information. . .' ) ;
2024                 --
2025                 -- Initialize the message list if the user has set the
2026                 -- Init Message List parameter
2027                 --
2028                 IF p_init_msg_list
2029                 THEN
2030 --dbms_output.put_line('Error_Handler.Initialize. . .' ) ;
2031                         Error_Handler.Initialize;
2032                 END IF;
2033 
2034 
2035                 IF l_Debug_flag IS NULL THEN
2036                   l_Debug_flag := 'N';
2037                 END IF;
2038                 IF l_debug_flag = 'Y'
2039                 THEN
2040 
2041                      IF trim(p_output_dir) IS NULL OR
2042                         trim(p_output_dir) = ''
2043                      THEN
2044                          -- If debug is Y then out dir must be
2045                          -- specified
2046 
2047 
2048 --dbms_output.put_line('Debug Y ,then Add_Error_Token. . .' ) ;
2049 
2050                          Error_Handler.Add_Error_Token
2051                          (  p_Message_text       =>
2052                                    'Debug is set to Y so an output directory' ||
2053                                    ' must be specified. Debug will be turned' ||
2054                                    ' off since no directory is specified'
2055                           , p_Mesg_Token_Tbl     => l_mesg_token_tbl
2056                           , x_Mesg_Token_Tbl     => l_mesg_token_tbl
2057                           , p_Token_Tbl          => l_token_tbl
2058                          );
2059 
2060 --dbms_output.put_line('Debug Y ,then Log_Error. . .' ) ;
2061 
2062                          Bom_Rtg_Error_Handler.Log_Error
2063                          (  p_rtg_header_rec        => p_rtg_header_rec
2064                          ,  p_rtg_revision_tbl      => p_rtg_revision_tbl
2065                          ,  p_operation_tbl         => p_operation_tbl
2066                          ,  p_op_resource_tbl       => p_op_resource_tbl
2067                          ,  p_sub_resource_tbl      => p_sub_resource_tbl
2068                          ,  p_op_network_tbl        => p_op_network_tbl
2069                          ,  p_mesg_token_tbl        => l_mesg_token_tbl
2070                          ,  p_error_status          => 'W'
2071                          ,  p_error_scope           => NULL
2072                          ,  p_error_level           => Error_Handler.G_BO_LEVEL
2073                          , p_other_message          => NULL
2074                          , p_other_mesg_appid       => 'BOM'
2075                          , p_other_status           => NULL
2076                          , p_other_token_tbl        =>
2077                                      Error_Handler.G_MISS_TOKEN_TBL
2078                          , p_entity_index           => 1
2079                          ,  x_rtg_header_rec        => l_rtg_header_rec
2080                          ,  x_rtg_revision_tbl      => l_routing_revision_tbl
2081                          ,  x_operation_tbl         => l_operation_tbl
2082                          ,  x_op_resource_tbl       => l_op_resource_tbl
2083                          ,  x_sub_resource_tbl      => l_sub_resource_tbl
2084                          ,  x_op_network_tbl        => l_op_network_tbl
2085                          );
2086 
2087 
2088                          l_debug_flag := 'N' ;
2089 
2090                      END IF;
2091 
2092                      IF trim(p_debug_filename) IS NULL OR
2093                         trim(p_debug_filename) = ''
2094                      THEN
2095 
2096                          Error_Handler.Add_Error_Token
2097                          (  p_Message_text       =>
2098                                   ' Debug is set to Y so an output filename' ||
2099                                   ' must be specified. Debug will be turned' ||
2100                                   ' off since no filename is specified'
2101                           , p_Mesg_Token_Tbl     => l_mesg_token_tbl
2102                           , x_Mesg_Token_Tbl     => l_mesg_token_tbl
2103                           , p_Token_Tbl          => l_token_tbl
2104                          );
2105 
2106                          Bom_Rtg_Error_Handler.Log_Error
2107                           (  p_rtg_header_rec        => p_rtg_header_rec
2108                           ,  p_rtg_revision_tbl      => p_rtg_revision_tbl
2109                           ,  p_operation_tbl         => p_operation_tbl
2110                           ,  p_op_resource_tbl       => p_op_resource_tbl
2111                           ,  p_sub_resource_tbl      => p_sub_resource_tbl
2112                           ,  p_op_network_tbl        => p_op_network_tbl
2113                           ,  p_mesg_token_tbl        => l_mesg_token_tbl
2114                           ,  p_error_status          => 'W'
2115                           ,  p_error_level           => Error_Handler.G_BO_LEVEL
2116                           , p_error_scope            => NULL
2117                           , p_other_message          => NULL
2118                           , p_other_mesg_appid       => 'BOM'
2119                           , p_other_status           => NULL
2120                           , p_other_token_tbl        =>
2121                                      Error_Handler.G_MISS_TOKEN_TBL
2122                           , p_entity_index           => 1
2123 
2124                           ,  x_rtg_header_rec        => l_rtg_header_rec
2125                           ,  x_rtg_revision_tbl      => l_routing_revision_tbl
2126                           ,  x_operation_tbl         => l_operation_tbl
2127                           ,  x_op_resource_tbl       => l_op_resource_tbl
2128                           ,  x_sub_resource_tbl      => l_sub_resource_tbl
2129                           ,  x_op_network_tbl        => l_op_network_tbl
2130                          );
2131                               l_debug_flag := 'N';
2132 
2133                       END IF;
2134 
2135                       BOM_Rtg_Globals.Set_Debug(l_debug_flag);
2136 
2137                       IF l_debug_flag = 'Y'
2138                       THEN
2139                           Error_Handler.Open_Debug_Session
2140                           (  p_debug_filename     => p_debug_filename
2141                            , p_output_dir         => p_output_dir
2142                            , x_return_status      => l_return_status
2143                            , p_mesg_token_tbl     => l_mesg_token_tbl
2144                            , x_mesg_token_tbl     => l_mesg_token_tbl
2145                           );
2146 
2147                           IF l_return_status <> FND_API.G_RET_STS_SUCCESS
2148                           THEN
2149                                 BOM_Rtg_Globals.Set_Debug('N');
2150                           END IF;
2151                       END IF;
2152                 END IF;
2153 
2154 
2155 IF BOM_Rtg_Globals.get_debug = 'Y' THEN
2156     Error_Handler.Write_Debug('The Routing BO as passed ');
2157     Error_Handler.Write_Debug('-----------------------------------------------------') ;
2158     Error_Handler.Write_Debug('Header Rec - Assembly Item : ' || p_rtg_header_rec.assembly_item_name);
2159     Error_Handler.Write_Debug('Num of Routing Revisions   : ' || p_rtg_revision_tbl.COUNT);
2160     Error_Handler.Write_Debug('Num of Operations          : ' || p_operation_tbl.COUNT);
2161     Error_Handler.Write_Debug('Num of Resources           : ' || p_op_resource_tbl.COUNT);
2162     Error_Handler.Write_Debug('Num of Substitue Resources : ' || p_sub_resource_tbl.COUNT);
2163     Error_Handler.Write_Debug('Num of Operation Network   : ' || p_op_network_tbl.COUNT);
2164     Error_Handler.Write_Debug('-----------------------------------------------------') ;
2165 END IF;
2166 /* Following code is for Patchset G because we are suppressing the OSFM support
2167   as the OSFM team's request. This will be added in Patchset H */
2168   --for OSFM import routings
2169   --IF p_rtg_header_rec.cfm_routing_flag = 3 THEN
2170   --   l_other_message := 'BOM_RBO_NO_OSFM_RTG_SUPPORT';
2171   --   RAISE G_EXC_SEV_QUIT_OBJECT;
2172   --END IF;
2173 
2174                 --
2175                 -- Verify if all the entity record(s) belong to the same
2176                 -- business object
2177                 --
2178 --dbms_output.put_line('Verify if all the entity record(s) belong to the same bo. . .' ) ;
2179 
2180                 IF NOT Check_Records_In_Same_RTG
2181                    (  p_rtg_header_rec          => p_rtg_header_rec
2182                     , p_rtg_revision_tbl        => p_rtg_revision_tbl
2183                     , p_operation_tbl           => p_operation_tbl
2184                     , p_op_resource_tbl         => p_op_resource_tbl
2185                     , p_sub_resource_tbl        => p_sub_resource_tbl
2186                     , p_op_network_tbl          => p_op_network_tbl
2187                     , x_assembly_item_name      => l_assembly_item_name
2188                     , x_organization_code       => l_organization_code
2189                     , x_alternate_routing_code  => l_alternate_routing_code
2190                     )
2191                 THEN
2192                         l_other_message := 'BOM_MUST_BE_IN_SAME_RTG';
2193                         RAISE G_EXC_SEV_QUIT_OBJECT;
2194                 END IF;
2195 
2196                 IF (l_assembly_item_name IS NULL OR
2197                     l_assembly_item_name = FND_API.G_MISS_CHAR)
2198                     OR
2199                     (l_organization_code IS NULL OR
2200                      l_organization_code = FND_API.G_MISS_CHAR)
2201                 THEN
2202                         l_other_message := 'BOM_ASSY_OR_ORG_MISSING';
2203                         RAISE G_EXC_SEV_QUIT_OBJECT;
2204                 END IF;
2205 
2206 
2207                 l_organization_id := BOM_Rtg_Val_To_Id.Organization
2208                                      (  p_organization => l_organization_code
2209                                       , x_err_text => l_err_text
2210                                      );
2211 
2212                 IF l_organization_id IS NULL
2213                 THEN
2214                         l_other_message := 'BOM_ORG_INVALID';
2215                         l_token_tbl(1).token_name := 'ORG_CODE';
2216                         l_token_tbl(1).token_value := l_organization_code;
2217                         RAISE G_EXC_SEV_QUIT_OBJECT;
2218 
2219                 ELSIF l_organization_id = FND_API.G_MISS_NUM
2220                 THEN
2221                         l_other_message := 'BOM_UNEXP_ORG_INVALID';
2222                         RAISE G_EXC_UNEXP_SKIP_OBJECT;
2223                 END IF;
2224 
2225 
2226                 --
2227                 -- Set Organization Id in the System Information record.
2228                 --
2229                 BOM_Rtg_Globals.Set_Org_Id( p_org_id => l_organization_id);
2230 
2231 		--
2232 		-- Set Application Id in the appication context and set the
2233 		-- fine-grained security policy on bom_alternate_designators
2234 		-- table. This is currently applicable only if the application
2235 		-- calling this BO is EAM
2236 		--
2237 		Bom_Set_Context.set_application_id;
2238 
2239 		--
2240                 -- Call the Private API for performing further business
2241                 -- rules validation
2242                 --
2243 --dbms_output.put_line('Call the Private API Process_Rtg. . .' ) ;
2244 
2245                 Bom_Rtg_Pvt.Process_Rtg
2246                 (   p_api_version_number     =>  p_api_version_number
2247                 ,   p_validation_level       =>  FND_API.G_VALID_LEVEL_FULL
2248                 ,   x_return_status          =>  l_return_status
2249                 ,   x_msg_count              =>  x_msg_count
2250                 ,   p_rtg_header_rec         =>  p_rtg_header_rec
2251                 ,   p_rtg_revision_tbl       =>  p_rtg_revision_tbl
2252                 ,   p_operation_tbl          =>  p_operation_tbl
2253                 ,   p_op_resource_tbl        =>  p_op_resource_tbl
2254                 ,   p_sub_resource_tbl       =>  p_sub_resource_tbl
2255                 ,   p_op_network_tbl         =>  p_op_network_tbl
2256                 ,   x_rtg_header_rec         =>  x_rtg_header_rec
2257                 ,   x_rtg_revision_tbl       =>  x_rtg_revision_tbl
2258                 ,   x_operation_tbl          =>  x_operation_tbl
2259                 ,   x_op_resource_tbl        =>  x_op_resource_tbl
2260                 ,   x_sub_resource_tbl       =>  x_sub_resource_tbl
2261                 ,   x_op_network_tbl         =>  x_op_network_tbl
2262                 );
2263 
2264                 BOM_Rtg_Globals.Set_Org_Id( p_org_id    => NULL);
2265                 BOM_Rtg_Globals.Set_Eco_Name( p_eco_name => NULL);
2266 
2267                 IF l_return_status <> 'S'
2268                 THEN
2269                     -- Call Error Handler
2270                     l_token_tbl(1).token_name := 'ASSEMBLY_ITEM_NAME';
2271                     l_token_tbl(1).token_value := l_assembly_item_name;
2272                     l_token_tbl(2).token_name := 'ORGANIZATION_CODE';
2273                     l_token_tbl(2).token_value := l_organization_code;
2274 
2275                     Bom_Rtg_Error_Handler.Log_Error
2276                     (
2277                       p_rtg_header_rec      => p_rtg_header_rec
2278                     , p_rtg_revision_tbl    => p_rtg_revision_tbl
2279                     , p_operation_tbl       => p_operation_tbl
2280                     , p_op_resource_tbl     => p_op_resource_tbl
2281                     , p_sub_resource_tbl    => p_sub_resource_tbl
2282                     , p_op_network_tbl      => p_op_network_tbl
2283                     , p_Mesg_Token_tbl      => Error_Handler.G_MISS_MESG_TOKEN_TBL
2284                     , p_error_status        => l_return_status
2285                     , p_error_scope         => Error_Handler.G_SCOPE_ALL
2286                     , p_error_level         => Error_Handler.G_BO_LEVEL
2287                     , p_other_message       => 'BOM_ERROR_BUSINESS_OBJECT'
2288                     , p_other_status        => l_return_status
2289                     , p_other_token_tbl     => l_token_tbl
2290                     , p_other_mesg_appid    => 'BOM'
2291                     , p_entity_index        => 1
2292                     , x_rtg_header_rec      => l_rtg_header_rec
2293                     , x_rtg_revision_tbl    => l_routing_revision_tbl
2294                     , x_operation_tbl       => l_operation_tbl
2295                     , x_op_resource_tbl     => l_op_resource_tbl
2296                     , x_sub_resource_tbl    => l_sub_resource_tbl
2297                     , x_op_network_tbl      => l_op_network_tbl
2298                     );
2299 
2300                 END IF;
2301 /*
2302                 IF l_return_status <> 'S'
2303                 THEN
2304                     -- Call Error Handler
2305                     l_token_tbl(1).token_name := 'ASSEMBLY_ITEM_NAME';
2306                     l_token_tbl(1).token_value := l_assembly_item_name;
2307                     l_token_tbl(2).token_name := 'ORGANIZATION_CODE';
2308                     l_token_tbl(2).token_value := l_organization_code;
2309 
2310                     Bom_Rtg_Error_Handler.Log_Error
2311                     (
2312                       p_rtg_header_rec      =>
2313                                        Bom_Rtg_Pub.G_MISS_RTG_HEADER_REC
2314                     , p_rtg_revision_tbl    =>
2315                                        Bom_Rtg_Pub.G_MISS_RTG_REVISION_TBL
2316                     , p_operation_tbl       =>
2317                                        Bom_Rtg_Pub.G_MISS_OPERATION_TBL
2318                     , p_op_resource_tbl     =>
2319                                        Bom_Rtg_Pub.G_MISS_OP_RESOURCE_TBL
2320                     , p_sub_resource_tbl    =>
2321                                        Bom_Rtg_Pub.G_MISS_SUB_RESOURCE_TBL
2322                     , p_op_network_tbl      =>
2323                                        Bom_Rtg_Pub.G_MISS_OP_NETWORK_TBL
2324                     , p_Mesg_Token_tbl      => Error_Handler.G_MISS_MESG_TOKEN_TBL
2325                     , p_error_status        => l_return_status
2326                     , p_error_scope         => Error_Handler.G_SCOPE_ALL
2327                     , p_error_level         => Error_Handler.G_BO_LEVEL
2328                     , p_other_message       => 'BOM_ERROR_BUSINESS_OBJECT'
2329                     , p_other_status        => l_return_status
2330                     , p_other_token_tbl     => l_token_tbl
2331                     , p_other_mesg_appid    => 'BOM'
2332                     , p_entity_index        => 1
2333                     , x_rtg_header_rec      => l_rtg_header_rec
2334                     , x_rtg_revision_tbl    => l_rtg_revision_tbl
2335                     , x_operation_tbl       => l_operation_tbl
2336                     , x_op_resource_tbl     => l_op_resource_tbl
2337                     , x_sub_resource_tbl    => l_sub_resource_tbl
2338                     , x_op_network_tbl      => l_op_network_tbl
2339                     );
2340                 END IF;
2341 */
2342                 x_return_status := l_return_status;
2343                 x_msg_count := Error_Handler.Get_Message_Count;
2344                 IF Bom_Rtg_Globals.Get_Debug = 'Y'
2345                 THEN
2346                         Error_Handler.Close_Debug_Session;
2347                 END IF;
2348 
2349        EXCEPTION
2350        WHEN G_EXC_SEV_QUIT_OBJECT THEN
2351 
2352                 -- Call Error Handler
2353                 Bom_Rtg_Error_Handler.Log_Error
2354                 ( p_rtg_header_rec        => p_rtg_header_rec
2355                 , p_rtg_revision_tbl      => p_rtg_revision_tbl
2356                 , p_operation_tbl         => p_operation_tbl
2357                 , p_op_resource_tbl       => p_op_resource_tbl
2358                 , p_sub_resource_tbl      => p_sub_resource_tbl
2359                 , p_op_network_tbl        => p_op_network_tbl
2360                 , p_Mesg_Token_Tbl        => l_Mesg_Token_Tbl
2361                 , p_error_status          => Error_Handler.G_STATUS_ERROR
2362                 , p_error_level           => Error_Handler.G_BO_LEVEL
2363                 , p_error_scope           => Error_Handler.G_SCOPE_ALL
2364                 , p_other_status          => Error_Handler.G_STATUS_NOT_PICKED
2365                 , p_other_message         => l_other_message
2366                 , p_other_token_tbl       => l_token_tbl
2367                 , p_other_mesg_appid      => 'BOM'
2368                 , p_entity_index          => 1
2369                 , x_rtg_header_rec        => l_rtg_header_rec
2370                 , x_rtg_revision_tbl      => l_routing_revision_tbl
2371                 , x_operation_tbl         => l_operation_tbl
2372                 , x_op_resource_tbl       => l_op_resource_tbl
2373                 , x_sub_resource_tbl      => l_sub_resource_tbl
2374                 , x_op_network_tbl        => l_op_network_tbl
2375                 );
2376 
2377                 x_return_status := Error_Handler.G_STATUS_ERROR;
2378                 x_msg_count := Error_Handler.Get_Message_Count;
2379                 IF Bom_Rtg_Globals.Get_Debug = 'Y'
2380                 THEN
2381                         Error_Handler.Close_Debug_Session;
2382                 END IF;
2383 
2384         WHEN G_EXC_UNEXP_SKIP_OBJECT THEN
2385 
2386                 -- Call Error Handler
2387                 Bom_Rtg_Error_Handler.Log_Error
2388                 ( p_rtg_header_rec        => p_rtg_header_rec
2389                 , p_rtg_revision_tbl      => p_rtg_revision_tbl
2390                 , p_operation_tbl         => p_operation_tbl
2391                 , p_op_resource_tbl       => p_op_resource_tbl
2392                 , p_sub_resource_tbl      => p_sub_resource_tbl
2393                 , p_op_network_tbl        => p_op_network_tbl
2394                 , p_Mesg_Token_Tbl        => l_Mesg_Token_Tbl
2395                 , p_error_status          => Error_Handler.G_STATUS_UNEXPECTED
2396                 , p_error_scope           => NULL
2397                 , p_error_level           => Error_Handler.G_BO_LEVEL
2398                 , p_other_status          => Error_Handler.G_STATUS_NOT_PICKED
2399                 , p_other_message         => l_other_message
2400                 , p_other_mesg_appid      => 'BOM'
2401                 , p_other_token_tbl       => l_token_tbl
2402                 , p_entity_index          => 1
2403                 , x_rtg_header_rec        => l_rtg_header_rec
2404                 , x_rtg_revision_tbl      => l_routing_revision_tbl
2405                 , x_operation_tbl         => l_operation_tbl
2406                 , x_op_resource_tbl       => l_op_resource_tbl
2407                 , x_sub_resource_tbl      => l_sub_resource_tbl
2408                 , x_op_network_tbl        => l_op_network_tbl
2409                 );
2410 
2411                 x_return_status := Error_Handler.G_STATUS_UNEXPECTED;
2412                 x_msg_count := Error_Handler.Get_Message_Count;
2413                 IF Bom_Rtg_Globals.Get_Debug = 'Y'
2414                 THEN
2415                         Error_Handler.Close_Debug_Session;
2416                 END IF;
2417 
2418         END Process_Rtg;
2419 
2420 END Bom_Rtg_Pub ;