29:
30: BEGIN
31: SAVEPOINT VALIDATE_REBUILD;
32: IF FND_API.to_Boolean( p_init_msg_list ) THEN
33: FND_MSG_PUB.initialize;
34: END IF;
35:
36: l_log := (FND_LOG.LEVEL_UNEXPECTED >= FND_LOG.G_CURRENT_RUNTIME_LEVEL);
37: if (l_log) then -- true only if logging enabled, avoids costly function call
82: and eam_item_type = 3
83: and rownum = 1;
84: else
85: fnd_message.set_name('EAM', 'EAM_REBUILD_ITEM_EXCEPTION');
86: fnd_msg_pub.add;
87: FND_MSG_PUB.Count_And_Get('T', x_msg_count, x_msg_data);
88: return; --no use in continuing further with validations
89: end if;
90: exception
83: and rownum = 1;
84: else
85: fnd_message.set_name('EAM', 'EAM_REBUILD_ITEM_EXCEPTION');
86: fnd_msg_pub.add;
87: FND_MSG_PUB.Count_And_Get('T', x_msg_count, x_msg_data);
88: return; --no use in continuing further with validations
89: end if;
90: exception
91: when no_data_found then
89: end if;
90: exception
91: when no_data_found then
92: fnd_message.set_name('EAM', 'EAM_INVALID_REBUILD_ITEM');
93: fnd_msg_pub.add;
94: FND_MSG_PUB.Count_And_Get('T', x_msg_count, x_msg_data);
95: return;
96: end;
97:
90: exception
91: when no_data_found then
92: fnd_message.set_name('EAM', 'EAM_INVALID_REBUILD_ITEM');
93: fnd_msg_pub.add;
94: FND_MSG_PUB.Count_And_Get('T', x_msg_count, x_msg_data);
95: return;
96: end;
97:
98: if (l_log and (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL)) then
162: else
163: fnd_message.set_name('EAM', 'EAM_INVALID_RBLD_SERIAL');
164: end if;
165: fnd_message.set_token('SERIAL', p_rebuild_serial_number);
166: fnd_msg_pub.add;
167: FND_MSG_PUB.Count_And_Get('T', x_msg_count, x_msg_data);
168: return;
169: end;
170: end if;
163: fnd_message.set_name('EAM', 'EAM_INVALID_RBLD_SERIAL');
164: end if;
165: fnd_message.set_token('SERIAL', p_rebuild_serial_number);
166: fnd_msg_pub.add;
167: FND_MSG_PUB.Count_And_Get('T', x_msg_count, x_msg_data);
168: return;
169: end;
170: end if;
171:
179: end if;
180: -- serial mandatory if specifying activity for serialized rebuild
181: if ((p_rebuild_serial_number is null) and (l_serial_control_code > 1)) then
182: fnd_message.set_name('EAM', 'EAM_NO_SERIAL_FOR_ACTIVITY');
183: fnd_msg_pub.add;
184: FND_MSG_PUB.Count_And_Get('T', x_msg_count, x_msg_data);
185: return;
186: end if;
187:
180: -- serial mandatory if specifying activity for serialized rebuild
181: if ((p_rebuild_serial_number is null) and (l_serial_control_code > 1)) then
182: fnd_message.set_name('EAM', 'EAM_NO_SERIAL_FOR_ACTIVITY');
183: fnd_msg_pub.add;
184: FND_MSG_PUB.Count_And_Get('T', x_msg_count, x_msg_data);
185: return;
186: end if;
187:
188: begin
236: end if;
237: exception
238: when no_data_found then
239: fnd_message.set_name('EAM', 'EAM_INVALID_ACTIVITY');
240: fnd_msg_pub.add;
241: FND_MSG_PUB.Count_And_Get('T', x_msg_count, x_msg_data);
242: return;
243: end;
244: end if;
237: exception
238: when no_data_found then
239: fnd_message.set_name('EAM', 'EAM_INVALID_ACTIVITY');
240: fnd_msg_pub.add;
241: FND_MSG_PUB.Count_And_Get('T', x_msg_count, x_msg_data);
242: return;
243: end;
244: end if;
245:
243: end;
244: end if;
245:
246: x_return_status := FND_API.G_RET_STS_SUCCESS;
247: FND_MSG_PUB.Count_And_Get('T', x_msg_count, x_msg_data);
248: if (l_log and (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL)) then
249: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE, l_module, 'End of ' || l_module);
250: end if;
251:
251:
252: EXCEPTION
253: WHEN OTHERS THEN
254: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
255: FND_MSG_PUB.Count_And_Get(
256: p_count => x_msg_count,
257: p_data => x_msg_data);
258: ROLLBACK to VALIDATE_REBUILD;
259: END validate_rebuild;