245:
246: --
247: -- Initialize message list if p_init_msg_list is set to true
248: IF FND_API.to_Boolean(p_init_msg_list) THEN
249: FND_MSG_PUB.initialize;
250: END IF;
251:
252: -- Initialize API return status to success
253: x_return_status := FND_API.G_RET_STS_SUCCESS;
310: IF (l_debug = 1) THEN
311: mdebug('fatal error: exported by someone else');
312: END IF;
313: FND_MESSAGE.Set_Name('INV', 'INV_CCEOI_ENTRY_EXPORTED');
314: FND_MSG_PUB.Add;
315: x_errorcode := 201;
316: RAISE FND_API.G_EXC_ERROR;
317: end if;
318:
318:
319:
320: if (not (c_rec.entry_status_code in (1,3))) then
321: FND_MESSAGE.Set_Name('INV', 'INV_CCEOI_ENTRY_STATUS_NA');
322: FND_MSG_PUB.Add;
323: x_errorcode := 202;
324: RAISE FND_API.G_EXC_ERROR;
325: end if;
326:
352: -- if user provided cycle_count_entry_id does not correspond
353: -- to anything report an error
354: if (counter = 0) then
355: FND_MESSAGE.Set_Name('INV', 'INV_CCEOI_NO_CCE_WITH_CCEID');
356: FND_MSG_PUB.Add;
357: x_errorcode := 203;
358: raise fnd_api.g_exc_error;
359: end if;
360:
367: IF FND_API.to_Boolean(p_commit) THEN
368: COMMIT;
369: END IF;
370:
371: FND_MSG_PUB.Count_And_Get
372: (p_count => x_msg_count
373: , p_data => x_msg_data);
374:
375: EXCEPTION
379:
380: --
381: x_return_status := FND_API.G_RET_STS_ERROR;
382: --
383: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
384: , p_data => x_msg_data);
385: --
386: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
387: --
389: --
390: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
391: x_errorcode := -1;
392: --
393: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
394: , p_data => x_msg_data);
395: --
396: WHEN OTHERS THEN
397: --
399: --
400: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
401: x_errorcode := -1;
402: --
403: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
404: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
405: END IF;
406: --
407: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
400: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
401: x_errorcode := -1;
402: --
403: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
404: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
405: END IF;
406: --
407: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
408: , p_data => x_msg_data);
403: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
404: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
405: END IF;
406: --
407: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
408: , p_data => x_msg_data);
409: END;
410:
411:
484:
485: --
486: -- Initialize message list if p_init_msg_list is set to true
487: IF FND_API.to_Boolean(p_init_msg_list) THEN
488: FND_MSG_PUB.initialize;
489: END IF;
490:
491: -- Initialize API return status to success
492: x_return_status := FND_API.G_RET_STS_SUCCESS;
507:
508: if (c_rec.lock_flag = 1) then
509:
510: FND_MESSAGE.Set_Name('INV', 'INV_CCEOI_IFACE_ROW_LOCKED');
511: FND_MSG_PUB.Add;
512: x_errorcode := 200;
513: RAISE FND_API.G_EXC_ERROR;
514:
515: end if;
515: end if;
516:
517: if (c_rec.delete_flag = 1) then
518: FND_MESSAGE.Set_Name('INV', 'INV_CCEOI_IFACE_MARKED_DELETED');
519: FND_MSG_PUB.Add;
520: x_errorcode := 204;
521: RAISE FND_API.G_EXC_ERROR;
522: end if;
523:
522: end if;
523:
524: if (c_rec.status_flag in (0, 1)) then
525: FND_MESSAGE.Set_Name('INV', 'INV_CCEOI_IFACE_STATUS_DONE');
526: FND_MSG_PUB.Add;
527: x_errorcode := 206;
528: RAISE FND_API.G_EXC_ERROR;
529: end if;
530:
529: end if;
530:
531: if (nvl(c_rec.process_flag,1) = 2) then
532: FND_MESSAGE.Set_Name('INV', 'INV_CCEOI_IFACE_NOT_READY');
533: FND_MSG_PUB.Add;
534: x_errorcode := 207;
535: RAISE FND_API.G_EXC_ERROR;
536: end if;
537:
663: end if;
664:
665: else
666: FND_MESSAGE.Set_Name('INV', 'INV_CCEOI_INVALID_CEI_ID');
667: FND_MSG_PUB.Add;
668: x_errorcode := 205;
669: raise fnd_api.g_exc_error;
670: end if;
671: end if;
680: IF FND_API.to_Boolean(p_commit) THEN
681: COMMIT;
682: END IF;
683:
684: FND_MSG_PUB.Count_And_Get
685: (p_count => x_msg_count
686: , p_data => x_msg_data);
687:
688: EXCEPTION
692:
693: --
694: x_return_status := FND_API.G_RET_STS_ERROR;
695: --
696: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
697: , p_data => x_msg_data);
698: --
699: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
700: --
702: --
703: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
704: x_errorcode := -1;
705: --
706: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
707: , p_data => x_msg_data);
708: --
709: WHEN OTHERS THEN
710: --
712: --
713: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
714: x_errorcode := -1;
715: --
716: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
717: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
718: END IF;
719: --
720: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
713: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
714: x_errorcode := -1;
715: --
716: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
717: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
718: END IF;
719: --
720: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
721: , p_data => x_msg_data);
716: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
717: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
718: END IF;
719: --
720: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
721: , p_data => x_msg_data);
722: END;
723:
724:
790: END IF;
791: --
792: -- Initialize message list if p_init_msg_list is set to true
793: IF FND_API.to_Boolean(p_init_msg_list) THEN
794: FND_MSG_PUB.initialize;
795: END IF;
796: --
797: -- Initialisize API return status to access
798: x_return_status := FND_API.G_RET_STS_SUCCESS;
815: IF (l_debug = 1) THEN
816: mdebug('invalid cost group id or cost group name');
817: END IF;
818: FND_MESSAGE.SET_NAME('INV', 'INV_INT_CSTEXT');
819: FND_MSG_PUB.ADD;
820: RAISE FND_API.G_EXC_ERROR;
821: END IF;
822: END IF;
823:
907: -- set an error
908:
909:
910: FND_MESSAGE.SET_NAME('INV', 'INV_CCEOI_UNKNOWN_ACTION_CODE');
911: FND_MSG_PUB.Add;
912:
913: if (MTL_CCEOI_VAR_PVT.G_REC_IN_SYSTEM = FALSE) THEN
914:
915: -- this is a really dangerous call since
1024: IF FND_API.to_Boolean(p_commit) THEN
1025: COMMIT;
1026: END IF;
1027: -- Standard call to get message count and if count is 1, get message info
1028: FND_MSG_PUB.Count_And_Get
1029: (p_count => x_msg_count
1030: , p_data => x_msg_data);
1031:
1032:
1036: x_return_status := FND_API.G_RET_STS_ERROR;
1037: IF (l_debug = 1) THEN
1038: mdebug('Exception: ' || sqlerrm);
1039: END IF;
1040: FND_MSG_PUB.Count_And_Get(
1041: p_count => x_msg_count
1042: , p_data => x_msg_data);
1043:
1044:
1048: x_errorcode := -1;
1049: IF (l_debug = 1) THEN
1050: mdebug('Unexp-Exception: ' || sqlerrm);
1051: END IF;
1052: FND_MSG_PUB.Count_And_Get(
1053: p_count => x_msg_count
1054: , p_data => x_msg_data);
1055:
1056:
1061: IF (l_debug = 1) THEN
1062: mdebug('Other-Exception: ' || sqlerrm);
1063: END IF;
1064:
1065: IF FND_MSG_PUB.Check_Msg_Level(
1066: FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1067: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1068: END IF;
1069:
1062: mdebug('Other-Exception: ' || sqlerrm);
1063: END IF;
1064:
1065: IF FND_MSG_PUB.Check_Msg_Level(
1066: FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1067: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1068: END IF;
1069:
1070: FND_MSG_PUB.Count_And_Get(
1063: END IF;
1064:
1065: IF FND_MSG_PUB.Check_Msg_Level(
1066: FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1067: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1068: END IF;
1069:
1070: FND_MSG_PUB.Count_And_Get(
1071: p_count => x_msg_count
1066: FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1067: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1068: END IF;
1069:
1070: FND_MSG_PUB.Count_And_Get(
1071: p_count => x_msg_count
1072: , p_data => x_msg_data);
1073: END;
1074:
1132: END IF;
1133:
1134: -- Initialize message list if p_init_msg_list is set to true
1135: IF FND_API.to_Boolean(p_init_msg_list) THEN
1136: FND_MSG_PUB.initialize;
1137: END IF;
1138: --
1139: -- Initialisize API return status to access
1140: x_return_status := FND_API.G_RET_STS_SUCCESS;
1182: IF (l_debug = 1) THEN
1183: mdebug('invalid parent lpn id or parent lpn');
1184: END IF;
1185: FND_MESSAGE.SET_NAME('INV', 'INV_WMS_CONT_INVALID_LPN');
1186: FND_MSG_PUB.ADD;
1187: RAISE e_Invalid_Inputs;
1188: END IF;
1189: -- Assing validated values to l_item_rec.
1190: l_item_rec.parent_lpn_id := l_lpn.lpn_id;
1207: END IF;
1208: IF p_interface_rec.parent_lpn_id <> p_interface_rec.outermost_lpn_id THEN
1209: -- error out, this case not supported
1210: FND_MESSAGE.SET_NAME('INV', 'INV_WMS_CC_NESTED_LPN_DISCR');
1211: FND_MSG_PUB.ADD;
1212: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1213: ELSE
1214: -- set lpn discrepancy flag to 1 (yes)
1215: l_lpn_discrepancy := 1;
1347: IF (l_debug = 1) THEN
1348: mdebug('invalid parent lpn id or parent lpn');
1349: END IF;
1350: FND_MESSAGE.SET_NAME('INV', 'INV_WMS_CONT_INVALID_LPN');
1351: FND_MSG_PUB.ADD;
1352: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1353: END IF;
1354:
1355: -- put new lpn in record
1470: x_return_status := FND_API.G_RET_STS_ERROR;
1471: IF (l_debug = 1) THEN
1472: mdebug('Exception: ' || sqlerrm);
1473: END IF;
1474: FND_MSG_PUB.Count_And_Get(
1475: p_count => x_msg_count
1476: , p_data => x_msg_data);
1477:
1478:
1482: x_errorcode := -1;
1483: IF (l_debug = 1) THEN
1484: mdebug('Unexp-Exception: ' || sqlerrm);
1485: END IF;
1486: FND_MSG_PUB.Count_And_Get(
1487: p_count => x_msg_count
1488: , p_data => x_msg_data);
1489:
1490: WHEN e_Invalid_Inputs THEN
1489:
1490: WHEN e_Invalid_Inputs THEN
1491: ROLLBACK TO Process_LPN_CountRequest;
1492: x_return_status := FND_API.G_RET_STS_ERROR;
1493: FND_MSG_PUB.Count_And_Get
1494: ( p_count => x_msg_count,
1495: p_data => x_msg_data
1496: );
1497:
1501: IF (l_debug = 1) THEN
1502: mdebug('Other-Exception: ' || sqlerrm);
1503: END IF;
1504:
1505: IF FND_MSG_PUB.Check_Msg_Level(
1506: FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1507: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1508: END IF;
1509:
1502: mdebug('Other-Exception: ' || sqlerrm);
1503: END IF;
1504:
1505: IF FND_MSG_PUB.Check_Msg_Level(
1506: FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1507: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1508: END IF;
1509:
1510: FND_MSG_PUB.Count_And_Get(
1503: END IF;
1504:
1505: IF FND_MSG_PUB.Check_Msg_Level(
1506: FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1507: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1508: END IF;
1509:
1510: FND_MSG_PUB.Count_And_Get(
1511: p_count => x_msg_count
1506: FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1507: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1508: END IF;
1509:
1510: FND_MSG_PUB.Count_And_Get(
1511: p_count => x_msg_count
1512: , p_data => x_msg_data);
1513: END Process_LPN_CountRequest;
1514: