3: g_pkg_name CONSTANT VARCHAR2(30) := 'INV_KanbanCard_PKG';
4:
5: TYPE supply_status_change_tbl_type IS TABLE OF VARCHAR2(1);
6:
7: g_true CONSTANT VARCHAR2(1) := fnd_api.g_true;
8: g_false CONSTANT VARCHAR2(1) := fnd_api.g_false;
9: g_supply_status_rows CONSTANT NUMBER := 7;
10: g_supply_status_columns CONSTANT NUMBER := 7;
11: g_supply_status_change_tbl supply_status_change_tbl_type
4:
5: TYPE supply_status_change_tbl_type IS TABLE OF VARCHAR2(1);
6:
7: g_true CONSTANT VARCHAR2(1) := fnd_api.g_true;
8: g_false CONSTANT VARCHAR2(1) := fnd_api.g_false;
9: g_supply_status_rows CONSTANT NUMBER := 7;
10: g_supply_status_columns CONSTANT NUMBER := 7;
11: g_supply_status_change_tbl supply_status_change_tbl_type
12: := supply_status_change_tbl_type(
207: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
208: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Query_Row');
209: END IF;
210:
211: RAISE fnd_api.g_exc_unexpected_error;
212: END query_row;
213:
214: FUNCTION cell(row_in NUMBER, col_in NUMBER)
215: RETURN NUMBER IS
233: FND_MESSAGE.SET_NAME('INV','INV_NO_ACT_ALLOW_HOLD_CARD');
234: Return False;
235: Else
236: */
237: l_result := fnd_api.to_boolean(g_supply_status_change_tbl(cell(trunc(p_to_supply_status), trunc(p_from_supply_status))));
238:
239: IF l_result THEN
240: RETURN(l_result);
241: END IF;
274: l_supply_status_from VARCHAR2(30);
275: l_supply_status_to VARCHAR2(30);
276: BEGIN
277:
278: l_result := fnd_api.to_boolean(fnd_api.g_true);
279:
280: if trunc(p_from_supply_status) in (1,2,3,4,5,6,7) and
281: trunc(p_to_supply_status) in (1,2,3,4,5,6,7) then
282: l_result := fnd_api.to_boolean(g_supply_status_change_tbl(cell(trunc(p_to_supply_status), trunc(p_from_supply_status))));
278: l_result := fnd_api.to_boolean(fnd_api.g_true);
279:
280: if trunc(p_from_supply_status) in (1,2,3,4,5,6,7) and
281: trunc(p_to_supply_status) in (1,2,3,4,5,6,7) then
282: l_result := fnd_api.to_boolean(g_supply_status_change_tbl(cell(trunc(p_to_supply_status), trunc(p_from_supply_status))));
283: elsif trunc(p_from_supply_status) = 8 or trunc(p_to_supply_status) = 8 then
284: l_result := fnd_api.to_boolean(fnd_api.g_false);
285: end if;
286:
280: if trunc(p_from_supply_status) in (1,2,3,4,5,6,7) and
281: trunc(p_to_supply_status) in (1,2,3,4,5,6,7) then
282: l_result := fnd_api.to_boolean(g_supply_status_change_tbl(cell(trunc(p_to_supply_status), trunc(p_from_supply_status))));
283: elsif trunc(p_from_supply_status) = 8 or trunc(p_to_supply_status) = 8 then
284: l_result := fnd_api.to_boolean(fnd_api.g_false);
285: end if;
286:
287: if ( p_from_supply_status not in (1,2,3,4,5,6,7,8) or
288: p_to_supply_status not in (1,2,3,4,5,6,7,8)) and l_result then
287: if ( p_from_supply_status not in (1,2,3,4,5,6,7,8) or
288: p_to_supply_status not in (1,2,3,4,5,6,7,8)) and l_result then
289: if nvl(fnd_profile.VALUE('FLM_EKB_OPS_FLAG'),0) = 1 then
290: if FLM_KANBAN_CUSTOM_PKG.status_change_hook(p_kanban_card_id,p_from_supply_status,p_to_supply_status) = 1 then
291: l_result := fnd_api.to_boolean(fnd_api.g_true);
292: else
293: l_result := fnd_api.to_boolean(fnd_api.g_false);
294: end if;
295: else
289: if nvl(fnd_profile.VALUE('FLM_EKB_OPS_FLAG'),0) = 1 then
290: if FLM_KANBAN_CUSTOM_PKG.status_change_hook(p_kanban_card_id,p_from_supply_status,p_to_supply_status) = 1 then
291: l_result := fnd_api.to_boolean(fnd_api.g_true);
292: else
293: l_result := fnd_api.to_boolean(fnd_api.g_false);
294: end if;
295: else
296: l_result := fnd_api.to_boolean(fnd_api.g_false);
297: end if;
292: else
293: l_result := fnd_api.to_boolean(fnd_api.g_false);
294: end if;
295: else
296: l_result := fnd_api.to_boolean(fnd_api.g_false);
297: end if;
298: end if;
299:
300: IF l_result THEN
539: ) IS
540: l_kanban_card_rec inv_kanban_pvt.kanban_card_rec_type;
541: l_kanban_card_number_ok BOOLEAN := FALSE;
542: l_dummy VARCHAR2(1);
543: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
544: l_current_replnsh_cycle_id NUMBER;
545: l_card_status NUMBER;
546: l_supply_status NUMBER;
547: BEGIN
585: end;
586: end if;
587: end if;
588: --Modified For Bug 12419870.
589: IF l_kanban_card_rec.kanban_card_number IS NULL or l_kanban_card_rec.kanban_card_number = FND_API.G_MISS_CHAR THEN
590: l_kanban_card_rec.kanban_card_number := TO_CHAR(l_kanban_card_rec.kanban_card_id);
591: end if;
592: ELSE
593: l_kanban_card_rec.kanban_card_number := p_kanban_card_number;
808: ELSE
809: insert_activity_for_card(l_kanban_card_rec);
810: END IF;
811:
812: IF l_return_status = fnd_api.g_ret_sts_error THEN
813: RAISE fnd_api.g_exc_error;
814: END IF;
815:
816: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
809: insert_activity_for_card(l_kanban_card_rec);
810: END IF;
811:
812: IF l_return_status = fnd_api.g_ret_sts_error THEN
813: RAISE fnd_api.g_exc_error;
814: END IF;
815:
816: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
817: RAISE fnd_api.g_exc_unexpected_error;
812: IF l_return_status = fnd_api.g_ret_sts_error THEN
813: RAISE fnd_api.g_exc_error;
814: END IF;
815:
816: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
817: RAISE fnd_api.g_exc_unexpected_error;
818: END IF;
819:
820: x_return_status := l_return_status;
813: RAISE fnd_api.g_exc_error;
814: END IF;
815:
816: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
817: RAISE fnd_api.g_exc_unexpected_error;
818: END IF;
819:
820: x_return_status := l_return_status;
821: p_kanban_card_number := l_kanban_card_rec.kanban_card_number;
823: p_supply_status := l_kanban_card_rec.supply_status;
824: p_card_status := l_kanban_card_rec.card_status;
825: p_current_replnsh_cycle_id := l_kanban_card_rec.current_replnsh_cycle_id;
826: EXCEPTION
827: WHEN fnd_api.g_exc_error THEN
828: x_return_status := fnd_api.g_ret_sts_error;
829: WHEN fnd_api.g_exc_unexpected_error THEN
830: x_return_status := fnd_api.g_ret_sts_unexp_error;
831: WHEN OTHERS THEN
824: p_card_status := l_kanban_card_rec.card_status;
825: p_current_replnsh_cycle_id := l_kanban_card_rec.current_replnsh_cycle_id;
826: EXCEPTION
827: WHEN fnd_api.g_exc_error THEN
828: x_return_status := fnd_api.g_ret_sts_error;
829: WHEN fnd_api.g_exc_unexpected_error THEN
830: x_return_status := fnd_api.g_ret_sts_unexp_error;
831: WHEN OTHERS THEN
832: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
825: p_current_replnsh_cycle_id := l_kanban_card_rec.current_replnsh_cycle_id;
826: EXCEPTION
827: WHEN fnd_api.g_exc_error THEN
828: x_return_status := fnd_api.g_ret_sts_error;
829: WHEN fnd_api.g_exc_unexpected_error THEN
830: x_return_status := fnd_api.g_ret_sts_unexp_error;
831: WHEN OTHERS THEN
832: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
833: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Insert_Row');
826: EXCEPTION
827: WHEN fnd_api.g_exc_error THEN
828: x_return_status := fnd_api.g_ret_sts_error;
829: WHEN fnd_api.g_exc_unexpected_error THEN
830: x_return_status := fnd_api.g_ret_sts_unexp_error;
831: WHEN OTHERS THEN
832: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
833: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Insert_Row');
834: END IF;
832: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
833: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Insert_Row');
834: END IF;
835:
836: x_return_status := fnd_api.g_ret_sts_unexp_error;
837: END insert_row;
838:
839: PROCEDURE lock_row(
840: p_kanban_card_id NUMBER
1101: ) IS
1102: l_kanban_card_rec inv_kanban_pvt.kanban_card_rec_type;
1103: l_old_kanban_card_rec inv_kanban_pvt.kanban_card_rec_type;
1104: l_current_replenish_cycle_id NUMBER;
1105: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
1106: l_supply_status NUMBER;
1107: l_consolidation_option NUMBER := null;
1108: l_status_check BOOLEAN; --ekanban changes by javakat
1109: --add for Ekanban business event
1127: --Calling the override method javakat
1128: l_status_check:=supply_status_change_ok(p_kanban_card_id ,l_old_kanban_card_rec.supply_status, p_supply_status,l_kanban_card_rec.card_status);
1129: IF l_status_check =FALSE THEN
1130: mydebug('In side the chck l_old_kanban_card_rec.supply_status != p_supply_status ');
1131: RAISE fnd_api.g_exc_error;
1132: END IF;
1133: END IF;
1134: */
1135:
1225: , x_current_replenish_cycle_id => l_current_replenish_cycle_id
1226: , p_kanban_card_rec => l_kanban_card_rec
1227: );
1228:
1229: IF l_return_status = fnd_api.g_ret_sts_error THEN
1230: RAISE fnd_api.g_exc_error;
1231: END IF;
1232:
1233: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1226: , p_kanban_card_rec => l_kanban_card_rec
1227: );
1228:
1229: IF l_return_status = fnd_api.g_ret_sts_error THEN
1230: RAISE fnd_api.g_exc_error;
1231: END IF;
1232:
1233: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1234: RAISE fnd_api.g_exc_unexpected_error;
1229: IF l_return_status = fnd_api.g_ret_sts_error THEN
1230: RAISE fnd_api.g_exc_error;
1231: END IF;
1232:
1233: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1234: RAISE fnd_api.g_exc_unexpected_error;
1235: END IF;
1236:
1237: l_kanban_card_rec.supply_status := l_supply_status;
1230: RAISE fnd_api.g_exc_error;
1231: END IF;
1232:
1233: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1234: RAISE fnd_api.g_exc_unexpected_error;
1235: END IF;
1236:
1237: l_kanban_card_rec.supply_status := l_supply_status;
1238: l_kanban_card_rec.current_replnsh_cycle_id := l_current_replenish_cycle_id;
1347: x_return_status =>l_return_status);
1348: end if;
1349:
1350: EXCEPTION
1351: WHEN fnd_api.g_exc_error THEN
1352: x_return_status := fnd_api.g_ret_sts_error;
1353: WHEN fnd_api.g_exc_unexpected_error THEN
1354: x_return_status := fnd_api.g_ret_sts_unexp_error;
1355: WHEN OTHERS THEN
1348: end if;
1349:
1350: EXCEPTION
1351: WHEN fnd_api.g_exc_error THEN
1352: x_return_status := fnd_api.g_ret_sts_error;
1353: WHEN fnd_api.g_exc_unexpected_error THEN
1354: x_return_status := fnd_api.g_ret_sts_unexp_error;
1355: WHEN OTHERS THEN
1356: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1349:
1350: EXCEPTION
1351: WHEN fnd_api.g_exc_error THEN
1352: x_return_status := fnd_api.g_ret_sts_error;
1353: WHEN fnd_api.g_exc_unexpected_error THEN
1354: x_return_status := fnd_api.g_ret_sts_unexp_error;
1355: WHEN OTHERS THEN
1356: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1357: fnd_msg_pub.add_exc_msg(g_pkg_name, 'update_row');
1350: EXCEPTION
1351: WHEN fnd_api.g_exc_error THEN
1352: x_return_status := fnd_api.g_ret_sts_error;
1353: WHEN fnd_api.g_exc_unexpected_error THEN
1354: x_return_status := fnd_api.g_ret_sts_unexp_error;
1355: WHEN OTHERS THEN
1356: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1357: fnd_msg_pub.add_exc_msg(g_pkg_name, 'update_row');
1358: END IF;
1356: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1357: fnd_msg_pub.add_exc_msg(g_pkg_name, 'update_row');
1358: END IF;
1359:
1360: x_return_status := fnd_api.g_ret_sts_unexp_error;
1361: END update_row;
1362:
1363: PROCEDURE update_row(p_kanban_card_rec inv_kanban_pvt.kanban_card_rec_type) IS
1364: l_return_status VARCHAR2(1);
1433: , p_disable_date => p_kanban_card_rec.disable_date
1434: , p_replacement_flag => p_kanban_card_rec.replacement_flag
1435: );
1436:
1437: IF l_return_status = fnd_api.g_ret_sts_error THEN
1438: RAISE fnd_api.g_exc_error;
1439: END IF;
1440:
1441: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1434: , p_replacement_flag => p_kanban_card_rec.replacement_flag
1435: );
1436:
1437: IF l_return_status = fnd_api.g_ret_sts_error THEN
1438: RAISE fnd_api.g_exc_error;
1439: END IF;
1440:
1441: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1442: RAISE fnd_api.g_exc_unexpected_error;
1437: IF l_return_status = fnd_api.g_ret_sts_error THEN
1438: RAISE fnd_api.g_exc_error;
1439: END IF;
1440:
1441: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1442: RAISE fnd_api.g_exc_unexpected_error;
1443: END IF;
1444: EXCEPTION
1445: WHEN fnd_api.g_exc_error THEN
1438: RAISE fnd_api.g_exc_error;
1439: END IF;
1440:
1441: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1442: RAISE fnd_api.g_exc_unexpected_error;
1443: END IF;
1444: EXCEPTION
1445: WHEN fnd_api.g_exc_error THEN
1446: RAISE fnd_api.g_exc_error;
1441: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1442: RAISE fnd_api.g_exc_unexpected_error;
1443: END IF;
1444: EXCEPTION
1445: WHEN fnd_api.g_exc_error THEN
1446: RAISE fnd_api.g_exc_error;
1447: WHEN fnd_api.g_exc_unexpected_error THEN
1448: RAISE fnd_api.g_exc_unexpected_error;
1449: WHEN OTHERS THEN
1442: RAISE fnd_api.g_exc_unexpected_error;
1443: END IF;
1444: EXCEPTION
1445: WHEN fnd_api.g_exc_error THEN
1446: RAISE fnd_api.g_exc_error;
1447: WHEN fnd_api.g_exc_unexpected_error THEN
1448: RAISE fnd_api.g_exc_unexpected_error;
1449: WHEN OTHERS THEN
1450: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1443: END IF;
1444: EXCEPTION
1445: WHEN fnd_api.g_exc_error THEN
1446: RAISE fnd_api.g_exc_error;
1447: WHEN fnd_api.g_exc_unexpected_error THEN
1448: RAISE fnd_api.g_exc_unexpected_error;
1449: WHEN OTHERS THEN
1450: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1451: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Update_Row');
1444: EXCEPTION
1445: WHEN fnd_api.g_exc_error THEN
1446: RAISE fnd_api.g_exc_error;
1447: WHEN fnd_api.g_exc_unexpected_error THEN
1448: RAISE fnd_api.g_exc_unexpected_error;
1449: WHEN OTHERS THEN
1450: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1451: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Update_Row');
1452: END IF;
1450: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1451: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Update_Row');
1452: END IF;
1453:
1454: RAISE fnd_api.g_exc_unexpected_error;
1455: END update_row;
1456:
1457: PROCEDURE update_card_status(p_kanban_card_rec IN OUT NOCOPY inv_kanban_pvt.kanban_card_rec_type, p_card_status IN NUMBER) IS
1458: l_return_status VARCHAR2(1);
1508: , p_attribute14 => p_kanban_card_rec.attribute14
1509: , p_attribute15 => p_kanban_card_rec.attribute15
1510: );
1511:
1512: IF l_return_status = fnd_api.g_ret_sts_error THEN
1513: RAISE fnd_api.g_exc_error;
1514: END IF;
1515:
1516: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1509: , p_attribute15 => p_kanban_card_rec.attribute15
1510: );
1511:
1512: IF l_return_status = fnd_api.g_ret_sts_error THEN
1513: RAISE fnd_api.g_exc_error;
1514: END IF;
1515:
1516: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1517: RAISE fnd_api.g_exc_unexpected_error;
1512: IF l_return_status = fnd_api.g_ret_sts_error THEN
1513: RAISE fnd_api.g_exc_error;
1514: END IF;
1515:
1516: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1517: RAISE fnd_api.g_exc_unexpected_error;
1518: END IF;
1519: EXCEPTION
1520: WHEN fnd_api.g_exc_error THEN
1513: RAISE fnd_api.g_exc_error;
1514: END IF;
1515:
1516: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1517: RAISE fnd_api.g_exc_unexpected_error;
1518: END IF;
1519: EXCEPTION
1520: WHEN fnd_api.g_exc_error THEN
1521: RAISE fnd_api.g_exc_error;
1516: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1517: RAISE fnd_api.g_exc_unexpected_error;
1518: END IF;
1519: EXCEPTION
1520: WHEN fnd_api.g_exc_error THEN
1521: RAISE fnd_api.g_exc_error;
1522: WHEN fnd_api.g_exc_unexpected_error THEN
1523: RAISE fnd_api.g_exc_unexpected_error;
1524: WHEN OTHERS THEN
1517: RAISE fnd_api.g_exc_unexpected_error;
1518: END IF;
1519: EXCEPTION
1520: WHEN fnd_api.g_exc_error THEN
1521: RAISE fnd_api.g_exc_error;
1522: WHEN fnd_api.g_exc_unexpected_error THEN
1523: RAISE fnd_api.g_exc_unexpected_error;
1524: WHEN OTHERS THEN
1525: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1518: END IF;
1519: EXCEPTION
1520: WHEN fnd_api.g_exc_error THEN
1521: RAISE fnd_api.g_exc_error;
1522: WHEN fnd_api.g_exc_unexpected_error THEN
1523: RAISE fnd_api.g_exc_unexpected_error;
1524: WHEN OTHERS THEN
1525: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1526: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Update_Card_Status');
1519: EXCEPTION
1520: WHEN fnd_api.g_exc_error THEN
1521: RAISE fnd_api.g_exc_error;
1522: WHEN fnd_api.g_exc_unexpected_error THEN
1523: RAISE fnd_api.g_exc_unexpected_error;
1524: WHEN OTHERS THEN
1525: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1526: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Update_Card_Status');
1527: END IF;
1525: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1526: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Update_Card_Status');
1527: END IF;
1528:
1529: RAISE fnd_api.g_exc_unexpected_error;
1530: END update_card_status;
1531:
1532: PROCEDURE delete_row(x_return_status OUT NOCOPY VARCHAR2, p_kanban_card_id NUMBER) IS
1533: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
1529: RAISE fnd_api.g_exc_unexpected_error;
1530: END update_card_status;
1531:
1532: PROCEDURE delete_row(x_return_status OUT NOCOPY VARCHAR2, p_kanban_card_id NUMBER) IS
1533: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
1534: BEGIN
1535: DELETE FROM mtl_kanban_cards
1536: WHERE kanban_card_id = p_kanban_card_id;
1537:
1541:
1542: delete_activity_for_card(p_kanban_card_id);
1543: x_return_status := l_return_status;
1544: EXCEPTION
1545: WHEN fnd_api.g_exc_error THEN
1546: x_return_status := fnd_api.g_ret_sts_error;
1547: WHEN fnd_api.g_exc_unexpected_error THEN
1548: x_return_status := fnd_api.g_ret_sts_unexp_error;
1549: WHEN OTHERS THEN
1542: delete_activity_for_card(p_kanban_card_id);
1543: x_return_status := l_return_status;
1544: EXCEPTION
1545: WHEN fnd_api.g_exc_error THEN
1546: x_return_status := fnd_api.g_ret_sts_error;
1547: WHEN fnd_api.g_exc_unexpected_error THEN
1548: x_return_status := fnd_api.g_ret_sts_unexp_error;
1549: WHEN OTHERS THEN
1550: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1543: x_return_status := l_return_status;
1544: EXCEPTION
1545: WHEN fnd_api.g_exc_error THEN
1546: x_return_status := fnd_api.g_ret_sts_error;
1547: WHEN fnd_api.g_exc_unexpected_error THEN
1548: x_return_status := fnd_api.g_ret_sts_unexp_error;
1549: WHEN OTHERS THEN
1550: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1551: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Delete_Row');
1544: EXCEPTION
1545: WHEN fnd_api.g_exc_error THEN
1546: x_return_status := fnd_api.g_ret_sts_error;
1547: WHEN fnd_api.g_exc_unexpected_error THEN
1548: x_return_status := fnd_api.g_ret_sts_unexp_error;
1549: WHEN OTHERS THEN
1550: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1551: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Delete_Row');
1552: END IF;
1550: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1551: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Delete_Row');
1552: END IF;
1553:
1554: x_return_status := fnd_api.g_ret_sts_unexp_error;
1555: END delete_row;
1556:
1557: PROCEDURE insert_activity_for_card(p_kanban_card_rec IN inv_kanban_pvt.kanban_card_rec_type) IS
1558: BEGIN
1661: , p_kanban_card_rec.program_update_date
1662: , p_kanban_card_rec.source_wip_entity_id
1663: );
1664: EXCEPTION
1665: WHEN fnd_api.g_exc_error THEN
1666: RAISE fnd_api.g_exc_error;
1667: WHEN OTHERS THEN
1668: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1669: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Insert_Activity_For_Card');
1662: , p_kanban_card_rec.source_wip_entity_id
1663: );
1664: EXCEPTION
1665: WHEN fnd_api.g_exc_error THEN
1666: RAISE fnd_api.g_exc_error;
1667: WHEN OTHERS THEN
1668: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1669: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Insert_Activity_For_Card');
1670: END IF;
1668: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1669: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Insert_Activity_For_Card');
1670: END IF;
1671:
1672: RAISE fnd_api.g_exc_unexpected_error;
1673: END insert_activity_for_card;
1674:
1675: PROCEDURE delete_cards_for_pull_seq(p_pull_sequence_id NUMBER) IS
1676: BEGIN
1678:
1679: DELETE FROM mtl_kanban_cards
1680: WHERE pull_sequence_id = p_pull_sequence_id;
1681: EXCEPTION
1682: WHEN fnd_api.g_exc_error THEN
1683: RAISE fnd_api.g_exc_error;
1684: WHEN OTHERS THEN
1685: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1686: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Delete_Cards_For_Pull_Seq');
1679: DELETE FROM mtl_kanban_cards
1680: WHERE pull_sequence_id = p_pull_sequence_id;
1681: EXCEPTION
1682: WHEN fnd_api.g_exc_error THEN
1683: RAISE fnd_api.g_exc_error;
1684: WHEN OTHERS THEN
1685: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1686: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Delete_Cards_For_Pull_Seq');
1687: END IF;
1685: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1686: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Delete_Cards_For_Pull_Seq');
1687: END IF;
1688:
1689: RAISE fnd_api.g_exc_unexpected_error;
1690: END delete_cards_for_pull_seq;
1691:
1692: PROCEDURE delete_activity_for_card(p_kanban_card_id NUMBER) IS
1693: BEGIN
1693: BEGIN
1694: DELETE FROM mtl_kanban_card_activity
1695: WHERE kanban_card_id = p_kanban_card_id;
1696: EXCEPTION
1697: WHEN fnd_api.g_exc_error THEN
1698: RAISE fnd_api.g_exc_error;
1699: WHEN OTHERS THEN
1700: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1701: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Delete_Activity_For_Card');
1694: DELETE FROM mtl_kanban_card_activity
1695: WHERE kanban_card_id = p_kanban_card_id;
1696: EXCEPTION
1697: WHEN fnd_api.g_exc_error THEN
1698: RAISE fnd_api.g_exc_error;
1699: WHEN OTHERS THEN
1700: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1701: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Delete_Activity_For_Card');
1702: END IF;
1700: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1701: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Delete_Activity_For_Card');
1702: END IF;
1703:
1704: RAISE fnd_api.g_exc_unexpected_error;
1705: END delete_activity_for_card;
1706:
1707: PROCEDURE delete_activity_for_pull_seq(p_pull_sequence_id NUMBER) IS
1708: BEGIN
1711: FROM mtl_kanban_cards crd
1712: WHERE crd.kanban_card_id = act.kanban_card_id
1713: AND crd.pull_sequence_id = p_pull_sequence_id);
1714: EXCEPTION
1715: WHEN fnd_api.g_exc_error THEN
1716: RAISE fnd_api.g_exc_error;
1717: WHEN OTHERS THEN
1718: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1719: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Delete_Activity_For_Pull_Seq');
1712: WHERE crd.kanban_card_id = act.kanban_card_id
1713: AND crd.pull_sequence_id = p_pull_sequence_id);
1714: EXCEPTION
1715: WHEN fnd_api.g_exc_error THEN
1716: RAISE fnd_api.g_exc_error;
1717: WHEN OTHERS THEN
1718: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1719: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Delete_Activity_For_Pull_Seq');
1720: END IF;
1718: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1719: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Delete_Activity_For_Pull_Seq');
1720: END IF;
1721:
1722: RAISE fnd_api.g_exc_unexpected_error;
1723: END delete_activity_for_pull_seq;
1724:
1725:
1726:
1786: ) IS
1787: l_kanban_card_rec inv_kanban_pvt.kanban_card_rec_type;
1788: l_kanban_card_number_ok BOOLEAN := FALSE;
1789: l_dummy VARCHAR2(1);
1790: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
1791: l_current_replnsh_cycle_id NUMBER;
1792: l_card_status NUMBER;
1793: l_supply_status NUMBER;
1794: --add for Ekanban busniess event
1839: end;
1840: end if;
1841: end if;
1842: --Modified For Bug 12419870.
1843: IF l_kanban_card_rec.kanban_card_number IS NULL or l_kanban_card_rec.kanban_card_number = FND_API.G_MISS_CHAR THEN
1844: l_kanban_card_rec.kanban_card_number := TO_CHAR(l_kanban_card_rec.kanban_card_id);
1845: end if;
1846:
1847: ELSE
2087: ELSE
2088: insert_activity_for_card(l_kanban_card_rec);
2089: END IF;
2090:
2091: IF l_return_status = fnd_api.g_ret_sts_error THEN
2092: RAISE fnd_api.g_exc_error;
2093: END IF;
2094:
2095: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2088: insert_activity_for_card(l_kanban_card_rec);
2089: END IF;
2090:
2091: IF l_return_status = fnd_api.g_ret_sts_error THEN
2092: RAISE fnd_api.g_exc_error;
2093: END IF;
2094:
2095: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2096: RAISE fnd_api.g_exc_unexpected_error;
2091: IF l_return_status = fnd_api.g_ret_sts_error THEN
2092: RAISE fnd_api.g_exc_error;
2093: END IF;
2094:
2095: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2096: RAISE fnd_api.g_exc_unexpected_error;
2097: END IF;
2098:
2099: x_return_status := l_return_status;
2092: RAISE fnd_api.g_exc_error;
2093: END IF;
2094:
2095: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2096: RAISE fnd_api.g_exc_unexpected_error;
2097: END IF;
2098:
2099: x_return_status := l_return_status;
2100: p_kanban_card_number := l_kanban_card_rec.kanban_card_number;
2109: x_msg_data =>l_msg_data,
2110: x_return_status =>l_return_status);
2111: end if;
2112: EXCEPTION
2113: WHEN fnd_api.g_exc_error THEN
2114: x_return_status := fnd_api.g_ret_sts_error;
2115: WHEN fnd_api.g_exc_unexpected_error THEN
2116: x_return_status := fnd_api.g_ret_sts_unexp_error;
2117: WHEN OTHERS THEN
2110: x_return_status =>l_return_status);
2111: end if;
2112: EXCEPTION
2113: WHEN fnd_api.g_exc_error THEN
2114: x_return_status := fnd_api.g_ret_sts_error;
2115: WHEN fnd_api.g_exc_unexpected_error THEN
2116: x_return_status := fnd_api.g_ret_sts_unexp_error;
2117: WHEN OTHERS THEN
2118: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2111: end if;
2112: EXCEPTION
2113: WHEN fnd_api.g_exc_error THEN
2114: x_return_status := fnd_api.g_ret_sts_error;
2115: WHEN fnd_api.g_exc_unexpected_error THEN
2116: x_return_status := fnd_api.g_ret_sts_unexp_error;
2117: WHEN OTHERS THEN
2118: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2119: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Insert_Row');
2112: EXCEPTION
2113: WHEN fnd_api.g_exc_error THEN
2114: x_return_status := fnd_api.g_ret_sts_error;
2115: WHEN fnd_api.g_exc_unexpected_error THEN
2116: x_return_status := fnd_api.g_ret_sts_unexp_error;
2117: WHEN OTHERS THEN
2118: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2119: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Insert_Row');
2120: END IF;
2118: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2119: fnd_msg_pub.add_exc_msg(g_pkg_name, 'Insert_Row');
2120: END IF;
2121:
2122: x_return_status := fnd_api.g_ret_sts_unexp_error;
2123: END insert_row;
2124:
2125: PROCEDURE lock_row(
2126: p_kanban_card_id NUMBER
2362: ) IS
2363: l_kanban_card_rec inv_kanban_pvt.kanban_card_rec_type;
2364: l_old_kanban_card_rec inv_kanban_pvt.kanban_card_rec_type;
2365: l_current_replenish_cycle_id NUMBER;
2366: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
2367: l_supply_status NUMBER;
2368: BEGIN
2369: fnd_msg_pub.initialize;
2370: mydebug('Inside update_row 2');
2448: , x_current_replenish_cycle_id => l_current_replenish_cycle_id
2449: , p_kanban_card_rec => l_kanban_card_rec
2450: );
2451:
2452: IF l_return_status = fnd_api.g_ret_sts_error THEN
2453: RAISE fnd_api.g_exc_error;
2454: END IF;
2455:
2456: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2449: , p_kanban_card_rec => l_kanban_card_rec
2450: );
2451:
2452: IF l_return_status = fnd_api.g_ret_sts_error THEN
2453: RAISE fnd_api.g_exc_error;
2454: END IF;
2455:
2456: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2457: RAISE fnd_api.g_exc_unexpected_error;
2452: IF l_return_status = fnd_api.g_ret_sts_error THEN
2453: RAISE fnd_api.g_exc_error;
2454: END IF;
2455:
2456: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2457: RAISE fnd_api.g_exc_unexpected_error;
2458: END IF;
2459:
2460: l_kanban_card_rec.supply_status := l_supply_status;
2453: RAISE fnd_api.g_exc_error;
2454: END IF;
2455:
2456: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2457: RAISE fnd_api.g_exc_unexpected_error;
2458: END IF;
2459:
2460: l_kanban_card_rec.supply_status := l_supply_status;
2461: l_kanban_card_rec.current_replnsh_cycle_id := l_current_replenish_cycle_id;
2552: p_supply_status := l_kanban_card_rec.supply_status;
2553: p_card_status := l_kanban_card_rec.card_status;
2554: p_current_replnsh_cycle_id := l_kanban_card_rec.current_replnsh_cycle_id;
2555: EXCEPTION
2556: WHEN fnd_api.g_exc_error THEN
2557: x_return_status := fnd_api.g_ret_sts_error;
2558: WHEN fnd_api.g_exc_unexpected_error THEN
2559: x_return_status := fnd_api.g_ret_sts_unexp_error;
2560: WHEN OTHERS THEN
2553: p_card_status := l_kanban_card_rec.card_status;
2554: p_current_replnsh_cycle_id := l_kanban_card_rec.current_replnsh_cycle_id;
2555: EXCEPTION
2556: WHEN fnd_api.g_exc_error THEN
2557: x_return_status := fnd_api.g_ret_sts_error;
2558: WHEN fnd_api.g_exc_unexpected_error THEN
2559: x_return_status := fnd_api.g_ret_sts_unexp_error;
2560: WHEN OTHERS THEN
2561: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2554: p_current_replnsh_cycle_id := l_kanban_card_rec.current_replnsh_cycle_id;
2555: EXCEPTION
2556: WHEN fnd_api.g_exc_error THEN
2557: x_return_status := fnd_api.g_ret_sts_error;
2558: WHEN fnd_api.g_exc_unexpected_error THEN
2559: x_return_status := fnd_api.g_ret_sts_unexp_error;
2560: WHEN OTHERS THEN
2561: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2562: fnd_msg_pub.add_exc_msg(g_pkg_name, 'update_row');
2555: EXCEPTION
2556: WHEN fnd_api.g_exc_error THEN
2557: x_return_status := fnd_api.g_ret_sts_error;
2558: WHEN fnd_api.g_exc_unexpected_error THEN
2559: x_return_status := fnd_api.g_ret_sts_unexp_error;
2560: WHEN OTHERS THEN
2561: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2562: fnd_msg_pub.add_exc_msg(g_pkg_name, 'update_row');
2563: END IF;
2561: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2562: fnd_msg_pub.add_exc_msg(g_pkg_name, 'update_row');
2563: END IF;
2564:
2565: x_return_status := fnd_api.g_ret_sts_unexp_error;
2566: END update_row;
2567:
2568:
2569: END inv_kanbancard_pkg;