46: BEGIN
47: /* debugging */
48:
49: FND_MESSAGE.SET_NAME ('EAM', ERROR);
50: FND_MSG_PUB.ADD;
51: RAISE FND_API.G_EXC_ERROR;
52: END;
53:
54: /*
68:
69: if l_count > 0
70: then
71: fnd_message.set_name('EAM', 'EAM_AA_DUP_LOCATION_CODE');
72: fnd_msg_pub.add;
73: RAISE FND_API.G_EXC_ERROR;
74: end if;
75:
76: END;
85: BEGIN
86: if p_start_date = null
87: then
88: fnd_message.set_name('EAM', 'EAM_NULL_START_DATE');
89: fnd_msg_pub.add;
90: RAISE FND_API.G_EXC_ERROR;
91: end if;
92:
93:
92:
93:
94: if (p_end_date is not null and (trunc(p_start_date)>trunc(p_end_date))) then
95: fnd_message.set_name('EAM', 'EAM_INVALID_START_DATE');
96: fnd_msg_pub.add;
97: RAISE FND_API.G_EXC_ERROR;
98: end if;
99:
100: /*
100: /*
101: IF TRUNC(P_START_DATE) > TRUNC(SYSDATE)
102: THEN
103: fnd_message.set_name('EAM', 'EAM_INVALID_START_DATE');
104: fnd_msg_pub.add;
105: RAISE FND_API.G_EXC_ERROR;
106: ELSIF TRUNC(P_START_DATE) > TRUNC(NVL(P_END_DATE,SYSDATE))
107: THEN
108: fnd_message.set_name('EAM', 'EAM_INVALID_START_DATE');
105: RAISE FND_API.G_EXC_ERROR;
106: ELSIF TRUNC(P_START_DATE) > TRUNC(NVL(P_END_DATE,SYSDATE))
107: THEN
108: fnd_message.set_name('EAM', 'EAM_INVALID_START_DATE');
109: fnd_msg_pub.add;
110: RAISE FND_API.G_EXC_ERROR;
111: ELSIF TRUNC(NVL(P_END_DATE, SYSDATE)) > TRUNC(SYSDATE)
112: THEN
113: fnd_message.set_name('EAM', 'EAM_INVALID_END_DATE');
110: RAISE FND_API.G_EXC_ERROR;
111: ELSIF TRUNC(NVL(P_END_DATE, SYSDATE)) > TRUNC(SYSDATE)
112: THEN
113: fnd_message.set_name('EAM', 'EAM_INVALID_END_DATE');
114: fnd_msg_pub.add;
115: RAISE FND_API.G_EXC_ERROR;
116: END IF ;
117: */
118: END;
133: then
134: if NOT p_create_flag
135: then
136: fnd_message.set_name('EAM', 'EAM_LOCATION_REC_NOT_FOUND');
137: fnd_msg_pub.add;
138: RAISE fnd_api.g_exc_error;
139: END IF;
140: else
141: if p_create_flag
140: else
141: if p_create_flag
142: then
143: fnd_message.set_name('EAM', 'EAM_LOCATION_REC_EXISTS');
144: fnd_msg_pub.add;
145: RAISE fnd_api.g_exc_error;
146: END IF;
147: end if;
148: END;
185: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
186: END IF;
187: -- Initialize message list if p_init_msg_list is set to TRUE.
188: IF FND_API.to_Boolean( p_init_msg_list ) THEN
189: FND_MSG_PUB.initialize;
190: END IF;
191: -- Initialize API return status to success
192: x_return_status := FND_API.G_RET_STS_SUCCESS;
193: -- API body
207: x_msg_data => l_msg_data);
208: if l_boolean = 0
209: then
210: fnd_message.set_name('EAM', 'EAM_ABO_INVALID_ORG_ID');
211: fnd_msg_pub.add;
212: RAISE fnd_api.g_exc_error;
213: end if;
214:
215:
230: );
231:
232: if (p_organization_id is not null and p_creation_organization_id is not null and p_organization_id <> p_creation_organization_id) then
233: fnd_message.set_name('EAM', 'EAM_ORG_ID_INCONSISTENT');
234: fnd_msg_pub.add;
235: RAISE fnd_api.g_exc_error;
236: end if;
237:
238: VALIDATE_ROW_EXISTS(P_LOCATION_CODES, P_CREATION_ORGANIZATION_ID , TRUE);
275: IF FND_API.To_Boolean( p_commit ) THEN
276: COMMIT WORK;
277: END IF;
278: -- Standard call to get message count and if count is 1, get message info.
279: FND_MSG_PUB.get
280: ( p_msg_index_out => x_msg_count ,
281: p_data => x_msg_data
282: );
283: EXCEPTION
283: EXCEPTION
284: WHEN FND_API.G_EXC_ERROR THEN
285: ROLLBACK TO insert_asset_areas;
286: x_return_status := FND_API.G_RET_STS_ERROR ;
287: FND_MSG_PUB.get
288: ( p_msg_index_out => x_msg_count ,
289: p_data => x_msg_data
290: );
291: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
290: );
291: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
292: ROLLBACK TO insert_asset_areas;
293: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
294: FND_MSG_PUB.get
295: ( p_msg_index_out => x_msg_count ,
296: p_data => x_msg_data
297: );
298: WHEN OTHERS THEN
297: );
298: WHEN OTHERS THEN
299: ROLLBACK TO insert_asset_areas;
300: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
301: IF FND_MSG_PUB.Check_Msg_Level
302: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
303: THEN
304: FND_MSG_PUB.Add_Exc_Msg
305: ( G_PKG_NAME ,
298: WHEN OTHERS THEN
299: ROLLBACK TO insert_asset_areas;
300: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
301: IF FND_MSG_PUB.Check_Msg_Level
302: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
303: THEN
304: FND_MSG_PUB.Add_Exc_Msg
305: ( G_PKG_NAME ,
306: l_api_name
300: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
301: IF FND_MSG_PUB.Check_Msg_Level
302: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
303: THEN
304: FND_MSG_PUB.Add_Exc_Msg
305: ( G_PKG_NAME ,
306: l_api_name
307: );
308: END IF;
305: ( G_PKG_NAME ,
306: l_api_name
307: );
308: END IF;
309: FND_MSG_PUB.get
310: ( p_msg_index_out => x_msg_count ,
311: p_data => x_msg_data
312: );
313: END insert_asset_areas;
353: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
354: END IF;
355: -- Initialize message list if p_init_msg_list is set to TRUE.
356: IF FND_API.to_Boolean( p_init_msg_list ) THEN
357: FND_MSG_PUB.initialize;
358: END IF;
359: -- Initialize API return status to success
360: x_return_status := FND_API.G_RET_STS_SUCCESS;
361: -- API body
373: x_msg_data => l_msg_data);
374: if l_boolean = 0
375: then
376: fnd_message.set_name('EAM', 'EAM_ABO_INVALID_ORG_ID');
377: fnd_msg_pub.add;
378: RAISE fnd_api.g_exc_error;
379: end if;
380:
381: VALIDATE_DATES(
438: IF FND_API.To_Boolean( p_commit ) THEN
439: COMMIT WORK;
440: END IF;
441: -- Standard call to get message count and if count is 1, get message info.
442: FND_MSG_PUB.get
443: ( p_msg_index_out => x_msg_count ,
444: p_data => x_msg_data
445: );
446: EXCEPTION
446: EXCEPTION
447: WHEN FND_API.G_EXC_ERROR THEN
448: ROLLBACK TO update_asset_areas;
449: x_return_status := FND_API.G_RET_STS_ERROR ;
450: FND_MSG_PUB.get
451: ( p_msg_index_out => x_msg_count ,
452: p_data => x_msg_data
453: );
454: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
453: );
454: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
455: ROLLBACK TO update_asset_areas;
456: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
457: FND_MSG_PUB.get
458: ( p_msg_index_out => x_msg_count ,
459: p_data => x_msg_data
460: );
461: WHEN OTHERS THEN
460: );
461: WHEN OTHERS THEN
462: ROLLBACK TO update_asset_areas;
463: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
464: IF FND_MSG_PUB.Check_Msg_Level
465: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
466: THEN
467: FND_MSG_PUB.Add_Exc_Msg
468: ( G_PKG_NAME ,
461: WHEN OTHERS THEN
462: ROLLBACK TO update_asset_areas;
463: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
464: IF FND_MSG_PUB.Check_Msg_Level
465: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
466: THEN
467: FND_MSG_PUB.Add_Exc_Msg
468: ( G_PKG_NAME ,
469: l_api_name
463: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
464: IF FND_MSG_PUB.Check_Msg_Level
465: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
466: THEN
467: FND_MSG_PUB.Add_Exc_Msg
468: ( G_PKG_NAME ,
469: l_api_name
470: );
471: END IF;
468: ( G_PKG_NAME ,
469: l_api_name
470: );
471: END IF;
472: FND_MSG_PUB.get
473: ( p_msg_index_out => x_msg_count ,
474: p_data => x_msg_data
475: );
476: END update_asset_areas;