DBA Data[Home] [Help]

PACKAGE BODY: APPS.B_STD_OP_RES_PKG

Source


1 PACKAGE BODY B_STD_OP_RES_PKG as
2 /* $Header: BOMPISRB.pls 115.7 2003/12/24 08:59:05 dpsingh ship $ */
3 
4 
5 PROCEDURE Insert_Row(X_Rowid                        IN OUT NOCOPY VARCHAR2,
6                      X_Standard_Operation_Id               NUMBER,
7                      X_Resource_Id                         NUMBER,
8                      X_Activity_Id                         NUMBER DEFAULT NULL,
9                      X_Last_Update_Date                    DATE,
10                      X_Last_Updated_By                     NUMBER,
11                      X_Creation_Date                       DATE,
12                      X_Created_By                          NUMBER,
13                      X_Last_Update_Login                   NUMBER DEFAULT NULL,
14                      X_Resource_Seq_Num                    NUMBER,
15                      X_Usage_Rate_Or_Amount                NUMBER,
16                      X_Usage_Rate_Or_Amount_Inverse        NUMBER,
17                      X_Basis_Type                          NUMBER,
18                      X_Autocharge_Type                     NUMBER,
19                      X_Standard_Rate_Flag                  NUMBER,
20                      X_Assigned_Units                      NUMBER DEFAULT NULL,
21                      X_Schedule_Flag                       NUMBER,
22                      X_Attribute_Category                  VARCHAR2 DEFAULT NULL,
23                      X_Attribute1                          VARCHAR2 DEFAULT NULL,
24                      X_Attribute2                          VARCHAR2 DEFAULT NULL,
25                      X_Attribute3                          VARCHAR2 DEFAULT NULL,
26                      X_Attribute4                          VARCHAR2 DEFAULT NULL,
27                      X_Attribute5                          VARCHAR2 DEFAULT NULL,
28                      X_Attribute6                          VARCHAR2 DEFAULT NULL,
29                      X_Attribute7                          VARCHAR2 DEFAULT NULL,
30                      X_Attribute8                          VARCHAR2 DEFAULT NULL,
31                      X_Attribute9                          VARCHAR2 DEFAULT NULL,
32                      X_Attribute10                         VARCHAR2 DEFAULT NULL,
33                      X_Attribute11                         VARCHAR2 DEFAULT NULL,
34                      X_Attribute12                         VARCHAR2 DEFAULT NULL,
35                      X_Attribute13                         VARCHAR2 DEFAULT NULL,
36                      X_Attribute14                         VARCHAR2 DEFAULT NULL,
37                      X_Attribute15                         VARCHAR2 DEFAULT NULL
38  ) IS
39 
40 BEGIN
41           Insert_Row(X_Rowid                             => X_Rowid,
42                      X_Standard_Operation_Id             => X_Standard_Operation_Id,
43                      X_Resource_Id                       => X_Resource_Id,
44 		     X_Substitute_Group_Num              => NULL,
45                      X_Activity_Id                       => X_Activity_Id,
46                      X_Last_Update_Date                  => X_Last_Update_Date,
47                      X_Last_Updated_By                   => X_Last_Updated_By,
48                      X_Creation_Date                     => X_Creation_Date,
49                      X_Created_By                        => X_Created_By,
50                      X_Last_Update_Login                 => X_Last_Update_Login,
51                      X_Resource_Seq_Num                  => X_Resource_Seq_Num,
52                      X_Usage_Rate_Or_Amount              => X_Usage_Rate_Or_Amount,
53                      X_Usage_Rate_Or_Amount_Inverse      => X_Usage_Rate_Or_Amount_Inverse,
54                      X_Basis_Type                        => X_Basis_Type,
55                      X_Autocharge_Type                   => X_Autocharge_Type,
56                      X_Standard_Rate_Flag                => X_Standard_Rate_Flag,
57                      X_Assigned_Units                    => X_Assigned_Units,
58                      X_Schedule_Flag                     => X_Schedule_Flag,
59                      X_Attribute_Category                => X_Attribute_Category,
60                      X_Attribute1                        => X_Attribute1,
61                      X_Attribute2                        => X_Attribute2,
62                      X_Attribute3                        => X_Attribute3,
63                      X_Attribute4                        => X_Attribute4,
64                      X_Attribute5                        => X_Attribute5,
65                      X_Attribute6                        => X_Attribute6,
66                      X_Attribute7                        => X_Attribute7,
67                      X_Attribute8                        => X_Attribute8,
68                      X_Attribute9                        => X_Attribute9,
69                      X_Attribute10                       => X_Attribute10,
70                      X_Attribute11                       => X_Attribute11,
71                      X_Attribute12                       => X_Attribute12,
72                      X_Attribute13                       => X_Attribute13,
73                      X_Attribute14                       => X_Attribute14,
74                      X_Attribute15                       => X_Attribute15
75 
76   );
77 
78 END Insert_Row;
79 
80 PROCEDURE Insert_Row(X_Rowid                        IN OUT NOCOPY VARCHAR2,
81                      X_Standard_Operation_Id               NUMBER,
82                      X_Resource_Id                         NUMBER,
83 		     X_Substitute_Group_Num                NUMBER,
84                      X_Activity_Id                         NUMBER DEFAULT NULL,
85                      X_Last_Update_Date                    DATE,
86                      X_Last_Updated_By                     NUMBER,
87                      X_Creation_Date                       DATE,
88                      X_Created_By                          NUMBER,
89                      X_Last_Update_Login                   NUMBER DEFAULT NULL,
90                      X_Resource_Seq_Num                    NUMBER,
91                      X_Usage_Rate_Or_Amount                NUMBER,
92                      X_Usage_Rate_Or_Amount_Inverse        NUMBER,
93                      X_Basis_Type                          NUMBER,
94                      X_Autocharge_Type                     NUMBER,
95                      X_Standard_Rate_Flag                  NUMBER,
96                      X_Assigned_Units                      NUMBER DEFAULT NULL,
97                      X_Schedule_Flag                       NUMBER,
98                      X_Attribute_Category                  VARCHAR2 DEFAULT NULL,
99                      X_Attribute1                          VARCHAR2 DEFAULT NULL,
100                      X_Attribute2                          VARCHAR2 DEFAULT NULL,
101                      X_Attribute3                          VARCHAR2 DEFAULT NULL,
102                      X_Attribute4                          VARCHAR2 DEFAULT NULL,
103                      X_Attribute5                          VARCHAR2 DEFAULT NULL,
104                      X_Attribute6                          VARCHAR2 DEFAULT NULL,
105                      X_Attribute7                          VARCHAR2 DEFAULT NULL,
106                      X_Attribute8                          VARCHAR2 DEFAULT NULL,
107                      X_Attribute9                          VARCHAR2 DEFAULT NULL,
108                      X_Attribute10                         VARCHAR2 DEFAULT NULL,
109                      X_Attribute11                         VARCHAR2 DEFAULT NULL,
110                      X_Attribute12                         VARCHAR2 DEFAULT NULL,
111                      X_Attribute13                         VARCHAR2 DEFAULT NULL,
112                      X_Attribute14                         VARCHAR2 DEFAULT NULL,
113                      X_Attribute15                         VARCHAR2 DEFAULT NULL
114  ) IS
115    CURSOR C IS SELECT rowid FROM BOM_STD_OP_RESOURCES
116              WHERE standard_operation_id = X_Standard_Operation_Id
117              AND   resource_seq_num = X_Resource_Seq_Num;
118 
119 BEGIN
120   INSERT INTO BOM_STD_OP_RESOURCES(
121           standard_operation_id,
122           resource_id,
123 	  substitute_group_num,
124           activity_id,
125           last_update_date,
126           last_updated_by,
127           creation_date,
128           created_by,
129           last_update_login,
130           resource_seq_num,
131           usage_rate_or_amount,
132           usage_rate_or_amount_inverse,
133           basis_type,
134           autocharge_type,
135           standard_rate_flag,
136           assigned_units,
137           schedule_flag,
138           attribute_category,
139           attribute1,
140           attribute2,
141           attribute3,
142           attribute4,
143           attribute5,
144           attribute6,
145           attribute7,
146           attribute8,
147           attribute9,
148           attribute10,
149           attribute11,
150           attribute12,
151           attribute13,
152           attribute14,
153           attribute15
154          ) VALUES (
155           X_Standard_Operation_Id,
156           X_Resource_Id,
157 	  X_Substitute_Group_Num,
158           X_Activity_Id,
159           X_Last_Update_Date,
160           X_Last_Updated_By,
161           X_Creation_Date,
162           X_Created_By,
163           X_Last_Update_Login,
164           X_Resource_Seq_Num,
165           X_Usage_Rate_Or_Amount,
166           X_Usage_Rate_Or_Amount_Inverse,
167           X_Basis_Type,
168           X_Autocharge_Type,
169           X_Standard_Rate_Flag,
170           X_Assigned_Units,
171           X_Schedule_Flag,
172           X_Attribute_Category,
173           X_Attribute1,
174           X_Attribute2,
175           X_Attribute3,
176           X_Attribute4,
177           X_Attribute5,
178           X_Attribute6,
179           X_Attribute7,
180           X_Attribute8,
181           X_Attribute9,
182           X_Attribute10,
183           X_Attribute11,
184           X_Attribute12,
185           X_Attribute13,
186           X_Attribute14,
187           X_Attribute15
188 
189   );
190 
191   OPEN C;
192   FETCH C INTO X_Rowid;
193   if (C%NOTFOUND) then
194     CLOSE C;
195     RAISE NO_DATA_FOUND;
196   end if;
197   CLOSE C;
198 END Insert_Row;
199 
200 PROCEDURE Lock_Row(X_Rowid                                 VARCHAR2,
201                    X_Standard_Operation_Id                 NUMBER,
202                    X_Resource_Id                           NUMBER,
203                    X_Activity_Id                           NUMBER DEFAULT NULL,
204                    X_Resource_Seq_Num                      NUMBER,
205                    X_Usage_Rate_Or_Amount                  NUMBER,
206                    X_Usage_Rate_Or_Amount_Inverse          NUMBER,
207                    X_Basis_Type                            NUMBER,
208                    X_Autocharge_Type                       NUMBER,
209                    X_Standard_Rate_Flag                    NUMBER,
210                    X_Assigned_Units                        NUMBER DEFAULT NULL,
211                    X_Schedule_Flag                         NUMBER,
212                    X_Attribute_Category                    VARCHAR2 DEFAULT NULL,
213                    X_Attribute1                            VARCHAR2 DEFAULT NULL,
214                    X_Attribute2                            VARCHAR2 DEFAULT NULL,
215                    X_Attribute3                            VARCHAR2 DEFAULT NULL,
216                    X_Attribute4                            VARCHAR2 DEFAULT NULL,
217                    X_Attribute5                            VARCHAR2 DEFAULT NULL,
218                    X_Attribute6                            VARCHAR2 DEFAULT NULL,
219                    X_Attribute7                            VARCHAR2 DEFAULT NULL,
220                    X_Attribute8                            VARCHAR2 DEFAULT NULL,
221                    X_Attribute9                            VARCHAR2 DEFAULT NULL,
222                    X_Attribute10                           VARCHAR2 DEFAULT NULL,
223                    X_Attribute11                           VARCHAR2 DEFAULT NULL,
224                    X_Attribute12                           VARCHAR2 DEFAULT NULL,
225                    X_Attribute13                           VARCHAR2 DEFAULT NULL,
226                    X_Attribute14                           VARCHAR2 DEFAULT NULL,
227                    X_Attribute15                           VARCHAR2 DEFAULT NULL
228 ) IS
229 
230 BEGIN
231 
232           Lock_Row(X_Rowid                                 => X_Rowid,
233                    X_Standard_Operation_Id                 => X_Standard_Operation_Id,
234                    X_Resource_Id                           => X_Resource_Id,
235 		   X_Substitute_Group_Num                  => NULL,
236                    X_Activity_Id                           => X_Activity_Id,
237                    X_Resource_Seq_Num                      => X_Resource_Seq_Num,
238                    X_Usage_Rate_Or_Amount                  => X_Usage_Rate_Or_Amount,
239                    X_Usage_Rate_Or_Amount_Inverse          => X_Usage_Rate_Or_Amount_Inverse,
240                    X_Basis_Type                            => X_Basis_Type,
241                    X_Autocharge_Type                       => X_Autocharge_Type,
242                    X_Standard_Rate_Flag                    => X_Standard_Rate_Flag,
243                    X_Assigned_Units                        => X_Assigned_Units,
244                    X_Schedule_Flag                         => X_Schedule_Flag,
245                    X_Attribute_Category                    => X_Attribute_Category,
246                    X_Attribute1                            => X_Attribute1,
247                    X_Attribute2                            => X_Attribute2,
248                    X_Attribute3                            => X_Attribute3,
249                    X_Attribute4                            => X_Attribute4,
250                    X_Attribute5                            => X_Attribute5,
251                    X_Attribute6                            => X_Attribute6,
252                    X_Attribute7                            => X_Attribute7,
253                    X_Attribute8                            => X_Attribute8,
254                    X_Attribute9                            => X_Attribute9,
255                    X_Attribute10                           => X_Attribute10,
256                    X_Attribute11                           => X_Attribute11,
257                    X_Attribute12                           => X_Attribute12,
258                    X_Attribute13                           => X_Attribute13,
259                    X_Attribute14                           => X_Attribute14,
260                    X_Attribute15                           => X_Attribute15);
261 
262 END Lock_Row;
263 
264 PROCEDURE Lock_Row(X_Rowid                                 VARCHAR2,
265                    X_Standard_Operation_Id                 NUMBER,
266                    X_Resource_Id                           NUMBER,
267 		   X_Substitute_Group_Num                  NUMBER,
268                    X_Activity_Id                           NUMBER DEFAULT NULL,
269                    X_Resource_Seq_Num                      NUMBER,
270                    X_Usage_Rate_Or_Amount                  NUMBER,
271                    X_Usage_Rate_Or_Amount_Inverse          NUMBER,
272                    X_Basis_Type                            NUMBER,
273                    X_Autocharge_Type                       NUMBER,
274                    X_Standard_Rate_Flag                    NUMBER,
275                    X_Assigned_Units                        NUMBER DEFAULT NULL,
276                    X_Schedule_Flag                         NUMBER,
277                    X_Attribute_Category                    VARCHAR2 DEFAULT NULL,
278                    X_Attribute1                            VARCHAR2 DEFAULT NULL,
279                    X_Attribute2                            VARCHAR2 DEFAULT NULL,
280                    X_Attribute3                            VARCHAR2 DEFAULT NULL,
281                    X_Attribute4                            VARCHAR2 DEFAULT NULL,
282                    X_Attribute5                            VARCHAR2 DEFAULT NULL,
283                    X_Attribute6                            VARCHAR2 DEFAULT NULL,
284                    X_Attribute7                            VARCHAR2 DEFAULT NULL,
285                    X_Attribute8                            VARCHAR2 DEFAULT NULL,
286                    X_Attribute9                            VARCHAR2 DEFAULT NULL,
287                    X_Attribute10                           VARCHAR2 DEFAULT NULL,
288                    X_Attribute11                           VARCHAR2 DEFAULT NULL,
289                    X_Attribute12                           VARCHAR2 DEFAULT NULL,
290                    X_Attribute13                           VARCHAR2 DEFAULT NULL,
291                    X_Attribute14                           VARCHAR2 DEFAULT NULL,
292                    X_Attribute15                           VARCHAR2 DEFAULT NULL
293 ) IS
294   CURSOR C IS
295       SELECT *
296       FROM   BOM_STD_OP_RESOURCES
297       WHERE  rowid = X_Rowid
298       FOR UPDATE of Standard_Operation_Id, Substitute_Group_Num NOWAIT;
299   Recinfo C%ROWTYPE;
300 BEGIN
301   OPEN C;
302   FETCH C INTO Recinfo;
303   if (C%NOTFOUND) then
304     CLOSE C;
305     FND_MESSAGE.SET_NAME('FND', 'FORM_RECORD_DELETED');
306     APP_EXCEPTION.RAISE_EXCEPTION;
307   end if;
308   CLOSE C;
309   if (
310           (   (Recinfo.standard_operation_id = X_Standard_Operation_Id)
311            OR (    (Recinfo.standard_operation_id IS NULL)
312                AND (X_Standard_Operation_Id IS NULL)))
313       AND (   (Recinfo.resource_id = X_Resource_Id)
314            OR (    (Recinfo.resource_id IS NULL)
315                AND (X_Resource_Id IS NULL)))
316       AND (   (Recinfo.substitute_group_num = X_Substitute_Group_Num)
317            OR (    (Recinfo.Substitute_Group_Num IS NULL)
318                AND (X_Substitute_Group_Num IS NULL)))
319       AND (   (Recinfo.activity_id = X_Activity_Id)
320            OR (    (Recinfo.activity_id IS NULL)
321                AND (X_Activity_Id IS NULL)))
322       AND (   (Recinfo.resource_seq_num = X_Resource_Seq_Num)
323            OR (    (Recinfo.resource_seq_num IS NULL)
324                AND (X_Resource_Seq_Num IS NULL)))
325       AND (   (Recinfo.usage_rate_or_amount = X_Usage_Rate_Or_Amount)
326            OR (    (Recinfo.usage_rate_or_amount IS NULL)
327                AND (X_Usage_Rate_Or_Amount IS NULL)))
328       AND (   (Recinfo.usage_rate_or_amount_inverse = X_Usage_Rate_Or_Amount_Inverse)
329            OR (    (Recinfo.usage_rate_or_amount_inverse IS NULL)
330                AND (X_Usage_Rate_Or_Amount_Inverse IS NULL)))
331       AND (   (Recinfo.basis_type = X_Basis_Type)
332            OR (    (Recinfo.basis_type IS NULL)
333                AND (X_Basis_Type IS NULL)))
334       AND (   (Recinfo.autocharge_type = X_Autocharge_Type)
335            OR (    (Recinfo.autocharge_type IS NULL)
336                AND (X_Autocharge_Type IS NULL)))
337       AND (   (Recinfo.standard_rate_flag = X_Standard_Rate_Flag)
338            OR (    (Recinfo.standard_rate_flag IS NULL)
339                AND (X_Standard_Rate_Flag IS NULL)))
340       AND (   (Recinfo.assigned_units = X_Assigned_Units)
341            OR (    (Recinfo.assigned_units IS NULL)
342                AND (X_Assigned_Units IS NULL)))
343       AND (   (Recinfo.schedule_flag = X_Schedule_Flag)
344            OR (    (Recinfo.schedule_flag IS NULL)
345                AND (X_Schedule_Flag IS NULL)))
346       AND (   (Recinfo.attribute_category = X_Attribute_Category)
347            OR (    (Recinfo.attribute_category IS NULL)
348                AND (X_Attribute_Category IS NULL)))
349       AND (   (Recinfo.attribute1 = X_Attribute1)
350            OR (    (Recinfo.attribute1 IS NULL)
351                AND (X_Attribute1 IS NULL)))
352       AND (   (Recinfo.attribute2 = X_Attribute2)
353            OR (    (Recinfo.attribute2 IS NULL)
354                AND (X_Attribute2 IS NULL)))
355       AND (   (Recinfo.attribute3 = X_Attribute3)
356            OR (    (Recinfo.attribute3 IS NULL)
357                AND (X_Attribute3 IS NULL)))
358       AND (   (Recinfo.attribute4 = X_Attribute4)
359            OR (    (Recinfo.attribute4 IS NULL)
360                AND (X_Attribute4 IS NULL)))
361       AND (   (Recinfo.attribute5 = X_Attribute5)
362            OR (    (Recinfo.attribute5 IS NULL)
363                AND (X_Attribute5 IS NULL)))
364       AND (   (Recinfo.attribute6 = X_Attribute6)
365            OR (    (Recinfo.attribute6 IS NULL)
366                AND (X_Attribute6 IS NULL)))
367       AND (   (Recinfo.attribute7 = X_Attribute7)
368            OR (    (Recinfo.attribute7 IS NULL)
369                AND (X_Attribute7 IS NULL)))
370       AND (   (Recinfo.attribute8 = X_Attribute8)
371            OR (    (Recinfo.attribute8 IS NULL)
372                AND (X_Attribute8 IS NULL)))
373       AND (   (Recinfo.attribute9 = X_Attribute9)
374            OR (    (Recinfo.attribute9 IS NULL)
375                AND (X_Attribute9 IS NULL)))
376       AND (   (Recinfo.attribute10 = X_Attribute10)
377            OR (    (Recinfo.attribute10 IS NULL)
378                AND (X_Attribute10 IS NULL)))
379       AND (   (Recinfo.attribute11 = X_Attribute11)
380            OR (    (Recinfo.attribute11 IS NULL)
381                AND (X_Attribute11 IS NULL)))
382       AND (   (Recinfo.attribute12 = X_Attribute12)
383            OR (    (Recinfo.attribute12 IS NULL)
384                AND (X_Attribute12 IS NULL)))
385       AND (   (Recinfo.attribute13 = X_Attribute13)
386            OR (    (Recinfo.attribute13 IS NULL)
387                AND (X_Attribute13 IS NULL)))
388       AND (   (Recinfo.attribute14 = X_Attribute14)
389            OR (    (Recinfo.attribute14 IS NULL)
390                AND (X_Attribute14 IS NULL)))
391       AND (   (Recinfo.attribute15 = X_Attribute15)
392            OR (    (Recinfo.attribute15 IS NULL)
393                AND (X_Attribute15 IS NULL)))
394           ) then
395     return;
396   else
397     FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
398     APP_EXCEPTION.RAISE_EXCEPTION;
399   end if;
400 END Lock_Row;
401 
402 PROCEDURE Update_Row(X_Rowid                               VARCHAR2,
403                      X_Standard_Operation_Id               NUMBER,
404                      X_Resource_Id                         NUMBER,
405                      X_Activity_Id                         NUMBER DEFAULT NULL,
406                      X_Last_Update_Date                    DATE,
407                      X_Last_Updated_By                     NUMBER,
408                      X_Last_Update_Login                   NUMBER DEFAULT NULL,
409                      X_Resource_Seq_Num                    NUMBER,
410                      X_Usage_Rate_Or_Amount                NUMBER,
411                      X_Usage_Rate_Or_Amount_Inverse        NUMBER,
412                      X_Basis_Type                          NUMBER,
413                      X_Autocharge_Type                     NUMBER,
414                      X_Standard_Rate_Flag                  NUMBER,
415                      X_Assigned_Units                      NUMBER DEFAULT NULL,
416                      X_Schedule_Flag                       NUMBER,
417                      X_Attribute_Category                  VARCHAR2 DEFAULT NULL,
418                      X_Attribute1                          VARCHAR2 DEFAULT NULL,
419                      X_Attribute2                          VARCHAR2 DEFAULT NULL,
420                      X_Attribute3                          VARCHAR2 DEFAULT NULL,
421                      X_Attribute4                          VARCHAR2 DEFAULT NULL,
422                      X_Attribute5                          VARCHAR2 DEFAULT NULL,
423                      X_Attribute6                          VARCHAR2 DEFAULT NULL,
424                      X_Attribute7                          VARCHAR2 DEFAULT NULL,
425                      X_Attribute8                          VARCHAR2 DEFAULT NULL,
426                      X_Attribute9                          VARCHAR2 DEFAULT NULL,
427                      X_Attribute10                         VARCHAR2 DEFAULT NULL,
428                      X_Attribute11                         VARCHAR2 DEFAULT NULL,
429                      X_Attribute12                         VARCHAR2 DEFAULT NULL,
430                      X_Attribute13                         VARCHAR2 DEFAULT NULL,
431                      X_Attribute14                         VARCHAR2 DEFAULT NULL,
432                      X_Attribute15                         VARCHAR2 DEFAULT NULL
433 ) IS
434 BEGIN
435           Update_Row(X_Rowid                               => X_Rowid,
436                      X_Standard_Operation_Id               => X_Standard_Operation_Id,
437                      X_Resource_Id                         => X_Resource_Id,
438 		     X_Substitute_Group_Num                => NULL,
439                      X_Activity_Id                         => X_Activity_Id,
440                      X_Last_Update_Date                    => X_Last_Update_Date,
441                      X_Last_Updated_By                     => X_Last_Updated_By,
442                      X_Last_Update_Login                   => X_Last_Update_Login,
443                      X_Resource_Seq_Num                    => X_Resource_Seq_Num,
444                      X_Usage_Rate_Or_Amount                => X_Usage_Rate_Or_Amount,
445                      X_Usage_Rate_Or_Amount_Inverse        => X_Usage_Rate_Or_Amount_Inverse,
446                      X_Basis_Type                          => X_Basis_Type,
447                      X_Autocharge_Type                     => X_Autocharge_Type,
448                      X_Standard_Rate_Flag                  => X_Standard_Rate_Flag,
449                      X_Assigned_Units                      => X_Assigned_Units,
450                      X_Schedule_Flag                       => X_Schedule_Flag,
451                      X_Attribute_Category                  => X_Attribute_Category,
452                      X_Attribute1                            => X_Attribute1,
453                      X_Attribute2                            => X_Attribute2,
454                      X_Attribute3                            => X_Attribute3,
455                      X_Attribute4                            => X_Attribute4,
456                      X_Attribute5                            => X_Attribute5,
457                      X_Attribute6                            => X_Attribute6,
458                      X_Attribute7                            => X_Attribute7,
459                      X_Attribute8                            => X_Attribute8,
460                      X_Attribute9                            => X_Attribute9,
461                      X_Attribute10                           => X_Attribute10,
462                      X_Attribute11                           => X_Attribute11,
463                      X_Attribute12                           => X_Attribute12,
464                      X_Attribute13                           => X_Attribute13,
465                      X_Attribute14                           => X_Attribute14,
466                      X_Attribute15                           => X_Attribute15);
467 
468 END Update_Row;
469 
470 PROCEDURE Update_Row(X_Rowid                               VARCHAR2,
471                      X_Standard_Operation_Id               NUMBER,
472                      X_Resource_Id                         NUMBER,
473 		     X_Substitute_Group_Num                NUMBER,
474                      X_Activity_Id                         NUMBER DEFAULT NULL,
475                      X_Last_Update_Date                    DATE,
476                      X_Last_Updated_By                     NUMBER,
477                      X_Last_Update_Login                   NUMBER DEFAULT NULL,
478                      X_Resource_Seq_Num                    NUMBER,
479                      X_Usage_Rate_Or_Amount                NUMBER,
480                      X_Usage_Rate_Or_Amount_Inverse        NUMBER,
481                      X_Basis_Type                          NUMBER,
482                      X_Autocharge_Type                     NUMBER,
483                      X_Standard_Rate_Flag                  NUMBER,
484                      X_Assigned_Units                      NUMBER DEFAULT NULL,
485                      X_Schedule_Flag                       NUMBER,
486                      X_Attribute_Category                  VARCHAR2 DEFAULT NULL,
487                      X_Attribute1                          VARCHAR2 DEFAULT NULL,
488                      X_Attribute2                          VARCHAR2 DEFAULT NULL,
489                      X_Attribute3                          VARCHAR2 DEFAULT NULL,
490                      X_Attribute4                          VARCHAR2 DEFAULT NULL,
491                      X_Attribute5                          VARCHAR2 DEFAULT NULL,
492                      X_Attribute6                          VARCHAR2 DEFAULT NULL,
493                      X_Attribute7                          VARCHAR2 DEFAULT NULL,
494                      X_Attribute8                          VARCHAR2 DEFAULT NULL,
495                      X_Attribute9                          VARCHAR2 DEFAULT NULL,
496                      X_Attribute10                         VARCHAR2 DEFAULT NULL,
497                      X_Attribute11                         VARCHAR2 DEFAULT NULL,
498                      X_Attribute12                         VARCHAR2 DEFAULT NULL,
499                      X_Attribute13                         VARCHAR2 DEFAULT NULL,
500                      X_Attribute14                         VARCHAR2 DEFAULT NULL,
501                      X_Attribute15                         VARCHAR2 DEFAULT NULL
502 ) IS
503 BEGIN
504   UPDATE BOM_STD_OP_RESOURCES
505   SET
506     standard_operation_id                     =    X_Standard_Operation_Id,
507     resource_id                               =    X_Resource_Id,
508     substitute_group_num                      =    X_Substitute_Group_Num,
509     activity_id                               =    X_Activity_Id,
510     last_update_date                          =    X_Last_Update_Date,
511     last_updated_by                           =    X_Last_Updated_By,
512     last_update_login                         =    X_Last_Update_Login,
513     resource_seq_num                          =    X_Resource_Seq_Num,
514     usage_rate_or_amount                      =    X_Usage_Rate_Or_Amount,
515     usage_rate_or_amount_inverse              =    X_Usage_Rate_Or_Amount_Inverse,
516     basis_type                                =    X_Basis_Type,
517     autocharge_type                           =    X_Autocharge_Type,
518     standard_rate_flag                        =    X_Standard_Rate_Flag,
519     assigned_units                            =    X_Assigned_Units,
520     schedule_flag                             =    X_Schedule_Flag,
521     attribute_category                        =    X_Attribute_Category,
522     attribute1                                =    X_Attribute1,
523     attribute2                                =    X_Attribute2,
524     attribute3                                =    X_Attribute3,
525     attribute4                                =    X_Attribute4,
526     attribute5                                =    X_Attribute5,
527     attribute6                                =    X_Attribute6,
528     attribute7                                =    X_Attribute7,
529     attribute8                                =    X_Attribute8,
530     attribute9                                =    X_Attribute9,
531     attribute10                               =    X_Attribute10,
532     attribute11                               =    X_Attribute11,
533     attribute12                               =    X_Attribute12,
534     attribute13                               =    X_Attribute13,
535     attribute14                               =    X_Attribute14,
536     attribute15                               =    X_Attribute15
537   WHERE rowid = X_rowid;
538 
539   if (SQL%NOTFOUND) then
540     RAISE NO_DATA_FOUND;
541   end if;
542 
543 END Update_Row;
544 
545 PROCEDURE Delete_Row(X_Rowid VARCHAR2) IS
546 BEGIN
547   DELETE FROM BOM_STD_OP_RESOURCES
548   WHERE  rowid = X_Rowid;
549 
550   if (SQL%NOTFOUND) then
551     RAISE NO_DATA_FOUND;
552   end if;
553 END Delete_Row;
554 
555 PROCEDURE Check_Unique(X_Rowid VARCHAR2,
556 		       X_Standard_Operation_Id NUMBER,
557 		       X_Resource_Seq_Num NUMBER) IS
558   dummy NUMBER;
559 BEGIN
560   SELECT 1 INTO dummy FROM DUAL WHERE NOT EXISTS
561     (SELECT 1 FROM BOM_STD_OP_RESOURCES
562      WHERE Standard_Operation_Id = X_Standard_Operation_Id
563        AND Resource_Seq_Num = X_Resource_Seq_Num
564        AND ((X_Rowid IS NULL) OR (ROWID <> X_Rowid))
565     );
566 
567 EXCEPTION
568   WHEN NO_DATA_FOUND THEN
569     FND_MESSAGE.SET_NAME('BOM', 'BOM_ALREADY_EXISTS');
570     FND_MESSAGE.SET_TOKEN('ENTITY1', 'SEQUENCE NUMBER_CAP', TRUE);
571     FND_MESSAGE.SET_TOKEN('ENTITY2', X_Resource_Seq_Num);
572     APP_EXCEPTION.RAISE_EXCEPTION;
573 END Check_Unique;
574 
575 
576 END B_STD_OP_RES_PKG;