DBA Data[Home] [Help]

PACKAGE BODY: APPS.B_STD_OP_PKG

Source


1 PACKAGE BODY B_STD_OP_PKG as
2 /* $Header: BOMPISOB.pls 120.3.12010000.3 2008/11/13 10:05:41 sisankar ship $ */
3 
4 PROCEDURE Insert_Row(X_Rowid                        IN OUT NOCOPY VARCHAR2,
5                      X_Standard_Operation_Id        IN OUT NOCOPY NUMBER,
6                      X_Operation_Code                      VARCHAR2,
7 	  	                 X_Operation_Type                      NUMBER,
8 		                   X_Line_Id	                   	        NUMBER DEFAULT NULL,
9  	 	                 X_Sequence_Num			                     NUMBER DEFAULT NULL,
10                      X_Organization_Id                     NUMBER,
11                      X_Department_Id                       NUMBER,
12                      X_Last_Update_Date                    DATE,
13                      X_Last_Updated_By                     NUMBER,
14                      X_Creation_Date                       DATE,
15                      X_Created_By                          NUMBER,
16                      X_Last_Update_Login                   NUMBER DEFAULT NULL,
17                      X_Minimum_Transfer_Quantity           NUMBER DEFAULT NULL,
18                      X_Count_Point_Type                    NUMBER DEFAULT NULL,
19                      X_Operation_Description               VARCHAR2 DEFAULT NULL,
20                      X_Option_Dependent_Flag               NUMBER DEFAULT NULL,
21                      X_Attribute_Category                  VARCHAR2 DEFAULT NULL,
22                      X_Attribute1                          VARCHAR2 DEFAULT NULL,
23                      X_Attribute2                          VARCHAR2 DEFAULT NULL,
24                      X_Attribute3                          VARCHAR2 DEFAULT NULL,
25                      X_Attribute4                          VARCHAR2 DEFAULT NULL,
26                      X_Attribute5                          VARCHAR2 DEFAULT NULL,
27                      X_Attribute6                          VARCHAR2 DEFAULT NULL,
28                      X_Attribute7                          VARCHAR2 DEFAULT NULL,
29                      X_Attribute8                          VARCHAR2 DEFAULT NULL,
30                      X_Attribute9                          VARCHAR2 DEFAULT NULL,
31                      X_Attribute10                         VARCHAR2 DEFAULT NULL,
32                      X_Attribute11                         VARCHAR2 DEFAULT NULL,
33                      X_Attribute12                         VARCHAR2 DEFAULT NULL,
34                      X_Attribute13                         VARCHAR2 DEFAULT NULL,
35                      X_Attribute14                         VARCHAR2 DEFAULT NULL,
36                      X_Attribute15                         VARCHAR2 DEFAULT NULL,
37                      X_Backflush_Flag                      NUMBER DEFAULT NULL,
38                      X_Wms_Task_Type                       NUMBER DEFAULT NULL,
39                      X_Yield                               NUMBER DEFAULT NULL,
40                      X_Operation_Yield_Enabled             NUMBER DEFAULT NULL,
41                      X_Shutdown_Type                       VARCHAR2 DEFAULT NULL
42 
43  ) IS
44    CURSOR C IS SELECT rowid FROM BOM_STANDARD_OPERATIONS
45              WHERE standard_operation_id = X_Standard_Operation_Id;
46    CURSOR C2 IS SELECT bom_standard_operations_s.nextval FROM sys.dual;
47 BEGIN
48    if (X_Standard_Operation_Id is NULL) then
49      OPEN C2;
50      FETCH C2 INTO X_Standard_Operation_Id;
51      CLOSE C2;
52    end if;
53    INSERT INTO BOM_STANDARD_OPERATIONS(
54           standard_operation_id,
55           operation_code,
56           operation_type,
57           line_id,
58           sequence_num,
59           organization_id,
60           department_id,
61           last_update_date,
62           last_updated_by,
63           creation_date,
64           created_by,
65           last_update_login,
66           minimum_transfer_quantity,
67           count_point_type,
68           operation_description,
69           option_dependent_flag,
70           attribute_category,
71           attribute1,
72           attribute2,
73           attribute3,
74           attribute4,
75           attribute5,
76           attribute6,
77           attribute7,
78           attribute8,
79           attribute9,
80           attribute10,
81           attribute11,
82           attribute12,
83           attribute13,
84           attribute14,
85           attribute15,
86           backflush_flag,
87 										wms_task_type,
88 										yield,
89 										operation_yield_enabled,
90           shutdown_type
91          ) VALUES (
92 	         X_Standard_Operation_Id,
93           X_Operation_Code,
94 	         X_Operation_Type,
95           X_Line_Id,
96  	        X_Sequence_Num,
97           X_Organization_Id,
98           X_Department_Id,
99           X_Last_Update_Date,
100           X_Last_Updated_By,
101           X_Creation_Date,
102           X_Created_By,
103           X_Last_Update_Login,
104           X_Minimum_Transfer_Quantity,
105           X_Count_Point_Type,
106           X_Operation_Description,
107           X_Option_Dependent_Flag,
108           X_Attribute_Category,
109           X_Attribute1,
110           X_Attribute2,
111           X_Attribute3,
112           X_Attribute4,
113           X_Attribute5,
114           X_Attribute6,
115           X_Attribute7,
116           X_Attribute8,
117           X_Attribute9,
118           X_Attribute10,
119           X_Attribute11,
120           X_Attribute12,
121           X_Attribute13,
122           X_Attribute14,
123           X_Attribute15,
124           X_Backflush_Flag,
125 										X_Wms_Task_Type,
126 										X_Yield,
127 										X_Operation_Yield_Enabled,
128           X_Shutdown_Type
129   );
130 
131   OPEN C;
132   FETCH C INTO X_Rowid;
133   if (C%NOTFOUND) then
134     CLOSE C;
135     RAISE NO_DATA_FOUND;
136   end if;
137   CLOSE C;
138 END Insert_Row;
139 
140 PROCEDURE Insert_Row(X_Rowid                        IN OUT NOCOPY VARCHAR2,
141                      X_Standard_Operation_Id        IN OUT NOCOPY NUMBER,
142                      X_Operation_Code                      VARCHAR2,
143 																					X_Operation_Type                      NUMBER,
144 																			  X_Line_Id                   	         NUMBER DEFAULT NULL,
145 																					X_Sequence_Num			                     NUMBER DEFAULT NULL,
146                      X_Organization_Id                     NUMBER,
147                      X_Department_Id                       NUMBER,
148                      X_Last_Update_Date                    DATE,
149                      X_Last_Updated_By                     NUMBER,
150                      X_Creation_Date                       DATE,
151                      X_Created_By                          NUMBER,
152                      X_Last_Update_Login                   NUMBER DEFAULT NULL,
153                      X_Minimum_Transfer_Quantity           NUMBER DEFAULT NULL,
154                      X_Count_Point_Type                    NUMBER DEFAULT NULL,
155                      X_Operation_Description               VARCHAR2 DEFAULT NULL,
156                      X_Option_Dependent_Flag               NUMBER DEFAULT NULL,
157                      X_Attribute_Category                  VARCHAR2 DEFAULT NULL,
158                      X_Attribute1                          VARCHAR2 DEFAULT NULL,
159                      X_Attribute2                          VARCHAR2 DEFAULT NULL,
160                      X_Attribute3                          VARCHAR2 DEFAULT NULL,
161                      X_Attribute4                          VARCHAR2 DEFAULT NULL,
162                      X_Attribute5                          VARCHAR2 DEFAULT NULL,
163                      X_Attribute6                          VARCHAR2 DEFAULT NULL,
164                      X_Attribute7                          VARCHAR2 DEFAULT NULL,
165                      X_Attribute8                          VARCHAR2 DEFAULT NULL,
166                      X_Attribute9                          VARCHAR2 DEFAULT NULL,
167                      X_Attribute10                         VARCHAR2 DEFAULT NULL,
168                      X_Attribute11                         VARCHAR2 DEFAULT NULL,
169                      X_Attribute12                         VARCHAR2 DEFAULT NULL,
170                      X_Attribute13                         VARCHAR2 DEFAULT NULL,
171                      X_Attribute14                         VARCHAR2 DEFAULT NULL,
172                      X_Attribute15                         VARCHAR2 DEFAULT NULL,
173                      X_Backflush_Flag                      NUMBER DEFAULT NULL,
174                      X_Wms_Task_Type                       NUMBER DEFAULT NULL,
175                      X_Yield                               NUMBER DEFAULT NULL,
176                      X_Operation_Yield_Enabled             NUMBER DEFAULT NULL,
177                      X_Shutdown_Type                       VARCHAR2 DEFAULT NULL,
178                      X_Default_SubInventory                VARCHAR2,
179                      X_Default_Locator_Id                  NUMBER,
180                      X_Value_added			                      VARCHAR2 DEFAULT NULL,
181                      X_Critical_To_Quality		               VARCHAR2 DEFAULT NULL
182  ) IS
183 BEGIN
184 	Insert_Row(
185 		   X_Rowid				   => X_Rowid,
186 		   X_Operation_type			   => X_Operation_type,
187 		   X_Line_Id				   => X_Line_Id,
188 		   X_Sequence_Num			   => X_Sequence_Num,
189 		   X_Standard_Operation_Id		   => X_Standard_Operation_Id,
190 		   X_Operation_Code			   => X_Operation_Code,
191 		   X_Organization_Id			   => X_Organization_Id,
192 		   X_Department_Id			   => X_Department_Id,
193 		   X_Last_Update_Date			   => X_Last_Update_Date,
194 		   X_Last_Updated_By			   => X_Last_Updated_By,
195 		   X_Creation_Date			   => X_Creation_Date,
196 		   X_Created_By				   => X_Created_By,
197 		   X_Last_Update_Login			   => X_Last_Update_Login,
198 		   X_Minimum_Transfer_Quantity		   => X_Minimum_Transfer_Quantity,
199 		   X_Count_Point_Type			   => X_Count_Point_Type,
200 		   X_Operation_Description		   => X_Operation_Description,
201 		   X_Option_Dependent_Flag		   => X_Option_Dependent_Flag,
202 		   X_Attribute_Category			   => X_Attribute_Category,
203 		   X_Attribute1				   => X_Attribute1,
204 		   X_Attribute2				   => X_Attribute2,
205 		   X_Attribute3				   => X_Attribute3,
206 		   X_Attribute4				   => X_Attribute4,
207 		   X_Attribute5				   => X_Attribute5,
208 		   X_Attribute6				   => X_Attribute6,
209 		   X_Attribute7				   => X_Attribute7,
210 		   X_Attribute8				   => X_Attribute8,
211 		   X_Attribute9				   => X_Attribute9,
212 		   X_Attribute10			   => X_Attribute10,
213 		   X_Attribute11			   => X_Attribute11,
214 		   X_Attribute12			   => X_Attribute12,
215 		   X_Attribute13			   => X_Attribute13,
216 		   X_Attribute14			   => X_Attribute14,
217 		   X_Attribute15			   => X_Attribute15,
218 		   X_Backflush_Flag			   => X_Backflush_Flag,
219 		   X_Wms_Task_Type			   => X_Wms_Task_Type,
220 		   X_Yield	     			   => X_Yield,
221 		   X_Operation_Yield_Enabled		   => X_Operation_Yield_Enabled,
222 		   X_Shutdown_Type			   => X_Shutdown_Type,
223 		   X_Default_Subinventory		   => X_Default_Subinventory,
224 		   X_Default_locator_id			   => X_Default_locator_id,
225 		   X_value_added			   => X_value_added,
226 		   X_Critical_To_Quality		   => X_Critical_To_Quality,
227 		   X_Lowest_Acceptable_Yield		   => NULL,
228 		   X_Use_Org_Settings			   => NULL,
229 		   X_Queue_Mandatory_Flag		   => NULL,
230 		   X_Run_Mandatory_Flag			   => NULL,
231 		   X_To_Move_Mandatory_Flag		   => NULL,
232 		   X_Show_Next_Op_By_Default		   => NULL,
233 		   X_Show_Scrap_Code			   => NULL,
234 	    X_Show_Lot_Attrib			   => NULL,
235 		   X_Track_Multiple_Res_Usage_Dts	   => NULL);
236 END Insert_Row;
237 
238 PROCEDURE Insert_Row(X_Rowid                        IN OUT NOCOPY VARCHAR2,
239                      X_Standard_Operation_Id        IN OUT NOCOPY NUMBER,
240                      X_Operation_Code                      VARCHAR2,
241 																					X_Operation_Type                      NUMBER,
242 																			  X_Line_Id	                   	        NUMBER DEFAULT NULL,
243 																					X_Sequence_Num			                     NUMBER DEFAULT NULL,
244                      X_Organization_Id                     NUMBER,
245                      X_Department_Id                       NUMBER,
246                      X_Last_Update_Date                    DATE,
247                      X_Last_Updated_By                     NUMBER,
248                      X_Creation_Date                       DATE,
249                      X_Created_By                          NUMBER,
250                      X_Last_Update_Login                   NUMBER DEFAULT NULL,
251                      X_Minimum_Transfer_Quantity           NUMBER DEFAULT NULL,
252                      X_Count_Point_Type                    NUMBER DEFAULT NULL,
253                      X_Operation_Description               VARCHAR2 DEFAULT NULL,
254                      X_Option_Dependent_Flag               NUMBER DEFAULT NULL,
255                      X_Attribute_Category                  VARCHAR2 DEFAULT NULL,
256                      X_Attribute1                          VARCHAR2 DEFAULT NULL,
257                      X_Attribute2                          VARCHAR2 DEFAULT NULL,
258                      X_Attribute3                          VARCHAR2 DEFAULT NULL,
259                      X_Attribute4                          VARCHAR2 DEFAULT NULL,
260                      X_Attribute5                          VARCHAR2 DEFAULT NULL,
261                      X_Attribute6                          VARCHAR2 DEFAULT NULL,
262                      X_Attribute7                          VARCHAR2 DEFAULT NULL,
263                      X_Attribute8                          VARCHAR2 DEFAULT NULL,
264                      X_Attribute9                          VARCHAR2 DEFAULT NULL,
265                      X_Attribute10                         VARCHAR2 DEFAULT NULL,
266                      X_Attribute11                         VARCHAR2 DEFAULT NULL,
267                      X_Attribute12                         VARCHAR2 DEFAULT NULL,
268                      X_Attribute13                         VARCHAR2 DEFAULT NULL,
269                      X_Attribute14                         VARCHAR2 DEFAULT NULL,
270                      X_Attribute15                         VARCHAR2 DEFAULT NULL,
271                      X_Backflush_Flag                      NUMBER DEFAULT NULL,
272                      X_Wms_Task_Type                       NUMBER DEFAULT NULL,
273                      X_Yield                               NUMBER DEFAULT NULL,
274                      X_Operation_Yield_Enabled             NUMBER DEFAULT NULL,
275                      X_Shutdown_Type                       VARCHAR2 DEFAULT NULL,
276                      X_Default_SubInventory                VARCHAR2,
277                      X_Default_Locator_Id                  NUMBER,
278                      X_Value_added			   VARCHAR2 DEFAULT NULL,
279                      X_Critical_To_Quality		   VARCHAR2 DEFAULT NULL,
280 																					--OSFM-MES:Following new arguments are added
281 																					X_LOWEST_ACCEPTABLE_YIELD              NUMBER,
282 																					X_USE_ORG_SETTINGS                     NUMBER,
283 																					X_QUEUE_MANDATORY_FLAG                 NUMBER,
284 																					X_RUN_MANDATORY_FLAG                   NUMBER,
285 																					X_TO_MOVE_MANDATORY_FLAG               NUMBER,
286 																					X_SHOW_NEXT_OP_BY_DEFAULT              NUMBER,
287 																					X_SHOW_SCRAP_CODE                      NUMBER,
288 																					X_SHOW_LOT_ATTRIB                      NUMBER,
289 																					X_TRACK_MULTIPLE_RES_USAGE_DTS       NUMBER,
290 																					-- Added for labor skills validation project
291 																					X_CHECK_SKILL                        NUMBER DEFAULT NULL
292  ) IS
293    CURSOR C IS SELECT rowid FROM BOM_STANDARD_OPERATIONS
294              WHERE standard_operation_id = X_Standard_Operation_Id;
295    CURSOR C2 IS SELECT bom_standard_operations_s.nextval FROM sys.dual;
296 BEGIN
297    if (X_Standard_Operation_Id is NULL) then
298      OPEN C2;
299      FETCH C2 INTO X_Standard_Operation_Id;
300      CLOSE C2;
301    end if;
302    INSERT INTO BOM_STANDARD_OPERATIONS(
303           standard_operation_id,
304           operation_code,
305           operation_type,
306           line_id,
307           sequence_num,
308           organization_id,
309           department_id,
310           last_update_date,
311           last_updated_by,
312           creation_date,
313           created_by,
314           last_update_login,
315           minimum_transfer_quantity,
316           count_point_type,
317           operation_description,
318           option_dependent_flag,
319           attribute_category,
320           attribute1,
321           attribute2,
322           attribute3,
323           attribute4,
324           attribute5,
325           attribute6,
326           attribute7,
327           attribute8,
328           attribute9,
329           attribute10,
330           attribute11,
331           attribute12,
332           attribute13,
333           attribute14,
334           attribute15,
335           backflush_flag,
336 										wms_task_type,
337 										yield,
338 										operation_yield_enabled,
339           shutdown_type,
340           default_subinventory,
341           default_locator_id,
342           value_added,
343           critical_to_quality,
344 										--OSFM-MES:Following new Colunbs are added
345 										LOWEST_ACCEPTABLE_YIELD,
346 										USE_ORG_SETTINGS,
347 										QUEUE_MANDATORY_FLAG,
348 										RUN_MANDATORY_FLAG ,
349 										TO_MOVE_MANDATORY_FLAG ,
350 										SHOW_NEXT_OP_BY_DEFAULT,
351 										SHOW_SCRAP_CODE ,
352 										SHOW_LOT_ATTRIB ,
353 										TRACK_MULTIPLE_RES_USAGE_DATES,
354 										-- Added for labor skills validation project
355 										CHECK_SKILL
356          ) VALUES (
357 	         X_Standard_Operation_Id,
358           X_Operation_Code,
359 	         X_Operation_Type,
360           X_Line_Id,
361  	        X_Sequence_Num,
362           X_Organization_Id,
363           X_Department_Id,
364           X_Last_Update_Date,
365           X_Last_Updated_By,
366           X_Creation_Date,
367           X_Created_By,
368           X_Last_Update_Login,
369           X_Minimum_Transfer_Quantity,
370           X_Count_Point_Type,
371           X_Operation_Description,
372           X_Option_Dependent_Flag,
373           X_Attribute_Category,
374           X_Attribute1,
375           X_Attribute2,
376           X_Attribute3,
377           X_Attribute4,
378           X_Attribute5,
379           X_Attribute6,
380           X_Attribute7,
381           X_Attribute8,
382           X_Attribute9,
383           X_Attribute10,
384           X_Attribute11,
385           X_Attribute12,
386           X_Attribute13,
387           X_Attribute14,
388           X_Attribute15,
389           X_Backflush_Flag,
390 										X_Wms_Task_Type,
391 										X_Yield,
392 										X_Operation_Yield_Enabled,
393           X_Shutdown_Type,
394           X_Default_SubInventory,
395           X_Default_Locator_Id,
396           X_Value_added,
397           X_Critical_to_Quality,
398 										--OSFM-MES:Following new Colunbs are added
399 										X_LOWEST_ACCEPTABLE_YIELD,
400 										X_USE_ORG_SETTINGS,
401 										X_QUEUE_MANDATORY_FLAG,
402 										X_RUN_MANDATORY_FLAG ,
403 										X_TO_MOVE_MANDATORY_FLAG ,
404 										X_SHOW_NEXT_OP_BY_DEFAULT,
405 										X_SHOW_SCRAP_CODE ,
406 										X_SHOW_LOT_ATTRIB ,
407 										X_TRACK_MULTIPLE_RES_USAGE_DTS,
408 										-- Added for labor skills validation project
409 										X_CHECK_SKILL
410   );
411 
412   OPEN C;
413   FETCH C INTO X_Rowid;
414   if (C%NOTFOUND) then
415     CLOSE C;
416     RAISE NO_DATA_FOUND;
417   end if;
418   CLOSE C;
419 END Insert_Row;
420 
421 
422 PROCEDURE Lock_Row(X_Rowid                                 VARCHAR2,
423                    X_Standard_Operation_Id                 NUMBER,
424                    X_Operation_Code                        VARCHAR2,
425 	  	               X_Operation_Type                        NUMBER,
426 		                 X_Line_Id	                   	          NUMBER DEFAULT NULL,
427  	 	               X_Sequence_Num			                       NUMBER DEFAULT NULL,
428                    X_Organization_Id                       NUMBER,
429                    X_Department_Id                         NUMBER,
430                    X_Minimum_Transfer_Quantity             NUMBER DEFAULT NULL,
431                    X_Count_Point_Type                      NUMBER DEFAULT NULL,
432                    X_Operation_Description                 VARCHAR2 DEFAULT NULL,
433                    X_Option_Dependent_Flag                 NUMBER DEFAULT NULL,
434                    X_Attribute_Category                    VARCHAR2 DEFAULT NULL,
435                    X_Attribute1                            VARCHAR2 DEFAULT NULL,
436                    X_Attribute2                            VARCHAR2 DEFAULT NULL,
437                    X_Attribute3                            VARCHAR2 DEFAULT NULL,
438                    X_Attribute4                            VARCHAR2 DEFAULT NULL,
439                    X_Attribute5                            VARCHAR2 DEFAULT NULL,
440                    X_Attribute6                            VARCHAR2 DEFAULT NULL,
441                    X_Attribute7                            VARCHAR2 DEFAULT NULL,
442                    X_Attribute8                            VARCHAR2 DEFAULT NULL,
443                    X_Attribute9                            VARCHAR2 DEFAULT NULL,
444                    X_Attribute10                           VARCHAR2 DEFAULT NULL,
445                    X_Attribute11                           VARCHAR2 DEFAULT NULL,
446                    X_Attribute12                           VARCHAR2 DEFAULT NULL,
447                    X_Attribute13                           VARCHAR2 DEFAULT NULL,
448                    X_Attribute14                           VARCHAR2 DEFAULT NULL,
449                    X_Attribute15                           VARCHAR2 DEFAULT NULL,
450                    X_Backflush_Flag                        NUMBER DEFAULT NULL,
451                    X_Wms_Task_Type                         NUMBER DEFAULT NULL,
452                    X_Yield                                 NUMBER DEFAULT NULL,
453                    X_Operation_Yield_Enabled               NUMBER DEFAULT NULL,
454                    X_Shutdown_Type                         VARCHAR2 DEFAULT NULL
455 
456 ) IS
457   CURSOR C IS
458       SELECT *
459       FROM   BOM_STANDARD_OPERATIONS
460       WHERE  rowid = X_Rowid
461       FOR UPDATE of Standard_Operation_Id NOWAIT;
462   Recinfo C%ROWTYPE;
463 BEGIN
464   OPEN C;
465   FETCH C INTO Recinfo;
466   if (C%NOTFOUND) then
467     CLOSE C;
468     FND_MESSAGE.SET_NAME('FND', 'FORM_RECORD_DELETED');
469     APP_EXCEPTION.RAISE_EXCEPTION;
470   end if;
471   CLOSE C;
472   if (
473           (   (Recinfo.standard_operation_id = X_Standard_Operation_Id)
474            OR (    (Recinfo.standard_operation_id IS NULL)
475                AND (X_Standard_Operation_Id IS NULL)))
476       AND (   (Recinfo.operation_code = X_Operation_Code)
477            OR (    (Recinfo.operation_code IS NULL)
478                AND (X_Operation_Code IS NULL)))
479       AND (   (Recinfo.operation_type = X_Operation_Type)
480            OR (    (Recinfo.operation_type IS NULL)
481                AND (X_Operation_Type IS NULL)))
482       AND (   (Recinfo.line_id = X_Line_Id)
483            OR (    (Recinfo.line_id IS NULL)
484                AND (X_Line_Id IS NULL)))
485       AND (   (Recinfo.sequence_num = X_Sequence_Num)
486            OR (    (Recinfo.sequence_num IS NULL)
487                AND (X_Sequence_Num IS NULL)))
488       AND (   (Recinfo.organization_id = X_Organization_Id)
489            OR (    (Recinfo.organization_id IS NULL)
490                AND (X_Organization_Id IS NULL)))
491       AND (   (Recinfo.department_id = X_Department_Id)
492            OR (    (Recinfo.department_id IS NULL)
493                AND (X_Department_Id IS NULL)))
494       AND (   (Recinfo.minimum_transfer_quantity = X_Minimum_Transfer_Quantity)
495            OR (    (Recinfo.minimum_transfer_quantity IS NULL)
496                AND (X_Minimum_Transfer_Quantity IS NULL)))
497       AND (   (Recinfo.count_point_type = X_Count_Point_type)
498            OR (    (Recinfo.count_point_type IS NULL)
499                AND (X_Count_Point_Type IS NULL)))
500       AND (   (Recinfo.operation_description = X_Operation_Description)
501            OR (    (Recinfo.operation_description IS NULL)
502                AND (X_Operation_Description IS NULL)))
503       AND (   (Recinfo.option_dependent_flag = X_Option_Dependent_Flag)
504            OR (    (Recinfo.option_dependent_flag IS NULL)
505                AND (X_Option_Dependent_Flag IS NULL)))
506       AND (   (Recinfo.attribute_category = X_Attribute_Category)
507            OR (    (Recinfo.attribute_category IS NULL)
508                AND (X_Attribute_Category IS NULL)))
509       AND (   (Recinfo.attribute1 = X_Attribute1)
510            OR (    (Recinfo.attribute1 IS NULL)
511                AND (X_Attribute1 IS NULL)))
512       AND (   (Recinfo.attribute2 = X_Attribute2)
513            OR (    (Recinfo.attribute2 IS NULL)
514                AND (X_Attribute2 IS NULL)))
515       AND (   (Recinfo.attribute3 = X_Attribute3)
516            OR (    (Recinfo.attribute3 IS NULL)
517                AND (X_Attribute3 IS NULL)))
518       AND (   (Recinfo.attribute4 = X_Attribute4)
519            OR (    (Recinfo.attribute4 IS NULL)
520                AND (X_Attribute4 IS NULL)))
521       AND (   (Recinfo.attribute5 = X_Attribute5)
522            OR (    (Recinfo.attribute5 IS NULL)
523                AND (X_Attribute5 IS NULL)))
524       AND (   (Recinfo.attribute6 = X_Attribute6)
525            OR (    (Recinfo.attribute6 IS NULL)
526                AND (X_Attribute6 IS NULL)))
527       AND (   (Recinfo.attribute7 = X_Attribute7)
528            OR (    (Recinfo.attribute7 IS NULL)
529                AND (X_Attribute7 IS NULL)))
530       AND (   (Recinfo.attribute8 = X_Attribute8)
531            OR (    (Recinfo.attribute8 IS NULL)
532                AND (X_Attribute8 IS NULL)))
533       AND (   (Recinfo.attribute9 = X_Attribute9)
534            OR (    (Recinfo.attribute9 IS NULL)
535                AND (X_Attribute9 IS NULL)))
536       AND (   (Recinfo.attribute10 = X_Attribute10)
537            OR (    (Recinfo.attribute10 IS NULL)
538                AND (X_Attribute10 IS NULL)))
539       AND (   (Recinfo.attribute11 = X_Attribute11)
540            OR (    (Recinfo.attribute11 IS NULL)
541                AND (X_Attribute11 IS NULL)))
542       AND (   (Recinfo.attribute12 = X_Attribute12)
543            OR (    (Recinfo.attribute12 IS NULL)
544                AND (X_Attribute12 IS NULL)))
545       AND (   (Recinfo.attribute13 = X_Attribute13)
546            OR (    (Recinfo.attribute13 IS NULL)
547                AND (X_Attribute13 IS NULL)))
548       AND (   (Recinfo.attribute14 = X_Attribute14)
549            OR (    (Recinfo.attribute14 IS NULL)
550                AND (X_Attribute14 IS NULL)))
551       AND (   (Recinfo.attribute15 = X_Attribute15)
552            OR (    (Recinfo.attribute15 IS NULL)
553                AND (X_Attribute15 IS NULL)))
554       AND (   (Recinfo.backflush_flag = X_Backflush_Flag)
555            OR (    (Recinfo.backflush_flag IS NULL)
556                AND (X_Backflush_Flag IS NULL)))
557       AND (   (Recinfo.wms_task_type = X_Wms_Task_Type)
558            OR (    (Recinfo.wms_task_type IS NULL)
559                AND (X_Wms_Task_Type IS NULL)))
560       AND (   (Recinfo.yield = X_Yield)
561            OR (    (Recinfo.yield IS NULL)
562                AND (X_Yield IS NULL)))
563       AND (   (Recinfo.Operation_Yield_Enabled = X_Operation_Yield_Enabled)
564            OR (    (Recinfo.Operation_Yield_Enabled IS NULL)
565                AND (X_Operation_Yield_Enabled IS NULL)))
566       AND (   (Recinfo.Shutdown_Type = X_Shutdown_Type)
567            OR (    (Recinfo.Shutdown_Type IS NULL)
568                AND (X_Shutdown_Type IS NULL)))
569           ) then
570     return;
571   else
572     FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
573     APP_EXCEPTION.RAISE_EXCEPTION;
574   end if;
575 END Lock_Row;
576 
577 PROCEDURE Lock_Row(X_Rowid                                 VARCHAR2,
578                    X_Standard_Operation_Id                 NUMBER,
579                    X_Operation_Code                        VARCHAR2,
580 																			X_Operation_Type                        NUMBER,
581 																	  X_Line_Id	                   	          NUMBER DEFAULT NULL,
582 																			X_Sequence_Num			                       NUMBER DEFAULT NULL,
583                    X_Organization_Id                       NUMBER,
584                    X_Department_Id                         NUMBER,
585                    X_Minimum_Transfer_Quantity             NUMBER DEFAULT NULL,
586                    X_Count_Point_Type                      NUMBER DEFAULT NULL,
587                    X_Operation_Description                 VARCHAR2 DEFAULT NULL,
588                    X_Option_Dependent_Flag                 NUMBER DEFAULT NULL,
589                    X_Attribute_Category                    VARCHAR2 DEFAULT NULL,
590                    X_Attribute1                            VARCHAR2 DEFAULT NULL,
591                    X_Attribute2                            VARCHAR2 DEFAULT NULL,
592                    X_Attribute3                            VARCHAR2 DEFAULT NULL,
593                    X_Attribute4                            VARCHAR2 DEFAULT NULL,
594                    X_Attribute5                            VARCHAR2 DEFAULT NULL,
595                    X_Attribute6                            VARCHAR2 DEFAULT NULL,
596                    X_Attribute7                            VARCHAR2 DEFAULT NULL,
597                    X_Attribute8                            VARCHAR2 DEFAULT NULL,
598                    X_Attribute9                            VARCHAR2 DEFAULT NULL,
599                    X_Attribute10                           VARCHAR2 DEFAULT NULL,
600                    X_Attribute11                           VARCHAR2 DEFAULT NULL,
601                    X_Attribute12                           VARCHAR2 DEFAULT NULL,
602                    X_Attribute13                           VARCHAR2 DEFAULT NULL,
603                    X_Attribute14                           VARCHAR2 DEFAULT NULL,
604                    X_Attribute15                           VARCHAR2 DEFAULT NULL,
605                    X_Backflush_Flag                        NUMBER DEFAULT NULL,
606                    X_Wms_Task_Type                         NUMBER DEFAULT NULL,
607                    X_Yield                                 NUMBER DEFAULT NULL,
608                    X_Operation_Yield_Enabled               NUMBER DEFAULT NULL,
609                    X_Shutdown_Type                         VARCHAR2 DEFAULT NULL,
610                    X_Default_SubInventory                  VARCHAR2,
611                    X_Default_Locator_Id                    NUMBER,
612                    X_Value_added			                        VARCHAR2 DEFAULT NULL,
613                    X_Critical_To_Quality		                 VARCHAR2 DEFAULT NULL
614 ) IS
615 BEGIN
616 	  Lock_Row(
617 		                 X_Rowid                                 => X_Rowid,
618                    X_Standard_Operation_Id                 => X_Standard_Operation_Id,
619                    X_Operation_Code                        => X_Operation_Code,
620 																			X_Operation_Type                        => X_Operation_Type,
621 																	  X_Line_Id	                   	   => X_Line_Id,
622 																			X_Sequence_Num			   => X_Sequence_Num,
623                    X_Organization_Id                       => X_Organization_Id ,
624                    X_Department_Id                         => X_Department_Id ,
625                    X_Minimum_Transfer_Quantity		   => X_Minimum_Transfer_Quantity,
626                    X_Count_Point_Type                      => X_Count_Point_Type  ,
627                    X_Operation_Description                 => X_Operation_Description ,
628                    X_Option_Dependent_Flag                 => X_Option_Dependent_Flag ,
629                    X_Attribute_Category                    => X_Attribute_Category,
630                    X_Attribute1                            => X_Attribute1,
631                    X_Attribute2                            => X_Attribute2,
632                    X_Attribute3                            => X_Attribute3,
633                    X_Attribute4                            => X_Attribute4,
634                    X_Attribute5                            => X_Attribute5,
635                    X_Attribute6                            => X_Attribute6,
636                    X_Attribute7                            => X_Attribute7,
637                    X_Attribute8                            => X_Attribute8,
638                    X_Attribute9                            => X_Attribute9,
639                    X_Attribute10                           => X_Attribute10,
640                    X_Attribute11                           => X_Attribute11,
641                    X_Attribute12                           => X_Attribute12,
642                    X_Attribute13                           => X_Attribute13,
643                    X_Attribute14                           => X_Attribute14,
644                    X_Attribute15                           => X_Attribute15,
645                    X_Backflush_Flag                        => X_Backflush_Flag,
646                    X_Wms_Task_Type                         => X_Wms_Task_Type,
647                    X_Yield                                 => X_Yield,
648                    X_Operation_Yield_Enabled               => X_Operation_Yield_Enabled,
649                    X_Shutdown_Type                         => X_Shutdown_Type,
650                    X_Default_SubInventory                  => X_Default_SubInventory,
651                    X_Default_Locator_Id                    => X_Default_Locator_Id,
652                    X_Value_added			   => X_Value_added,
653                    X_Critical_To_Quality		   => X_Critical_To_Quality,
654 																			X_Lowest_Acceptable_Yield               => NULL,
655 																			X_Use_Org_Settings                      => NULL,
656 																			X_Queue_Mandatory_Flag                  => NULL,
657 																			X_Run_Mandatory_Flag                    => NULL,
658 																			X_To_Move_Mandatory_Flag                => NULL,
659 																			X_Show_Next_Op_By_Default               => NULL,
660 																			X_Show_Scrap_Code                       => NULL,
661 																			X_Show_Lot_Attrib                       => NULL,
662 																			X_Track_Multiple_Res_Usage_Dts          => NULL);
663 END Lock_Row;
664 
665 PROCEDURE Lock_Row(X_Rowid                                 VARCHAR2,
666                    X_Standard_Operation_Id                 NUMBER,
667                    X_Operation_Code                        VARCHAR2,
668 																			X_Operation_Type                        NUMBER,
669 																	  X_Line_Id	                   	          NUMBER DEFAULT NULL,
670 																			X_Sequence_Num			                       NUMBER DEFAULT NULL,
671                    X_Organization_Id                       NUMBER,
672                    X_Department_Id                         NUMBER,
673                    X_Minimum_Transfer_Quantity             NUMBER DEFAULT NULL,
674                    X_Count_Point_Type                      NUMBER DEFAULT NULL,
675                    X_Operation_Description                 VARCHAR2 DEFAULT NULL,
676                    X_Option_Dependent_Flag                 NUMBER DEFAULT NULL,
677                    X_Attribute_Category                    VARCHAR2 DEFAULT NULL,
678                    X_Attribute1                            VARCHAR2 DEFAULT NULL,
679                    X_Attribute2                            VARCHAR2 DEFAULT NULL,
680                    X_Attribute3                            VARCHAR2 DEFAULT NULL,
681                    X_Attribute4                            VARCHAR2 DEFAULT NULL,
682                    X_Attribute5                            VARCHAR2 DEFAULT NULL,
683                    X_Attribute6                            VARCHAR2 DEFAULT NULL,
684                    X_Attribute7                            VARCHAR2 DEFAULT NULL,
685                    X_Attribute8                            VARCHAR2 DEFAULT NULL,
686                    X_Attribute9                            VARCHAR2 DEFAULT NULL,
687                    X_Attribute10                           VARCHAR2 DEFAULT NULL,
688                    X_Attribute11                           VARCHAR2 DEFAULT NULL,
689                    X_Attribute12                           VARCHAR2 DEFAULT NULL,
690                    X_Attribute13                           VARCHAR2 DEFAULT NULL,
691                    X_Attribute14                           VARCHAR2 DEFAULT NULL,
692                    X_Attribute15                           VARCHAR2 DEFAULT NULL,
693                    X_Backflush_Flag                        NUMBER DEFAULT NULL,
694                    X_Wms_Task_Type                         NUMBER DEFAULT NULL,
695                    X_Yield                                 NUMBER DEFAULT NULL,
696                    X_Operation_Yield_Enabled               NUMBER DEFAULT NULL,
697                    X_Shutdown_Type                         VARCHAR2 DEFAULT NULL,
698                    X_Default_SubInventory                  VARCHAR2,
699                    X_Default_Locator_Id                    NUMBER,
700                    X_Value_added			   VARCHAR2 DEFAULT NULL,
701                    X_Critical_To_Quality		   VARCHAR2 DEFAULT NULL,
702 																			--OSFM-MES:Following new arguments are added
703 																			X_LOWEST_ACCEPTABLE_YIELD              NUMBER,
704 																			X_USE_ORG_SETTINGS                     NUMBER,
705 																			X_QUEUE_MANDATORY_FLAG                 NUMBER,
706 																			X_RUN_MANDATORY_FLAG                   NUMBER,
707 																			X_TO_MOVE_MANDATORY_FLAG               NUMBER,
708 																			X_SHOW_NEXT_OP_BY_DEFAULT              NUMBER,
709 																			X_SHOW_SCRAP_CODE                      NUMBER,
710 																			X_SHOW_LOT_ATTRIB                      NUMBER,
711 																			X_TRACK_MULTIPLE_RES_USAGE_DTS       NUMBER,
712 																			-- Added for labor skills validation project
713 																			X_CHECK_SKILL                          NUMBER DEFAULT NULL
714 ) IS
715   CURSOR C IS
716       SELECT *
717       FROM   BOM_STANDARD_OPERATIONS
718       WHERE  rowid = X_Rowid
719       FOR UPDATE of Standard_Operation_Id NOWAIT;
720   Recinfo C%ROWTYPE;
721 BEGIN
722   OPEN C;
723   FETCH C INTO Recinfo;
724   if (C%NOTFOUND) then
725     CLOSE C;
726     FND_MESSAGE.SET_NAME('FND', 'FORM_RECORD_DELETED');
727     APP_EXCEPTION.RAISE_EXCEPTION;
728   end if;
729   CLOSE C;
730   if (
731           (   (Recinfo.standard_operation_id = X_Standard_Operation_Id)
732            OR (    (Recinfo.standard_operation_id IS NULL)
733                AND (X_Standard_Operation_Id IS NULL)))
734       AND (   (Recinfo.operation_code = X_Operation_Code)
735            OR (    (Recinfo.operation_code IS NULL)
736                AND (X_Operation_Code IS NULL)))
737       AND (   (Recinfo.operation_type = X_Operation_Type)
738            OR (    (Recinfo.operation_type IS NULL)
739                AND (X_Operation_Type IS NULL)))
740       AND (   (Recinfo.line_id = X_Line_Id)
741            OR (    (Recinfo.line_id IS NULL)
742                AND (X_Line_Id IS NULL)))
743       AND (   (Recinfo.sequence_num = X_Sequence_Num)
744            OR (    (Recinfo.sequence_num IS NULL)
745                AND (X_Sequence_Num IS NULL)))
746       AND (   (Recinfo.organization_id = X_Organization_Id)
747            OR (    (Recinfo.organization_id IS NULL)
748                AND (X_Organization_Id IS NULL)))
749       AND (   (Recinfo.department_id = X_Department_Id)
750            OR (    (Recinfo.department_id IS NULL)
751                AND (X_Department_Id IS NULL)))
752       AND (   (Recinfo.minimum_transfer_quantity = X_Minimum_Transfer_Quantity)
753            OR (    (Recinfo.minimum_transfer_quantity IS NULL)
754                AND (X_Minimum_Transfer_Quantity IS NULL)))
755       AND (   (Recinfo.count_point_type = X_Count_Point_type)
756            OR (    (Recinfo.count_point_type IS NULL)
757                AND (X_Count_Point_Type IS NULL)))
758       AND (   (Recinfo.operation_description = X_Operation_Description)
759            OR (    (Recinfo.operation_description IS NULL)
760                AND (X_Operation_Description IS NULL)))
761       AND (   (Recinfo.option_dependent_flag = X_Option_Dependent_Flag)
762            OR (    (Recinfo.option_dependent_flag IS NULL)
763                AND (X_Option_Dependent_Flag IS NULL)))
764       AND (   (Recinfo.attribute_category = X_Attribute_Category)
765            OR (    (Recinfo.attribute_category IS NULL)
766                AND (X_Attribute_Category IS NULL)))
767       AND (   (Recinfo.attribute1 = X_Attribute1)
768            OR (    (Recinfo.attribute1 IS NULL)
769                AND (X_Attribute1 IS NULL)))
770       AND (   (Recinfo.attribute2 = X_Attribute2)
771            OR (    (Recinfo.attribute2 IS NULL)
772                AND (X_Attribute2 IS NULL)))
773       AND (   (Recinfo.attribute3 = X_Attribute3)
774            OR (    (Recinfo.attribute3 IS NULL)
775                AND (X_Attribute3 IS NULL)))
776       AND (   (Recinfo.attribute4 = X_Attribute4)
777            OR (    (Recinfo.attribute4 IS NULL)
778                AND (X_Attribute4 IS NULL)))
779       AND (   (Recinfo.attribute5 = X_Attribute5)
780            OR (    (Recinfo.attribute5 IS NULL)
781                AND (X_Attribute5 IS NULL)))
782       AND (   (Recinfo.attribute6 = X_Attribute6)
783            OR (    (Recinfo.attribute6 IS NULL)
784                AND (X_Attribute6 IS NULL)))
785       AND (   (Recinfo.attribute7 = X_Attribute7)
786            OR (    (Recinfo.attribute7 IS NULL)
787                AND (X_Attribute7 IS NULL)))
788       AND (   (Recinfo.attribute8 = X_Attribute8)
789            OR (    (Recinfo.attribute8 IS NULL)
790                AND (X_Attribute8 IS NULL)))
791       AND (   (Recinfo.attribute9 = X_Attribute9)
792            OR (    (Recinfo.attribute9 IS NULL)
793                AND (X_Attribute9 IS NULL)))
794       AND (   (Recinfo.attribute10 = X_Attribute10)
795            OR (    (Recinfo.attribute10 IS NULL)
796                AND (X_Attribute10 IS NULL)))
797       AND (   (Recinfo.attribute11 = X_Attribute11)
798            OR (    (Recinfo.attribute11 IS NULL)
799                AND (X_Attribute11 IS NULL)))
800       AND (   (Recinfo.attribute12 = X_Attribute12)
801            OR (    (Recinfo.attribute12 IS NULL)
802                AND (X_Attribute12 IS NULL)))
803       AND (   (Recinfo.attribute13 = X_Attribute13)
804            OR (    (Recinfo.attribute13 IS NULL)
805                AND (X_Attribute13 IS NULL)))
806       AND (   (Recinfo.attribute14 = X_Attribute14)
807            OR (    (Recinfo.attribute14 IS NULL)
808                AND (X_Attribute14 IS NULL)))
809       AND (   (Recinfo.attribute15 = X_Attribute15)
810            OR (    (Recinfo.attribute15 IS NULL)
811                AND (X_Attribute15 IS NULL)))
812       AND (   (Recinfo.backflush_flag = X_Backflush_Flag)
813            OR (    (Recinfo.backflush_flag IS NULL)
814                AND (X_Backflush_Flag IS NULL)))
815       AND (   (Recinfo.wms_task_type = X_Wms_Task_Type)
816            OR (    (Recinfo.wms_task_type IS NULL)
817                AND (X_Wms_Task_Type IS NULL)))
818       AND (   (Recinfo.yield = X_Yield)
819            OR (    (Recinfo.yield IS NULL)
820                AND (X_Yield IS NULL)))
821       AND (   (Recinfo.Operation_Yield_Enabled = X_Operation_Yield_Enabled)
822            OR (    (Recinfo.Operation_Yield_Enabled IS NULL)
823                AND (X_Operation_Yield_Enabled IS NULL)))
824       AND (   (Recinfo.Shutdown_Type = X_Shutdown_Type)
825            OR (    (Recinfo.Shutdown_Type IS NULL)
826                AND (X_Shutdown_Type IS NULL)))
827       AND (   (Recinfo.Default_SubInventory = X_Default_SubInventory)
828            OR (    (Recinfo.Default_SubInventory IS NULL)
829                AND (X_Default_SubInventory IS NULL)))
830       AND (   (Recinfo.Default_Locator_Id = X_Default_Locator_Id)
831            OR (    (Recinfo.Default_Locator_Id IS NULL)
832                AND (X_Default_Locator_Id IS NULL)))
833       AND (   (Recinfo.Value_added = X_Value_added)
834            OR (    (Recinfo.Value_added IS NULL)
835                AND (X_Value_added IS NULL)))
836       AND (   (Recinfo.Critical_To_Quality = X_Critical_To_Quality)
837            OR (    (Recinfo.Critical_To_Quality IS NULL)
838                AND (X_Critical_To_Quality IS NULL)))
839       --OSFM-MES:Following New columns are added...
840       AND	(Recinfo.LOWEST_ACCEPTABLE_YIELD        =  X_LOWEST_ACCEPTABLE_YIELD
841       OR	 (Recinfo.LOWEST_ACCEPTABLE_YIELD IS NULL
842       AND 	X_LOWEST_ACCEPTABLE_YIELD IS NULL))
843       AND	(Recinfo.USE_ORG_SETTINGS               =  X_USE_ORG_SETTINGS
844        OR	 (Recinfo.USE_ORG_SETTINGS IS NULL
845       AND 	X_USE_ORG_SETTINGS IS NULL))
846       AND	(Recinfo.QUEUE_MANDATORY_FLAG           =  X_QUEUE_MANDATORY_FLAG
847         OR	 (Recinfo.QUEUE_MANDATORY_FLAG IS NULL
848       AND 	X_QUEUE_MANDATORY_FLAG IS NULL))
849       AND	(Recinfo.RUN_MANDATORY_FLAG             =  X_RUN_MANDATORY_FLAG
850        OR	 (Recinfo.RUN_MANDATORY_FLAG IS NULL
851       AND 	X_RUN_MANDATORY_FLAG IS NULL))
852       AND	(Recinfo.TO_MOVE_MANDATORY_FLAG         =  X_TO_MOVE_MANDATORY_FLAG
853        OR	 (Recinfo.TO_MOVE_MANDATORY_FLAG IS NULL
854       AND 	X_TO_MOVE_MANDATORY_FLAG IS NULL))
855       AND	(Recinfo.SHOW_NEXT_OP_BY_DEFAULT        =  X_SHOW_NEXT_OP_BY_DEFAULT
856         OR	 (Recinfo.SHOW_NEXT_OP_BY_DEFAULT IS NULL
857       AND 	X_SHOW_NEXT_OP_BY_DEFAULT IS NULL))
858       AND	(Recinfo.SHOW_SCRAP_CODE                =  X_SHOW_SCRAP_CODE
859       OR	 (Recinfo.SHOW_SCRAP_CODE IS NULL
860       AND 	X_SHOW_SCRAP_CODE IS NULL))
861       AND	(Recinfo.SHOW_LOT_ATTRIB                =  X_SHOW_LOT_ATTRIB
862       OR	 (Recinfo.SHOW_LOT_ATTRIB IS NULL
863       AND 	X_SHOW_LOT_ATTRIB IS NULL))
864       AND	(Recinfo.TRACK_MULTIPLE_RES_USAGE_DATES =  X_TRACK_MULTIPLE_RES_USAGE_DTS
865      OR	 	(Recinfo.TRACK_MULTIPLE_RES_USAGE_DATES IS NULL
866       AND 	X_TRACK_MULTIPLE_RES_USAGE_DTS IS NULL))
867       -- Added for labor skills validation project
868 						AND	(Recinfo.CHECK_SKILL =  X_CHECK_SKILL
869      OR	 	(Recinfo.CHECK_SKILL IS NULL
870       AND 	(X_CHECK_SKILL IS NULL OR X_CHECK_SKILL=2)))
871 
872           ) then
873     return;
874   else
875     FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
876     APP_EXCEPTION.RAISE_EXCEPTION;
877   end if;
878 END Lock_Row;
879 
880 PROCEDURE Update_Row(X_Rowid                               VARCHAR2,
881                      X_Standard_Operation_Id               NUMBER,
882                      X_Operation_Code                      VARCHAR2,
883 																					X_Operation_Type                      NUMBER,
884 																			  X_Line_Id	                            NUMBER DEFAULT NULL,
885 																					X_Sequence_Num			                     NUMBER DEFAULT NULL,
886                      X_Organization_Id                     NUMBER,
887                      X_Department_Id                       NUMBER,
888                      X_Last_Update_Date                    DATE,
889                      X_Last_Updated_By                     NUMBER,
890                      X_Last_Update_Login                   NUMBER DEFAULT NULL,
891                      X_Minimum_Transfer_Quantity           NUMBER DEFAULT NULL,
892                      X_Count_Point_Type                    NUMBER DEFAULT NULL,
893                      X_Operation_Description               VARCHAR2 DEFAULT NULL,
894                      X_Option_Dependent_Flag               NUMBER DEFAULT NULL,
895                      X_Attribute_Category                  VARCHAR2 DEFAULT NULL,
896                      X_Attribute1                          VARCHAR2 DEFAULT NULL,
897                      X_Attribute2                          VARCHAR2 DEFAULT NULL,
898                      X_Attribute3                          VARCHAR2 DEFAULT NULL,
899                      X_Attribute4                          VARCHAR2 DEFAULT NULL,
900                      X_Attribute5                          VARCHAR2 DEFAULT NULL,
901                      X_Attribute6                          VARCHAR2 DEFAULT NULL,
902                      X_Attribute7                          VARCHAR2 DEFAULT NULL,
903                      X_Attribute8                          VARCHAR2 DEFAULT NULL,
904                      X_Attribute9                          VARCHAR2 DEFAULT NULL,
905                      X_Attribute10                         VARCHAR2 DEFAULT NULL,
906                      X_Attribute11                         VARCHAR2 DEFAULT NULL,
907                      X_Attribute12                         VARCHAR2 DEFAULT NULL,
908                      X_Attribute13                         VARCHAR2 DEFAULT NULL,
909                      X_Attribute14                         VARCHAR2 DEFAULT NULL,
910                      X_Attribute15                         VARCHAR2 DEFAULT NULL,
911                      X_Backflush_Flag                      NUMBER DEFAULT NULL,
912                      X_Wms_Task_Type                       NUMBER DEFAULT NULL,
913                      X_Yield                               NUMBER DEFAULT NULL,
914                      X_Operation_Yield_Enabled             NUMBER DEFAULT NULL,
915                      X_Shutdown_Type                       VARCHAR2 DEFAULT NULL
916 
917 ) IS
918 BEGIN
919   UPDATE BOM_STANDARD_OPERATIONS
920   SET
921     standard_operation_id                     =    X_Standard_Operation_Id,
922     operation_code                            =    X_Operation_Code,
923     operation_type			                         =    X_Operation_Type,
924     line_id                                   =    X_Line_Id,
925     sequence_num			                           =    X_Sequence_Num,
926     organization_id                           =    X_Organization_Id,
927     department_id                             =    X_Department_Id,
928     last_update_date                          =    X_Last_Update_Date,
929     last_updated_by                           =    X_Last_Updated_By,
930     last_update_login                         =    X_Last_Update_Login,
931     minimum_transfer_quantity                 =    X_Minimum_Transfer_Quantity,
932     count_point_type                          =    X_Count_Point_Type,
933     operation_description                     =    X_Operation_Description,
934     option_dependent_flag                     =    X_Option_Dependent_Flag,
935     attribute_category                        =    X_Attribute_Category,
936     attribute1                                =    X_Attribute1,
937     attribute2                                =    X_Attribute2,
938     attribute3                                =    X_Attribute3,
939     attribute4                                =    X_Attribute4,
940     attribute5                                =    X_Attribute5,
941     attribute6                                =    X_Attribute6,
942     attribute7                                =    X_Attribute7,
943     attribute8                                =    X_Attribute8,
944     attribute9                                =    X_Attribute9,
945     attribute10                               =    X_Attribute10,
946     attribute11                               =    X_Attribute11,
947     attribute12                               =    X_Attribute12,
948     attribute13                               =    X_Attribute13,
949     attribute14                               =    X_Attribute14,
950     attribute15                               =    X_Attribute15,
951     backflush_flag                            =    X_Backflush_Flag,
952     wms_task_type                             =    X_Wms_Task_Type,
953     yield				                                 =    X_Yield,
954     operation_yield_enabled		                 =    X_Operation_Yield_Enabled,
955     shutdown_type                             =    X_Shutdown_Type
956   WHERE rowid = X_rowid;
957 
958   if (SQL%NOTFOUND) then
959     RAISE NO_DATA_FOUND;
960   end if;
961 
962 END Update_Row;
963 
964 PROCEDURE Update_Row(X_Rowid                               VARCHAR2,
965                      X_Standard_Operation_Id               NUMBER,
966                      X_Operation_Code                      VARCHAR2,
967 																					X_Operation_Type                      NUMBER,
968 																			  X_Line_Id	                            NUMBER DEFAULT NULL,
969 																					X_Sequence_Num			                     NUMBER DEFAULT NULL,
970                      X_Organization_Id                     NUMBER,
971                      X_Department_Id                       NUMBER,
972                      X_Last_Update_Date                    DATE,
973                      X_Last_Updated_By                     NUMBER,
974                      X_Last_Update_Login                   NUMBER DEFAULT NULL,
975                      X_Minimum_Transfer_Quantity           NUMBER DEFAULT NULL,
976                      X_Count_Point_Type                    NUMBER DEFAULT NULL,
977                      X_Operation_Description               VARCHAR2 DEFAULT NULL,
978                      X_Option_Dependent_Flag               NUMBER DEFAULT NULL,
979                      X_Attribute_Category                  VARCHAR2 DEFAULT NULL,
980                      X_Attribute1                          VARCHAR2 DEFAULT NULL,
981                      X_Attribute2                          VARCHAR2 DEFAULT NULL,
982                      X_Attribute3                          VARCHAR2 DEFAULT NULL,
983                      X_Attribute4                          VARCHAR2 DEFAULT NULL,
984                      X_Attribute5                          VARCHAR2 DEFAULT NULL,
985                      X_Attribute6                          VARCHAR2 DEFAULT NULL,
986                      X_Attribute7                          VARCHAR2 DEFAULT NULL,
987                      X_Attribute8                          VARCHAR2 DEFAULT NULL,
988                      X_Attribute9                          VARCHAR2 DEFAULT NULL,
989                      X_Attribute10                         VARCHAR2 DEFAULT NULL,
990                      X_Attribute11                         VARCHAR2 DEFAULT NULL,
991                      X_Attribute12                         VARCHAR2 DEFAULT NULL,
992                      X_Attribute13                         VARCHAR2 DEFAULT NULL,
993                      X_Attribute14                         VARCHAR2 DEFAULT NULL,
994                      X_Attribute15                         VARCHAR2 DEFAULT NULL,
995                      X_Backflush_Flag                      NUMBER DEFAULT NULL,
996                      X_Wms_Task_Type                       NUMBER DEFAULT NULL,
997                      X_Yield                               NUMBER DEFAULT NULL,
998                      X_Operation_Yield_Enabled             NUMBER DEFAULT NULL,
999                      X_Shutdown_Type                       VARCHAR2 DEFAULT NULL,
1000                      X_Default_SubInventory                VARCHAR2,
1001                      X_Default_Locator_Id                  NUMBER,
1002                      X_Value_added			                      VARCHAR2 DEFAULT NULL,
1003                      X_Critical_To_quality		               VARCHAR2 DEFAULT NULL
1004 ) IS
1005 BEGIN
1006 	  Update_Row(
1007 		                 X_Rowid                                 => X_Rowid,
1008                    X_Standard_Operation_Id                 => X_Standard_Operation_Id,
1009                    X_Operation_Code                        => X_Operation_Code,
1010 	  	               X_Operation_Type                        => X_Operation_Type,
1011 		                 X_Line_Id	                   	          => X_Line_Id,
1012  	 	               X_Sequence_Num			                       => X_Sequence_Num,
1013                    X_Organization_Id                       => X_Organization_Id ,
1014                    X_Department_Id                         => X_Department_Id ,
1015                    X_Last_Update_Date                      => X_Last_Update_Date ,
1016                    X_Last_Updated_By                       => X_Last_Updated_By ,
1017                    X_Last_Update_Login                     => X_Last_Update_Login ,
1018                    X_Minimum_Transfer_Quantity		           => X_Minimum_Transfer_Quantity,
1019                    X_Count_Point_Type                      => X_Count_Point_Type  ,
1020                    X_Operation_Description                 => X_Operation_Description ,
1021                    X_Option_Dependent_Flag                 => X_Option_Dependent_Flag ,
1022                    X_Attribute_Category                    => X_Attribute_Category,
1023                    X_Attribute1                            => X_Attribute1,
1024                    X_Attribute2                            => X_Attribute2,
1025                    X_Attribute3                            => X_Attribute3,
1026                    X_Attribute4                            => X_Attribute4,
1027                    X_Attribute5                            => X_Attribute5,
1028                    X_Attribute6                            => X_Attribute6,
1029                    X_Attribute7                            => X_Attribute7,
1030                    X_Attribute8                            => X_Attribute8,
1031                    X_Attribute9                            => X_Attribute9,
1032                    X_Attribute10                           => X_Attribute10,
1033                    X_Attribute11                           => X_Attribute11,
1034                    X_Attribute12                           => X_Attribute12,
1035                    X_Attribute13                           => X_Attribute13,
1036                    X_Attribute14                           => X_Attribute14,
1037                    X_Attribute15                           => X_Attribute15,
1038                    X_Backflush_Flag                        => X_Backflush_Flag,
1039                    X_Wms_Task_Type                         => X_Wms_Task_Type,
1040                    X_Yield                                 => X_Yield,
1041                    X_Operation_Yield_Enabled               => X_Operation_Yield_Enabled,
1042                    X_Shutdown_Type                         => X_Shutdown_Type,
1043                    X_Default_SubInventory                  => X_Default_SubInventory,
1044                    X_Default_Locator_Id                    => X_Default_Locator_Id,
1045                    X_Value_added			                        => X_Value_added,
1046                    X_Critical_To_Quality		                 => X_Critical_To_Quality,
1047 																			X_Lowest_Acceptable_Yield               => NULL,
1048 																			X_Use_Org_Settings                      => NULL,
1049 																			X_Queue_Mandatory_Flag                  => NULL,
1050 																			X_Run_Mandatory_Flag                    => NULL,
1051 																			X_To_Move_Mandatory_Flag                => NULL,
1052 																			X_Show_Next_Op_By_Default               => NULL,
1053 																			X_Show_Scrap_Code                       => NULL,
1054 																			X_Show_Lot_Attrib                       => NULL,
1055 																			X_Track_Multiple_Res_Usage_Dts          => NULL);
1056 END Update_Row;
1057 
1058 PROCEDURE Update_Row(X_Rowid                               VARCHAR2,
1059                      X_Standard_Operation_Id               NUMBER,
1060                      X_Operation_Code                      VARCHAR2,
1061 																					X_Operation_Type                      NUMBER,
1062 																			  X_Line_Id	                            NUMBER DEFAULT NULL,
1063 																					X_Sequence_Num			                     NUMBER DEFAULT NULL,
1064                      X_Organization_Id                     NUMBER,
1065                      X_Department_Id                       NUMBER,
1066                      X_Last_Update_Date                    DATE,
1067                      X_Last_Updated_By                     NUMBER,
1068                      X_Last_Update_Login                   NUMBER DEFAULT NULL,
1069                      X_Minimum_Transfer_Quantity           NUMBER DEFAULT NULL,
1070                      X_Count_Point_Type                    NUMBER DEFAULT NULL,
1071                      X_Operation_Description               VARCHAR2 DEFAULT NULL,
1072                      X_Option_Dependent_Flag               NUMBER DEFAULT NULL,
1073                      X_Attribute_Category                  VARCHAR2 DEFAULT NULL,
1074                      X_Attribute1                          VARCHAR2 DEFAULT NULL,
1075                      X_Attribute2                          VARCHAR2 DEFAULT NULL,
1076                      X_Attribute3                          VARCHAR2 DEFAULT NULL,
1077                      X_Attribute4                          VARCHAR2 DEFAULT NULL,
1078                      X_Attribute5                          VARCHAR2 DEFAULT NULL,
1079                      X_Attribute6                          VARCHAR2 DEFAULT NULL,
1080                      X_Attribute7                          VARCHAR2 DEFAULT NULL,
1081                      X_Attribute8                          VARCHAR2 DEFAULT NULL,
1082                      X_Attribute9                          VARCHAR2 DEFAULT NULL,
1083                      X_Attribute10                         VARCHAR2 DEFAULT NULL,
1084                      X_Attribute11                         VARCHAR2 DEFAULT NULL,
1085                      X_Attribute12                         VARCHAR2 DEFAULT NULL,
1086                      X_Attribute13                         VARCHAR2 DEFAULT NULL,
1087                      X_Attribute14                         VARCHAR2 DEFAULT NULL,
1088                      X_Attribute15                         VARCHAR2 DEFAULT NULL,
1089                      X_Backflush_Flag                      NUMBER DEFAULT NULL,
1090                      X_Wms_Task_Type                       NUMBER DEFAULT NULL,
1091                      X_Yield                               NUMBER DEFAULT NULL,
1092                      X_Operation_Yield_Enabled             NUMBER DEFAULT NULL,
1093                      X_Shutdown_Type                       VARCHAR2 DEFAULT NULL,
1094                      X_Default_SubInventory                VARCHAR2,
1095                      X_Default_Locator_Id                  NUMBER,
1096                      X_Value_added			                      VARCHAR2 DEFAULT NULL,
1097                      X_Critical_To_quality		               VARCHAR2 DEFAULT NULL,
1098 		                   --OSFM-MES:Following new arguments are added
1099 																					X_LOWEST_ACCEPTABLE_YIELD              NUMBER,
1100 																					X_USE_ORG_SETTINGS                     NUMBER,
1101 																					X_QUEUE_MANDATORY_FLAG                 NUMBER,
1102 																					X_RUN_MANDATORY_FLAG                   NUMBER,
1103 																					X_TO_MOVE_MANDATORY_FLAG               NUMBER,
1104 																					X_SHOW_NEXT_OP_BY_DEFAULT              NUMBER,
1105 																					X_SHOW_SCRAP_CODE                      NUMBER,
1106 																					X_SHOW_LOT_ATTRIB                      NUMBER,
1107 																					X_TRACK_MULTIPLE_RES_USAGE_DTS         NUMBER,
1108 																					X_CHECK_SKILL                          NUMBER DEFAULT NULL
1109 ) IS
1110 BEGIN
1111   UPDATE BOM_STANDARD_OPERATIONS
1112   SET
1113     standard_operation_id                     =    X_Standard_Operation_Id,
1114     operation_code                            =    X_Operation_Code,
1115     operation_type			                         =    X_Operation_Type,
1116     line_id                                   =    X_Line_Id,
1117     sequence_num			                           =    X_Sequence_Num,
1118     organization_id                           =    X_Organization_Id,
1119     department_id                             =    X_Department_Id,
1120     last_update_date                          =    X_Last_Update_Date,
1121     last_updated_by                           =    X_Last_Updated_By,
1122     last_update_login                         =    X_Last_Update_Login,
1123     minimum_transfer_quantity                 =    X_Minimum_Transfer_Quantity,
1124     count_point_type                          =    X_Count_Point_Type,
1125     operation_description                     =    X_Operation_Description,
1126     option_dependent_flag                     =    X_Option_Dependent_Flag,
1127     attribute_category                        =    X_Attribute_Category,
1128     attribute1                                =    X_Attribute1,
1129     attribute2                                =    X_Attribute2,
1130     attribute3                                =    X_Attribute3,
1131     attribute4                                =    X_Attribute4,
1132     attribute5                                =    X_Attribute5,
1133     attribute6                                =    X_Attribute6,
1134     attribute7                                =    X_Attribute7,
1135     attribute8                                =    X_Attribute8,
1136     attribute9                                =    X_Attribute9,
1137     attribute10                               =    X_Attribute10,
1138     attribute11                               =    X_Attribute11,
1139     attribute12                               =    X_Attribute12,
1140     attribute13                               =    X_Attribute13,
1141     attribute14                               =    X_Attribute14,
1142     attribute15                               =    X_Attribute15,
1143     backflush_flag                            =    X_Backflush_Flag,
1144     wms_task_type                             =    X_Wms_Task_Type,
1145     yield				                                 =    X_Yield,
1146     operation_yield_enabled		                 =    X_Operation_Yield_Enabled,
1147     shutdown_type                             =    X_Shutdown_Type,
1148     default_subinventory                      =    X_Default_SubInventory,
1149     default_locator_id                        =    X_Default_Locator_Id,
1150     value_added				                           =    X_Value_Added,
1151     critical_to_quality			                    =    X_Critical_To_Quality,
1152     LOWEST_ACCEPTABLE_YIELD       	           =    X_LOWEST_ACCEPTABLE_YIELD,
1153     USE_ORG_SETTINGS              	           =    X_USE_ORG_SETTINGS,
1154     QUEUE_MANDATORY_FLAG          	           =    X_QUEUE_MANDATORY_FLAG,
1155     RUN_MANDATORY_FLAG            	           =    X_RUN_MANDATORY_FLAG,
1156     TO_MOVE_MANDATORY_FLAG        	           =    X_TO_MOVE_MANDATORY_FLAG ,
1157     SHOW_NEXT_OP_BY_DEFAULT       	           =    X_SHOW_NEXT_OP_BY_DEFAULT ,
1158     SHOW_SCRAP_CODE               	           =    X_SHOW_SCRAP_CODE ,
1159     SHOW_LOT_ATTRIB               	           =    X_SHOW_LOT_ATTRIB,
1160     TRACK_MULTIPLE_RES_USAGE_DATES	           =    X_TRACK_MULTIPLE_RES_USAGE_DTS,
1161     CHECK_SKILL                               =    X_CHECK_SKILL
1162   WHERE rowid = X_rowid;
1163 
1164   if (SQL%NOTFOUND) then
1165     RAISE NO_DATA_FOUND;
1166   end if;
1167 
1168 END Update_Row;
1169 
1170 
1171 PROCEDURE Delete_Row(X_Rowid                 VARCHAR2,
1172   		     X_Standard_Operation_Id NUMBER) IS
1173 BEGIN
1174   DELETE FROM BOM_STANDARD_OPERATIONS
1175   WHERE  rowid = X_Rowid;
1176 
1177   if (SQL%NOTFOUND) then
1178     Raise NO_DATA_FOUND;
1179   elsif (SQL%FOUND) then
1180     Delete_Details(X_Standard_Operation_Id);
1181   end if;
1182 END Delete_Row;
1183 
1184 
1185 PROCEDURE Check_Unique(X_Rowid VARCHAR2,
1186 		       X_Organization_Id NUMBER,
1187 	       	       X_Operation_Code VARCHAR2,
1188                        X_Line_Id      NUMBER,
1189                        X_Operation_Type Number) IS
1190   dummy 	NUMBER;
1191 BEGIN
1192 -- Added If condition and wrote seperate sql's to handle x_line_id NULL condition.
1193 -- Bug 4173389
1194  If (X_Line_Id is NULL) Then
1195   SELECT 1 INTO dummy FROM DUAL WHERE NOT EXISTS
1196     (SELECT 1 FROM BOM_STANDARD_OPERATIONS
1197      WHERE Organization_Id = X_Organization_Id
1198        AND Operation_Code  = X_Operation_Code
1199        AND (Operation_Type  = X_Operation_Type
1200        OR   Operation_Type  IS NULL)
1201        AND   Line_Id  IS NULL
1202        AND ((X_Rowid IS NULL) OR (ROWID <> X_Rowid))
1203     );
1204   Else
1205   SELECT 1 INTO dummy FROM DUAL WHERE NOT EXISTS
1206     (SELECT 1 FROM BOM_STANDARD_OPERATIONS
1207      WHERE Organization_Id = X_Organization_Id
1208        AND Operation_Code  = X_Operation_Code
1209        AND (Operation_Type  = X_Operation_Type
1210        OR   Operation_Type  IS NULL)
1211        AND  Line_Id         = X_Line_Id
1212        -- OR   Line_Id  IS NULL) Commented for bug 4173389 and modified above line.
1213        AND ((X_Rowid IS NULL) OR (ROWID <> X_Rowid))
1214     );
1215   End If;
1216 
1217   EXCEPTION
1218     WHEN NO_DATA_FOUND THEN
1219       FND_MESSAGE.SET_NAME('BOM', 'BOM_ALREADY_EXISTS');
1220       if (( X_Operation_type =1) and (X_Line_Id is null )) then
1221          FND_MESSAGE.SET_TOKEN('ENTITY1', 'STANDARD OPERATION_CAP', TRUE);
1222       elsif (X_Operation_type =3) then
1223          FND_MESSAGE.SET_TOKEN('ENTITY1', 'STANDARD LINE_OP_CAP', TRUE);
1224       elsif (X_Operation_type =2) then
1225          FND_MESSAGE.SET_TOKEN('ENTITY1', 'STANDARD PROCESS_CAP', TRUE);
1226       else
1227          FND_MESSAGE.SET_TOKEN('ENTITY1', 'STANDARD EVENT_CAP', TRUE);
1228       end if;
1229       FND_MESSAGE.SET_TOKEN('ENTITY2', X_Operation_Code);
1230       APP_EXCEPTION.RAISE_EXCEPTION;
1231 END Check_Unique;
1232 
1233 
1234 PROCEDURE Check_Unique_Seq(X_Rowid VARCHAR2,
1235 		           X_Organization_Id NUMBER,
1236 	       	           X_Operation_Code VARCHAR2,
1237                            X_Line_Id      NUMBER,
1238                            X_Operation_Type Number,
1239 		           X_Sequence_Num   Number) IS
1240   dummy 	NUMBER;
1241   x_line_code     VARCHAR2(10);
1242 BEGIN
1243 
1244    SELECT 1 INTO dummy FROM DUAL WHERE NOT EXISTS
1245     (SELECT 1 FROM BOM_STANDARD_OPERATIONS
1246      WHERE Organization_Id = X_Organization_Id
1247        AND (Operation_Type  = X_Operation_Type
1248        OR   Operation_Type IS NULL)
1249        AND (Line_Id         = X_Line_Id
1250        OR   Line_Id  IS NULL)
1251        AND Sequence_Num    = X_Sequence_Num
1252        AND ((X_Rowid IS NULL) OR (ROWID <> X_Rowid))
1253     );
1254 
1255   EXCEPTION
1256     WHEN NO_DATA_FOUND THEN
1257       SELECT LINE_CODE into x_line_code from WIP_LINES  where LINE_ID = X_Line_id;
1258       FND_MESSAGE.SET_NAME('BOM', 'BOM_ALREADY_EXISTS');
1259       FND_MESSAGE.SET_TOKEN('ENTITY1', X_Sequence_Num);
1260       FND_MESSAGE.SET_TOKEN('ENTITY2', x_line_code);
1261       APP_EXCEPTION.RAISE_EXCEPTION;
1262 END Check_Unique_Seq;
1263 
1264 
1265 PROCEDURE Check_References(X_Standard_Operation_Id NUMBER,
1266 		           X_Operation_Code VARCHAR2	) IS
1267   	dummy 		NUMBER;
1268 BEGIN
1269   SELECT 1 INTO dummy FROM DUAL WHERE NOT EXISTS
1270     (SELECT 1 FROM BOM_OPERATION_SEQUENCES
1271      WHERE STANDARD_OPERATION_ID = X_Standard_Operation_Id
1272        AND ((DISABLE_DATE > SYSDATE) OR (DISABLE_DATE IS NULL))
1273     );
1274 
1275 EXCEPTION
1276   WHEN NO_DATA_FOUND THEN
1277     FND_MESSAGE.SET_NAME('BOM', 'BOM_STD_OP_IN_USE');
1278     FND_MESSAGE.SET_TOKEN('ENTITY', X_Operation_Code);
1279     APP_EXCEPTION.RAISE_EXCEPTION;
1280 END Check_References;
1281 
1282 PROCEDURE Delete_Details(X_Standard_Operation_Id NUMBER) IS
1283 BEGIN
1284   DELETE FROM BOM_STD_OP_RESOURCES
1285   WHERE STANDARD_OPERATION_ID = X_Standard_Operation_Id;
1286 		DELETE FROM BOM_OPERATION_SKILLS
1287 		WHERE STANDARD_OPERATION_ID = X_Standard_Operation_Id
1288 		and LEVEL_ID=1;
1289 END Delete_Details;
1290 
1291 -- Added the following Function for BUG 3986337
1292 FUNCTION Check_Wms_exists(p_std_operation_id IN NUMBER) RETURN BOOLEAN IS
1293 l_wms_install NUMBER;
1294 v_sqlstr VARCHAR2(100);
1295 v_result NUMBER;
1296 CURSOR wms_inst_cur IS
1297 SELECT 1 FROM fnd_application app, fnd_product_installations inst
1298 WHERE  app.application_short_name = 'WMS'
1299 AND    inst.application_id = app.application_id
1300 AND    inst.status <> 'N';
1301 BEGIN
1302 OPEN wms_inst_cur;
1303 FETCH wms_inst_cur INTO l_wms_install;
1304 CLOSE wms_inst_cur;
1305 v_sqlstr := 'SELECT 1 FROM wms_rules_b WHERE type_hdr_id = :a AND type_code = 3 AND rownum < 2';
1306 IF l_wms_install = 1 THEN
1307   EXECUTE IMMEDIATE v_sqlstr INTO v_result USING p_std_operation_id;
1308   IF v_result = 1 THEN
1309 	RETURN TRUE;
1310   ELSE
1311 	RETURN FALSE;
1312   END IF;
1313 ELSE /*bug:4318462 - If l_wms_install is not 1 (i.e.) when WMS is not installed, then return false.*/
1314 	RETURN FALSE;
1315 END IF;
1316 EXCEPTION
1317 WHEN OTHERS THEN
1318 	RETURN FALSE;
1319 END Check_Wms_exists;
1320 
1321 PROCEDURE Check_Setup_Std_Op_Ref( P_Standard_Operation_Id NUMBER,   -- BUG 4256393
1322                                   P_Operation_Code VARCHAR2 ) IS
1323 	l_dummy		NUMBER;
1324 BEGIN
1325   SELECT 1 INTO l_dummy FROM DUAL WHERE NOT EXISTS
1326     (SELECT 1 FROM BOM_SETUP_TRANSITIONS
1327      WHERE OPERATION_ID = P_Standard_Operation_Id
1328     );
1329 
1330 EXCEPTION
1331   WHEN NO_DATA_FOUND THEN
1332     FND_MESSAGE.SET_NAME('BOM', 'BOM_SETUP_STD_OP_IN_USE');
1333     FND_MESSAGE.SET_TOKEN('ENTITY', P_Operation_Code);
1334     APP_EXCEPTION.RAISE_EXCEPTION;
1335 END Check_Setup_Std_Op_Ref;
1336 
1337 END B_STD_OP_PKG;