64: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
65: END IF;
66: --Initialize message list if p_init_msg_list is TRUE.
67: IF FND_API.To_Boolean (p_init_msg_list) THEN
68: FND_MSG_PUB.initialize;
69: END IF;
70: -- Initialize API return status to success
71: x_return_status := FND_API.G_RET_STS_SUCCESS;
72: -- Get the current (login) user id.
81: IF (p_check_login_user = FND_API.G_TRUE) THEN
82: -- Check if user is login and has the required privilege.
83: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
84: -- User is not login.
85: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
86: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
87: FND_MSG_PUB.ADD;
88: END IF;
89: RAISE FND_API.G_EXC_ERROR;
83: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
84: -- User is not login.
85: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
86: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
87: FND_MSG_PUB.ADD;
88: END IF;
89: RAISE FND_API.G_EXC_ERROR;
90: END IF;
91: AMV_USER_PVT.Is_Administrator
99: x_result_flag => l_admin_flag
100: );
101: IF (l_admin_flag <> FND_API.G_TRUE) THEN
102: -- User is not an administrator.
103: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
104: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
105: FND_MSG_PUB.ADD;
106: END IF;
107: RAISE FND_API.G_EXC_ERROR;
101: IF (l_admin_flag <> FND_API.G_TRUE) THEN
102: -- User is not an administrator.
103: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
104: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
105: FND_MSG_PUB.ADD;
106: END IF;
107: RAISE FND_API.G_EXC_ERROR;
108: END IF;
109: END IF;
119:
120: -- MAKE SURE THE PASSED ITEM OBJECT HAS ALL THE RIGHT INFORMATION.
121: -- Check if the object is really passed.
122: IF (p_item_obj.item_name IS NULL) THEN
123: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
124: FND_MESSAGE.Set_name('AMV','AMV_NEED_ITEM_INFO');
125: FND_MSG_PUB.ADD;
126: END IF;
127: RAISE FND_API.G_EXC_ERROR;
121: -- Check if the object is really passed.
122: IF (p_item_obj.item_name IS NULL) THEN
123: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
124: FND_MESSAGE.Set_name('AMV','AMV_NEED_ITEM_INFO');
125: FND_MSG_PUB.ADD;
126: END IF;
127: RAISE FND_API.G_EXC_ERROR;
128: END IF;
129: IF (l_item_obj.application_id = AMV_UTILITY_PVT.G_AMV_APP_ID ) THEN
129: IF (l_item_obj.application_id = AMV_UTILITY_PVT.G_AMV_APP_ID ) THEN
130: -- Check if item type in the item object is null
131: IF (l_item_obj.item_type IS NULL OR
132: l_item_obj.item_type = FND_API.G_MISS_CHAR ) THEN
133: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
134: FND_MESSAGE.Set_name('AMV','AMV_NULL_ITEM_TYPE');
135: FND_MSG_PUB.ADD;
136: END IF;
137: RAISE FND_API.G_EXC_ERROR;
131: IF (l_item_obj.item_type IS NULL OR
132: l_item_obj.item_type = FND_API.G_MISS_CHAR ) THEN
133: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
134: FND_MESSAGE.Set_name('AMV','AMV_NULL_ITEM_TYPE');
135: FND_MSG_PUB.ADD;
136: END IF;
137: RAISE FND_API.G_EXC_ERROR;
138: END IF;
139: -- Check if owner_id is valid
143: l_item_obj.owner_id := l_resource_id;
144: ELSE
145: IF (AMV_UTILITY_PVT.Is_ResourceIdValid(l_item_obj.owner_id)
146: <> TRUE) THEN
147: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
148: FND_MESSAGE.Set_name('AMV','AMV_INVALID_OWNER_USER_ID');
149: FND_MESSAGE.Set_Token('ID', TO_CHAR(l_item_obj.owner_id));
150: FND_MSG_PUB.ADD;
151: END IF;
146: <> TRUE) THEN
147: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
148: FND_MESSAGE.Set_name('AMV','AMV_INVALID_OWNER_USER_ID');
149: FND_MESSAGE.Set_Token('ID', TO_CHAR(l_item_obj.owner_id));
150: FND_MSG_PUB.ADD;
151: END IF;
152: RAISE FND_API.G_EXC_ERROR;
153: END IF;
154: END IF;
160: l_item_obj.default_approver_id := l_resource_id;
161: ELSE
162: IF(AMV_UTILITY_PVT.Is_ResourceIdValid(l_item_obj.default_approver_id)
163: <> TRUE) THEN
164: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
165: FND_MESSAGE.Set_name('AMV','AMV_INVALID_APPROVER_ID');
166: FND_MESSAGE.Set_Token('ID',
167: TO_CHAR(l_item_obj.default_approver_id));
168: FND_MSG_PUB.ADD;
164: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
165: FND_MESSAGE.Set_name('AMV','AMV_INVALID_APPROVER_ID');
166: FND_MESSAGE.Set_Token('ID',
167: TO_CHAR(l_item_obj.default_approver_id));
168: FND_MSG_PUB.ADD;
169: END IF;
170: RAISE FND_API.G_EXC_ERROR;
171: END IF;
172: END IF;
176: l_item_obj.content_type_id = FND_API.G_MISS_NUM) THEN
177: l_item_obj.content_type_id := NULL;
178: ELSIF (AMV_UTILITY_PVT.Is_ContentTypeIdValid(l_item_obj.content_type_id)
179: <> TRUE) THEN
180: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
181: FND_MESSAGE.Set_name('AMV','AMV_INVALID_CONTENT_TYPE_ID');
182: FND_MESSAGE.Set_Token('ID',
183: TO_CHAR( l_item_obj.content_type_id ) );
184: FND_MSG_PUB.ADD;
180: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
181: FND_MESSAGE.Set_name('AMV','AMV_INVALID_CONTENT_TYPE_ID');
182: FND_MESSAGE.Set_Token('ID',
183: TO_CHAR( l_item_obj.content_type_id ) );
184: FND_MSG_PUB.ADD;
185: END IF;
186: RAISE FND_API.G_EXC_ERROR;
187: END IF;
188: -- Check if item_name(title) in the item object is null
187: END IF;
188: -- Check if item_name(title) in the item object is null
189: IF (l_item_obj.item_name IS NULL OR
190: l_item_obj.item_name = FND_API.G_MISS_CHAR) THEN
191: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
192: FND_MESSAGE.Set_name('AMV','AMV_NULL_ITEM_TITLE');
193: FND_MSG_PUB.ADD;
194: END IF;
195: RAISE FND_API.G_EXC_ERROR;
189: IF (l_item_obj.item_name IS NULL OR
190: l_item_obj.item_name = FND_API.G_MISS_CHAR) THEN
191: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
192: FND_MESSAGE.Set_name('AMV','AMV_NULL_ITEM_TITLE');
193: FND_MSG_PUB.ADD;
194: END IF;
195: RAISE FND_API.G_EXC_ERROR;
196: END IF;
197: END IF; --END OF IF (l_item_obj.application_id = ...G_AMV_APP_ID )
337: x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
338: x_return_status := FND_API.G_RET_STS_ERROR;
339: END IF;
340: ELSE
341: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
342: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
343: FND_MESSAGE.Set_Token('RECORD', 'AMV_CHANNEL_TK', TRUE);
344: FND_MESSAGE.Set_Token('ID',
345: TO_CHAR(NVL(p_channel_id_array(i), -1)));
342: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
343: FND_MESSAGE.Set_Token('RECORD', 'AMV_CHANNEL_TK', TRUE);
344: FND_MESSAGE.Set_Token('ID',
345: TO_CHAR(NVL(p_channel_id_array(i), -1)));
346: FND_MSG_PUB.ADD;
347: END IF;
348: END IF;
349: END LOOP;
350: END IF;
368: IF FND_API.To_Boolean ( p_commit ) THEN
369: COMMIT WORK;
370: END IF;
371: --Standard call to get message count and if count=1, get the message
372: FND_MSG_PUB.Count_And_Get (
373: p_encoded => FND_API.G_FALSE,
374: p_count => x_msg_count,
375: p_data => x_msg_data
376: );
378: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
379: ROLLBACK TO Create_Item_Pub;
380: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
381: -- Standard call to get message count and if count=1, get the message
382: FND_MSG_PUB.Count_And_Get (
383: p_encoded => FND_API.G_FALSE,
384: p_count => x_msg_count,
385: p_data => x_msg_data
386: );
387: WHEN FND_API.G_EXC_ERROR THEN
388: ROLLBACK TO Create_Item_Pub;
389: x_return_status := FND_API.G_RET_STS_ERROR;
390: -- Standard call to get message count and if count=1, get the message
391: FND_MSG_PUB.Count_And_Get (
392: p_encoded => FND_API.G_FALSE,
393: p_count => x_msg_count,
394: p_data => x_msg_data
395: );
395: );
396: WHEN OTHERS THEN
397: ROLLBACK TO Create_Item_Pub;
398: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
399: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
400: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
401: END IF;
402: -- Standard call to get message count and if count=1, get the message
403: FND_MSG_PUB.Count_And_Get (
396: WHEN OTHERS THEN
397: ROLLBACK TO Create_Item_Pub;
398: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
399: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
400: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
401: END IF;
402: -- Standard call to get message count and if count=1, get the message
403: FND_MSG_PUB.Count_And_Get (
404: p_encoded => FND_API.G_FALSE,
399: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
400: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
401: END IF;
402: -- Standard call to get message count and if count=1, get the message
403: FND_MSG_PUB.Count_And_Get (
404: p_encoded => FND_API.G_FALSE,
405: p_count => x_msg_count,
406: p_data => x_msg_data
407: );
439: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
440: END IF;
441: --Initialize message list if p_init_msg_list is TRUE.
442: IF FND_API.To_Boolean (p_init_msg_list) THEN
443: FND_MSG_PUB.initialize;
444: END IF;
445: -- Initialize API return status to success
446: x_return_status := FND_API.G_RET_STS_SUCCESS;
447: -- Get the current (login) user id.
454: IF (p_check_login_user = FND_API.G_TRUE) THEN
455: -- Check if user is login and has the required privilege.
456: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
457: -- User is not login.
458: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
459: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
460: FND_MSG_PUB.ADD;
461: END IF;
462: RAISE FND_API.G_EXC_ERROR;
456: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
457: -- User is not login.
458: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
459: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
460: FND_MSG_PUB.ADD;
461: END IF;
462: RAISE FND_API.G_EXC_ERROR;
463: END IF;
464: AMV_USER_PVT.Is_Administrator
472: x_result_flag => l_admin_flag
473: );
474: IF (l_admin_flag <> FND_API.G_TRUE) THEN
475: -- User is not an administrator.
476: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
477: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
478: FND_MSG_PUB.ADD;
479: END IF;
480: RAISE FND_API.G_EXC_ERROR;
474: IF (l_admin_flag <> FND_API.G_TRUE) THEN
475: -- User is not an administrator.
476: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
477: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
478: FND_MSG_PUB.ADD;
479: END IF;
480: RAISE FND_API.G_EXC_ERROR;
481: END IF;
482: END IF;
481: END IF;
482: END IF;
483: -- Check if item id is valid.
484: IF (AMV_UTILITY_PVT.Is_ItemIdValid(p_item_id) <> TRUE) THEN
485: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
486: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
487: FND_MESSAGE.Set_Token('RECORD', 'AMV_ITEM_TK', TRUE);
488: FND_MESSAGE.Set_Token('ID', TO_CHAR(p_item_id));
489: FND_MSG_PUB.ADD;
485: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
486: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
487: FND_MESSAGE.Set_Token('RECORD', 'AMV_ITEM_TK', TRUE);
488: FND_MESSAGE.Set_Token('ID', TO_CHAR(p_item_id));
489: FND_MSG_PUB.ADD;
490: END IF;
491: RAISE FND_API.G_EXC_ERROR;
492: END IF;
493: -- Now do the deleting (real job).
548: x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
549: x_return_status := FND_API.G_RET_STS_ERROR;
550: END IF;
551: --Standard call to get message count and if count=1, get the message
552: FND_MSG_PUB.Count_And_Get (
553: p_encoded => FND_API.G_FALSE,
554: p_count => x_msg_count,
555: p_data => x_msg_data
556: );
558: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
559: ROLLBACK TO Delete_Item_Pub;
560: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
561: -- Standard call to get message count and if count=1, get the message
562: FND_MSG_PUB.Count_And_Get (
563: p_encoded => FND_API.G_FALSE,
564: p_count => x_msg_count,
565: p_data => x_msg_data
566: );
567: WHEN FND_API.G_EXC_ERROR THEN
568: ROLLBACK TO Delete_Item_Pub;
569: x_return_status := FND_API.G_RET_STS_ERROR;
570: -- Standard call to get message count and if count=1, get the message
571: FND_MSG_PUB.Count_And_Get (
572: p_encoded => FND_API.G_FALSE,
573: p_count => x_msg_count,
574: p_data => x_msg_data
575: );
575: );
576: WHEN OTHERS THEN
577: ROLLBACK TO Delete_Item_Pub;
578: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
579: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
580: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
581: END IF;
582: -- Standard call to get message count and if count=1, get the message
583: FND_MSG_PUB.Count_And_Get (
576: WHEN OTHERS THEN
577: ROLLBACK TO Delete_Item_Pub;
578: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
579: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
580: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
581: END IF;
582: -- Standard call to get message count and if count=1, get the message
583: FND_MSG_PUB.Count_And_Get (
584: p_encoded => FND_API.G_FALSE,
579: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
580: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
581: END IF;
582: -- Standard call to get message count and if count=1, get the message
583: FND_MSG_PUB.Count_And_Get (
584: p_encoded => FND_API.G_FALSE,
585: p_count => x_msg_count,
586: p_data => x_msg_data
587: );
638: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
639: END IF;
640: --Initialize message list if p_init_msg_list is TRUE.
641: IF FND_API.To_Boolean (p_init_msg_list) THEN
642: FND_MSG_PUB.initialize;
643: END IF;
644: -- Initialize API return status to success
645: x_return_status := FND_API.G_RET_STS_SUCCESS;
646: -- Get the current (login) user id.
653: IF (p_check_login_user = FND_API.G_TRUE) THEN
654: -- Check if user is login and has the required privilege.
655: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
656: -- User is not login.
657: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
658: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
659: FND_MSG_PUB.ADD;
660: END IF;
661: RAISE FND_API.G_EXC_ERROR;
655: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
656: -- User is not login.
657: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
658: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
659: FND_MSG_PUB.ADD;
660: END IF;
661: RAISE FND_API.G_EXC_ERROR;
662: END IF;
663: AMV_USER_PVT.Is_Administrator
671: x_result_flag => l_admin_flag
672: );
673: IF (l_admin_flag <> FND_API.G_TRUE) THEN
674: -- User is not an administrator.
675: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
676: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
677: FND_MSG_PUB.ADD;
678: END IF;
679: RAISE FND_API.G_EXC_ERROR;
673: IF (l_admin_flag <> FND_API.G_TRUE) THEN
674: -- User is not an administrator.
675: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
676: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
677: FND_MSG_PUB.ADD;
678: END IF;
679: RAISE FND_API.G_EXC_ERROR;
680: END IF;
681: END IF;
693:
694: -- MAKE SURE THE PASSED ITEM OBJECT HAS ALL THE RIGHT INFORMATION.
695: -- Check if the object is really passed.
696: IF (p_item_obj.item_id IS NULL) THEN
697: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
698: FND_MESSAGE.Set_name('AMV','AMV_NEED_ITEM_INFO');
699: FND_MSG_PUB.ADD;
700: END IF;
701: RAISE FND_API.G_EXC_ERROR;
695: -- Check if the object is really passed.
696: IF (p_item_obj.item_id IS NULL) THEN
697: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
698: FND_MESSAGE.Set_name('AMV','AMV_NEED_ITEM_INFO');
699: FND_MSG_PUB.ADD;
700: END IF;
701: RAISE FND_API.G_EXC_ERROR;
702: END IF;
703: --Do update the record now.
726: l_item_rec.external_access_flag <> FND_API.G_FALSE) THEN
727: l_item_rec.external_access_flag := FND_API.G_MISS_CHAR;
728: END IF;
729: IF (l_item_rec.item_name IS NULL) THEN
730: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
731: FND_MESSAGE.Set_name('AMV','AMV_NULL_ITEM_TITLE');
732: FND_MSG_PUB.ADD;
733: END IF;
734: l_item_rec.item_name := FND_API.G_MISS_CHAR;
728: END IF;
729: IF (l_item_rec.item_name IS NULL) THEN
730: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
731: FND_MESSAGE.Set_name('AMV','AMV_NULL_ITEM_TITLE');
732: FND_MSG_PUB.ADD;
733: END IF;
734: l_item_rec.item_name := FND_API.G_MISS_CHAR;
735: END IF;
736: IF (l_item_rec.item_type IS NULL) THEN
733: END IF;
734: l_item_rec.item_name := FND_API.G_MISS_CHAR;
735: END IF;
736: IF (l_item_rec.item_type IS NULL) THEN
737: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
738: FND_MESSAGE.Set_name('AMV','AMV_NULL_ITEM_TYPE');
739: FND_MSG_PUB.ADD;
740: END IF;
741: l_item_rec.item_type := FND_API.G_MISS_CHAR;
735: END IF;
736: IF (l_item_rec.item_type IS NULL) THEN
737: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
738: FND_MESSAGE.Set_name('AMV','AMV_NULL_ITEM_TYPE');
739: FND_MSG_PUB.ADD;
740: END IF;
741: l_item_rec.item_type := FND_API.G_MISS_CHAR;
742: END IF;
743: IF ( l_item_rec.content_type_id IS NOT NULL AND
743: IF ( l_item_rec.content_type_id IS NOT NULL AND
744: l_item_rec.content_type_id <> FND_API.G_MISS_NUM) THEN
745: IF (AMV_UTILITY_PVT.Is_ContentTypeIdValid(l_item_rec.content_type_id)
746: <> TRUE) THEN
747: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
748: FND_MESSAGE.Set_name('AMV','AMV_INVALID_CONTENT_TYPE_ID');
749: FND_MESSAGE.Set_Token('ID',
750: TO_CHAR( l_item_rec.content_type_id ) );
751: FND_MSG_PUB.ADD;
747: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
748: FND_MESSAGE.Set_name('AMV','AMV_INVALID_CONTENT_TYPE_ID');
749: FND_MESSAGE.Set_Token('ID',
750: TO_CHAR( l_item_rec.content_type_id ) );
751: FND_MSG_PUB.ADD;
752: END IF;
753: l_item_rec.content_type_id := FND_API.G_MISS_NUM;
754: END IF;
755: END IF;
923: x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
924: x_return_status := FND_API.G_RET_STS_ERROR;
925: END IF;
926: ELSE
927: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
928: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
929: FND_MESSAGE.Set_Token('RECORD', 'AMV_CHANNEL_TK', TRUE);
930: FND_MESSAGE.Set_Token('ID',
931: TO_CHAR(NVL(l_channel_remove_id(i), -1)));
928: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
929: FND_MESSAGE.Set_Token('RECORD', 'AMV_CHANNEL_TK', TRUE);
930: FND_MESSAGE.Set_Token('ID',
931: TO_CHAR(NVL(l_channel_remove_id(i), -1)));
932: FND_MSG_PUB.ADD;
933: END IF;
934: END IF;
935: END LOOP;
936:
957: x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
958: x_return_status := FND_API.G_RET_STS_ERROR;
959: END IF;
960: ELSE
961: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
962: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
963: FND_MESSAGE.Set_Token('RECORD', 'AMV_CHANNEL_TK', TRUE);
964: FND_MESSAGE.Set_Token('ID',
965: TO_CHAR(NVL(p_channel_id_array(i), -1)));
962: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
963: FND_MESSAGE.Set_Token('RECORD', 'AMV_CHANNEL_TK', TRUE);
964: FND_MESSAGE.Set_Token('ID',
965: TO_CHAR(NVL(p_channel_id_array(i), -1)));
966: FND_MSG_PUB.ADD;
967: END IF;
968: END IF;
969: END LOOP;
970: END IF;
985: IF FND_API.To_Boolean ( p_commit ) THEN
986: COMMIT WORK;
987: END IF;
988: --Standard call to get message count and if count=1, get the message
989: FND_MSG_PUB.Count_And_Get (
990: p_encoded => FND_API.G_FALSE,
991: p_count => x_msg_count,
992: p_data => x_msg_data
993: );
995: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
996: ROLLBACK TO Update_Item_Pub;
997: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
998: -- Standard call to get message count and if count=1, get the message
999: FND_MSG_PUB.Count_And_Get (
1000: p_encoded => FND_API.G_FALSE,
1001: p_count => x_msg_count,
1002: p_data => x_msg_data
1003: );
1004: WHEN FND_API.G_EXC_ERROR THEN
1005: ROLLBACK TO Update_Item_Pub;
1006: x_return_status := FND_API.G_RET_STS_ERROR;
1007: -- Standard call to get message count and if count=1, get the message
1008: FND_MSG_PUB.Count_And_Get (
1009: p_encoded => FND_API.G_FALSE,
1010: p_count => x_msg_count,
1011: p_data => x_msg_data
1012: );
1012: );
1013: WHEN OTHERS THEN
1014: ROLLBACK TO Update_Item_Pub;
1015: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1016: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1017: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1018: END IF;
1019: -- Standard call to get message count and if count=1, get the message
1020: FND_MSG_PUB.Count_And_Get (
1013: WHEN OTHERS THEN
1014: ROLLBACK TO Update_Item_Pub;
1015: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1016: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1017: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1018: END IF;
1019: -- Standard call to get message count and if count=1, get the message
1020: FND_MSG_PUB.Count_And_Get (
1021: p_encoded => FND_API.G_FALSE,
1016: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1017: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1018: END IF;
1019: -- Standard call to get message count and if count=1, get the message
1020: FND_MSG_PUB.Count_And_Get (
1021: p_encoded => FND_API.G_FALSE,
1022: p_count => x_msg_count,
1023: p_data => x_msg_data
1024: );
1064: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1065: END IF;
1066: --Initialize message list if p_init_msg_list is TRUE.
1067: IF FND_API.To_Boolean (p_init_msg_list) THEN
1068: FND_MSG_PUB.initialize;
1069: END IF;
1070: -- Initialize API return status to success
1071: x_return_status := FND_API.G_RET_STS_SUCCESS;
1072: -- Get the current (login) user id.
1079: IF (p_check_login_user = FND_API.G_TRUE) THEN
1080: -- Check if user is login and has the required privilege.
1081: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
1082: -- User is not login.
1083: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1084: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
1085: FND_MSG_PUB.ADD;
1086: END IF;
1087: RAISE FND_API.G_EXC_ERROR;
1081: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
1082: -- User is not login.
1083: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1084: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
1085: FND_MSG_PUB.ADD;
1086: END IF;
1087: RAISE FND_API.G_EXC_ERROR;
1088: END IF;
1089: END IF;
1088: END IF;
1089: END IF;
1090: -- Check if item id is valid.
1091: IF (AMV_UTILITY_PVT.Is_ItemIdValid(p_item_id) <> TRUE) THEN
1092: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1093: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
1094: FND_MESSAGE.Set_Token('RECORD', 'AMV_ITEM_TK', TRUE);
1095: FND_MESSAGE.Set_Token('ID', TO_CHAR(p_item_id));
1096: FND_MSG_PUB.ADD;
1092: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1093: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
1094: FND_MESSAGE.Set_Token('RECORD', 'AMV_ITEM_TK', TRUE);
1095: FND_MESSAGE.Set_Token('ID', TO_CHAR(p_item_id));
1096: FND_MSG_PUB.ADD;
1097: END IF;
1098: RAISE FND_API.G_EXC_ERROR;
1099: END IF;
1100: JTF_AMV_ITEM_PUB.Get_Item
1210: x_author_array := l_author_varray;
1211: x_keyword_array := AMV_CHAR_VARRAY_TYPE();
1212: x_keyword_array := l_keyword_varray;
1213: --Standard call to get message count and if count=1, get the message
1214: FND_MSG_PUB.Count_And_Get (
1215: p_encoded => FND_API.G_FALSE,
1216: p_count => x_msg_count,
1217: p_data => x_msg_data
1218: );
1219: EXCEPTION
1220: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1221: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1222: -- Standard call to get message count and if count=1, get the message
1223: FND_MSG_PUB.Count_And_Get (
1224: p_encoded => FND_API.G_FALSE,
1225: p_count => x_msg_count,
1226: p_data => x_msg_data
1227: );
1227: );
1228: WHEN FND_API.G_EXC_ERROR THEN
1229: x_return_status := FND_API.G_RET_STS_ERROR;
1230: -- Standard call to get message count and if count=1, get the message
1231: FND_MSG_PUB.Count_And_Get (
1232: p_encoded => FND_API.G_FALSE,
1233: p_count => x_msg_count,
1234: p_data => x_msg_data
1235: );
1234: p_data => x_msg_data
1235: );
1236: WHEN OTHERS THEN
1237: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1238: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1239: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1240: END IF;
1241: -- Standard call to get message count and if count=1, get the message
1242: FND_MSG_PUB.Count_And_Get (
1235: );
1236: WHEN OTHERS THEN
1237: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1238: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1239: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1240: END IF;
1241: -- Standard call to get message count and if count=1, get the message
1242: FND_MSG_PUB.Count_And_Get (
1243: p_encoded => FND_API.G_FALSE,
1238: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1239: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1240: END IF;
1241: -- Standard call to get message count and if count=1, get the message
1242: FND_MSG_PUB.Count_And_Get (
1243: p_encoded => FND_API.G_FALSE,
1244: p_count => x_msg_count,
1245: p_data => x_msg_data
1246: );
1323: G_PKG_NAME) THEN
1324: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1325: END IF;
1326: -- Debug Message
1327: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW) THEN
1328: FND_MESSAGE.Set_name('AMV','PVT Find Item API: Start');
1329: FND_MSG_PUB.ADD;
1330: END IF;
1331: --Initialize message list if p_init_msg_list is TRUE.
1325: END IF;
1326: -- Debug Message
1327: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW) THEN
1328: FND_MESSAGE.Set_name('AMV','PVT Find Item API: Start');
1329: FND_MSG_PUB.ADD;
1330: END IF;
1331: --Initialize message list if p_init_msg_list is TRUE.
1332: IF FND_API.To_Boolean (p_init_msg_list) THEN
1333: FND_MSG_PUB.initialize;
1329: FND_MSG_PUB.ADD;
1330: END IF;
1331: --Initialize message list if p_init_msg_list is TRUE.
1332: IF FND_API.To_Boolean (p_init_msg_list) THEN
1333: FND_MSG_PUB.initialize;
1334: END IF;
1335: -- Initialize API return status to success
1336: x_return_status := FND_API.G_RET_STS_SUCCESS;
1337: -- Get the current (login) user id.
1344: IF (p_check_login_user = FND_API.G_TRUE) THEN
1345: -- Check if user is login and has the required privilege.
1346: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
1347: -- User is not login.
1348: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1349: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
1350: FND_MSG_PUB.ADD;
1351: END IF;
1352: RAISE FND_API.G_EXC_ERROR;
1346: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
1347: -- User is not login.
1348: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1349: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
1350: FND_MSG_PUB.ADD;
1351: END IF;
1352: RAISE FND_API.G_EXC_ERROR;
1353: END IF;
1354: END IF;
1408: l_sql_statement := l_sql_statement ||
1409: l_where_clause || 'ORDER BY ITEM_NAME ';
1410: l_sql_statement2 := l_sql_statement2 ||
1411: l_where_clause;
1412: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW) THEN
1413: FND_MESSAGE.Set_name('AMV','AMV_API_DEBUG_MESSAGE');
1414: FND_MESSAGE.Set_Token('ROW', l_sql_statement);
1415: FND_MSG_PUB.ADD;
1416: --
1411: l_where_clause;
1412: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW) THEN
1413: FND_MESSAGE.Set_name('AMV','AMV_API_DEBUG_MESSAGE');
1414: FND_MESSAGE.Set_Token('ROW', l_sql_statement);
1415: FND_MSG_PUB.ADD;
1416: --
1417: FND_MESSAGE.Set_name('AMV','AMV_API_DEBUG_MESSAGE');
1418: FND_MESSAGE.Set_Token('ROW', l_sql_statement2);
1419: FND_MSG_PUB.ADD;
1415: FND_MSG_PUB.ADD;
1416: --
1417: FND_MESSAGE.Set_name('AMV','AMV_API_DEBUG_MESSAGE');
1418: FND_MESSAGE.Set_Token('ROW', l_sql_statement2);
1419: FND_MSG_PUB.ADD;
1420: END IF;
1421: --Execute the SQL statements to get the total count:
1422: IF (p_subset_request_obj.return_total_count_flag = FND_API.G_TRUE) THEN
1423: OPEN l_cursor FOR l_sql_statement2;
1574: x_subset_return_obj.next_record_position :=
1575: p_subset_request_obj.start_record_position + l_fetch_count;
1576: x_subset_return_obj.total_record_count := l_total_record_count;
1577: --Standard call to get message count and if count=1, get the message
1578: FND_MSG_PUB.Count_And_Get (
1579: p_encoded => FND_API.G_FALSE,
1580: p_count => x_msg_count,
1581: p_data => x_msg_data
1582: );
1583: EXCEPTION
1584: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1585: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1586: -- Standard call to get message count and if count=1, get the message
1587: FND_MSG_PUB.Count_And_Get (
1588: p_encoded => FND_API.G_FALSE,
1589: p_count => x_msg_count,
1590: p_data => x_msg_data
1591: );
1591: );
1592: WHEN FND_API.G_EXC_ERROR THEN
1593: x_return_status := FND_API.G_RET_STS_ERROR;
1594: -- Standard call to get message count and if count=1, get the message
1595: FND_MSG_PUB.Count_And_Get (
1596: p_encoded => FND_API.G_FALSE,
1597: p_count => x_msg_count,
1598: p_data => x_msg_data
1599: );
1598: p_data => x_msg_data
1599: );
1600: WHEN OTHERS THEN
1601: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1602: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1603: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1604: END IF;
1605: -- Standard call to get message count and if count=1, get the message
1606: FND_MSG_PUB.Count_And_Get (
1599: );
1600: WHEN OTHERS THEN
1601: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1602: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1603: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1604: END IF;
1605: -- Standard call to get message count and if count=1, get the message
1606: FND_MSG_PUB.Count_And_Get (
1607: p_encoded => FND_API.G_FALSE,
1602: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1603: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1604: END IF;
1605: -- Standard call to get message count and if count=1, get the message
1606: FND_MSG_PUB.Count_And_Get (
1607: p_encoded => FND_API.G_FALSE,
1608: p_count => x_msg_count,
1609: p_data => x_msg_data
1610: );
1636: BEGIN
1637: SAVEPOINT Add_ItemKeyword_Pub;
1638: --Initialize message list if p_init_msg_list is TRUE.
1639: IF FND_API.To_Boolean (p_init_msg_list) THEN
1640: FND_MSG_PUB.initialize;
1641: END IF;
1642: -- Initialize API return status to success
1643: x_return_status := FND_API.G_RET_STS_SUCCESS;
1644: -- Get the current (login) user id.
1651: IF (p_check_login_user = FND_API.G_TRUE) THEN
1652: -- Check if user is login and has the required privilege.
1653: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
1654: -- User is not login.
1655: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1656: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
1657: FND_MSG_PUB.ADD;
1658: END IF;
1659: RAISE FND_API.G_EXC_ERROR;
1653: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
1654: -- User is not login.
1655: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1656: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
1657: FND_MSG_PUB.ADD;
1658: END IF;
1659: RAISE FND_API.G_EXC_ERROR;
1660: END IF;
1661: AMV_USER_PVT.Is_Administrator
1669: x_result_flag => l_admin_flag
1670: );
1671: IF (l_admin_flag <> FND_API.G_TRUE) THEN
1672: -- User is not an administrator.
1673: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1674: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
1675: FND_MSG_PUB.ADD;
1676: END IF;
1677: RAISE FND_API.G_EXC_ERROR;
1671: IF (l_admin_flag <> FND_API.G_TRUE) THEN
1672: -- User is not an administrator.
1673: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1674: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
1675: FND_MSG_PUB.ADD;
1676: END IF;
1677: RAISE FND_API.G_EXC_ERROR;
1678: END IF;
1679: END IF;
1694: p_item_id => p_item_id,
1695: p_keyword_tab => l_char_tab
1696: );
1697: ELSE
1698: FND_MSG_PUB.Count_And_Get (
1699: p_encoded => FND_API.G_FALSE,
1700: p_count => x_msg_count,
1701: p_data => x_msg_data
1702: );
1705: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1706: ROLLBACK TO Add_ItemKeyword_Pub;
1707: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1708: -- Standard call to get message count and if count=1, get the message
1709: FND_MSG_PUB.Count_And_Get (
1710: p_encoded => FND_API.G_FALSE,
1711: p_count => x_msg_count,
1712: p_data => x_msg_data
1713: );
1714: WHEN FND_API.G_EXC_ERROR THEN
1715: ROLLBACK TO Add_ItemKeyword_Pub;
1716: x_return_status := FND_API.G_RET_STS_ERROR;
1717: -- Standard call to get message count and if count=1, get the message
1718: FND_MSG_PUB.Count_And_Get (
1719: p_encoded => FND_API.G_FALSE,
1720: p_count => x_msg_count,
1721: p_data => x_msg_data
1722: );
1722: );
1723: WHEN OTHERS THEN
1724: ROLLBACK TO Add_ItemKeyword_Pub;
1725: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1726: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1727: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
1728: END IF;
1729: -- Standard call to get message count and if count=1, get the message
1730: FND_MSG_PUB.Count_And_Get (
1723: WHEN OTHERS THEN
1724: ROLLBACK TO Add_ItemKeyword_Pub;
1725: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1726: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1727: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
1728: END IF;
1729: -- Standard call to get message count and if count=1, get the message
1730: FND_MSG_PUB.Count_And_Get (
1731: p_encoded => FND_API.G_FALSE,
1726: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1727: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
1728: END IF;
1729: -- Standard call to get message count and if count=1, get the message
1730: FND_MSG_PUB.Count_And_Get (
1731: p_encoded => FND_API.G_FALSE,
1732: p_count => x_msg_count,
1733: p_data => x_msg_data
1734: );
1791: -- Standard call to check for call compatibility.
1792: SAVEPOINT Delete_ItemKeyword_Pub;
1793: --Initialize message list if p_init_msg_list is TRUE.
1794: IF FND_API.To_Boolean (p_init_msg_list) THEN
1795: FND_MSG_PUB.initialize;
1796: END IF;
1797: -- Initialize API return status to success
1798: x_return_status := FND_API.G_RET_STS_SUCCESS;
1799: -- Get the current (login) user id.
1806: IF (p_check_login_user = FND_API.G_TRUE) THEN
1807: -- Check if user is login and has the required privilege.
1808: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
1809: -- User is not login.
1810: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1811: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
1812: FND_MSG_PUB.ADD;
1813: END IF;
1814: RAISE FND_API.G_EXC_ERROR;
1808: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
1809: -- User is not login.
1810: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1811: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
1812: FND_MSG_PUB.ADD;
1813: END IF;
1814: RAISE FND_API.G_EXC_ERROR;
1815: END IF;
1816: AMV_USER_PVT.Is_Administrator
1824: x_result_flag => l_admin_flag
1825: );
1826: IF (l_admin_flag <> FND_API.G_TRUE) THEN
1827: -- User is not an administrator.
1828: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1829: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
1830: FND_MSG_PUB.ADD;
1831: END IF;
1832: RAISE FND_API.G_EXC_ERROR;
1826: IF (l_admin_flag <> FND_API.G_TRUE) THEN
1827: -- User is not an administrator.
1828: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1829: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
1830: FND_MSG_PUB.ADD;
1831: END IF;
1832: RAISE FND_API.G_EXC_ERROR;
1833: END IF;
1834: END IF;
1858: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1859: ROLLBACK TO Delete_ItemKeyword_Pub;
1860: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1861: -- Standard call to get message count and if count=1, get the message
1862: FND_MSG_PUB.Count_And_Get (
1863: p_encoded => FND_API.G_FALSE,
1864: p_count => x_msg_count,
1865: p_data => x_msg_data
1866: );
1867: WHEN FND_API.G_EXC_ERROR THEN
1868: ROLLBACK TO Delete_ItemKeyword_Pub;
1869: x_return_status := FND_API.G_RET_STS_ERROR;
1870: -- Standard call to get message count and if count=1, get the message
1871: FND_MSG_PUB.Count_And_Get (
1872: p_encoded => FND_API.G_FALSE,
1873: p_count => x_msg_count,
1874: p_data => x_msg_data
1875: );
1875: );
1876: WHEN OTHERS THEN
1877: ROLLBACK TO Delete_ItemKeyword_Pub;
1878: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1879: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1880: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1881: END IF;
1882: -- Standard call to get message count and if count=1, get the message
1883: FND_MSG_PUB.Count_And_Get (
1876: WHEN OTHERS THEN
1877: ROLLBACK TO Delete_ItemKeyword_Pub;
1878: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1879: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1880: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1881: END IF;
1882: -- Standard call to get message count and if count=1, get the message
1883: FND_MSG_PUB.Count_And_Get (
1884: p_encoded => FND_API.G_FALSE,
1879: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1880: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1881: END IF;
1882: -- Standard call to get message count and if count=1, get the message
1883: FND_MSG_PUB.Count_And_Get (
1884: p_encoded => FND_API.G_FALSE,
1885: p_count => x_msg_count,
1886: p_data => x_msg_data
1887: );
1950: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1951: END IF;
1952: --Initialize message list if p_init_msg_list is TRUE.
1953: IF FND_API.To_Boolean (p_init_msg_list) THEN
1954: FND_MSG_PUB.initialize;
1955: END IF;
1956: -- Initialize API return status to success
1957: x_return_status := FND_API.G_RET_STS_SUCCESS;
1958: -- Get the current (login) user id.
1965: IF (p_check_login_user = FND_API.G_TRUE) THEN
1966: -- Check if user is login and has the required privilege.
1967: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
1968: -- User is not login.
1969: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1970: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
1971: FND_MSG_PUB.ADD;
1972: END IF;
1973: RAISE FND_API.G_EXC_ERROR;
1967: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
1968: -- User is not login.
1969: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1970: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
1971: FND_MSG_PUB.ADD;
1972: END IF;
1973: RAISE FND_API.G_EXC_ERROR;
1974: END IF;
1975: AMV_USER_PVT.Is_Administrator
1983: x_result_flag => l_admin_flag
1984: );
1985: IF (l_admin_flag <> FND_API.G_TRUE) THEN
1986: -- User is not an administrator.
1987: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1988: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
1989: FND_MSG_PUB.ADD;
1990: END IF;
1991: RAISE FND_API.G_EXC_ERROR;
1985: IF (l_admin_flag <> FND_API.G_TRUE) THEN
1986: -- User is not an administrator.
1987: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1988: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
1989: FND_MSG_PUB.ADD;
1990: END IF;
1991: RAISE FND_API.G_EXC_ERROR;
1992: END IF;
1993: END IF;
2030: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2031: ROLLBACK TO Replace_ItemKeyword_Pub;
2032: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2033: -- Standard call to get message count and if count=1, get the message
2034: FND_MSG_PUB.Count_And_Get (
2035: p_encoded => FND_API.G_FALSE,
2036: p_count => x_msg_count,
2037: p_data => x_msg_data
2038: );
2039: WHEN FND_API.G_EXC_ERROR THEN
2040: ROLLBACK TO Replace_ItemKeyword_Pub;
2041: x_return_status := FND_API.G_RET_STS_ERROR;
2042: -- Standard call to get message count and if count=1, get the message
2043: FND_MSG_PUB.Count_And_Get (
2044: p_encoded => FND_API.G_FALSE,
2045: p_count => x_msg_count,
2046: p_data => x_msg_data
2047: );
2047: );
2048: WHEN OTHERS THEN
2049: ROLLBACK TO Replace_ItemKeyword_Pub;
2050: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2051: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2052: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
2053: END IF;
2054: -- Standard call to get message count and if count=1, get the message
2055: FND_MSG_PUB.Count_And_Get (
2048: WHEN OTHERS THEN
2049: ROLLBACK TO Replace_ItemKeyword_Pub;
2050: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2051: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2052: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
2053: END IF;
2054: -- Standard call to get message count and if count=1, get the message
2055: FND_MSG_PUB.Count_And_Get (
2056: p_encoded => FND_API.G_FALSE,
2051: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2052: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
2053: END IF;
2054: -- Standard call to get message count and if count=1, get the message
2055: FND_MSG_PUB.Count_And_Get (
2056: p_encoded => FND_API.G_FALSE,
2057: p_count => x_msg_count,
2058: p_data => x_msg_data
2059: );
2081: --
2082: BEGIN
2083: --Initialize message list if p_init_msg_list is TRUE.
2084: IF FND_API.To_Boolean (p_init_msg_list) THEN
2085: FND_MSG_PUB.initialize;
2086: END IF;
2087: -- Initialize API return status to success
2088: x_return_status := FND_API.G_RET_STS_SUCCESS;
2089: -- Get the current (login) user id.
2096: IF (p_check_login_user = FND_API.G_TRUE) THEN
2097: -- Check if user is login and has the required privilege.
2098: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
2099: -- User is not login.
2100: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2101: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
2102: FND_MSG_PUB.ADD;
2103: END IF;
2104: RAISE FND_API.G_EXC_ERROR;
2098: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
2099: -- User is not login.
2100: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2101: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
2102: FND_MSG_PUB.ADD;
2103: END IF;
2104: RAISE FND_API.G_EXC_ERROR;
2105: END IF;
2106: END IF;
2126: EXCEPTION
2127: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2128: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2129: -- Standard call to get message count and if count=1, get the message
2130: FND_MSG_PUB.Count_And_Get (
2131: p_encoded => FND_API.G_FALSE,
2132: p_count => x_msg_count,
2133: p_data => x_msg_data
2134: );
2134: );
2135: WHEN FND_API.G_EXC_ERROR THEN
2136: x_return_status := FND_API.G_RET_STS_ERROR;
2137: -- Standard call to get message count and if count=1, get the message
2138: FND_MSG_PUB.Count_And_Get (
2139: p_encoded => FND_API.G_FALSE,
2140: p_count => x_msg_count,
2141: p_data => x_msg_data
2142: );
2141: p_data => x_msg_data
2142: );
2143: WHEN OTHERS THEN
2144: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2145: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2146: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2147: END IF;
2148: -- Standard call to get message count and if count=1, get the message
2149: FND_MSG_PUB.Count_And_Get (
2142: );
2143: WHEN OTHERS THEN
2144: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2145: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2146: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2147: END IF;
2148: -- Standard call to get message count and if count=1, get the message
2149: FND_MSG_PUB.Count_And_Get (
2150: p_encoded => FND_API.G_FALSE,
2145: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2146: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2147: END IF;
2148: -- Standard call to get message count and if count=1, get the message
2149: FND_MSG_PUB.Count_And_Get (
2150: p_encoded => FND_API.G_FALSE,
2151: p_count => x_msg_count,
2152: p_data => x_msg_data
2153: );
2180: -- Standard call to check for call compatibility.
2181: SAVEPOINT Add_ItemAuthor_Pub;
2182: --Initialize message list if p_init_msg_list is TRUE.
2183: IF FND_API.To_Boolean (p_init_msg_list) THEN
2184: FND_MSG_PUB.initialize;
2185: END IF;
2186: -- Initialize API return status to success
2187: x_return_status := FND_API.G_RET_STS_SUCCESS;
2188: -- Get the current (login) user id.
2195: IF (p_check_login_user = FND_API.G_TRUE) THEN
2196: -- Check if user is login and has the required privilege.
2197: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
2198: -- User is not login.
2199: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2200: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
2201: FND_MSG_PUB.ADD;
2202: END IF;
2203: RAISE FND_API.G_EXC_ERROR;
2197: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
2198: -- User is not login.
2199: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2200: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
2201: FND_MSG_PUB.ADD;
2202: END IF;
2203: RAISE FND_API.G_EXC_ERROR;
2204: END IF;
2205: AMV_USER_PVT.Is_Administrator
2213: x_result_flag => l_admin_flag
2214: );
2215: IF (l_admin_flag <> FND_API.G_TRUE) THEN
2216: -- User is not an administrator.
2217: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2218: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
2219: FND_MSG_PUB.ADD;
2220: END IF;
2221: RAISE FND_API.G_EXC_ERROR;
2215: IF (l_admin_flag <> FND_API.G_TRUE) THEN
2216: -- User is not an administrator.
2217: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2218: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
2219: FND_MSG_PUB.ADD;
2220: END IF;
2221: RAISE FND_API.G_EXC_ERROR;
2222: END IF;
2223: END IF;
2238: p_item_id => p_item_id,
2239: p_author_tab => l_char_tab
2240: );
2241: ELSE
2242: FND_MSG_PUB.Count_And_Get (
2243: p_encoded => FND_API.G_FALSE,
2244: p_count => x_msg_count,
2245: p_data => x_msg_data
2246: );
2249: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2250: ROLLBACK TO Add_ItemAuthor_Pub;
2251: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2252: -- Standard call to get message count and if count=1, get the message
2253: FND_MSG_PUB.Count_And_Get (
2254: p_encoded => FND_API.G_FALSE,
2255: p_count => x_msg_count,
2256: p_data => x_msg_data
2257: );
2258: WHEN FND_API.G_EXC_ERROR THEN
2259: ROLLBACK TO Add_ItemAuthor_Pub;
2260: x_return_status := FND_API.G_RET_STS_ERROR;
2261: -- Standard call to get message count and if count=1, get the message
2262: FND_MSG_PUB.Count_And_Get (
2263: p_encoded => FND_API.G_FALSE,
2264: p_count => x_msg_count,
2265: p_data => x_msg_data
2266: );
2266: );
2267: WHEN OTHERS THEN
2268: ROLLBACK TO Add_ItemAuthor_Pub;
2269: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2270: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2271: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
2272: END IF;
2273: -- Standard call to get message count and if count=1, get the message
2274: FND_MSG_PUB.Count_And_Get (
2267: WHEN OTHERS THEN
2268: ROLLBACK TO Add_ItemAuthor_Pub;
2269: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2270: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2271: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
2272: END IF;
2273: -- Standard call to get message count and if count=1, get the message
2274: FND_MSG_PUB.Count_And_Get (
2275: p_encoded => FND_API.G_FALSE,
2270: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2271: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
2272: END IF;
2273: -- Standard call to get message count and if count=1, get the message
2274: FND_MSG_PUB.Count_And_Get (
2275: p_encoded => FND_API.G_FALSE,
2276: p_count => x_msg_count,
2277: p_data => x_msg_data
2278: );
2335: -- Standard call to check for call compatibility.
2336: SAVEPOINT Delete_ItemAuthor_Pub;
2337: --Initialize message list if p_init_msg_list is TRUE.
2338: IF FND_API.To_Boolean (p_init_msg_list) THEN
2339: FND_MSG_PUB.initialize;
2340: END IF;
2341: -- Initialize API return status to success
2342: x_return_status := FND_API.G_RET_STS_SUCCESS;
2343: -- Get the current (login) user id.
2350: IF (p_check_login_user = FND_API.G_TRUE) THEN
2351: -- Check if user is login and has the required privilege.
2352: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
2353: -- User is not login.
2354: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2355: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
2356: FND_MSG_PUB.ADD;
2357: END IF;
2358: RAISE FND_API.G_EXC_ERROR;
2352: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
2353: -- User is not login.
2354: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2355: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
2356: FND_MSG_PUB.ADD;
2357: END IF;
2358: RAISE FND_API.G_EXC_ERROR;
2359: END IF;
2360: AMV_USER_PVT.Is_Administrator
2368: x_result_flag => l_admin_flag
2369: );
2370: IF (l_admin_flag <> FND_API.G_TRUE) THEN
2371: -- User is not an administrator.
2372: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2373: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
2374: FND_MSG_PUB.ADD;
2375: END IF;
2376: RAISE FND_API.G_EXC_ERROR;
2370: IF (l_admin_flag <> FND_API.G_TRUE) THEN
2371: -- User is not an administrator.
2372: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2373: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
2374: FND_MSG_PUB.ADD;
2375: END IF;
2376: RAISE FND_API.G_EXC_ERROR;
2377: END IF;
2378: END IF;
2401: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2402: ROLLBACK TO Delete_ItemAuthor_Pub;
2403: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2404: -- Standard call to get message count and if count=1, get the message
2405: FND_MSG_PUB.Count_And_Get (
2406: p_encoded => FND_API.G_FALSE,
2407: p_count => x_msg_count,
2408: p_data => x_msg_data
2409: );
2410: WHEN FND_API.G_EXC_ERROR THEN
2411: ROLLBACK TO Delete_ItemAuthor_Pub;
2412: x_return_status := FND_API.G_RET_STS_ERROR;
2413: -- Standard call to get message count and if count=1, get the message
2414: FND_MSG_PUB.Count_And_Get (
2415: p_encoded => FND_API.G_FALSE,
2416: p_count => x_msg_count,
2417: p_data => x_msg_data
2418: );
2418: );
2419: WHEN OTHERS THEN
2420: ROLLBACK TO Delete_ItemAuthor_Pub;
2421: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2422: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2423: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2424: END IF;
2425: -- Standard call to get message count and if count=1, get the message
2426: FND_MSG_PUB.Count_And_Get (
2419: WHEN OTHERS THEN
2420: ROLLBACK TO Delete_ItemAuthor_Pub;
2421: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2422: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2423: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2424: END IF;
2425: -- Standard call to get message count and if count=1, get the message
2426: FND_MSG_PUB.Count_And_Get (
2427: p_encoded => FND_API.G_FALSE,
2422: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2423: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2424: END IF;
2425: -- Standard call to get message count and if count=1, get the message
2426: FND_MSG_PUB.Count_And_Get (
2427: p_encoded => FND_API.G_FALSE,
2428: p_count => x_msg_count,
2429: p_data => x_msg_data
2430: );
2493: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2494: END IF;
2495: --Initialize message list if p_init_msg_list is TRUE.
2496: IF FND_API.To_Boolean (p_init_msg_list) THEN
2497: FND_MSG_PUB.initialize;
2498: END IF;
2499: -- Initialize API return status to success
2500: x_return_status := FND_API.G_RET_STS_SUCCESS;
2501: -- Get the current (login) user id.
2508: IF (p_check_login_user = FND_API.G_TRUE) THEN
2509: -- Check if user is login and has the required privilege.
2510: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
2511: -- User is not login.
2512: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2513: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
2514: FND_MSG_PUB.ADD;
2515: END IF;
2516: RAISE FND_API.G_EXC_ERROR;
2510: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
2511: -- User is not login.
2512: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2513: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
2514: FND_MSG_PUB.ADD;
2515: END IF;
2516: RAISE FND_API.G_EXC_ERROR;
2517: END IF;
2518: AMV_USER_PVT.Is_Administrator
2526: x_result_flag => l_admin_flag
2527: );
2528: IF (l_admin_flag <> FND_API.G_TRUE) THEN
2529: -- User is not an administrator.
2530: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2531: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
2532: FND_MSG_PUB.ADD;
2533: END IF;
2534: RAISE FND_API.G_EXC_ERROR;
2528: IF (l_admin_flag <> FND_API.G_TRUE) THEN
2529: -- User is not an administrator.
2530: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2531: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
2532: FND_MSG_PUB.ADD;
2533: END IF;
2534: RAISE FND_API.G_EXC_ERROR;
2535: END IF;
2536: END IF;
2535: END IF;
2536: END IF;
2537: -- Check if item id is valid.
2538: IF (AMV_UTILITY_PVT.Is_ItemIdValid(p_item_id) <> TRUE) THEN
2539: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2540: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
2541: FND_MESSAGE.Set_Token('RECORD', 'AMV_ITEM_TK', TRUE);
2542: FND_MESSAGE.Set_Token('ID', TO_CHAR(p_item_id));
2543: FND_MSG_PUB.ADD;
2539: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2540: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
2541: FND_MESSAGE.Set_Token('RECORD', 'AMV_ITEM_TK', TRUE);
2542: FND_MESSAGE.Set_Token('ID', TO_CHAR(p_item_id));
2543: FND_MSG_PUB.ADD;
2544: END IF;
2545: RAISE FND_API.G_EXC_ERROR;
2546: END IF;
2547: -- Delete all the item's original authors
2583: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2584: ROLLBACK TO Replace_ItemAuthor_Pub;
2585: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2586: -- Standard call to get message count and if count=1, get the message
2587: FND_MSG_PUB.Count_And_Get (
2588: p_encoded => FND_API.G_FALSE,
2589: p_count => x_msg_count,
2590: p_data => x_msg_data
2591: );
2592: WHEN FND_API.G_EXC_ERROR THEN
2593: ROLLBACK TO Replace_ItemAuthor_Pub;
2594: x_return_status := FND_API.G_RET_STS_ERROR;
2595: -- Standard call to get message count and if count=1, get the message
2596: FND_MSG_PUB.Count_And_Get (
2597: p_encoded => FND_API.G_FALSE,
2598: p_count => x_msg_count,
2599: p_data => x_msg_data
2600: );
2600: );
2601: WHEN OTHERS THEN
2602: ROLLBACK TO Replace_ItemAuthor_Pub;
2603: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2604: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2605: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
2606: END IF;
2607: -- Standard call to get message count and if count=1, get the message
2608: FND_MSG_PUB.Count_And_Get (
2601: WHEN OTHERS THEN
2602: ROLLBACK TO Replace_ItemAuthor_Pub;
2603: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2604: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2605: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
2606: END IF;
2607: -- Standard call to get message count and if count=1, get the message
2608: FND_MSG_PUB.Count_And_Get (
2609: p_encoded => FND_API.G_FALSE,
2604: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2605: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
2606: END IF;
2607: -- Standard call to get message count and if count=1, get the message
2608: FND_MSG_PUB.Count_And_Get (
2609: p_encoded => FND_API.G_FALSE,
2610: p_count => x_msg_count,
2611: p_data => x_msg_data
2612: );
2634: --
2635: BEGIN
2636: --Initialize message list if p_init_msg_list is TRUE.
2637: IF FND_API.To_Boolean (p_init_msg_list) THEN
2638: FND_MSG_PUB.initialize;
2639: END IF;
2640: -- Initialize API return status to success
2641: x_return_status := FND_API.G_RET_STS_SUCCESS;
2642: -- Get the current (login) user id.
2649: IF (p_check_login_user = FND_API.G_TRUE) THEN
2650: -- Check if user is login and has the required privilege.
2651: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
2652: -- User is not login.
2653: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2654: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
2655: FND_MSG_PUB.ADD;
2656: END IF;
2657: RAISE FND_API.G_EXC_ERROR;
2651: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
2652: -- User is not login.
2653: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2654: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
2655: FND_MSG_PUB.ADD;
2656: END IF;
2657: RAISE FND_API.G_EXC_ERROR;
2658: END IF;
2659: END IF;
2679: EXCEPTION
2680: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2681: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2682: -- Standard call to get message count and if count=1, get the message
2683: FND_MSG_PUB.Count_And_Get (
2684: p_encoded => FND_API.G_FALSE,
2685: p_count => x_msg_count,
2686: p_data => x_msg_data
2687: );
2687: );
2688: WHEN FND_API.G_EXC_ERROR THEN
2689: x_return_status := FND_API.G_RET_STS_ERROR;
2690: -- Standard call to get message count and if count=1, get the message
2691: FND_MSG_PUB.Count_And_Get (
2692: p_encoded => FND_API.G_FALSE,
2693: p_count => x_msg_count,
2694: p_data => x_msg_data
2695: );
2694: p_data => x_msg_data
2695: );
2696: WHEN OTHERS THEN
2697: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2698: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2699: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2700: END IF;
2701: -- Standard call to get message count and if count=1, get the message
2702: FND_MSG_PUB.Count_And_Get (
2695: );
2696: WHEN OTHERS THEN
2697: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2698: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2699: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2700: END IF;
2701: -- Standard call to get message count and if count=1, get the message
2702: FND_MSG_PUB.Count_And_Get (
2703: p_encoded => FND_API.G_FALSE,
2698: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2699: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2700: END IF;
2701: -- Standard call to get message count and if count=1, get the message
2702: FND_MSG_PUB.Count_And_Get (
2703: p_encoded => FND_API.G_FALSE,
2704: p_count => x_msg_count,
2705: p_data => x_msg_data
2706: );
2762: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2763: END IF;
2764: --Initialize message list if p_init_msg_list is TRUE.
2765: IF FND_API.To_Boolean (p_init_msg_list) THEN
2766: FND_MSG_PUB.initialize;
2767: END IF;
2768: -- Initialize API return status to success
2769: x_return_status := FND_API.G_RET_STS_SUCCESS;
2770: -- Get the current (login) user id.
2777: IF (p_check_login_user = FND_API.G_TRUE) THEN
2778: -- Check if user is login and has the required privilege.
2779: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
2780: -- User is not login.
2781: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2782: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
2783: FND_MSG_PUB.ADD;
2784: END IF;
2785: RAISE FND_API.G_EXC_ERROR;
2779: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
2780: -- User is not login.
2781: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2782: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
2783: FND_MSG_PUB.ADD;
2784: END IF;
2785: RAISE FND_API.G_EXC_ERROR;
2786: END IF;
2787: AMV_USER_PVT.Is_Administrator
2795: x_result_flag => l_admin_flag
2796: );
2797: IF (l_admin_flag <> FND_API.G_TRUE) THEN
2798: -- User is not an administrator.
2799: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2800: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
2801: FND_MSG_PUB.ADD;
2802: END IF;
2803: RAISE FND_API.G_EXC_ERROR;
2797: IF (l_admin_flag <> FND_API.G_TRUE) THEN
2798: -- User is not an administrator.
2799: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2800: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
2801: FND_MSG_PUB.ADD;
2802: END IF;
2803: RAISE FND_API.G_EXC_ERROR;
2804: END IF;
2805: END IF;
2809: l_current_user_id := -1;
2810: END IF;
2811: -- Check if item id is valid.
2812: IF (AMV_UTILITY_PVT.Is_ItemIdValid(p_item_id) <> TRUE) THEN
2813: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2814: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
2815: FND_MESSAGE.Set_Token('RECORD', 'AMV_ITEM_TK', TRUE);
2816: fnd_MESSAGE.Set_Token('ID', TO_CHAR(p_item_id));
2817: FND_MSG_PUB.ADD;
2813: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2814: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
2815: FND_MESSAGE.Set_Token('RECORD', 'AMV_ITEM_TK', TRUE);
2816: fnd_MESSAGE.Set_Token('ID', TO_CHAR(p_item_id));
2817: FND_MSG_PUB.ADD;
2818: END IF;
2819: RAISE FND_API.G_EXC_ERROR;
2820: END IF;
2821: l_count := p_file_id_varray.COUNT;
2824: OPEN Get_FileLanguage_csr( p_file_id_varray(i) );
2825: FETCH Get_FileLanguage_csr INTO l_language_code;
2826: IF (Get_FileLanguage_csr%NOTFOUND) THEN
2827: CLOSE Get_FileLanguage_csr;
2828: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2829: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
2830: FND_MESSAGE.Set_Token('RECORD', 'AMV_FILE_TK', TRUE);
2831: FND_MESSAGE.Set_Token('ID', TO_CHAR(p_file_id_varray(i)) );
2832: FND_MSG_PUB.ADD;
2828: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2829: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
2830: FND_MESSAGE.Set_Token('RECORD', 'AMV_FILE_TK', TRUE);
2831: FND_MESSAGE.Set_Token('ID', TO_CHAR(p_file_id_varray(i)) );
2832: FND_MSG_PUB.ADD;
2833: END IF;
2834: IF ( x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
2835: x_return_status := FND_API.G_RET_STS_ERROR;
2836: END IF;
2841: FETCH Check_Itemfile_csr INTO l_temp_number;
2842: IF (Check_Itemfile_csr%FOUND) THEN
2843: CLOSE Check_Itemfile_csr;
2844: x_return_status := FND_API.G_RET_STS_ERROR;
2845: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2846: FND_MESSAGE.Set_name('AMV','AMV_ENTITY_HAS_ATTR');
2847: FND_MESSAGE.Set_Token('ENTITY', 'AMV_ITEM_TK', TRUE);
2848: FND_MESSAGE.Set_Token('ENTID', TO_CHAR(p_item_id) );
2849: FND_MESSAGE.Set_Token('ATTRIBUTE', 'AMV_FILE_TK', TRUE);
2847: FND_MESSAGE.Set_Token('ENTITY', 'AMV_ITEM_TK', TRUE);
2848: FND_MESSAGE.Set_Token('ENTID', TO_CHAR(p_item_id) );
2849: FND_MESSAGE.Set_Token('ATTRIBUTE', 'AMV_FILE_TK', TRUE);
2850: FND_MESSAGE.Set_Token('ATTRID', p_file_id_varray(i));
2851: FND_MSG_PUB.ADD;
2852: END IF;
2853: IF ( x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
2854: x_return_status := FND_API.G_RET_STS_ERROR;
2855: END IF;
2925: IF FND_API.To_Boolean ( p_commit ) THEN
2926: COMMIT WORK;
2927: END IF;
2928: --Standard call to get message count and if count=1, get the message
2929: FND_MSG_PUB.Count_And_Get (
2930: p_encoded => FND_API.G_FALSE,
2931: p_count => x_msg_count,
2932: p_data => x_msg_data
2933: );
2935: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2936: ROLLBACK TO Add_ItemFile_Pub;
2937: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2938: -- Standard call to get message count and if count=1, get the message
2939: FND_MSG_PUB.Count_And_Get (
2940: p_encoded => FND_API.G_FALSE,
2941: p_count => x_msg_count,
2942: p_data => x_msg_data
2943: );
2944: WHEN FND_API.G_EXC_ERROR THEN
2945: ROLLBACK TO Add_ItemFile_Pub;
2946: x_return_status := FND_API.G_RET_STS_ERROR;
2947: -- Standard call to get message count and if count=1, get the message
2948: FND_MSG_PUB.Count_And_Get (
2949: p_encoded => FND_API.G_FALSE,
2950: p_count => x_msg_count,
2951: p_data => x_msg_data
2952: );
2952: );
2953: WHEN OTHERS THEN
2954: ROLLBACK TO Add_ItemFile_Pub;
2955: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2956: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2957: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
2958: END IF;
2959: -- Standard call to get message count and if count=1, get the message
2960: FND_MSG_PUB.Count_And_Get (
2953: WHEN OTHERS THEN
2954: ROLLBACK TO Add_ItemFile_Pub;
2955: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2956: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2957: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
2958: END IF;
2959: -- Standard call to get message count and if count=1, get the message
2960: FND_MSG_PUB.Count_And_Get (
2961: p_encoded => FND_API.G_FALSE,
2956: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2957: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
2958: END IF;
2959: -- Standard call to get message count and if count=1, get the message
2960: FND_MSG_PUB.Count_And_Get (
2961: p_encoded => FND_API.G_FALSE,
2962: p_count => x_msg_count,
2963: p_data => x_msg_data
2964: );
3041: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3042: END IF;
3043: --Initialize message list if p_init_msg_list is TRUE.
3044: IF FND_API.To_Boolean (p_init_msg_list) THEN
3045: FND_MSG_PUB.initialize;
3046: END IF;
3047: -- Initialize API return status to success
3048: x_return_status := FND_API.G_RET_STS_SUCCESS;
3049: -- Get the current (login) user id.
3056: IF (p_check_login_user = FND_API.G_TRUE) THEN
3057: -- Check if user is login and has the required privilege.
3058: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
3059: -- User is not login.
3060: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3061: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
3062: FND_MSG_PUB.ADD;
3063: END IF;
3064: RAISE FND_API.G_EXC_ERROR;
3058: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
3059: -- User is not login.
3060: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3061: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
3062: FND_MSG_PUB.ADD;
3063: END IF;
3064: RAISE FND_API.G_EXC_ERROR;
3065: END IF;
3066: AMV_USER_PVT.Is_Administrator
3074: x_result_flag => l_admin_flag
3075: );
3076: IF (l_admin_flag <> FND_API.G_TRUE) THEN
3077: -- User is not an administrator.
3078: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3079: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
3080: FND_MSG_PUB.ADD;
3081: END IF;
3082: RAISE FND_API.G_EXC_ERROR;
3076: IF (l_admin_flag <> FND_API.G_TRUE) THEN
3077: -- User is not an administrator.
3078: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3079: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
3080: FND_MSG_PUB.ADD;
3081: END IF;
3082: RAISE FND_API.G_EXC_ERROR;
3083: END IF;
3084: END IF;
3083: END IF;
3084: END IF;
3085: -- Check if item id is valid.
3086: IF (AMV_UTILITY_PVT.Is_ItemIdValid(p_item_id) <> TRUE) THEN
3087: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3088: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
3089: FND_MESSAGE.Set_Token('RECORD', 'AMV_ITEM_TK', TRUE);
3090: FND_MESSAGE.Set_Token('ID', TO_CHAR(p_item_id));
3091: FND_MSG_PUB.ADD;
3087: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3088: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
3089: FND_MESSAGE.Set_Token('RECORD', 'AMV_ITEM_TK', TRUE);
3090: FND_MESSAGE.Set_Token('ID', TO_CHAR(p_item_id));
3091: FND_MSG_PUB.ADD;
3092: END IF;
3093: RAISE FND_API.G_EXC_ERROR;
3094: END IF;
3095: IF (p_file_id_varray IS NOT NULL) THEN
3099: FETCH Check_ItemFile_csr INTO l_temp_number, l_object_version_number;
3100: IF (Check_ItemFile_csr%NOTFOUND) THEN
3101: CLOSE Check_ItemFile_csr;
3102: x_return_status := FND_API.G_RET_STS_ERROR;
3103: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3104: FND_MESSAGE.Set_name('AMV','AMV_ENTITY_HAS_NOT_ATTR');
3105: FND_MESSAGE.Set_Token('ENTITY', 'AMV_ITEM_TK', TRUE);
3106: FND_MESSAGE.Set_Token('ENTID', TO_CHAR(p_item_id) );
3107: FND_MESSAGE.Set_Token('ATTRIBUTE', 'AMV_FILE_TK', TRUE);
3106: FND_MESSAGE.Set_Token('ENTID', TO_CHAR(p_item_id) );
3107: FND_MESSAGE.Set_Token('ATTRIBUTE', 'AMV_FILE_TK', TRUE);
3108: FND_MESSAGE.Set_Token('ATTRID',
3109: TO_CHAR( p_file_id_varray(i) ) );
3110: FND_MSG_PUB.ADD;
3111: END IF;
3112: IF ( x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
3113: x_return_status := FND_API.G_RET_STS_ERROR;
3114: END IF;
3141: IF FND_API.To_Boolean ( p_commit ) THEN
3142: COMMIT WORK;
3143: END IF;
3144: --Standard call to get message count and if count=1, get the message
3145: FND_MSG_PUB.Count_And_Get (
3146: p_encoded => FND_API.G_FALSE,
3147: p_count => x_msg_count,
3148: p_data => x_msg_data
3149: );
3151: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3152: ROLLBACK TO Delete_ItemFile_Pub;
3153: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3154: -- Standard call to get message count and if count=1, get the message
3155: FND_MSG_PUB.Count_And_Get (
3156: p_encoded => FND_API.G_FALSE,
3157: p_count => x_msg_count,
3158: p_data => x_msg_data
3159: );
3160: WHEN FND_API.G_EXC_ERROR THEN
3161: ROLLBACK TO Delete_ItemFile_Pub;
3162: x_return_status := FND_API.G_RET_STS_ERROR;
3163: -- Standard call to get message count and if count=1, get the message
3164: FND_MSG_PUB.Count_And_Get (
3165: p_encoded => FND_API.G_FALSE,
3166: p_count => x_msg_count,
3167: p_data => x_msg_data
3168: );
3168: );
3169: WHEN OTHERS THEN
3170: ROLLBACK TO Delete_ItemFile_Pub;
3171: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3172: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3173: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3174: END IF;
3175: -- Standard call to get message count and if count=1, get the message
3176: FND_MSG_PUB.Count_And_Get (
3169: WHEN OTHERS THEN
3170: ROLLBACK TO Delete_ItemFile_Pub;
3171: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3172: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3173: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3174: END IF;
3175: -- Standard call to get message count and if count=1, get the message
3176: FND_MSG_PUB.Count_And_Get (
3177: p_encoded => FND_API.G_FALSE,
3172: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3173: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3174: END IF;
3175: -- Standard call to get message count and if count=1, get the message
3176: FND_MSG_PUB.Count_And_Get (
3177: p_encoded => FND_API.G_FALSE,
3178: p_count => x_msg_count,
3179: p_data => x_msg_data
3180: );
3246: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3247: END IF;
3248: --Initialize message list if p_init_msg_list is TRUE.
3249: IF FND_API.To_Boolean (p_init_msg_list) THEN
3250: FND_MSG_PUB.initialize;
3251: END IF;
3252: -- Initialize API return status to success
3253: x_return_status := FND_API.G_RET_STS_SUCCESS;
3254: -- Get the current (login) user id.
3261: IF (p_check_login_user = FND_API.G_TRUE) THEN
3262: -- Check if user is login and has the required privilege.
3263: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
3264: -- User is not login.
3265: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3266: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
3267: FND_MSG_PUB.ADD;
3268: END IF;
3269: RAISE FND_API.G_EXC_ERROR;
3263: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
3264: -- User is not login.
3265: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3266: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
3267: FND_MSG_PUB.ADD;
3268: END IF;
3269: RAISE FND_API.G_EXC_ERROR;
3270: END IF;
3271: AMV_USER_PVT.Is_Administrator
3279: x_result_flag => l_admin_flag
3280: );
3281: IF (l_admin_flag <> FND_API.G_TRUE) THEN
3282: -- User is not an administrator.
3283: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3284: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
3285: FND_MSG_PUB.ADD;
3286: END IF;
3287: RAISE FND_API.G_EXC_ERROR;
3281: IF (l_admin_flag <> FND_API.G_TRUE) THEN
3282: -- User is not an administrator.
3283: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3284: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_HAVE_PRIVILEGE');
3285: FND_MSG_PUB.ADD;
3286: END IF;
3287: RAISE FND_API.G_EXC_ERROR;
3288: END IF;
3289: END IF;
3288: END IF;
3289: END IF;
3290: -- Check if item id is valid.
3291: IF (AMV_UTILITY_PVT.Is_ItemIdValid(p_item_id) <> TRUE) THEN
3292: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3293: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
3294: FND_MESSAGE.Set_Token('RECORD', 'AMV_ITEM_TK', TRUE);
3295: FND_MESSAGE.Set_Token('ID', TO_CHAR(p_item_id));
3296: FND_MSG_PUB.ADD;
3292: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3293: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
3294: FND_MESSAGE.Set_Token('RECORD', 'AMV_ITEM_TK', TRUE);
3295: FND_MESSAGE.Set_Token('ID', TO_CHAR(p_item_id));
3296: FND_MSG_PUB.ADD;
3297: END IF;
3298: RAISE FND_API.G_EXC_ERROR;
3299: END IF;
3300: -- Delete all the item's original files
3330: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3331: ROLLBACK TO Replace_ItemFile_Pub;
3332: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3333: -- Standard call to get message count and if count=1, get the message
3334: FND_MSG_PUB.Count_And_Get (
3335: p_encoded => FND_API.G_FALSE,
3336: p_count => x_msg_count,
3337: p_data => x_msg_data
3338: );
3339: WHEN FND_API.G_EXC_ERROR THEN
3340: ROLLBACK TO Replace_ItemFile_Pub;
3341: x_return_status := FND_API.G_RET_STS_ERROR;
3342: -- Standard call to get message count and if count=1, get the message
3343: FND_MSG_PUB.Count_And_Get (
3344: p_encoded => FND_API.G_FALSE,
3345: p_count => x_msg_count,
3346: p_data => x_msg_data
3347: );
3347: );
3348: WHEN OTHERS THEN
3349: ROLLBACK TO Replace_ItemFile_Pub;
3350: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3351: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3352: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
3353: END IF;
3354: -- Standard call to get message count and if count=1, get the message
3355: FND_MSG_PUB.Count_And_Get (
3348: WHEN OTHERS THEN
3349: ROLLBACK TO Replace_ItemFile_Pub;
3350: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3351: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3352: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
3353: END IF;
3354: -- Standard call to get message count and if count=1, get the message
3355: FND_MSG_PUB.Count_And_Get (
3356: p_encoded => FND_API.G_FALSE,
3351: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3352: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME,l_api_name);
3353: END IF;
3354: -- Standard call to get message count and if count=1, get the message
3355: FND_MSG_PUB.Count_And_Get (
3356: p_encoded => FND_API.G_FALSE,
3357: p_count => x_msg_count,
3358: p_data => x_msg_data
3359: );
3395: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3396: END IF;
3397: --Initialize message list if p_init_msg_list is TRUE.
3398: IF FND_API.To_Boolean (p_init_msg_list) THEN
3399: FND_MSG_PUB.initialize;
3400: END IF;
3401: -- Initialize API return status to success
3402: x_return_status := FND_API.G_RET_STS_SUCCESS;
3403: -- Get the current (login) user id.
3410: IF (p_check_login_user = FND_API.G_TRUE) THEN
3411: -- Check if user is login and has the required privilege.
3412: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
3413: -- User is not login.
3414: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3415: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
3416: FND_MSG_PUB.ADD;
3417: END IF;
3418: RAISE FND_API.G_EXC_ERROR;
3412: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
3413: -- User is not login.
3414: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3415: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
3416: FND_MSG_PUB.ADD;
3417: END IF;
3418: RAISE FND_API.G_EXC_ERROR;
3419: END IF;
3420: END IF;
3419: END IF;
3420: END IF;
3421: -- Check if item id is valid.
3422: IF (AMV_UTILITY_PVT.Is_ItemIdValid(p_item_id) <> TRUE) THEN
3423: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3424: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
3425: FND_MESSAGE.Set_Token('RECORD', 'AMV_ITEM_TK', TRUE);
3426: FND_MESSAGE.Set_Token('ID', TO_CHAR(p_item_id));
3427: FND_MSG_PUB.ADD;
3423: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3424: FND_MESSAGE.Set_name('AMV','AMV_RECORD_ID_MISSING');
3425: FND_MESSAGE.Set_Token('RECORD', 'AMV_ITEM_TK', TRUE);
3426: FND_MESSAGE.Set_Token('ID', TO_CHAR(p_item_id));
3427: FND_MSG_PUB.ADD;
3428: END IF;
3429: RAISE FND_API.G_EXC_ERROR;
3430: END IF;
3431: --Execute the SQL statements to get records
3435: x_file_id_varray.extend;
3436: x_file_id_varray(l_fetch_count) := rec.file_id;
3437: END LOOP;
3438: --Standard call to get message count and if count=1, get the message
3439: FND_MSG_PUB.Count_And_Get (
3440: p_encoded => FND_API.G_FALSE,
3441: p_count => x_msg_count,
3442: p_data => x_msg_data
3443: );
3444: EXCEPTION
3445: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3446: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3447: -- Standard call to get message count and if count=1, get the message
3448: FND_MSG_PUB.Count_And_Get (
3449: p_encoded => FND_API.G_FALSE,
3450: p_count => x_msg_count,
3451: p_data => x_msg_data
3452: );
3452: );
3453: WHEN FND_API.G_EXC_ERROR THEN
3454: x_return_status := FND_API.G_RET_STS_ERROR;
3455: -- Standard call to get message count and if count=1, get the message
3456: FND_MSG_PUB.Count_And_Get (
3457: p_encoded => FND_API.G_FALSE,
3458: p_count => x_msg_count,
3459: p_data => x_msg_data
3460: );
3459: p_data => x_msg_data
3460: );
3461: WHEN OTHERS THEN
3462: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3463: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3464: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3465: END IF;
3466: -- Standard call to get message count and if count=1, get the message
3467: FND_MSG_PUB.Count_And_Get (
3460: );
3461: WHEN OTHERS THEN
3462: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3463: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3464: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3465: END IF;
3466: -- Standard call to get message count and if count=1, get the message
3467: FND_MSG_PUB.Count_And_Get (
3468: p_encoded => FND_API.G_FALSE,
3463: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3464: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3465: END IF;
3466: -- Standard call to get message count and if count=1, get the message
3467: FND_MSG_PUB.Count_And_Get (
3468: p_encoded => FND_API.G_FALSE,
3469: p_count => x_msg_count,
3470: p_data => x_msg_data
3471: );
3542: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3543: END IF;
3544: --Initialize message list if p_init_msg_list is TRUE.
3545: IF FND_API.To_Boolean (p_init_msg_list) THEN
3546: FND_MSG_PUB.initialize;
3547: END IF;
3548: -- Initialize API return status to success
3549: x_return_status := FND_API.G_RET_STS_SUCCESS;
3550: -- Get the current (login) user id.
3557: IF (p_check_login_user = FND_API.G_TRUE) THEN
3558: -- Check if user is login and has the required privilege.
3559: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
3560: -- User is not login.
3561: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3562: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
3563: FND_MSG_PUB.ADD;
3564: END IF;
3565: RAISE FND_API.G_EXC_ERROR;
3559: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
3560: -- User is not login.
3561: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3562: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
3563: FND_MSG_PUB.ADD;
3564: END IF;
3565: RAISE FND_API.G_EXC_ERROR;
3566: END IF;
3567: END IF;
3576: x_message_varray.extend;
3577: x_message_varray(l_count) := cur.item_name;
3578: END LOOP;
3579: --Standard call to get message count and if count=1, get the message
3580: FND_MSG_PUB.Count_And_Get (
3581: p_encoded => FND_API.G_FALSE,
3582: p_count => x_msg_count,
3583: p_data => x_msg_data
3584: );
3585: EXCEPTION
3586: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3587: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3588: -- Standard call to get message count and if count=1, get the message
3589: FND_MSG_PUB.Count_And_Get (
3590: p_encoded => FND_API.G_FALSE,
3591: p_count => x_msg_count,
3592: p_data => x_msg_data
3593: );
3593: );
3594: WHEN FND_API.G_EXC_ERROR THEN
3595: x_return_status := FND_API.G_RET_STS_ERROR;
3596: -- Standard call to get message count and if count=1, get the message
3597: FND_MSG_PUB.Count_And_Get (
3598: p_encoded => FND_API.G_FALSE,
3599: p_count => x_msg_count,
3600: p_data => x_msg_data
3601: );
3600: p_data => x_msg_data
3601: );
3602: WHEN OTHERS THEN
3603: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3604: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3605: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3606: END IF;
3607: -- Standard call to get message count and if count=1, get the message
3608: FND_MSG_PUB.Count_And_Get (
3601: );
3602: WHEN OTHERS THEN
3603: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3604: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3605: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3606: END IF;
3607: -- Standard call to get message count and if count=1, get the message
3608: FND_MSG_PUB.Count_And_Get (
3609: p_encoded => FND_API.G_FALSE,
3604: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3605: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3606: END IF;
3607: -- Standard call to get message count and if count=1, get the message
3608: FND_MSG_PUB.Count_And_Get (
3609: p_encoded => FND_API.G_FALSE,
3610: p_count => x_msg_count,
3611: p_data => x_msg_data
3612: );
3724: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3725: END IF;
3726: --Initialize message list if p_init_msg_list is TRUE.
3727: IF FND_API.To_Boolean (p_init_msg_list) THEN
3728: FND_MSG_PUB.initialize;
3729: END IF;
3730: -- Initialize API return status to success
3731: x_return_status := FND_API.G_RET_STS_SUCCESS;
3732: -- Get the current (login) user id.
3739: IF (p_check_login_user = FND_API.G_TRUE) THEN
3740: -- Check if user is login and has the required privilege.
3741: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
3742: -- User is not login.
3743: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3744: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
3745: FND_MSG_PUB.ADD;
3746: END IF;
3747: RAISE FND_API.G_EXC_ERROR;
3741: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
3742: -- User is not login.
3743: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3744: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
3745: FND_MSG_PUB.ADD;
3746: END IF;
3747: RAISE FND_API.G_EXC_ERROR;
3748: END IF;
3749: END IF;
3783: x_item_varray(l_count).author_list := ' ';
3784: x_item_varray(l_count).keyword_list := ' ';
3785: END LOOP;
3786: --Standard call to get message count and if count=1, get the message
3787: FND_MSG_PUB.Count_And_Get (
3788: p_encoded => FND_API.G_FALSE,
3789: p_count => x_msg_count,
3790: p_data => x_msg_data
3791: );
3792: EXCEPTION
3793: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3794: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3795: -- Standard call to get message count and if count=1, get the message
3796: FND_MSG_PUB.Count_And_Get (
3797: p_encoded => FND_API.G_FALSE,
3798: p_count => x_msg_count,
3799: p_data => x_msg_data
3800: );
3800: );
3801: WHEN FND_API.G_EXC_ERROR THEN
3802: x_return_status := FND_API.G_RET_STS_ERROR;
3803: -- Standard call to get message count and if count=1, get the message
3804: FND_MSG_PUB.Count_And_Get (
3805: p_encoded => FND_API.G_FALSE,
3806: p_count => x_msg_count,
3807: p_data => x_msg_data
3808: );
3807: p_data => x_msg_data
3808: );
3809: WHEN OTHERS THEN
3810: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3811: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3812: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3813: END IF;
3814: -- Standard call to get message count and if count=1, get the message
3815: FND_MSG_PUB.Count_And_Get (
3808: );
3809: WHEN OTHERS THEN
3810: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3811: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3812: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3813: END IF;
3814: -- Standard call to get message count and if count=1, get the message
3815: FND_MSG_PUB.Count_And_Get (
3816: p_encoded => FND_API.G_FALSE,
3811: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3812: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3813: END IF;
3814: -- Standard call to get message count and if count=1, get the message
3815: FND_MSG_PUB.Count_And_Get (
3816: p_encoded => FND_API.G_FALSE,
3817: p_count => x_msg_count,
3818: p_data => x_msg_data
3819: );
3893: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3894: END IF;
3895: --Initialize message list if p_init_msg_list is TRUE.
3896: IF FND_API.To_Boolean (p_init_msg_list) THEN
3897: FND_MSG_PUB.initialize;
3898: END IF;
3899: -- Initialize API return status to success
3900: x_return_status := FND_API.G_RET_STS_SUCCESS;
3901: -- Get the current (login) user id.
3908: IF (p_check_login_user = FND_API.G_TRUE) THEN
3909: -- Check if user is login and has the required privilege.
3910: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
3911: -- User is not login.
3912: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3913: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
3914: FND_MSG_PUB.ADD;
3915: END IF;
3916: RAISE FND_API.G_EXC_ERROR;
3910: IF (l_current_login_id = FND_API.G_MISS_NUM) THEN
3911: -- User is not login.
3912: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3913: FND_MESSAGE.Set_name('AMV','AMV_USER_NOT_LOGIN');
3914: FND_MSG_PUB.ADD;
3915: END IF;
3916: RAISE FND_API.G_EXC_ERROR;
3917: END IF;
3918: END IF;
3931: CLOSE GetChannels_csr;
3932: --
3933:
3934: --Standard call to get message count and if count=1, get the message
3935: FND_MSG_PUB.Count_And_Get (
3936: p_encoded => FND_API.G_FALSE,
3937: p_count => x_msg_count,
3938: p_data => x_msg_data
3939: );
3940: EXCEPTION
3941: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3942: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3943: -- Standard call to get message count and if count=1, get the message
3944: FND_MSG_PUB.Count_And_Get (
3945: p_encoded => FND_API.G_FALSE,
3946: p_count => x_msg_count,
3947: p_data => x_msg_data
3948: );
3948: );
3949: WHEN FND_API.G_EXC_ERROR THEN
3950: x_return_status := FND_API.G_RET_STS_ERROR;
3951: -- Standard call to get message count and if count=1, get the message
3952: FND_MSG_PUB.Count_And_Get (
3953: p_encoded => FND_API.G_FALSE,
3954: p_count => x_msg_count,
3955: p_data => x_msg_data
3956: );
3955: p_data => x_msg_data
3956: );
3957: WHEN OTHERS THEN
3958: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3959: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3960: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3961: END IF;
3962: -- Standard call to get message count and if count=1, get the message
3963: FND_MSG_PUB.Count_And_Get (
3956: );
3957: WHEN OTHERS THEN
3958: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3959: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3960: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3961: END IF;
3962: -- Standard call to get message count and if count=1, get the message
3963: FND_MSG_PUB.Count_And_Get (
3964: p_encoded => FND_API.G_FALSE,
3959: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3960: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
3961: END IF;
3962: -- Standard call to get message count and if count=1, get the message
3963: FND_MSG_PUB.Count_And_Get (
3964: p_encoded => FND_API.G_FALSE,
3965: p_count => x_msg_count,
3966: p_data => x_msg_data
3967: );