9: g_no constant number := 2;
10:
11: PROCEDURE AssignOperation(
12: p_api_version IN NUMBER,
13: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
14: p_commit IN VARCHAR2 := FND_API.G_FALSE,
15: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
16: x_return_status IN OUT NOCOPY VARCHAR2,
17: x_msg_count IN OUT NOCOPY NUMBER,
10:
11: PROCEDURE AssignOperation(
12: p_api_version IN NUMBER,
13: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
14: p_commit IN VARCHAR2 := FND_API.G_FALSE,
15: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
16: x_return_status IN OUT NOCOPY VARCHAR2,
17: x_msg_count IN OUT NOCOPY NUMBER,
18: x_msg_data IN OUT NOCOPY VARCHAR2,
11: PROCEDURE AssignOperation(
12: p_api_version IN NUMBER,
13: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
14: p_commit IN VARCHAR2 := FND_API.G_FALSE,
15: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
16: x_return_status IN OUT NOCOPY VARCHAR2,
17: x_msg_count IN OUT NOCOPY NUMBER,
18: x_msg_data IN OUT NOCOPY VARCHAR2,
19: p_operation_rec IN OPERATION_REC_TYPE := G_MISS_OPERATION_REC,
67: and bso.operation_code = P_Code
68: and bor.routing_sequence_id = P_RtgSeqId;
69: BEGIN
70: -- Standard call to check for call compatibility.
71: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name,
72: G_PKG_NAME) THEN
73: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
74: END IF;
75: -- Initialize message list if p_init_msg_list is set to TRUE.
69: BEGIN
70: -- Standard call to check for call compatibility.
71: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name,
72: G_PKG_NAME) THEN
73: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
74: END IF;
75: -- Initialize message list if p_init_msg_list is set to TRUE.
76: IF FND_API.to_Boolean(p_init_msg_list) THEN
77: FND_MSG_PUB.initialize;
72: G_PKG_NAME) THEN
73: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
74: END IF;
75: -- Initialize message list if p_init_msg_list is set to TRUE.
76: IF FND_API.to_Boolean(p_init_msg_list) THEN
77: FND_MSG_PUB.initialize;
78: END IF;
79: -- Initialize API return status to success
80: x_return_status := FND_API.G_RET_STS_SUCCESS;
76: IF FND_API.to_Boolean(p_init_msg_list) THEN
77: FND_MSG_PUB.initialize;
78: END IF;
79: -- Initialize API return status to success
80: x_return_status := FND_API.G_RET_STS_SUCCESS;
81:
82: -- API body
83: l_operation_rec := p_operation_rec;
84:
81:
82: -- API body
83: l_operation_rec := p_operation_rec;
84:
85: If nvl(l_operation_rec.operation_sequence_id, FND_API.G_MISS_NUM) <>
86: FND_API.G_MISS_NUM then
87: For l_ExistingOp_rec in l_operation_csr(
88: P_OpSeqId => l_operation_rec.operation_sequence_id) loop
89: l_operation_rec.routing_sequence_id := l_ExistingOp_rec.routing_sequence_id;
82: -- API body
83: l_operation_rec := p_operation_rec;
84:
85: If nvl(l_operation_rec.operation_sequence_id, FND_API.G_MISS_NUM) <>
86: FND_API.G_MISS_NUM then
87: For l_ExistingOp_rec in l_operation_csr(
88: P_OpSeqId => l_operation_rec.operation_sequence_id) loop
89: l_operation_rec.routing_sequence_id := l_ExistingOp_rec.routing_sequence_id;
90: l_operation_rec.operation_type := l_ExistingOp_rec.operation_type;
91: l_operation_rec.operation_seq_num := l_ExistingOp_rec.operation_seq_num;
92: End loop;
93: End if;
94:
95: If nvl(l_operation_rec.routing_sequence_id, FND_API.G_MISS_NUM) <>
96: FND_API.G_MISS_NUM then
97: For l_assy_rec in l_assy_csr(
98: P_RtgSeqId => l_operation_rec.routing_sequence_id) loop
99: l_operation_rec.assembly_item_id := l_assy_rec.assembly_item_id;
92: End loop;
93: End if;
94:
95: If nvl(l_operation_rec.routing_sequence_id, FND_API.G_MISS_NUM) <>
96: FND_API.G_MISS_NUM then
97: For l_assy_rec in l_assy_csr(
98: P_RtgSeqId => l_operation_rec.routing_sequence_id) loop
99: l_operation_rec.assembly_item_id := l_assy_rec.assembly_item_id;
100: l_operation_rec.organization_id := l_assy_rec.organization_id;
104: End if; -- check existing routing
105:
106: -- set organization id
107:
108: If nvl(l_operation_rec.organization_code, FND_API.G_MISS_CHAR) <>
109: FND_API.G_MISS_CHAR then
110: For l_parameter_rec in l_parameter_csr(
111: P_Code => l_operation_rec.organization_code) loop
112: l_operation_rec.organization_id := l_parameter_rec.organization_id;
105:
106: -- set organization id
107:
108: If nvl(l_operation_rec.organization_code, FND_API.G_MISS_CHAR) <>
109: FND_API.G_MISS_CHAR then
110: For l_parameter_rec in l_parameter_csr(
111: P_Code => l_operation_rec.organization_code) loop
112: l_operation_rec.organization_id := l_parameter_rec.organization_id;
113: End loop;
112: l_operation_rec.organization_id := l_parameter_rec.organization_id;
113: End loop;
114: End if; -- organization code
115:
116: if nvl(l_operation_rec.organization_id, FND_API.G_MISS_NUM) =
117: FND_API.G_MISS_NUM then
118: Fnd_Message.Set_Name('BOM', 'BOM_ORG_ID_MISSING');
119: FND_MSG_PUB.Add;
120: raise FND_API.G_EXC_ERROR;
113: End loop;
114: End if; -- organization code
115:
116: if nvl(l_operation_rec.organization_id, FND_API.G_MISS_NUM) =
117: FND_API.G_MISS_NUM then
118: Fnd_Message.Set_Name('BOM', 'BOM_ORG_ID_MISSING');
119: FND_MSG_PUB.Add;
120: raise FND_API.G_EXC_ERROR;
121: end if; -- organization_id
116: if nvl(l_operation_rec.organization_id, FND_API.G_MISS_NUM) =
117: FND_API.G_MISS_NUM then
118: Fnd_Message.Set_Name('BOM', 'BOM_ORG_ID_MISSING');
119: FND_MSG_PUB.Add;
120: raise FND_API.G_EXC_ERROR;
121: end if; -- organization_id
122:
123: If nvl(l_operation_rec.Assembly_Item_Number, FND_API.G_MISS_CHAR) <>
124: FND_API.G_MISS_CHAR then
119: FND_MSG_PUB.Add;
120: raise FND_API.G_EXC_ERROR;
121: end if; -- organization_id
122:
123: If nvl(l_operation_rec.Assembly_Item_Number, FND_API.G_MISS_CHAR) <>
124: FND_API.G_MISS_CHAR then
125: l_ret_code := INVPUOPI.mtl_pr_trans_prod_item(
126: org_id => l_operation_rec.organization_id,
127: item_number_in => l_operation_rec.assembly_item_number,
120: raise FND_API.G_EXC_ERROR;
121: end if; -- organization_id
122:
123: If nvl(l_operation_rec.Assembly_Item_Number, FND_API.G_MISS_CHAR) <>
124: FND_API.G_MISS_CHAR then
125: l_ret_code := INVPUOPI.mtl_pr_trans_prod_item(
126: org_id => l_operation_rec.organization_id,
127: item_number_in => l_operation_rec.assembly_item_number,
128: item_id_out => l_operation_rec.assembly_item_id,
129: err_text => l_err_text);
130: if l_ret_code <> 0 then
131: Fnd_Message.Set_Name('BOM', 'BOM_ASSY_ITEM_MISSING');
132: FND_MSG_PUB.Add;
133: raise FND_API.G_EXC_ERROR;
134: end if; -- parse failed
135: end if; -- assembly item number
136:
137: -- set department id
135: end if; -- assembly item number
136:
137: -- set department id
138:
139: If nvl(l_operation_rec.department_code, Fnd_Api.G_Miss_Char) <>
140: Fnd_Api.G_Miss_Char then
141: l_operation_rec.department_id := null;
142: For l_department_rec in l_department_csr(
143: P_code => l_operation_rec.department_code,
136:
137: -- set department id
138:
139: If nvl(l_operation_rec.department_code, Fnd_Api.G_Miss_Char) <>
140: Fnd_Api.G_Miss_Char then
141: l_operation_rec.department_id := null;
142: For l_department_rec in l_department_csr(
143: P_code => l_operation_rec.department_code,
144: P_OrgId => l_operation_rec.organization_id) loop
146: End loop;
147: If l_operation_rec.department_id is null then
148: Fnd_Message.Set_Name('BOM', 'BOM_DEPT_CODE_INVALID');
149: FND_MSG_PUB.Add;
150: raise FND_API.G_EXC_ERROR;
151: End if; -- invalid dept code
152: End if; -- dept code
153:
154: -- Get the Assembly type from Item Id/Org ID and set option dependent flag.
157: FROM MTL_SYSTEM_ITEMS
158: WHERE organization_id = l_operation_rec.organization_id
159: AND inventory_item_id = l_operation_rec.Assembly_Item_Id ;
160:
161: If (nvl(l_operation_rec.option_dependent_flag,Fnd_Api.G_Miss_Num) <> Fnd_Api.G_Miss_Num) then
162: If (g_assy_item_type not in (1,2) and l_operation_rec.option_dependent_flag = 1 ) then
163: Fnd_Message.Set_Name('BOM','BOM_OP_DPTFLAG_MUST_BE_NO');
164: FND_MSG_PUB.Add;
165: Raise FND_API.G_EXC_ERROR;
161: If (nvl(l_operation_rec.option_dependent_flag,Fnd_Api.G_Miss_Num) <> Fnd_Api.G_Miss_Num) then
162: If (g_assy_item_type not in (1,2) and l_operation_rec.option_dependent_flag = 1 ) then
163: Fnd_Message.Set_Name('BOM','BOM_OP_DPTFLAG_MUST_BE_NO');
164: FND_MSG_PUB.Add;
165: Raise FND_API.G_EXC_ERROR;
166: End If;
167: Else
168: If g_assy_item_type in ( 1,2 ) then
169: l_operation_rec.option_dependent_flag := 1;
172: End If;
173: End If;
174:
175: -- null routing sequence id
176: If nvl(l_operation_rec.routing_sequence_id, FND_API.G_MISS_NUM) =
177: FND_API.G_MISS_NUM then
178: If l_operation_rec.alternate_routing_designator = Fnd_Api.G_Miss_Char then
179: l_operation_rec.alternate_routing_designator := null;
180: End if;
173: End If;
174:
175: -- null routing sequence id
176: If nvl(l_operation_rec.routing_sequence_id, FND_API.G_MISS_NUM) =
177: FND_API.G_MISS_NUM then
178: If l_operation_rec.alternate_routing_designator = Fnd_Api.G_Miss_Char then
179: l_operation_rec.alternate_routing_designator := null;
180: End if;
181: For l_routing_rec in l_routing_csr(
174:
175: -- null routing sequence id
176: If nvl(l_operation_rec.routing_sequence_id, FND_API.G_MISS_NUM) =
177: FND_API.G_MISS_NUM then
178: If l_operation_rec.alternate_routing_designator = Fnd_Api.G_Miss_Char then
179: l_operation_rec.alternate_routing_designator := null;
180: End if;
181: For l_routing_rec in l_routing_csr(
182: P_AssyItemId => l_operation_rec.assembly_item_id,
184: P_Alternate => l_operation_rec.alternate_routing_designator) loop
185: l_operation_rec.routing_sequence_id :=
186: l_routing_rec.routing_sequence_id;
187: End loop;
188: If nvl(l_operation_rec.routing_sequence_id, FND_API.G_MISS_NUM) =
189: FND_API.G_MISS_NUM then
190: Fnd_Message.Set_Name('BOM', 'BOM_RTG_SEQ_INVALID');
191: FND_MSG_PUB.Add;
192: Raise FND_API.G_EXC_ERROR;
185: l_operation_rec.routing_sequence_id :=
186: l_routing_rec.routing_sequence_id;
187: End loop;
188: If nvl(l_operation_rec.routing_sequence_id, FND_API.G_MISS_NUM) =
189: FND_API.G_MISS_NUM then
190: Fnd_Message.Set_Name('BOM', 'BOM_RTG_SEQ_INVALID');
191: FND_MSG_PUB.Add;
192: Raise FND_API.G_EXC_ERROR;
193: End if;
188: If nvl(l_operation_rec.routing_sequence_id, FND_API.G_MISS_NUM) =
189: FND_API.G_MISS_NUM then
190: Fnd_Message.Set_Name('BOM', 'BOM_RTG_SEQ_INVALID');
191: FND_MSG_PUB.Add;
192: Raise FND_API.G_EXC_ERROR;
193: End if;
194: End if; -- get routing sequence id
195:
196: If l_operation_rec.operation_type = Fnd_Api.G_MISS_NUM then
192: Raise FND_API.G_EXC_ERROR;
193: End if;
194: End if; -- get routing sequence id
195:
196: If l_operation_rec.operation_type = Fnd_Api.G_MISS_NUM then
197: l_operation_rec.operation_type := g_event;
198: End if;
199:
200: If nvl(l_operation_rec.operation_code, Fnd_Api.G_Miss_Char) <>
196: If l_operation_rec.operation_type = Fnd_Api.G_MISS_NUM then
197: l_operation_rec.operation_type := g_event;
198: End if;
199:
200: If nvl(l_operation_rec.operation_code, Fnd_Api.G_Miss_Char) <>
201: Fnd_Api.G_Miss_Char then
202: l_operation_rec.standard_operation_id := null;
203: For l_StdOp_rec in l_StdOp_csr(
204: P_Code => l_operation_rec.operation_code,
197: l_operation_rec.operation_type := g_event;
198: End if;
199:
200: If nvl(l_operation_rec.operation_code, Fnd_Api.G_Miss_Char) <>
201: Fnd_Api.G_Miss_Char then
202: l_operation_rec.standard_operation_id := null;
203: For l_StdOp_rec in l_StdOp_csr(
204: P_Code => l_operation_rec.operation_code,
205: P_OpType => l_operation_rec.operation_type,
209: End loop; -- get standard operation id
210: If l_operation_rec.standard_operation_id is null then
211: Fnd_Message.Set_Name('BOM', 'BOM_STD_OP_CODE_INVALID');
212: FND_MSG_PUB.Add;
213: Raise FND_API.G_EXC_ERROR;
214: End if; -- invalid op code
215: End if; -- std op code
216:
217: x_operation_rec := l_operation_rec;
222: p_count => x_msg_count,
223: p_data => x_msg_data
224: );
225: EXCEPTION
226: WHEN FND_API.G_EXC_ERROR THEN
227: x_return_status := FND_API.G_RET_STS_ERROR;
228: FND_MSG_PUB.Count_And_Get(
229: p_count => x_msg_count,
230: p_data => x_msg_data
223: p_data => x_msg_data
224: );
225: EXCEPTION
226: WHEN FND_API.G_EXC_ERROR THEN
227: x_return_status := FND_API.G_RET_STS_ERROR;
228: FND_MSG_PUB.Count_And_Get(
229: p_count => x_msg_count,
230: p_data => x_msg_data
231: );
228: FND_MSG_PUB.Count_And_Get(
229: p_count => x_msg_count,
230: p_data => x_msg_data
231: );
232: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
233: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
234: FND_MSG_PUB.Count_And_Get(
235: p_count => x_msg_count,
236: p_data => x_msg_data
229: p_count => x_msg_count,
230: p_data => x_msg_data
231: );
232: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
233: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
234: FND_MSG_PUB.Count_And_Get(
235: p_count => x_msg_count,
236: p_data => x_msg_data
237: );
235: p_count => x_msg_count,
236: p_data => x_msg_data
237: );
238: WHEN OTHERS THEN
239: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
240: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
241: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
242: END IF;
243: FND_MSG_PUB.Count_And_Get(
247: END AssignOperation;
248:
249: PROCEDURE ValidateOperation(
250: p_api_version IN NUMBER,
251: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
252: p_commit IN VARCHAR2 := FND_API.G_FALSE,
253: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
254: x_return_status IN OUT NOCOPY VARCHAR2,
255: x_msg_count IN OUT NOCOPY NUMBER,
248:
249: PROCEDURE ValidateOperation(
250: p_api_version IN NUMBER,
251: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
252: p_commit IN VARCHAR2 := FND_API.G_FALSE,
253: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
254: x_return_status IN OUT NOCOPY VARCHAR2,
255: x_msg_count IN OUT NOCOPY NUMBER,
256: x_msg_data IN OUT NOCOPY VARCHAR2,
249: PROCEDURE ValidateOperation(
250: p_api_version IN NUMBER,
251: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
252: p_commit IN VARCHAR2 := FND_API.G_FALSE,
253: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
254: x_return_status IN OUT NOCOPY VARCHAR2,
255: x_msg_count IN OUT NOCOPY NUMBER,
256: x_msg_data IN OUT NOCOPY VARCHAR2,
257: p_operation_rec IN OPERATION_REC_TYPE := G_MISS_OPERATION_REC,
404: BEGIN
405: -- Standard Start of API savepoint
406: SAVEPOINT ValidateOperation_Pvt;
407: -- Standard call to check for call compatibility.
408: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name,
409: G_PKG_NAME) THEN
410: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
411: END IF;
412: -- Initialize message list if p_init_msg_list is set to TRUE.
406: SAVEPOINT ValidateOperation_Pvt;
407: -- Standard call to check for call compatibility.
408: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name,
409: G_PKG_NAME) THEN
410: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
411: END IF;
412: -- Initialize message list if p_init_msg_list is set to TRUE.
413: IF FND_API.to_Boolean(p_init_msg_list) THEN
414: FND_MSG_PUB.initialize;
409: G_PKG_NAME) THEN
410: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
411: END IF;
412: -- Initialize message list if p_init_msg_list is set to TRUE.
413: IF FND_API.to_Boolean(p_init_msg_list) THEN
414: FND_MSG_PUB.initialize;
415: END IF;
416: -- Initialize API return status to success
417: x_return_status := FND_API.G_RET_STS_SUCCESS;
413: IF FND_API.to_Boolean(p_init_msg_list) THEN
414: FND_MSG_PUB.initialize;
415: END IF;
416: -- Initialize API return status to success
417: x_return_status := FND_API.G_RET_STS_SUCCESS;
418:
419: -- API body
420: l_operation_rec := p_operation_rec;
421: If p_validation_level = FND_API.G_VALID_LEVEL_FULL then
417: x_return_status := FND_API.G_RET_STS_SUCCESS;
418:
419: -- API body
420: l_operation_rec := p_operation_rec;
421: If p_validation_level = FND_API.G_VALID_LEVEL_FULL then
422: AssignOperation(
423: p_api_version => 1,
424: p_init_msg_list => p_init_msg_list,
425: p_commit => p_commit,
422: AssignOperation(
423: p_api_version => 1,
424: p_init_msg_list => p_init_msg_list,
425: p_commit => p_commit,
426: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
427: x_return_status => l_return_status,
428: x_msg_count => l_msg_count,
429: x_msg_data => l_msg_data,
430: p_operation_rec => l_operation_rec,
428: x_msg_count => l_msg_count,
429: x_msg_data => l_msg_data,
430: p_operation_rec => l_operation_rec,
431: x_operation_rec => l_operation_rec);
432: If l_return_status = FND_API.G_RET_STS_ERROR then
433: Raise FND_API.G_EXC_ERROR;
434: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
435: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
436: End if; -- error
429: x_msg_data => l_msg_data,
430: p_operation_rec => l_operation_rec,
431: x_operation_rec => l_operation_rec);
432: If l_return_status = FND_API.G_RET_STS_ERROR then
433: Raise FND_API.G_EXC_ERROR;
434: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
435: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
436: End if; -- error
437: End if; -- assign values
430: p_operation_rec => l_operation_rec,
431: x_operation_rec => l_operation_rec);
432: If l_return_status = FND_API.G_RET_STS_ERROR then
433: Raise FND_API.G_EXC_ERROR;
434: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
435: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
436: End if; -- error
437: End if; -- assign values
438:
431: x_operation_rec => l_operation_rec);
432: If l_return_status = FND_API.G_RET_STS_ERROR then
433: Raise FND_API.G_EXC_ERROR;
434: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
435: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
436: End if; -- error
437: End if; -- assign values
438:
439: -- verify operation seq num is not null
439: -- verify operation seq num is not null
440: If l_operation_rec .operation_seq_num is null then
441: Fnd_Message.Set_Name('BOM', 'BOM_OP_SEQ_NUM_MISSING');
442: FND_MSG_PUB.Add;
443: Raise FND_API.G_EXC_ERROR;
444: End if;
445:
446: -- check effective date entered
447: If l_operation_rec.new_effectivity_date is null then
446: -- check effective date entered
447: If l_operation_rec.new_effectivity_date is null then
448: Fnd_Message.Set_Name('BOM', 'BOM_EFF_DATE_MISSING');
449: FND_MSG_PUB.Add;
450: Raise FND_API.G_EXC_ERROR;
451: End if;
452:
453: -- verify uniqueness of operation
454: For l_duplicate_rec in l_Duplicate_csr(
458: P_OpType => l_operation_rec.operation_type,
459: P_EffDate => l_operation_rec.new_effectivity_date) loop
460: Fnd_Message.Set_Name('BOM', 'BOM_OPERATION_DUPLICATE');
461: FND_MSG_PUB.Add;
462: Raise FND_API.G_EXC_ERROR;
463: End loop;
464:
465: -- check for existence of routing
466:
467: For l_routing_rec in l_routing_csr(
468: P_RtgSeqId => l_operation_rec.routing_sequence_id) loop
469: Fnd_Message.Set_Name('BOM', 'BOM_RTG_SEQ_INVALID');
470: FND_MSG_PUB.Add;
471: Raise FND_API.G_EXC_ERROR;
472: End loop; -- routing existence
473:
474: -- make sure there is no overlapping operations
475:
481: P_EffDate => l_operation_rec.new_effectivity_date,
482: P_DisDate => l_operation_rec.disable_date) loop
483: Fnd_Message.Set_Name('BOM', 'BOM_IMPL_OP_OVERLAP');
484: FND_MSG_PUB.Add;
485: Raise FND_API.G_EXC_ERROR;
486: End loop;
487:
488: -- verify that the routing does not have a common. If so, it cannot have
489: -- operations
490: For l_common_rec in l_common_csr(
491: P_RtgSeqId => l_operation_rec.routing_sequence_id) loop
492: Fnd_Message.Set_Name('BOM', 'BOM_COMMON_OP');
493: FND_MSG_PUB.Add;
494: Raise FND_API.G_EXC_ERROR;
495: End loop;
496:
497: -- Op Code is mandatory for Processes and Line Operations
498: If l_operation_rec.operation_type in (g_process, g_LineOp) and
498: If l_operation_rec.operation_type in (g_process, g_LineOp) and
499: l_operation_rec.standard_operation_id is null then
500: Fnd_Message.Set_Name('BOM', 'BOM_STD_OP_REQUIRED');
501: FND_MSG_PUB.Add;
502: Raise FND_API.G_EXC_ERROR;
503: End if; -- mandatory op code
504:
505: -- can not reference null op code
506: If l_operation_rec.standard_operation_id is null then
521: If l_PrevRefFlag = g_no and l_operation_rec.reference_flag = g_yes then
522: Fnd_Message.Set_Name('BOM', 'BOM_COPY_REF_OPERATION');
523: Fnd_Message.Set_Token('OPERATION', l_PrevStdCode);
524: FND_MSG_PUB.Add;
525: Raise FND_API.G_EXC_ERROR;
526: End if;
527:
528: -- Standard Operation has changed to not null value
529: If nvl(l_PrevStdOp, -1) <> l_operation_rec.standard_operation_id then
531: For l_resource_rec in l_OpResources_csr(
532: P_OpSeqId => l_operation_rec.operation_sequence_id) loop
533: Fnd_Message.Set_Name('BOM', 'BOM_CANNOT_COPY_STD_OP');
534: FND_MSG_PUB.Add;
535: Raise FND_API.G_EXC_ERROR;
536: End loop; -- resources exist, cannot copy
537: l_StdOpFound := false;
538: For l_StdOp_rec in l_StdOp_csr(
539: P_OpType => l_operation_rec.operation_type,
566: End loop; -- copy standard operation
567: If not l_StdOpFound then
568: Fnd_Message.Set_Name('BOM', 'BOM_STD_OP_ID_INVALID');
569: FND_MSG_PUB.Add;
570: Raise FND_API.G_EXC_ERROR;
571: End if; -- invalid op code
572: -- copy op resources
573: l_UserId := nvl(Fnd_Global.USER_ID, -1);
574: l_LoginId := Fnd_Global.LOGIN_ID;
724: End loop; -- copy standard operation
725: If not l_StdOpFound then
726: Fnd_Message.Set_Name('BOM', 'BOM_STD_OP_ID_INVALID');
727: FND_MSG_PUB.Add;
728: Raise FND_API.G_EXC_ERROR;
729: End if; -- invalid op code
730: End if; -- referenced
731:
732: -- Validate Department
735: P_DeptId => l_operation_rec.department_id,
736: P_EffDate => l_operation_rec.new_effectivity_date) loop
737: Fnd_Message.Set_Name('BOM', 'BOM_DEPT_ID_INVALID');
738: FND_MSG_PUB.Add;
739: Raise FND_API.G_EXC_ERROR;
740: End loop; -- invalid department
741:
742: -- validate operation details
743:
759: or (l_operation_rec.operation_yield_enabled not in (1,2))
760: then
761: Fnd_Message.Set_Name('BOM', 'BOM_OPERATION_ERROR');
762: FND_MSG_PUB.Add;
763: Raise FND_API.G_EXC_ERROR;
764: End if; -- etc, etc, etc
765:
766: -- CFM validation
767:
803: (l_operation_rec.process_op_seq_id is not null or
804: l_operation_rec.line_op_seq_id is not null) then
805: Fnd_Message.Set_Name('BOM', 'BOM_PARENT_OP_NULL');
806: FND_MSG_PUB.Add;
807: Raise FND_API.G_EXC_ERROR;
808: End if; -- only events can have parents
809:
810: For l_process_rec in l_parents_csr(
811: P_ParentSeqId => l_operation_rec.process_op_seq_id) loop
810: For l_process_rec in l_parents_csr(
811: P_ParentSeqId => l_operation_rec.process_op_seq_id) loop
812: Fnd_Message.Set_Name('BOM', 'BOM_PARENT_OP_INVALID');
813: FND_MSG_PUB.Add;
814: Raise FND_API.G_EXC_ERROR;
815: End loop; -- invalid process
816:
817: For l_LineOp_rec in l_parents_csr(
818: P_ParentSeqId => l_operation_rec.line_op_seq_id) loop
817: For l_LineOp_rec in l_parents_csr(
818: P_ParentSeqId => l_operation_rec.line_op_seq_id) loop
819: Fnd_Message.Set_Name('BOM', 'BOM_PARENT_OP_INVALID');
820: FND_MSG_PUB.Add;
821: Raise FND_API.G_EXC_ERROR;
822: End loop; -- invalid line operation
823:
824: x_operation_rec := l_operation_rec;
825:
825:
826: -- End of API body.
827:
828: -- Standard check of p_commit.
829: IF FND_API.To_Boolean(p_commit) THEN
830: COMMIT WORK;
831: END IF;
832:
833: -- Standard call to get message count and if count is 1, get message info.
835: p_count => x_msg_count,
836: p_data => x_msg_data
837: );
838: EXCEPTION
839: WHEN FND_API.G_EXC_ERROR THEN
840: ROLLBACK TO ValidateOperation_Pvt;
841: x_return_status := FND_API.G_RET_STS_ERROR;
842: FND_MSG_PUB.Count_And_Get(
843: p_count => x_msg_count,
837: );
838: EXCEPTION
839: WHEN FND_API.G_EXC_ERROR THEN
840: ROLLBACK TO ValidateOperation_Pvt;
841: x_return_status := FND_API.G_RET_STS_ERROR;
842: FND_MSG_PUB.Count_And_Get(
843: p_count => x_msg_count,
844: p_data => x_msg_data
845: );
842: FND_MSG_PUB.Count_And_Get(
843: p_count => x_msg_count,
844: p_data => x_msg_data
845: );
846: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
847: ROLLBACK TO ValidateOperation_Pvt;
848: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
849: FND_MSG_PUB.Count_And_Get(
850: p_count => x_msg_count,
844: p_data => x_msg_data
845: );
846: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
847: ROLLBACK TO ValidateOperation_Pvt;
848: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
849: FND_MSG_PUB.Count_And_Get(
850: p_count => x_msg_count,
851: p_data => x_msg_data
852: );
851: p_data => x_msg_data
852: );
853: WHEN OTHERS THEN
854: ROLLBACK TO ValidateOperation_Pvt;
855: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
856: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
857: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
858: END IF;
859: FND_MSG_PUB.Count_And_Get(
863: End ValidateOperation;
864:
865: PROCEDURE CreateOperation(
866: p_api_version IN NUMBER,
867: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
868: p_commit IN VARCHAR2 := FND_API.G_FALSE,
869: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
870: x_return_status IN OUT NOCOPY VARCHAR2,
871: x_msg_count IN OUT NOCOPY NUMBER,
864:
865: PROCEDURE CreateOperation(
866: p_api_version IN NUMBER,
867: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
868: p_commit IN VARCHAR2 := FND_API.G_FALSE,
869: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
870: x_return_status IN OUT NOCOPY VARCHAR2,
871: x_msg_count IN OUT NOCOPY NUMBER,
872: x_msg_data IN OUT NOCOPY VARCHAR2,
865: PROCEDURE CreateOperation(
866: p_api_version IN NUMBER,
867: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
868: p_commit IN VARCHAR2 := FND_API.G_FALSE,
869: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
870: x_return_status IN OUT NOCOPY VARCHAR2,
871: x_msg_count IN OUT NOCOPY NUMBER,
872: x_msg_data IN OUT NOCOPY VARCHAR2,
873: p_operation_rec IN OPERATION_REC_TYPE := G_MISS_OPERATION_REC,
891: BEGIN
892: -- Standard Start of API savepoint
893: SAVEPOINT CreateOperation_Pvt;
894: -- Standard call to check for call compatibility.
895: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name,
896: G_PKG_NAME) THEN
897: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
898: END IF;
899: -- Initialize message list if p_init_msg_list is set to TRUE.
893: SAVEPOINT CreateOperation_Pvt;
894: -- Standard call to check for call compatibility.
895: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name,
896: G_PKG_NAME) THEN
897: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
898: END IF;
899: -- Initialize message list if p_init_msg_list is set to TRUE.
900: IF FND_API.to_Boolean(p_init_msg_list) THEN
901: FND_MSG_PUB.initialize;
896: G_PKG_NAME) THEN
897: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
898: END IF;
899: -- Initialize message list if p_init_msg_list is set to TRUE.
900: IF FND_API.to_Boolean(p_init_msg_list) THEN
901: FND_MSG_PUB.initialize;
902: END IF;
903: -- Initialize API return status to success
904: x_return_status := FND_API.G_RET_STS_SUCCESS;
900: IF FND_API.to_Boolean(p_init_msg_list) THEN
901: FND_MSG_PUB.initialize;
902: END IF;
903: -- Initialize API return status to success
904: x_return_status := FND_API.G_RET_STS_SUCCESS;
905:
906: -- API body
907: l_operation_rec := p_operation_rec;
908:
911: For l_NewOper_rec in l_NewOper_csr loop
912: l_operation_rec.operation_sequence_id := l_NewOper_rec.new_op_seq_id;
913: End loop; -- new primary key
914:
915: If l_operation_rec.routing_sequence_id = Fnd_Api.G_Miss_Num then
916: l_operation_rec.routing_sequence_id := null;
917: End if;
918:
919: If l_operation_rec.operation_seq_num = Fnd_Api.G_Miss_Num then
915: If l_operation_rec.routing_sequence_id = Fnd_Api.G_Miss_Num then
916: l_operation_rec.routing_sequence_id := null;
917: End if;
918:
919: If l_operation_rec.operation_seq_num = Fnd_Api.G_Miss_Num then
920: l_operation_rec.operation_seq_num := null;
921: End if;
922:
923: If nvl(l_operation_rec.new_operation_seq_num, Fnd_Api.G_Miss_Num) =
919: If l_operation_rec.operation_seq_num = Fnd_Api.G_Miss_Num then
920: l_operation_rec.operation_seq_num := null;
921: End if;
922:
923: If nvl(l_operation_rec.new_operation_seq_num, Fnd_Api.G_Miss_Num) =
924: Fnd_Api.G_Miss_Num then
925: l_operation_rec.new_operation_seq_num := l_operation_rec.operation_seq_num;
926: End if;
927:
920: l_operation_rec.operation_seq_num := null;
921: End if;
922:
923: If nvl(l_operation_rec.new_operation_seq_num, Fnd_Api.G_Miss_Num) =
924: Fnd_Api.G_Miss_Num then
925: l_operation_rec.new_operation_seq_num := l_operation_rec.operation_seq_num;
926: End if;
927:
928: If l_operation_rec.standard_operation_id = Fnd_Api.G_Miss_Num then
924: Fnd_Api.G_Miss_Num then
925: l_operation_rec.new_operation_seq_num := l_operation_rec.operation_seq_num;
926: End if;
927:
928: If l_operation_rec.standard_operation_id = Fnd_Api.G_Miss_Num then
929: l_operation_rec.standard_operation_id := null;
930: End if;
931:
932: If l_operation_rec.department_id = Fnd_Api.G_Miss_Num then
928: If l_operation_rec.standard_operation_id = Fnd_Api.G_Miss_Num then
929: l_operation_rec.standard_operation_id := null;
930: End if;
931:
932: If l_operation_rec.department_id = Fnd_Api.G_Miss_Num then
933: l_operation_rec.department_id := null;
934: End if;
935:
936: If l_operation_rec.operation_lead_time_percent = Fnd_Api.G_Miss_Num then
932: If l_operation_rec.department_id = Fnd_Api.G_Miss_Num then
933: l_operation_rec.department_id := null;
934: End if;
935:
936: If l_operation_rec.operation_lead_time_percent = Fnd_Api.G_Miss_Num then
937: l_operation_rec.operation_lead_time_percent := null;
938: End if;
939:
940: If l_operation_rec.minimum_transfer_quantity = Fnd_Api.G_Miss_Num then
936: If l_operation_rec.operation_lead_time_percent = Fnd_Api.G_Miss_Num then
937: l_operation_rec.operation_lead_time_percent := null;
938: End if;
939:
940: If l_operation_rec.minimum_transfer_quantity = Fnd_Api.G_Miss_Num then
941: l_operation_rec.minimum_transfer_quantity := null;
942: End if;
943:
944: If nvl(l_operation_rec.count_point_type, Fnd_Api.G_Miss_Num) =
940: If l_operation_rec.minimum_transfer_quantity = Fnd_Api.G_Miss_Num then
941: l_operation_rec.minimum_transfer_quantity := null;
942: End if;
943:
944: If nvl(l_operation_rec.count_point_type, Fnd_Api.G_Miss_Num) =
945: Fnd_Api.G_Miss_Num then
946: l_operation_rec.count_point_type := 1;
947: End if;
948:
941: l_operation_rec.minimum_transfer_quantity := null;
942: End if;
943:
944: If nvl(l_operation_rec.count_point_type, Fnd_Api.G_Miss_Num) =
945: Fnd_Api.G_Miss_Num then
946: l_operation_rec.count_point_type := 1;
947: End if;
948:
949: If l_operation_rec.operation_description = Fnd_Api.G_Miss_Char then
945: Fnd_Api.G_Miss_Num then
946: l_operation_rec.count_point_type := 1;
947: End if;
948:
949: If l_operation_rec.operation_description = Fnd_Api.G_Miss_Char then
950: l_operation_rec.operation_description := null;
951: End if;
952:
953: If nvl(l_operation_rec.effectivity_date, Fnd_Api.G_Miss_Date) =
949: If l_operation_rec.operation_description = Fnd_Api.G_Miss_Char then
950: l_operation_rec.operation_description := null;
951: End if;
952:
953: If nvl(l_operation_rec.effectivity_date, Fnd_Api.G_Miss_Date) =
954: Fnd_Api.G_Miss_Date then
955: l_operation_rec.effectivity_date := trunc(sysdate);
956: End if;
957:
950: l_operation_rec.operation_description := null;
951: End if;
952:
953: If nvl(l_operation_rec.effectivity_date, Fnd_Api.G_Miss_Date) =
954: Fnd_Api.G_Miss_Date then
955: l_operation_rec.effectivity_date := trunc(sysdate);
956: End if;
957:
958: If nvl(l_operation_rec.new_effectivity_date, Fnd_Api.G_Miss_Date) =
954: Fnd_Api.G_Miss_Date then
955: l_operation_rec.effectivity_date := trunc(sysdate);
956: End if;
957:
958: If nvl(l_operation_rec.new_effectivity_date, Fnd_Api.G_Miss_Date) =
959: Fnd_Api.G_Miss_Date then
960: l_operation_rec.new_effectivity_date := l_operation_rec.effectivity_date;
961: End if;
962:
955: l_operation_rec.effectivity_date := trunc(sysdate);
956: End if;
957:
958: If nvl(l_operation_rec.new_effectivity_date, Fnd_Api.G_Miss_Date) =
959: Fnd_Api.G_Miss_Date then
960: l_operation_rec.new_effectivity_date := l_operation_rec.effectivity_date;
961: End if;
962:
963: If l_operation_rec.disable_date = Fnd_Api.G_Miss_Date then
959: Fnd_Api.G_Miss_Date then
960: l_operation_rec.new_effectivity_date := l_operation_rec.effectivity_date;
961: End if;
962:
963: If l_operation_rec.disable_date = Fnd_Api.G_Miss_Date then
964: l_operation_rec.disable_date := null;
965: End if;
966:
967: If nvl(l_operation_rec.backflush_flag, Fnd_Api.G_Miss_Num) =
963: If l_operation_rec.disable_date = Fnd_Api.G_Miss_Date then
964: l_operation_rec.disable_date := null;
965: End if;
966:
967: If nvl(l_operation_rec.backflush_flag, Fnd_Api.G_Miss_Num) =
968: Fnd_Api.G_Miss_Num then
969: l_operation_rec.backflush_flag := g_yes;
970: End if;
971:
964: l_operation_rec.disable_date := null;
965: End if;
966:
967: If nvl(l_operation_rec.backflush_flag, Fnd_Api.G_Miss_Num) =
968: Fnd_Api.G_Miss_Num then
969: l_operation_rec.backflush_flag := g_yes;
970: End if;
971:
972: If nvl(l_operation_rec.option_dependent_flag, Fnd_Api.G_Miss_Num) =
968: Fnd_Api.G_Miss_Num then
969: l_operation_rec.backflush_flag := g_yes;
970: End if;
971:
972: If nvl(l_operation_rec.option_dependent_flag, Fnd_Api.G_Miss_Num) =
973: Fnd_Api.G_Miss_Num then
974: l_operation_rec.option_dependent_flag := g_no;
975: End if;
976:
969: l_operation_rec.backflush_flag := g_yes;
970: End if;
971:
972: If nvl(l_operation_rec.option_dependent_flag, Fnd_Api.G_Miss_Num) =
973: Fnd_Api.G_Miss_Num then
974: l_operation_rec.option_dependent_flag := g_no;
975: End if;
976:
977: If l_operation_rec.attribute_category = Fnd_Api.G_Miss_Char then
973: Fnd_Api.G_Miss_Num then
974: l_operation_rec.option_dependent_flag := g_no;
975: End if;
976:
977: If l_operation_rec.attribute_category = Fnd_Api.G_Miss_Char then
978: l_operation_rec.attribute_category := null;
979: End if;
980:
981: If l_operation_rec.attribute1 = Fnd_Api.G_Miss_Char then
977: If l_operation_rec.attribute_category = Fnd_Api.G_Miss_Char then
978: l_operation_rec.attribute_category := null;
979: End if;
980:
981: If l_operation_rec.attribute1 = Fnd_Api.G_Miss_Char then
982: l_operation_rec.attribute1 := null;
983: End if;
984:
985: If l_operation_rec.attribute2 = Fnd_Api.G_Miss_Char then
981: If l_operation_rec.attribute1 = Fnd_Api.G_Miss_Char then
982: l_operation_rec.attribute1 := null;
983: End if;
984:
985: If l_operation_rec.attribute2 = Fnd_Api.G_Miss_Char then
986: l_operation_rec.attribute2 := null;
987: End if;
988:
989: If l_operation_rec.attribute3 = Fnd_Api.G_Miss_Char then
985: If l_operation_rec.attribute2 = Fnd_Api.G_Miss_Char then
986: l_operation_rec.attribute2 := null;
987: End if;
988:
989: If l_operation_rec.attribute3 = Fnd_Api.G_Miss_Char then
990: l_operation_rec.attribute3 := null;
991: End if;
992:
993: If l_operation_rec.attribute4 = Fnd_Api.G_Miss_Char then
989: If l_operation_rec.attribute3 = Fnd_Api.G_Miss_Char then
990: l_operation_rec.attribute3 := null;
991: End if;
992:
993: If l_operation_rec.attribute4 = Fnd_Api.G_Miss_Char then
994: l_operation_rec.attribute4 := null;
995: End if;
996:
997: If l_operation_rec.attribute5 = Fnd_Api.G_Miss_Char then
993: If l_operation_rec.attribute4 = Fnd_Api.G_Miss_Char then
994: l_operation_rec.attribute4 := null;
995: End if;
996:
997: If l_operation_rec.attribute5 = Fnd_Api.G_Miss_Char then
998: l_operation_rec.attribute5 := null;
999: End if;
1000:
1001: If l_operation_rec.attribute6 = Fnd_Api.G_Miss_Char then
997: If l_operation_rec.attribute5 = Fnd_Api.G_Miss_Char then
998: l_operation_rec.attribute5 := null;
999: End if;
1000:
1001: If l_operation_rec.attribute6 = Fnd_Api.G_Miss_Char then
1002: l_operation_rec.attribute6 := null;
1003: End if;
1004:
1005: If l_operation_rec.attribute7 = Fnd_Api.G_Miss_Char then
1001: If l_operation_rec.attribute6 = Fnd_Api.G_Miss_Char then
1002: l_operation_rec.attribute6 := null;
1003: End if;
1004:
1005: If l_operation_rec.attribute7 = Fnd_Api.G_Miss_Char then
1006: l_operation_rec.attribute7 := null;
1007: End if;
1008:
1009: If l_operation_rec.attribute8 = Fnd_Api.G_Miss_Char then
1005: If l_operation_rec.attribute7 = Fnd_Api.G_Miss_Char then
1006: l_operation_rec.attribute7 := null;
1007: End if;
1008:
1009: If l_operation_rec.attribute8 = Fnd_Api.G_Miss_Char then
1010: l_operation_rec.attribute8 := null;
1011: End if;
1012:
1013: If l_operation_rec.attribute9 = Fnd_Api.G_Miss_Char then
1009: If l_operation_rec.attribute8 = Fnd_Api.G_Miss_Char then
1010: l_operation_rec.attribute8 := null;
1011: End if;
1012:
1013: If l_operation_rec.attribute9 = Fnd_Api.G_Miss_Char then
1014: l_operation_rec.attribute9 := null;
1015: End if;
1016:
1017: If l_operation_rec.attribute10 = Fnd_Api.G_Miss_Char then
1013: If l_operation_rec.attribute9 = Fnd_Api.G_Miss_Char then
1014: l_operation_rec.attribute9 := null;
1015: End if;
1016:
1017: If l_operation_rec.attribute10 = Fnd_Api.G_Miss_Char then
1018: l_operation_rec.attribute10 := null;
1019: End if;
1020:
1021: If l_operation_rec.attribute11 = Fnd_Api.G_Miss_Char then
1017: If l_operation_rec.attribute10 = Fnd_Api.G_Miss_Char then
1018: l_operation_rec.attribute10 := null;
1019: End if;
1020:
1021: If l_operation_rec.attribute11 = Fnd_Api.G_Miss_Char then
1022: l_operation_rec.attribute11 := null;
1023: End if;
1024:
1025: If l_operation_rec.attribute12 = Fnd_Api.G_Miss_Char then
1021: If l_operation_rec.attribute11 = Fnd_Api.G_Miss_Char then
1022: l_operation_rec.attribute11 := null;
1023: End if;
1024:
1025: If l_operation_rec.attribute12 = Fnd_Api.G_Miss_Char then
1026: l_operation_rec.attribute12 := null;
1027: End if;
1028:
1029: If l_operation_rec.attribute13 = Fnd_Api.G_Miss_Char then
1025: If l_operation_rec.attribute12 = Fnd_Api.G_Miss_Char then
1026: l_operation_rec.attribute12 := null;
1027: End if;
1028:
1029: If l_operation_rec.attribute13 = Fnd_Api.G_Miss_Char then
1030: l_operation_rec.attribute13 := null;
1031: End if;
1032:
1033: If l_operation_rec.attribute14 = Fnd_Api.G_Miss_Char then
1029: If l_operation_rec.attribute13 = Fnd_Api.G_Miss_Char then
1030: l_operation_rec.attribute13 := null;
1031: End if;
1032:
1033: If l_operation_rec.attribute14 = Fnd_Api.G_Miss_Char then
1034: l_operation_rec.attribute14 := null;
1035: End if;
1036:
1037: If l_operation_rec.attribute15 = Fnd_Api.G_Miss_Char then
1033: If l_operation_rec.attribute14 = Fnd_Api.G_Miss_Char then
1034: l_operation_rec.attribute14 := null;
1035: End if;
1036:
1037: If l_operation_rec.attribute15 = Fnd_Api.G_Miss_Char then
1038: l_operation_rec.attribute15 := null;
1039: End if;
1040:
1041: If l_operation_rec.assembly_item_id = Fnd_Api.G_Miss_Num then
1037: If l_operation_rec.attribute15 = Fnd_Api.G_Miss_Char then
1038: l_operation_rec.attribute15 := null;
1039: End if;
1040:
1041: If l_operation_rec.assembly_item_id = Fnd_Api.G_Miss_Num then
1042: l_operation_rec.assembly_item_id := null;
1043: End if;
1044:
1045: If l_operation_rec.organization_id = Fnd_Api.G_Miss_Num then
1041: If l_operation_rec.assembly_item_id = Fnd_Api.G_Miss_Num then
1042: l_operation_rec.assembly_item_id := null;
1043: End if;
1044:
1045: If l_operation_rec.organization_id = Fnd_Api.G_Miss_Num then
1046: l_operation_rec.organization_id := null;
1047: End if;
1048:
1049: If l_operation_rec.alternate_routing_designator = Fnd_Api.G_Miss_Char then
1045: If l_operation_rec.organization_id = Fnd_Api.G_Miss_Num then
1046: l_operation_rec.organization_id := null;
1047: End if;
1048:
1049: If l_operation_rec.alternate_routing_designator = Fnd_Api.G_Miss_Char then
1050: l_operation_rec.alternate_routing_designator := null;
1051: End if;
1052:
1053: If l_operation_rec.organization_code = Fnd_Api.G_Miss_Char then
1049: If l_operation_rec.alternate_routing_designator = Fnd_Api.G_Miss_Char then
1050: l_operation_rec.alternate_routing_designator := null;
1051: End if;
1052:
1053: If l_operation_rec.organization_code = Fnd_Api.G_Miss_Char then
1054: l_operation_rec.organization_code := null;
1055: End if;
1056:
1057: If l_operation_rec.assembly_item_number = Fnd_Api.G_Miss_Char then
1053: If l_operation_rec.organization_code = Fnd_Api.G_Miss_Char then
1054: l_operation_rec.organization_code := null;
1055: End if;
1056:
1057: If l_operation_rec.assembly_item_number = Fnd_Api.G_Miss_Char then
1058: l_operation_rec.assembly_item_number := null;
1059: End if;
1060:
1061: If l_operation_rec.department_code = Fnd_Api.G_Miss_Char then
1057: If l_operation_rec.assembly_item_number = Fnd_Api.G_Miss_Char then
1058: l_operation_rec.assembly_item_number := null;
1059: End if;
1060:
1061: If l_operation_rec.department_code = Fnd_Api.G_Miss_Char then
1062: l_operation_rec.department_code := null;
1063: End if;
1064:
1065: If l_operation_rec.operation_code = Fnd_Api.G_Miss_Char then
1061: If l_operation_rec.department_code = Fnd_Api.G_Miss_Char then
1062: l_operation_rec.department_code := null;
1063: End if;
1064:
1065: If l_operation_rec.operation_code = Fnd_Api.G_Miss_Char then
1066: l_operation_rec.operation_code := null;
1067: End if;
1068:
1069: If l_operation_rec.operation_type = Fnd_Api.G_Miss_Num then
1065: If l_operation_rec.operation_code = Fnd_Api.G_Miss_Char then
1066: l_operation_rec.operation_code := null;
1067: End if;
1068:
1069: If l_operation_rec.operation_type = Fnd_Api.G_Miss_Num then
1070: l_operation_rec.operation_type := null;
1071: End if;
1072:
1073: If nvl(l_operation_rec.reference_flag, Fnd_Api.G_Miss_Num) =
1069: If l_operation_rec.operation_type = Fnd_Api.G_Miss_Num then
1070: l_operation_rec.operation_type := null;
1071: End if;
1072:
1073: If nvl(l_operation_rec.reference_flag, Fnd_Api.G_Miss_Num) =
1074: Fnd_Api.G_Miss_Num then
1075: l_operation_rec.reference_flag := g_no;
1076: End if;
1077:
1070: l_operation_rec.operation_type := null;
1071: End if;
1072:
1073: If nvl(l_operation_rec.reference_flag, Fnd_Api.G_Miss_Num) =
1074: Fnd_Api.G_Miss_Num then
1075: l_operation_rec.reference_flag := g_no;
1076: End if;
1077:
1078: If l_operation_rec.process_op_seq_id = Fnd_Api.G_Miss_Num then
1074: Fnd_Api.G_Miss_Num then
1075: l_operation_rec.reference_flag := g_no;
1076: End if;
1077:
1078: If l_operation_rec.process_op_seq_id = Fnd_Api.G_Miss_Num then
1079: l_operation_rec.process_op_seq_id := null;
1080: End if;
1081:
1082: If l_operation_rec.line_op_seq_id = Fnd_Api.G_Miss_Num then
1078: If l_operation_rec.process_op_seq_id = Fnd_Api.G_Miss_Num then
1079: l_operation_rec.process_op_seq_id := null;
1080: End if;
1081:
1082: If l_operation_rec.line_op_seq_id = Fnd_Api.G_Miss_Num then
1083: l_operation_rec.line_op_seq_id := null;
1084: End if;
1085:
1086: If l_operation_rec.yield = Fnd_Api.G_Miss_Num then
1082: If l_operation_rec.line_op_seq_id = Fnd_Api.G_Miss_Num then
1083: l_operation_rec.line_op_seq_id := null;
1084: End if;
1085:
1086: If l_operation_rec.yield = Fnd_Api.G_Miss_Num then
1087: l_operation_rec.yield := null;
1088: End if;
1089:
1090: If l_operation_rec.cumulative_yield = Fnd_Api.G_Miss_Num then
1086: If l_operation_rec.yield = Fnd_Api.G_Miss_Num then
1087: l_operation_rec.yield := null;
1088: End if;
1089:
1090: If l_operation_rec.cumulative_yield = Fnd_Api.G_Miss_Num then
1091: l_operation_rec.cumulative_yield := null;
1092: End if;
1093:
1094: If l_operation_rec.reverse_cumulative_yield = Fnd_Api.G_Miss_Num then
1090: If l_operation_rec.cumulative_yield = Fnd_Api.G_Miss_Num then
1091: l_operation_rec.cumulative_yield := null;
1092: End if;
1093:
1094: If l_operation_rec.reverse_cumulative_yield = Fnd_Api.G_Miss_Num then
1095: l_operation_rec.reverse_cumulative_yield := null;
1096: End if;
1097:
1098: If l_operation_rec.labor_time_calc = Fnd_Api.G_Miss_Num then
1094: If l_operation_rec.reverse_cumulative_yield = Fnd_Api.G_Miss_Num then
1095: l_operation_rec.reverse_cumulative_yield := null;
1096: End if;
1097:
1098: If l_operation_rec.labor_time_calc = Fnd_Api.G_Miss_Num then
1099: l_operation_rec.labor_time_calc := null;
1100: End if;
1101:
1102: If l_operation_rec.machine_time_calc = Fnd_Api.G_Miss_Num then
1098: If l_operation_rec.labor_time_calc = Fnd_Api.G_Miss_Num then
1099: l_operation_rec.labor_time_calc := null;
1100: End if;
1101:
1102: If l_operation_rec.machine_time_calc = Fnd_Api.G_Miss_Num then
1103: l_operation_rec.machine_time_calc := null;
1104: End if;
1105:
1106: If l_operation_rec.total_time_calc = Fnd_Api.G_Miss_Num then
1102: If l_operation_rec.machine_time_calc = Fnd_Api.G_Miss_Num then
1103: l_operation_rec.machine_time_calc := null;
1104: End if;
1105:
1106: If l_operation_rec.total_time_calc = Fnd_Api.G_Miss_Num then
1107: l_operation_rec.total_time_calc := null;
1108: End if;
1109:
1110: If l_operation_rec.labor_time_user = Fnd_Api.G_Miss_Num then
1106: If l_operation_rec.total_time_calc = Fnd_Api.G_Miss_Num then
1107: l_operation_rec.total_time_calc := null;
1108: End if;
1109:
1110: If l_operation_rec.labor_time_user = Fnd_Api.G_Miss_Num then
1111: l_operation_rec.labor_time_user := null;
1112: End if;
1113:
1114: If l_operation_rec.machine_time_user = Fnd_Api.G_Miss_Num then
1110: If l_operation_rec.labor_time_user = Fnd_Api.G_Miss_Num then
1111: l_operation_rec.labor_time_user := null;
1112: End if;
1113:
1114: If l_operation_rec.machine_time_user = Fnd_Api.G_Miss_Num then
1115: l_operation_rec.machine_time_user := null;
1116: End if;
1117:
1118: If l_operation_rec.total_time_user = Fnd_Api.G_Miss_Num then
1114: If l_operation_rec.machine_time_user = Fnd_Api.G_Miss_Num then
1115: l_operation_rec.machine_time_user := null;
1116: End if;
1117:
1118: If l_operation_rec.total_time_user = Fnd_Api.G_Miss_Num then
1119: l_operation_rec.total_time_user := null;
1120: End if;
1121:
1122: If l_operation_rec.net_planning_percent = Fnd_Api.G_Miss_Num then
1118: If l_operation_rec.total_time_user = Fnd_Api.G_Miss_Num then
1119: l_operation_rec.total_time_user := null;
1120: End if;
1121:
1122: If l_operation_rec.net_planning_percent = Fnd_Api.G_Miss_Num then
1123: l_operation_rec.net_planning_percent := null;
1124: End if;
1125:
1126: If nvl(l_operation_rec.include_in_rollup, Fnd_Api.G_Miss_Num) =
1122: If l_operation_rec.net_planning_percent = Fnd_Api.G_Miss_Num then
1123: l_operation_rec.net_planning_percent := null;
1124: End if;
1125:
1126: If nvl(l_operation_rec.include_in_rollup, Fnd_Api.G_Miss_Num) =
1127: Fnd_Api.G_Miss_Num then
1128: l_operation_rec.include_in_rollup := g_yes;
1129: End if;
1130:
1123: l_operation_rec.net_planning_percent := null;
1124: End if;
1125:
1126: If nvl(l_operation_rec.include_in_rollup, Fnd_Api.G_Miss_Num) =
1127: Fnd_Api.G_Miss_Num then
1128: l_operation_rec.include_in_rollup := g_yes;
1129: End if;
1130:
1131: If nvl(l_operation_rec.operation_yield_enabled, Fnd_Api.G_Miss_Num) =
1127: Fnd_Api.G_Miss_Num then
1128: l_operation_rec.include_in_rollup := g_yes;
1129: End if;
1130:
1131: If nvl(l_operation_rec.operation_yield_enabled, Fnd_Api.G_Miss_Num) =
1132: Fnd_Api.G_Miss_Num then
1133: l_operation_rec.operation_yield_enabled := g_yes;
1134: End if;
1135:
1128: l_operation_rec.include_in_rollup := g_yes;
1129: End if;
1130:
1131: If nvl(l_operation_rec.operation_yield_enabled, Fnd_Api.G_Miss_Num) =
1132: Fnd_Api.G_Miss_Num then
1133: l_operation_rec.operation_yield_enabled := g_yes;
1134: End if;
1135:
1136: If p_validation_level > FND_API.G_VALID_LEVEL_NONE then
1132: Fnd_Api.G_Miss_Num then
1133: l_operation_rec.operation_yield_enabled := g_yes;
1134: End if;
1135:
1136: If p_validation_level > FND_API.G_VALID_LEVEL_NONE then
1137: ValidateOperation(
1138: p_api_version => 1,
1139: p_init_msg_list => p_init_msg_list,
1140: p_commit => p_commit,
1143: x_msg_count => l_msg_count,
1144: x_msg_data => l_msg_data,
1145: p_operation_rec => l_operation_rec,
1146: x_operation_rec => l_operation_rec);
1147: If l_return_status = FND_API.G_RET_STS_ERROR then
1148: Raise FND_API.G_EXC_ERROR;
1149: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1150: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1151: End if; -- validation error
1144: x_msg_data => l_msg_data,
1145: p_operation_rec => l_operation_rec,
1146: x_operation_rec => l_operation_rec);
1147: If l_return_status = FND_API.G_RET_STS_ERROR then
1148: Raise FND_API.G_EXC_ERROR;
1149: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1150: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1151: End if; -- validation error
1152: End if; -- validate before inserting
1145: p_operation_rec => l_operation_rec,
1146: x_operation_rec => l_operation_rec);
1147: If l_return_status = FND_API.G_RET_STS_ERROR then
1148: Raise FND_API.G_EXC_ERROR;
1149: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1150: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1151: End if; -- validation error
1152: End if; -- validate before inserting
1153:
1146: x_operation_rec => l_operation_rec);
1147: If l_return_status = FND_API.G_RET_STS_ERROR then
1148: Raise FND_API.G_EXC_ERROR;
1149: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1150: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1151: End if; -- validation error
1152: End if; -- validate before inserting
1153:
1154: l_UserId := nvl(Fnd_Global.USER_ID, -1);
1279: x_operation_rec := l_operation_rec;
1280: -- End of API body.
1281:
1282: -- Standard check of p_commit.
1283: IF FND_API.To_Boolean(p_commit) THEN
1284: COMMIT WORK;
1285: END IF;
1286: -- Standard call to get message count and if count is 1, get message info.
1287: FND_MSG_PUB.Count_And_Get(
1288: p_count => x_msg_count,
1289: p_data => x_msg_data
1290: );
1291: EXCEPTION
1292: WHEN FND_API.G_EXC_ERROR THEN
1293: ROLLBACK TO CreateOperation_Pvt;
1294: x_return_status := FND_API.G_RET_STS_ERROR;
1295: FND_MSG_PUB.Count_And_Get(
1296: p_count => x_msg_count,
1290: );
1291: EXCEPTION
1292: WHEN FND_API.G_EXC_ERROR THEN
1293: ROLLBACK TO CreateOperation_Pvt;
1294: x_return_status := FND_API.G_RET_STS_ERROR;
1295: FND_MSG_PUB.Count_And_Get(
1296: p_count => x_msg_count,
1297: p_data => x_msg_data
1298: );
1295: FND_MSG_PUB.Count_And_Get(
1296: p_count => x_msg_count,
1297: p_data => x_msg_data
1298: );
1299: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1300: ROLLBACK TO CreateOperation_Pvt;
1301: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1302: FND_MSG_PUB.Count_And_Get(
1303: p_count => x_msg_count,
1297: p_data => x_msg_data
1298: );
1299: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1300: ROLLBACK TO CreateOperation_Pvt;
1301: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1302: FND_MSG_PUB.Count_And_Get(
1303: p_count => x_msg_count,
1304: p_data => x_msg_data
1305: );
1304: p_data => x_msg_data
1305: );
1306: WHEN OTHERS THEN
1307: ROLLBACK TO CreateOperation_Pvt;
1308: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1309: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1310: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1311: END IF;
1312: FND_MSG_PUB.Count_And_Get(
1316: End CreateOperation;
1317:
1318: PROCEDURE UpdateOperation(
1319: p_api_version IN NUMBER,
1320: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1321: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1322: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1323: x_return_status IN OUT NOCOPY VARCHAR2,
1324: x_msg_count IN OUT NOCOPY NUMBER,
1317:
1318: PROCEDURE UpdateOperation(
1319: p_api_version IN NUMBER,
1320: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1321: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1322: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1323: x_return_status IN OUT NOCOPY VARCHAR2,
1324: x_msg_count IN OUT NOCOPY NUMBER,
1325: x_msg_data IN OUT NOCOPY VARCHAR2,
1318: PROCEDURE UpdateOperation(
1319: p_api_version IN NUMBER,
1320: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1321: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1322: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1323: x_return_status IN OUT NOCOPY VARCHAR2,
1324: x_msg_count IN OUT NOCOPY NUMBER,
1325: x_msg_data IN OUT NOCOPY VARCHAR2,
1326: p_operation_rec IN OPERATION_REC_TYPE := G_MISS_OPERATION_REC,
1356: BEGIN
1357: -- Standard Start of API savepoint
1358: SAVEPOINT UpdateOperation_Pvt;
1359: -- Standard call to check for call compatibility.
1360: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name,
1361: G_PKG_NAME) THEN
1362: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1363: END IF;
1364: -- Initialize message list if p_init_msg_list is set to TRUE.
1358: SAVEPOINT UpdateOperation_Pvt;
1359: -- Standard call to check for call compatibility.
1360: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name,
1361: G_PKG_NAME) THEN
1362: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1363: END IF;
1364: -- Initialize message list if p_init_msg_list is set to TRUE.
1365: IF FND_API.to_Boolean(p_init_msg_list) THEN
1366: FND_MSG_PUB.initialize;
1361: G_PKG_NAME) THEN
1362: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1363: END IF;
1364: -- Initialize message list if p_init_msg_list is set to TRUE.
1365: IF FND_API.to_Boolean(p_init_msg_list) THEN
1366: FND_MSG_PUB.initialize;
1367: END IF;
1368: -- Initialize API return status to success
1369: x_return_status := FND_API.G_RET_STS_SUCCESS;
1365: IF FND_API.to_Boolean(p_init_msg_list) THEN
1366: FND_MSG_PUB.initialize;
1367: END IF;
1368: -- Initialize API return status to success
1369: x_return_status := FND_API.G_RET_STS_SUCCESS;
1370:
1371: -- API body
1372: l_operation_rec := p_operation_rec;
1373:
1370:
1371: -- API body
1372: l_operation_rec := p_operation_rec;
1373:
1374: If p_validation_level = FND_API.G_VALID_LEVEL_FULL then
1375: AssignOperation(
1376: p_api_version => 1,
1377: p_init_msg_list => p_init_msg_list,
1378: p_commit => p_commit,
1382: x_msg_data => l_msg_data,
1383: p_operation_rec => l_operation_rec,
1384: x_operation_rec => l_operation_rec
1385: );
1386: If l_return_status = FND_API.G_RET_STS_ERROR then
1387: Raise FND_API.G_EXC_ERROR;
1388: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1389: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1390: End if; -- assign error
1383: p_operation_rec => l_operation_rec,
1384: x_operation_rec => l_operation_rec
1385: );
1386: If l_return_status = FND_API.G_RET_STS_ERROR then
1387: Raise FND_API.G_EXC_ERROR;
1388: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1389: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1390: End if; -- assign error
1391: End If; -- assign
1384: x_operation_rec => l_operation_rec
1385: );
1386: If l_return_status = FND_API.G_RET_STS_ERROR then
1387: Raise FND_API.G_EXC_ERROR;
1388: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1389: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1390: End if; -- assign error
1391: End If; -- assign
1392:
1385: );
1386: If l_return_status = FND_API.G_RET_STS_ERROR then
1387: Raise FND_API.G_EXC_ERROR;
1388: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1389: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1390: End if; -- assign error
1391: End If; -- assign
1392:
1393: -- populate unspecified values
1407: l_operation_rec.routing_sequence_id := l_OldOper_rec.routing_sequence_id;
1408: l_operation_rec.operation_type := l_OldOper_rec.operation_type;
1409:
1410: l_operation_rec.operation_seq_num := l_OldOper_rec.operation_seq_num;
1411: If l_operation_rec.new_operation_seq_num = Fnd_Api.G_Miss_Num then
1412: l_operation_rec.new_operation_seq_num :=
1413: l_OldOper_rec.operation_seq_num;
1414: End if;
1415:
1412: l_operation_rec.new_operation_seq_num :=
1413: l_OldOper_rec.operation_seq_num;
1414: End if;
1415:
1416: If l_operation_rec.standard_operation_id = Fnd_Api.G_Miss_Num then
1417: l_operation_rec.standard_operation_id :=
1418: l_OldOper_rec.standard_operation_id;
1419: End if;
1420:
1417: l_operation_rec.standard_operation_id :=
1418: l_OldOper_rec.standard_operation_id;
1419: End if;
1420:
1421: If l_operation_rec.department_id = Fnd_Api.G_Miss_Num then
1422: l_operation_rec.department_id := l_OldOper_rec.department_id;
1423: End if;
1424:
1425: If l_operation_rec.operation_lead_time_percent = Fnd_Api.G_Miss_Num then
1421: If l_operation_rec.department_id = Fnd_Api.G_Miss_Num then
1422: l_operation_rec.department_id := l_OldOper_rec.department_id;
1423: End if;
1424:
1425: If l_operation_rec.operation_lead_time_percent = Fnd_Api.G_Miss_Num then
1426: l_operation_rec.operation_lead_time_percent :=
1427: l_OldOper_rec.operation_lead_time_percent;
1428: End if;
1429:
1426: l_operation_rec.operation_lead_time_percent :=
1427: l_OldOper_rec.operation_lead_time_percent;
1428: End if;
1429:
1430: If l_operation_rec.minimum_transfer_quantity = Fnd_Api.G_Miss_Num then
1431: l_operation_rec.minimum_transfer_quantity :=
1432: l_OldOper_rec.minimum_transfer_quantity;
1433: End if;
1434:
1431: l_operation_rec.minimum_transfer_quantity :=
1432: l_OldOper_rec.minimum_transfer_quantity;
1433: End if;
1434:
1435: If l_operation_rec.count_point_type = Fnd_Api.G_Miss_Num then
1436: l_operation_rec.count_point_type := l_OldOper_rec.count_point_type;
1437: End if;
1438:
1439: If l_operation_rec.operation_description = Fnd_Api.G_Miss_Char then
1435: If l_operation_rec.count_point_type = Fnd_Api.G_Miss_Num then
1436: l_operation_rec.count_point_type := l_OldOper_rec.count_point_type;
1437: End if;
1438:
1439: If l_operation_rec.operation_description = Fnd_Api.G_Miss_Char then
1440: l_operation_rec.operation_description :=
1441: l_OldOper_rec.operation_description;
1442: End if;
1443:
1441: l_OldOper_rec.operation_description;
1442: End if;
1443:
1444: l_operation_rec.effectivity_date := l_OldOper_rec.effectivity_date;
1445: If l_operation_rec.new_effectivity_date = Fnd_Api.G_Miss_Date then
1446: l_operation_rec.new_effectivity_date :=
1447: l_OldOper_rec.effectivity_date;
1448: End if;
1449:
1446: l_operation_rec.new_effectivity_date :=
1447: l_OldOper_rec.effectivity_date;
1448: End if;
1449:
1450: If l_operation_rec.disable_date = Fnd_Api.G_Miss_Date then
1451: l_operation_rec.disable_date := l_OldOper_rec.disable_date;
1452: End if;
1453:
1454: If l_operation_rec.backflush_flag = Fnd_Api.G_Miss_Num then
1450: If l_operation_rec.disable_date = Fnd_Api.G_Miss_Date then
1451: l_operation_rec.disable_date := l_OldOper_rec.disable_date;
1452: End if;
1453:
1454: If l_operation_rec.backflush_flag = Fnd_Api.G_Miss_Num then
1455: l_operation_rec.backflush_flag := l_OldOper_rec.backflush_flag;
1456: End if;
1457:
1458: If l_operation_rec.option_dependent_flag = Fnd_Api.G_Miss_Num then
1454: If l_operation_rec.backflush_flag = Fnd_Api.G_Miss_Num then
1455: l_operation_rec.backflush_flag := l_OldOper_rec.backflush_flag;
1456: End if;
1457:
1458: If l_operation_rec.option_dependent_flag = Fnd_Api.G_Miss_Num then
1459: l_operation_rec.option_dependent_flag :=
1460: l_OldOper_rec.option_dependent_flag;
1461: End if;
1462:
1459: l_operation_rec.option_dependent_flag :=
1460: l_OldOper_rec.option_dependent_flag;
1461: End if;
1462:
1463: If l_operation_rec.attribute_category = Fnd_Api.G_Miss_Char then
1464: l_operation_rec.attribute_category := l_OldOper_rec.attribute_category;
1465: End if;
1466:
1467: If l_operation_rec.attribute1 = Fnd_Api.G_Miss_Char then
1463: If l_operation_rec.attribute_category = Fnd_Api.G_Miss_Char then
1464: l_operation_rec.attribute_category := l_OldOper_rec.attribute_category;
1465: End if;
1466:
1467: If l_operation_rec.attribute1 = Fnd_Api.G_Miss_Char then
1468: l_operation_rec.attribute1 := l_OldOper_rec.attribute1;
1469: End if;
1470:
1471: If l_operation_rec.attribute2 = Fnd_Api.G_Miss_Char then
1467: If l_operation_rec.attribute1 = Fnd_Api.G_Miss_Char then
1468: l_operation_rec.attribute1 := l_OldOper_rec.attribute1;
1469: End if;
1470:
1471: If l_operation_rec.attribute2 = Fnd_Api.G_Miss_Char then
1472: l_operation_rec.attribute2 := l_OldOper_rec.attribute2;
1473: End if;
1474:
1475: If l_operation_rec.attribute3 = Fnd_Api.G_Miss_Char then
1471: If l_operation_rec.attribute2 = Fnd_Api.G_Miss_Char then
1472: l_operation_rec.attribute2 := l_OldOper_rec.attribute2;
1473: End if;
1474:
1475: If l_operation_rec.attribute3 = Fnd_Api.G_Miss_Char then
1476: l_operation_rec.attribute3 := l_OldOper_rec.attribute3;
1477: End if;
1478:
1479: If l_operation_rec.attribute4 = Fnd_Api.G_Miss_Char then
1475: If l_operation_rec.attribute3 = Fnd_Api.G_Miss_Char then
1476: l_operation_rec.attribute3 := l_OldOper_rec.attribute3;
1477: End if;
1478:
1479: If l_operation_rec.attribute4 = Fnd_Api.G_Miss_Char then
1480: l_operation_rec.attribute4 := l_OldOper_rec.attribute4;
1481: End if;
1482:
1483: If l_operation_rec.attribute5 = Fnd_Api.G_Miss_Char then
1479: If l_operation_rec.attribute4 = Fnd_Api.G_Miss_Char then
1480: l_operation_rec.attribute4 := l_OldOper_rec.attribute4;
1481: End if;
1482:
1483: If l_operation_rec.attribute5 = Fnd_Api.G_Miss_Char then
1484: l_operation_rec.attribute5 := l_OldOper_rec.attribute5;
1485: End if;
1486:
1487: If l_operation_rec.attribute6 = Fnd_Api.G_Miss_Char then
1483: If l_operation_rec.attribute5 = Fnd_Api.G_Miss_Char then
1484: l_operation_rec.attribute5 := l_OldOper_rec.attribute5;
1485: End if;
1486:
1487: If l_operation_rec.attribute6 = Fnd_Api.G_Miss_Char then
1488: l_operation_rec.attribute6 := l_OldOper_rec.attribute6;
1489: End if;
1490:
1491: If l_operation_rec.attribute7 = Fnd_Api.G_Miss_Char then
1487: If l_operation_rec.attribute6 = Fnd_Api.G_Miss_Char then
1488: l_operation_rec.attribute6 := l_OldOper_rec.attribute6;
1489: End if;
1490:
1491: If l_operation_rec.attribute7 = Fnd_Api.G_Miss_Char then
1492: l_operation_rec.attribute7 := l_OldOper_rec.attribute7;
1493: End if;
1494:
1495: If l_operation_rec.attribute8 = Fnd_Api.G_Miss_Char then
1491: If l_operation_rec.attribute7 = Fnd_Api.G_Miss_Char then
1492: l_operation_rec.attribute7 := l_OldOper_rec.attribute7;
1493: End if;
1494:
1495: If l_operation_rec.attribute8 = Fnd_Api.G_Miss_Char then
1496: l_operation_rec.attribute8 := l_OldOper_rec.attribute8;
1497: End if;
1498:
1499: If l_operation_rec.attribute9 = Fnd_Api.G_Miss_Char then
1495: If l_operation_rec.attribute8 = Fnd_Api.G_Miss_Char then
1496: l_operation_rec.attribute8 := l_OldOper_rec.attribute8;
1497: End if;
1498:
1499: If l_operation_rec.attribute9 = Fnd_Api.G_Miss_Char then
1500: l_operation_rec.attribute9 := l_OldOper_rec.attribute9;
1501: End if;
1502:
1503: If l_operation_rec.attribute10 = Fnd_Api.G_Miss_Char then
1499: If l_operation_rec.attribute9 = Fnd_Api.G_Miss_Char then
1500: l_operation_rec.attribute9 := l_OldOper_rec.attribute9;
1501: End if;
1502:
1503: If l_operation_rec.attribute10 = Fnd_Api.G_Miss_Char then
1504: l_operation_rec.attribute10 := l_OldOper_rec.attribute10;
1505: End if;
1506:
1507: If l_operation_rec.attribute11 = Fnd_Api.G_Miss_Char then
1503: If l_operation_rec.attribute10 = Fnd_Api.G_Miss_Char then
1504: l_operation_rec.attribute10 := l_OldOper_rec.attribute10;
1505: End if;
1506:
1507: If l_operation_rec.attribute11 = Fnd_Api.G_Miss_Char then
1508: l_operation_rec.attribute11 := l_OldOper_rec.attribute11;
1509: End if;
1510:
1511: If l_operation_rec.attribute12 = Fnd_Api.G_Miss_Char then
1507: If l_operation_rec.attribute11 = Fnd_Api.G_Miss_Char then
1508: l_operation_rec.attribute11 := l_OldOper_rec.attribute11;
1509: End if;
1510:
1511: If l_operation_rec.attribute12 = Fnd_Api.G_Miss_Char then
1512: l_operation_rec.attribute12 := l_OldOper_rec.attribute12;
1513: End if;
1514:
1515: If l_operation_rec.attribute13 = Fnd_Api.G_Miss_Char then
1511: If l_operation_rec.attribute12 = Fnd_Api.G_Miss_Char then
1512: l_operation_rec.attribute12 := l_OldOper_rec.attribute12;
1513: End if;
1514:
1515: If l_operation_rec.attribute13 = Fnd_Api.G_Miss_Char then
1516: l_operation_rec.attribute13 := l_OldOper_rec.attribute13;
1517: End if;
1518:
1519: If l_operation_rec.attribute14 = Fnd_Api.G_Miss_Char then
1515: If l_operation_rec.attribute13 = Fnd_Api.G_Miss_Char then
1516: l_operation_rec.attribute13 := l_OldOper_rec.attribute13;
1517: End if;
1518:
1519: If l_operation_rec.attribute14 = Fnd_Api.G_Miss_Char then
1520: l_operation_rec.attribute14 := l_OldOper_rec.attribute14;
1521: End if;
1522:
1523: If l_operation_rec.attribute15 = Fnd_Api.G_Miss_Char then
1519: If l_operation_rec.attribute14 = Fnd_Api.G_Miss_Char then
1520: l_operation_rec.attribute14 := l_OldOper_rec.attribute14;
1521: End if;
1522:
1523: If l_operation_rec.attribute15 = Fnd_Api.G_Miss_Char then
1524: l_operation_rec.attribute15 := l_OldOper_rec.attribute15;
1525: End if;
1526:
1527: If l_operation_rec.reference_flag = Fnd_Api.G_Miss_Num then
1523: If l_operation_rec.attribute15 = Fnd_Api.G_Miss_Char then
1524: l_operation_rec.attribute15 := l_OldOper_rec.attribute15;
1525: End if;
1526:
1527: If l_operation_rec.reference_flag = Fnd_Api.G_Miss_Num then
1528: l_operation_rec.reference_flag := l_OldOper_rec.reference_flag;
1529: End if;
1530:
1531: If l_operation_rec.process_op_seq_id = Fnd_Api.G_Miss_Num then
1527: If l_operation_rec.reference_flag = Fnd_Api.G_Miss_Num then
1528: l_operation_rec.reference_flag := l_OldOper_rec.reference_flag;
1529: End if;
1530:
1531: If l_operation_rec.process_op_seq_id = Fnd_Api.G_Miss_Num then
1532: l_operation_rec.process_op_seq_id := l_OldOper_rec.process_op_seq_id;
1533: End if;
1534:
1535: If l_operation_rec.line_op_seq_id = Fnd_Api.G_Miss_Num then
1531: If l_operation_rec.process_op_seq_id = Fnd_Api.G_Miss_Num then
1532: l_operation_rec.process_op_seq_id := l_OldOper_rec.process_op_seq_id;
1533: End if;
1534:
1535: If l_operation_rec.line_op_seq_id = Fnd_Api.G_Miss_Num then
1536: l_operation_rec.line_op_seq_id := l_OldOper_rec.line_op_seq_id;
1537: End if;
1538:
1539: If l_operation_rec.yield = Fnd_Api.G_Miss_Num then
1535: If l_operation_rec.line_op_seq_id = Fnd_Api.G_Miss_Num then
1536: l_operation_rec.line_op_seq_id := l_OldOper_rec.line_op_seq_id;
1537: End if;
1538:
1539: If l_operation_rec.yield = Fnd_Api.G_Miss_Num then
1540: l_operation_rec.yield := l_OldOper_rec.yield;
1541: End if;
1542:
1543: If l_operation_rec.cumulative_yield = Fnd_Api.G_Miss_Num then
1539: If l_operation_rec.yield = Fnd_Api.G_Miss_Num then
1540: l_operation_rec.yield := l_OldOper_rec.yield;
1541: End if;
1542:
1543: If l_operation_rec.cumulative_yield = Fnd_Api.G_Miss_Num then
1544: l_operation_rec.cumulative_yield := l_OldOper_rec.cumulative_yield;
1545: End if;
1546:
1547: If l_operation_rec.reverse_cumulative_yield = Fnd_Api.G_Miss_Num then
1543: If l_operation_rec.cumulative_yield = Fnd_Api.G_Miss_Num then
1544: l_operation_rec.cumulative_yield := l_OldOper_rec.cumulative_yield;
1545: End if;
1546:
1547: If l_operation_rec.reverse_cumulative_yield = Fnd_Api.G_Miss_Num then
1548: l_operation_rec.reverse_cumulative_yield :=
1549: l_OldOper_rec.reverse_cumulative_yield;
1550: End if;
1551:
1548: l_operation_rec.reverse_cumulative_yield :=
1549: l_OldOper_rec.reverse_cumulative_yield;
1550: End if;
1551:
1552: If l_operation_rec.labor_time_calc = Fnd_Api.G_Miss_Num then
1553: l_operation_rec.labor_time_calc := l_OldOper_rec.labor_time_calc;
1554: End if;
1555:
1556: If l_operation_rec.machine_time_calc = Fnd_Api.G_Miss_Num then
1552: If l_operation_rec.labor_time_calc = Fnd_Api.G_Miss_Num then
1553: l_operation_rec.labor_time_calc := l_OldOper_rec.labor_time_calc;
1554: End if;
1555:
1556: If l_operation_rec.machine_time_calc = Fnd_Api.G_Miss_Num then
1557: l_operation_rec.machine_time_calc := l_OldOper_rec.machine_time_calc;
1558: End if;
1559:
1560: If l_operation_rec.total_time_calc = Fnd_Api.G_Miss_Num then
1556: If l_operation_rec.machine_time_calc = Fnd_Api.G_Miss_Num then
1557: l_operation_rec.machine_time_calc := l_OldOper_rec.machine_time_calc;
1558: End if;
1559:
1560: If l_operation_rec.total_time_calc = Fnd_Api.G_Miss_Num then
1561: l_operation_rec.total_time_calc := l_OldOper_rec.total_time_calc;
1562: End if;
1563:
1564: If l_operation_rec.labor_time_user = Fnd_Api.G_Miss_Num then
1560: If l_operation_rec.total_time_calc = Fnd_Api.G_Miss_Num then
1561: l_operation_rec.total_time_calc := l_OldOper_rec.total_time_calc;
1562: End if;
1563:
1564: If l_operation_rec.labor_time_user = Fnd_Api.G_Miss_Num then
1565: l_operation_rec.labor_time_user := l_OldOper_rec.labor_time_user;
1566: End if;
1567:
1568: If l_operation_rec.machine_time_user = Fnd_Api.G_Miss_Num then
1564: If l_operation_rec.labor_time_user = Fnd_Api.G_Miss_Num then
1565: l_operation_rec.labor_time_user := l_OldOper_rec.labor_time_user;
1566: End if;
1567:
1568: If l_operation_rec.machine_time_user = Fnd_Api.G_Miss_Num then
1569: l_operation_rec.machine_time_user := l_OldOper_rec.machine_time_user;
1570: End if;
1571:
1572: If l_operation_rec.total_time_user = Fnd_Api.G_Miss_Num then
1568: If l_operation_rec.machine_time_user = Fnd_Api.G_Miss_Num then
1569: l_operation_rec.machine_time_user := l_OldOper_rec.machine_time_user;
1570: End if;
1571:
1572: If l_operation_rec.total_time_user = Fnd_Api.G_Miss_Num then
1573: l_operation_rec.total_time_user := l_OldOper_rec.total_time_user;
1574: End if;
1575:
1576: If l_operation_rec.net_planning_percent = Fnd_Api.G_Miss_Num then
1572: If l_operation_rec.total_time_user = Fnd_Api.G_Miss_Num then
1573: l_operation_rec.total_time_user := l_OldOper_rec.total_time_user;
1574: End if;
1575:
1576: If l_operation_rec.net_planning_percent = Fnd_Api.G_Miss_Num then
1577: l_operation_rec.net_planning_percent :=
1578: l_OldOper_rec.net_planning_percent;
1579: End if;
1580:
1577: l_operation_rec.net_planning_percent :=
1578: l_OldOper_rec.net_planning_percent;
1579: End if;
1580:
1581: If l_operation_rec.include_in_rollup = Fnd_Api.G_Miss_Num then
1582: l_operation_rec.include_in_rollup := l_OldOper_rec.include_in_rollup;
1583: End if;
1584:
1585: If l_operation_rec.operation_yield_enabled = Fnd_Api.G_Miss_Num then
1581: If l_operation_rec.include_in_rollup = Fnd_Api.G_Miss_Num then
1582: l_operation_rec.include_in_rollup := l_OldOper_rec.include_in_rollup;
1583: End if;
1584:
1585: If l_operation_rec.operation_yield_enabled = Fnd_Api.G_Miss_Num then
1586: l_operation_rec.operation_yield_enabled := l_OldOper_rec.operation_yield_enabled;
1587: End if;
1588:
1589: End loop; -- get old values
1590:
1591: If not l_OperFound then
1592: Fnd_Message.Set_Name('BOM', 'BOM_INVALID_OPERATION');
1593: FND_MSG_PUB.Add;
1594: Raise FND_API.G_EXC_ERROR;
1595: End if; -- missing operation
1596:
1597: If p_validation_level > FND_API.G_VALID_LEVEL_NONE then
1598: ValidateOperation(
1593: FND_MSG_PUB.Add;
1594: Raise FND_API.G_EXC_ERROR;
1595: End if; -- missing operation
1596:
1597: If p_validation_level > FND_API.G_VALID_LEVEL_NONE then
1598: ValidateOperation(
1599: p_api_version => 1,
1600: p_init_msg_list => p_init_msg_list,
1601: p_commit => p_commit,
1598: ValidateOperation(
1599: p_api_version => 1,
1600: p_init_msg_list => p_init_msg_list,
1601: p_commit => p_commit,
1602: p_validation_level => FND_API.G_VALID_LEVEL_NONE,
1603: x_return_status => l_return_status,
1604: x_msg_count => l_msg_count,
1605: x_msg_data => l_msg_data,
1606: p_operation_rec => l_operation_rec,
1605: x_msg_data => l_msg_data,
1606: p_operation_rec => l_operation_rec,
1607: x_operation_rec => l_operation_rec
1608: );
1609: If l_return_status = FND_API.G_RET_STS_ERROR then
1610: Raise FND_API.G_EXC_ERROR;
1611: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1612: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1613: End if; -- validation error
1606: p_operation_rec => l_operation_rec,
1607: x_operation_rec => l_operation_rec
1608: );
1609: If l_return_status = FND_API.G_RET_STS_ERROR then
1610: Raise FND_API.G_EXC_ERROR;
1611: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1612: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1613: End if; -- validation error
1614: End If; -- validation
1607: x_operation_rec => l_operation_rec
1608: );
1609: If l_return_status = FND_API.G_RET_STS_ERROR then
1610: Raise FND_API.G_EXC_ERROR;
1611: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1612: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1613: End if; -- validation error
1614: End If; -- validation
1615:
1608: );
1609: If l_return_status = FND_API.G_RET_STS_ERROR then
1610: Raise FND_API.G_EXC_ERROR;
1611: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1612: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1613: End if; -- validation error
1614: End If; -- validation
1615:
1616: -- update operation
1708: x_operation_rec := l_operation_rec;
1709: -- End of API body.
1710:
1711: -- Standard check of p_commit.
1712: IF FND_API.To_Boolean( p_commit ) THEN
1713: COMMIT WORK;
1714: END IF;
1715: -- Standard call to get message count and if count is 1, get message info.
1716: FND_MSG_PUB.Count_And_Get(
1717: p_count => x_msg_count,
1718: p_data => x_msg_data
1719: );
1720: EXCEPTION
1721: WHEN FND_API.G_EXC_ERROR THEN
1722: ROLLBACK TO UpdateOperation_Pvt;
1723: x_return_status := FND_API.G_RET_STS_ERROR;
1724: FND_MSG_PUB.Count_And_Get(
1725: p_count => x_msg_count,
1719: );
1720: EXCEPTION
1721: WHEN FND_API.G_EXC_ERROR THEN
1722: ROLLBACK TO UpdateOperation_Pvt;
1723: x_return_status := FND_API.G_RET_STS_ERROR;
1724: FND_MSG_PUB.Count_And_Get(
1725: p_count => x_msg_count,
1726: p_data => x_msg_data
1727: );
1724: FND_MSG_PUB.Count_And_Get(
1725: p_count => x_msg_count,
1726: p_data => x_msg_data
1727: );
1728: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1729: ROLLBACK TO UpdateOperation_Pvt;
1730: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1731: FND_MSG_PUB.Count_And_Get(
1732: p_count => x_msg_count,
1726: p_data => x_msg_data
1727: );
1728: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1729: ROLLBACK TO UpdateOperation_Pvt;
1730: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1731: FND_MSG_PUB.Count_And_Get(
1732: p_count => x_msg_count,
1733: p_data => x_msg_data
1734: );
1733: p_data => x_msg_data
1734: );
1735: WHEN OTHERS THEN
1736: ROLLBACK TO UpdateOperation_Pvt;
1737: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1738: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1739: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1740: END IF;
1741: FND_MSG_PUB.Count_And_Get(
1745: End UpdateOperation;
1746:
1747: PROCEDURE DeleteOperation(
1748: p_api_version IN NUMBER,
1749: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1750: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1751: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1752: x_return_status IN OUT NOCOPY VARCHAR2,
1753: x_msg_count IN OUT NOCOPY NUMBER,
1746:
1747: PROCEDURE DeleteOperation(
1748: p_api_version IN NUMBER,
1749: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1750: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1751: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1752: x_return_status IN OUT NOCOPY VARCHAR2,
1753: x_msg_count IN OUT NOCOPY NUMBER,
1754: x_msg_data IN OUT NOCOPY VARCHAR2,
1747: PROCEDURE DeleteOperation(
1748: p_api_version IN NUMBER,
1749: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1750: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1751: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1752: x_return_status IN OUT NOCOPY VARCHAR2,
1753: x_msg_count IN OUT NOCOPY NUMBER,
1754: x_msg_data IN OUT NOCOPY VARCHAR2,
1755: p_delete_group IN VARCHAR2,
1799: BEGIN
1800: -- Standard Start of API savepoint
1801: SAVEPOINT DeleteOperation_Pvt;
1802: -- Standard call to check for call compatibility.
1803: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name,
1804: G_PKG_NAME) THEN
1805: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1806: END IF;
1807: -- Initialize message list if p_init_msg_list is set to TRUE.
1801: SAVEPOINT DeleteOperation_Pvt;
1802: -- Standard call to check for call compatibility.
1803: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name,
1804: G_PKG_NAME) THEN
1805: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1806: END IF;
1807: -- Initialize message list if p_init_msg_list is set to TRUE.
1808: IF FND_API.to_Boolean(p_init_msg_list) THEN
1809: FND_MSG_PUB.initialize;
1804: G_PKG_NAME) THEN
1805: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1806: END IF;
1807: -- Initialize message list if p_init_msg_list is set to TRUE.
1808: IF FND_API.to_Boolean(p_init_msg_list) THEN
1809: FND_MSG_PUB.initialize;
1810: END IF;
1811: -- Initialize API return status to success
1812: x_return_status := FND_API.G_RET_STS_SUCCESS;
1808: IF FND_API.to_Boolean(p_init_msg_list) THEN
1809: FND_MSG_PUB.initialize;
1810: END IF;
1811: -- Initialize API return status to success
1812: x_return_status := FND_API.G_RET_STS_SUCCESS;
1813:
1814: -- API body
1815: l_operation_rec := p_operation_rec;
1816: If p_validation_level = FND_API.G_VALID_LEVEL_FULL then
1812: x_return_status := FND_API.G_RET_STS_SUCCESS;
1813:
1814: -- API body
1815: l_operation_rec := p_operation_rec;
1816: If p_validation_level = FND_API.G_VALID_LEVEL_FULL then
1817: AssignOperation(
1818: p_api_version => 1,
1819: p_init_msg_list => p_init_msg_list,
1820: p_commit => p_commit,
1824: x_msg_data => l_msg_data,
1825: p_operation_rec => l_operation_rec,
1826: x_operation_rec => l_operation_rec
1827: );
1828: If l_return_status = FND_API.G_RET_STS_ERROR then
1829: Raise FND_API.G_EXC_ERROR;
1830: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1831: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1832: End if; -- assign error
1825: p_operation_rec => l_operation_rec,
1826: x_operation_rec => l_operation_rec
1827: );
1828: If l_return_status = FND_API.G_RET_STS_ERROR then
1829: Raise FND_API.G_EXC_ERROR;
1830: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1831: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1832: End if; -- assign error
1833: End If; -- assign
1826: x_operation_rec => l_operation_rec
1827: );
1828: If l_return_status = FND_API.G_RET_STS_ERROR then
1829: Raise FND_API.G_EXC_ERROR;
1830: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1831: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1832: End if; -- assign error
1833: End If; -- assign
1834:
1827: );
1828: If l_return_status = FND_API.G_RET_STS_ERROR then
1829: Raise FND_API.G_EXC_ERROR;
1830: Elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
1831: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1832: End if; -- assign error
1833: End If; -- assign
1834:
1835: l_DeleteGrpSeqId := null;
1869: p_pkg_name => 'MODAL_DELETE',
1870: p_procedure_name => 'DELETE_MANAGER_OI',
1871: p_error_text => l_msg_data
1872: );
1873: Raise FND_API.G_EXC_UNEXPECTED_ERROR;
1874: End if; -- SQL error in modal delete
1875: End loop; -- Add to delete group
1876:
1877: If not l_OperFound then
1876:
1877: If not l_OperFound then
1878: Fnd_Message.Set_Name('BOM', 'BOM_INVALID_OPERATION');
1879: FND_MSG_PUB.Add;
1880: Raise FND_API.G_EXC_ERROR;
1881: End if; -- missing operation
1882:
1883: x_operation_rec := l_operation_rec;
1884: -- End of API body.
1883: x_operation_rec := l_operation_rec;
1884: -- End of API body.
1885:
1886: -- Standard check of p_commit.
1887: IF FND_API.To_Boolean(p_commit) THEN
1888: COMMIT WORK;
1889: END IF;
1890: -- Standard call to get message count and if count is 1, get message info.
1891: FND_MSG_PUB.Count_And_Get(
1892: p_count => x_msg_count,
1893: p_data => x_msg_data
1894: );
1895: EXCEPTION
1896: WHEN FND_API.G_EXC_ERROR THEN
1897: ROLLBACK TO DeleteOperation_Pvt;
1898: x_return_status := FND_API.G_RET_STS_ERROR;
1899: FND_MSG_PUB.Count_And_Get(
1900: p_count => x_msg_count,
1894: );
1895: EXCEPTION
1896: WHEN FND_API.G_EXC_ERROR THEN
1897: ROLLBACK TO DeleteOperation_Pvt;
1898: x_return_status := FND_API.G_RET_STS_ERROR;
1899: FND_MSG_PUB.Count_And_Get(
1900: p_count => x_msg_count,
1901: p_data => x_msg_data
1902: );
1899: FND_MSG_PUB.Count_And_Get(
1900: p_count => x_msg_count,
1901: p_data => x_msg_data
1902: );
1903: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1904: ROLLBACK TO DeleteOperation_Pvt;
1905: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1906: FND_MSG_PUB.Count_And_Get(
1907: p_count => x_msg_count,
1901: p_data => x_msg_data
1902: );
1903: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1904: ROLLBACK TO DeleteOperation_Pvt;
1905: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1906: FND_MSG_PUB.Count_And_Get(
1907: p_count => x_msg_count,
1908: p_data => x_msg_data
1909: );
1908: p_data => x_msg_data
1909: );
1910: WHEN OTHERS THEN
1911: ROLLBACK TO DeleteOperation_Pvt;
1912: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1913: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1914: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1915: END IF;
1916: FND_MSG_PUB.Count_And_Get(