742: END IF;
743:
744: -- Initialize message stack if required
745: IF FND_API.to_Boolean(p_init_msg_list) THEN
746: FND_MSG_PUB.initialize;
747: END IF;
748:
749:
750: IF (p_action_code = 'UPDATE') THEN
836: ELSE
837: x_return_status := wsh_util_core.g_ret_sts_success; --bug 2398628
838: END IF;
839: --
840: FND_MSG_PUB.Count_And_Get
841: ( p_count => x_msg_count
842: , p_data => x_msg_data
843: );
844: --
849: EXCEPTION
850: WHEN FND_API.G_EXC_ERROR THEN
851: x_return_status := FND_API.G_RET_STS_ERROR;
852: -- Get message count and data
853: FND_MSG_PUB.Count_And_Get
854: ( p_count => x_msg_count
855: , p_data => x_msg_data
856: );
857: --
862: --
863: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
864: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
865: -- Get message count and data
866: FND_MSG_PUB.Count_And_Get
867: ( p_count => x_msg_count
868: , p_data => x_msg_data
869: );
870: --
874: END IF;
875: --
876: WHEN OTHERS THEN
877: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
878: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
879: THEN
880: FND_MSG_PUB.Add_Exc_Msg
881: ( G_PKG_NAME
882: , '_x_'
876: WHEN OTHERS THEN
877: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
878: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
879: THEN
880: FND_MSG_PUB.Add_Exc_Msg
881: ( G_PKG_NAME
882: , '_x_'
883: );
884: END IF;
882: , '_x_'
883: );
884: END IF;
885: -- Get message count and data
886: FND_MSG_PUB.Count_And_Get
887: ( p_count => x_msg_count
888: , p_data => x_msg_data
889: );
890: --
983: END IF;
984:
985: -- Initialize message stack if required
986: IF FND_API.to_Boolean(p_init_msg_list) THEN
987: FND_MSG_PUB.initialize;
988: END IF;
989:
990: wsh_util_validate.validate_delivery_name(
991: p_delivery_id => l_delivery_id,
1074: ELSE
1075: x_return_status := wsh_util_core.g_ret_sts_success; --bug 2398628
1076: END IF;
1077: --
1078: FND_MSG_PUB.Count_And_Get
1079: ( p_count => x_msg_count
1080: , p_data => x_msg_data
1081: );
1082: --
1087: EXCEPTION
1088: WHEN FND_API.G_EXC_ERROR THEN
1089: x_return_status := FND_API.G_RET_STS_ERROR;
1090: -- Get message count and data
1091: FND_MSG_PUB.Count_And_Get
1092: ( p_count => x_msg_count
1093: , p_data => x_msg_data
1094: );
1095: --
1100: --
1101: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1102: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1103: -- Get message count and data
1104: FND_MSG_PUB.Count_And_Get
1105: ( p_count => x_msg_count
1106: , p_data => x_msg_data
1107: );
1108: --
1112: END IF;
1113: --
1114: WHEN OTHERS THEN
1115: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1116: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1117: THEN
1118: FND_MSG_PUB.Add_Exc_Msg
1119: ( G_PKG_NAME
1120: , '_x_'
1114: WHEN OTHERS THEN
1115: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1116: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1117: THEN
1118: FND_MSG_PUB.Add_Exc_Msg
1119: ( G_PKG_NAME
1120: , '_x_'
1121: );
1122: END IF;
1120: , '_x_'
1121: );
1122: END IF;
1123: -- Get message count and data
1124: FND_MSG_PUB.Count_And_Get
1125: ( p_count => x_msg_count
1126: , p_data => x_msg_data
1127: );
1128: --
1307: END IF;
1308:
1309: END IF;
1310:
1311: FND_MSG_PUB.Count_And_Get(
1312: p_count => x_msg_count,
1313: p_data => x_msg_data );
1314:
1315: IF l_debug_on THEN
1325: 'Expected error occured. Oracle error message is ' || SQLERRM,
1326: WSH_DEBUG_SV.C_EXCEP_LEVEL);
1327: WSH_DEBUG_SV.Pop(l_module_name, 'EXCEPTION: FND_API.G_EXC_ERROR');
1328: END IF;
1329: FND_MSG_PUB.Count_And_Get(
1330: p_count => x_msg_count,
1331: p_data => x_msg_data );
1332:
1333: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1337: 'Unexpected error occured. Oracle error message is ' || SQLERRM,
1338: WSH_DEBUG_SV.C_UNEXPEC_ERR_LEVEL);
1339: WSH_DEBUG_SV.Pop(l_module_name, 'EXCEPTION: FND_API.G_EXC_UNEXPECTED_ERROR');
1340: END IF;
1341: FND_MSG_PUB.Count_And_Get(
1342: p_count => x_msg_count,
1343: p_data => x_msg_data );
1344:
1345: WHEN WSH_INVALID_ORGANIZATION THEN
1346: x_return_status := WSH_UTIL_CORE.G_RET_STS_ERROR;
1347: IF l_debug_on THEN
1348: WSH_DEBUG_SV.Logmsg(l_module_name, 'WSH_INVALID_ORGANIZATION : ' || x_return_status);
1349: END IF;
1350: FND_MSG_PUB.Count_And_Get(
1351: p_count => x_msg_count,
1352: p_data => x_msg_data );
1353:
1354: WHEN WSH_INVALID_DELIVERY THEN
1357: IF l_debug_on THEN
1358: WSH_DEBUG_SV.Logmsg(l_module_name, 'WSH_INVALID_DELIVERY : ' || x_return_status);
1359: END IF;
1360: WSH_UTIL_CORE.Add_Message(x_return_status);
1361: FND_MSG_PUB.Count_And_Get(
1362: p_count => x_msg_count,
1363: p_data => x_msg_data );
1364:
1365: WHEN OTHERS THEN
1368: IF l_debug_on THEN
1369: WSH_DEBUG_SV.Logmsg(l_module_name, 'Unexpected Error : ' || x_return_status);
1370: WSH_DEBUG_SV.Logmsg(l_module_name, 'Error Message : ' || SQLERRM);
1371: END IF;
1372: FND_MSG_PUB.Count_And_Get(
1373: p_count => x_msg_count,
1374: p_data => x_msg_data );
1375: END Generate_Documents;
1376: