DBA Data[Home] [Help]

APPS.MRP_KANBAN_SNAPSHOT_PK dependencies on MRP_LOW_LEVEL_CODES

Line 7: -- locator ) are null in the mrp_low_level_codes table and populates them

3:
4:
5: -- ========================================================================
6: -- This function checks if the from locations (from subinventory and from
7: -- locator ) are null in the mrp_low_level_codes table and populates them
8: -- ========================================================================
9: FUNCTION CHECK_ITEM_LOCATIONS RETURN BOOLEAN IS
10:
11: l_count number;

Line 18: FROM mtl_system_items_kfv msi, mrp_low_level_codes mllc

14: -- declare a cursor for detailed debug information. This will be used
15: -- only if debug is turned on.
16: CURSOR cur_debug is
17: SELECT distinct msi.concatenated_segments
18: FROM mtl_system_items_kfv msi, mrp_low_level_codes mllc
19: WHERE mllc.plan_id = mrp_kanban_plan_pk.g_kanban_info_rec.kanban_plan_id
20: AND mllc.organization_id =
21: mrp_kanban_plan_pk.g_kanban_info_rec.organization_id
22: AND mllc.from_subinventory IS NULL

Line 45: FROM mrp_low_level_codes

41:
42: -- first check if any of the kanban items have null locations
43: SELECT count(*)
44: INTO l_count
45: FROM mrp_low_level_codes
46: WHERE plan_id = mrp_kanban_plan_pk.g_kanban_info_rec.kanban_plan_id
47: AND organization_id = mrp_kanban_plan_pk.g_kanban_info_rec.organization_id
48: AND from_subinventory IS NULL
49: AND from_locator_id IS NULL

Line 61: UPDATE mrp_low_level_codes mllc

57:
58: -- this is the first thing we do to get the sub and locator information
59: IF l_count > 0 THEN
60:
61: UPDATE mrp_low_level_codes mllc
62: SET (mllc.from_subinventory, mllc.from_locator_id) =
63: (SELECT bibs.SUBINVENTORY_NAME, bibs.LOCATOR_ID
64: FROM bom_inventory_backflush_subinv bibs
65: AND bibs.inventory_item_id = mllc.component_item_id

Line 82: FROM mrp_low_level_codes

78:
79: -- now check again to see if we have any kanban items with null locations
80: SELECT count(*)
81: INTO l_count
82: FROM mrp_low_level_codes
83: WHERE plan_id = mrp_kanban_plan_pk.g_kanban_info_rec.kanban_plan_id
84: AND organization_id = mrp_kanban_plan_pk.g_kanban_info_rec.organization_id
85: AND from_subinventory IS NULL
86: AND from_locator_id IS NULL

Line 97: UPDATE mrp_low_level_codes mllc

93: -- we go after the item master for the information
94:
95: IF l_count > 0 THEN
96:
97: UPDATE mrp_low_level_codes mllc
98: SET (mllc.from_subinventory, mllc.from_locator_id) =
99: (SELECT msi.wip_supply_subinventory,
100: msi.wip_supply_locator_id
101: FROM mtl_system_items msi

Line 119: FROM mrp_low_level_codes

115: -- now check again if we have any kanban items with incomplete from
116: -- location information. If so error out
117: SELECT count(*)
118: INTO l_count
119: FROM mrp_low_level_codes
120: WHERE plan_id = mrp_kanban_plan_pk.g_kanban_info_rec.kanban_plan_id
121: AND organization_id = mrp_kanban_plan_pk.g_kanban_info_rec.organization_id
122: AND from_subinventory IS NULL
123: AND from_locator_id IS NULL

Line 181: -- build in the mrp_low_level_codes table and errors out if we find one

177: END CHECK_ITEM_LOCATIONS;
178:
179: -- ========================================================================
180: -- This function checks for presence of loops in the bill structure
181: -- build in the mrp_low_level_codes table and errors out if we find one
182: -- ========================================================================
183: FUNCTION CHECK_FOR_LOOPS RETURN BOOLEAN IS
184:
185: l_count number;

Line 213: mrp_low_level_codes mllc

209: mtl_item_locations parent_loc,
210: mtl_item_locations child_loc,
211: mtl_system_items_kfv parent,
212: mtl_system_items_kfv child,
213: mrp_low_level_codes mllc
214: WHERE mllc.plan_id = mrp_kanban_plan_pk.g_kanban_info_rec.kanban_plan_id
215: AND mllc.organization_id =
216: mrp_kanban_plan_pk.g_kanban_info_rec.organization_id
217: AND mllc.low_level_code IS NULL

Line 321: -- location combinations in mrp_low_level_codes table

317:
318: END CHECK_FOR_LOOPS;
319:
320: -- ========================================================================
321: -- location combinations in mrp_low_level_codes table
322: -- ========================================================================
323:
324: FUNCTION CALC_LOW_LEVEL_CODE RETURN BOOLEAN
325: IS

Line 347: UPDATE mrp_low_level_codes mllc1

343: l_low_level_code := 1000; /* initialize */
344:
345: WHILE TRUE LOOP
346:
347: UPDATE mrp_low_level_codes mllc1
348: SET mllc1.low_level_code = l_low_level_code
349: WHERE mllc1.plan_id = mrp_kanban_plan_pk.g_kanban_info_rec.kanban_plan_id
350: AND mllc1.organization_id =
351: mrp_kanban_plan_pk.g_kanban_info_rec.organization_id

Line 354: (SELECT /*+index(mllc2 MRP_LOW_LEVEL_CODES_N1)*/ 'Exists as parent' /* Bug 4608294 - added hint*/

350: AND mllc1.organization_id =
351: mrp_kanban_plan_pk.g_kanban_info_rec.organization_id
352: AND mllc1.low_level_code IS NULL
353: AND NOT EXISTS
354: (SELECT /*+index(mllc2 MRP_LOW_LEVEL_CODES_N1)*/ 'Exists as parent' /* Bug 4608294 - added hint*/
355: FROM mrp_low_level_codes mllc2
356: WHERE mllc2.plan_id = mllc1.plan_id
357: AND mllc2.organization_id = mllc1.organization_id
358: AND mllc2.low_level_code IS NULL

Line 355: FROM mrp_low_level_codes mllc2

351: mrp_kanban_plan_pk.g_kanban_info_rec.organization_id
352: AND mllc1.low_level_code IS NULL
353: AND NOT EXISTS
354: (SELECT /*+index(mllc2 MRP_LOW_LEVEL_CODES_N1)*/ 'Exists as parent' /* Bug 4608294 - added hint*/
355: FROM mrp_low_level_codes mllc2
356: WHERE mllc2.plan_id = mllc1.plan_id
357: AND mllc2.organization_id = mllc1.organization_id
358: AND mllc2.low_level_code IS NULL
359: AND ( mllc2.assembly_item_id = mllc1.component_item_id AND

Line 756: 'INSERT INTO mrp_low_level_codes ( ' ||

752: MRP_UTIL.MRP_LOG (mrp_kanban_plan_pk.g_log_message);
753: END IF;
754:
755: l_sql_stmt :=
756: 'INSERT INTO mrp_low_level_codes ( ' ||
757: 'plan_id,' ||
758: 'organization_id,' ||
759: 'assembly_item_id,' ||
760: 'to_subinventory,' ||

Line 928: to_char(l_rows_processed) || ' into mrp_low_level_codes table';

924: mrp_kanban_plan_pk.g_log_message :=
925: 'Successfully executed the Dynamic Sql Statement';
926: MRP_UTIL.MRP_LOG (mrp_kanban_plan_pk.g_log_message);
927: mrp_kanban_plan_pk.g_log_message := 'Inserted ' ||
928: to_char(l_rows_processed) || ' into mrp_low_level_codes table';
929: MRP_UTIL.MRP_LOG (mrp_kanban_plan_pk.g_log_message);
930: END IF;
931:
932: END IF; -- so we basically did all the above only if we are not replanning

Line 951: -- mrp_low_level_codes table if not already present. So basically once

947: WHILE TRUE LOOP
948:
949: -- ------------------------------------------------------------------------
950: -- Select parent of the current level items and insert into
951: -- mrp_low_level_codes table if not already present. So basically once
952: -- we got our initial list of items into mrp_low_level_codes, it becomes
953: -- driver for our select statement for insert. The rest of the logic is
954: -- similar to the above built sql statement. Notice how we are using
955: -- the levels_below column to walk our way up the bill

Line 952: -- we got our initial list of items into mrp_low_level_codes, it becomes

948:
949: -- ------------------------------------------------------------------------
950: -- Select parent of the current level items and insert into
951: -- mrp_low_level_codes table if not already present. So basically once
952: -- we got our initial list of items into mrp_low_level_codes, it becomes
953: -- driver for our select statement for insert. The rest of the logic is
954: -- similar to the above built sql statement. Notice how we are using
955: -- the levels_below column to walk our way up the bill
956: -- ------------------------------------------------------------------------

Line 960: INSERT INTO mrp_low_level_codes (

956: -- ------------------------------------------------------------------------
957:
958: if l_eco_profile = FALSE then
959:
960: INSERT INTO mrp_low_level_codes (
961: plan_id,
962: organization_id,
963: assembly_item_id,
964: to_subinventory,

Line 1030: mrp_low_level_codes mllc

1026: mtl_kanban_pull_sequences ps,
1027: bom_bill_of_materials bbom,
1028: mtl_item_categories mic,
1029: bom_inventory_components mrp_bic,
1030: mrp_low_level_codes mllc
1031: WHERE mllc.plan_id =
1032: mrp_kanban_plan_pk.g_kanban_info_rec.kanban_plan_id
1033: AND mllc.organization_id =
1034: mrp_kanban_plan_pk.g_kanban_info_rec.organization_id

Line 1064: /* Avoid re-selecting items already in mrp_low_level_codes */

1060: mrp_kanban_plan_pk.g_kanban_info_rec.organization_id
1061: AND mic.inventory_item_id (+) = mllc.assembly_item_id
1062: AND mic.category_set_id (+) =
1063: mrp_kanban_plan_pk.g_kanban_info_rec.category_set_id
1064: /* Avoid re-selecting items already in mrp_low_level_codes */
1065: AND NOT EXISTS
1066: ( SELECT 'Exists'
1067: FROM mrp_low_level_codes mllc2
1068: WHERE mllc2.plan_id =

Line 1067: FROM mrp_low_level_codes mllc2

1063: mrp_kanban_plan_pk.g_kanban_info_rec.category_set_id
1064: /* Avoid re-selecting items already in mrp_low_level_codes */
1065: AND NOT EXISTS
1066: ( SELECT 'Exists'
1067: FROM mrp_low_level_codes mllc2
1068: WHERE mllc2.plan_id =
1069: mrp_kanban_plan_pk.g_kanban_info_rec.kanban_plan_id
1070: AND mllc2.organization_id =
1071: mrp_kanban_plan_pk.g_kanban_info_rec.organization_id

Line 1080: INSERT INTO mrp_low_level_codes (

1076: WHERE msi.organization_id = bbom.organization_id
1077: AND msi.inventory_item_id = bbom.assembly_item_id
1078: AND msi.planning_make_buy_code = 1);
1079: else
1080: INSERT INTO mrp_low_level_codes (
1081: plan_id,
1082: organization_id,
1083: assembly_item_id,
1084: to_subinventory,

Line 1147: mrp_low_level_codes mllc

1143: mtl_kanban_pull_sequences ps,
1144: bom_bill_of_materials bbom,
1145: mtl_item_categories mic,
1146: bom_inventory_components mrp_bic,
1147: mrp_low_level_codes mllc
1148: WHERE mllc.plan_id =
1149: mrp_kanban_plan_pk.g_kanban_info_rec.kanban_plan_id
1150: AND mllc.organization_id =
1151: mrp_kanban_plan_pk.g_kanban_info_rec.organization_id

Line 1211: /* Avoid re-selecting items already in mrp_low_level_codes */

1207: mrp_kanban_plan_pk.g_kanban_info_rec.organization_id
1208: AND mic.inventory_item_id (+) = mllc.assembly_item_id
1209: AND mic.category_set_id (+) =
1210: mrp_kanban_plan_pk.g_kanban_info_rec.category_set_id
1211: /* Avoid re-selecting items already in mrp_low_level_codes */
1212: AND NOT EXISTS
1213: ( SELECT 'Exists'
1214: FROM mrp_low_level_codes mllc2
1215: WHERE mllc2.plan_id =

Line 1214: FROM mrp_low_level_codes mllc2

1210: mrp_kanban_plan_pk.g_kanban_info_rec.category_set_id
1211: /* Avoid re-selecting items already in mrp_low_level_codes */
1212: AND NOT EXISTS
1213: ( SELECT 'Exists'
1214: FROM mrp_low_level_codes mllc2
1215: WHERE mllc2.plan_id =
1216: mrp_kanban_plan_pk.g_kanban_info_rec.kanban_plan_id
1217: AND mllc2.organization_id =
1218: mrp_kanban_plan_pk.g_kanban_info_rec.organization_id

Line 1241: UPDATE mrp_low_level_codes mllc

1237: -- The purpose of this statment is to improve the performance
1238: -- The above insert stmt has performance problems and
1239: -- to avoid two outer join in mtl_kanban_pull_sequences
1240: -- we decide to break it down.
1241: UPDATE mrp_low_level_codes mllc
1242: SET (mllc.kanban_item_flag) =
1243: (select nvl(max(decode(kbn_items.release_kanban_flag, 1, 'Y', 'Y')), 'N')
1244: from mtl_kanban_pull_sequences kbn_items
1245: where kbn_items.kanban_plan_id =

Line 1264: -- now update the mrp_low_level_codes table with operation_yield

1260: || to_char (mrp_kanban_plan_pk.g_stmt_num);
1261: MRP_UTIL.MRP_LOG (mrp_kanban_plan_pk.g_log_message);
1262: END IF;
1263:
1264: -- now update the mrp_low_level_codes table with operation_yield
1265: -- and net_planning_percent from the bom_operation_sequences table.
1266: -- We did this separately after inserting all that we wanted to
1267: -- insert only to make the code a little cleaner. We tried doing
1268: -- this in the above sql statement itself but obviously if got

Line 1277: UPDATE mrp_low_level_codes mllc

1273: -- sequence we have the net_planning_percent and the operation_yield
1274: -- (actually the reverse_cumulative_yield column) stored in
1275: -- bom_operation_sequences table
1276:
1277: UPDATE mrp_low_level_codes mllc
1278: SET (mllc.operation_yield,mllc.net_planning_percent) =
1279: (SELECT min(bos.reverse_cumulative_yield),
1280: min(bos.net_planning_percent)
1281: FROM bom_operation_sequences bos,

Line 1346: mrp_kanban_plan_pk.g_log_message := 'Updated mrp_low_level_codes ' ||

1342: IF mrp_kanban_plan_pk.g_debug THEN
1343: mrp_kanban_plan_pk.g_log_message := 'Debug Statement Number : '
1344: || to_char (mrp_kanban_plan_pk.g_stmt_num);
1345: MRP_UTIL.MRP_LOG (mrp_kanban_plan_pk.g_log_message);
1346: mrp_kanban_plan_pk.g_log_message := 'Updated mrp_low_level_codes ' ||
1347: 'with net planning percent and yield information';
1348: MRP_UTIL.MRP_LOG (mrp_kanban_plan_pk.g_log_message);
1349: END IF;
1350:

Line 1355: -- gotten into mrp_low_level_codes table as a component item (which is

1351:
1352: -- ------------------------------------------------------------------------
1353: -- Now insert the top level assembly item
1354: -- Since the top level assembly item does not have a parent, it would not
1355: -- gotten into mrp_low_level_codes table as a component item (which is
1356: -- what we use to plan). So, we create a dummy parent of -1 for him and
1357: -- insert him into the mrp_low_level_codes table
1358: -- ------------------------------------------------------------------------
1359:

Line 1357: -- insert him into the mrp_low_level_codes table

1353: -- Now insert the top level assembly item
1354: -- Since the top level assembly item does not have a parent, it would not
1355: -- gotten into mrp_low_level_codes table as a component item (which is
1356: -- what we use to plan). So, we create a dummy parent of -1 for him and
1357: -- insert him into the mrp_low_level_codes table
1358: -- ------------------------------------------------------------------------
1359:
1360: INSERT INTO mrp_low_level_codes (
1361: plan_id,

Line 1360: INSERT INTO mrp_low_level_codes (

1356: -- what we use to plan). So, we create a dummy parent of -1 for him and
1357: -- insert him into the mrp_low_level_codes table
1358: -- ------------------------------------------------------------------------
1359:
1360: INSERT INTO mrp_low_level_codes (
1361: plan_id,
1362: organization_id,
1363: assembly_item_id,
1364: component_item_id,

Line 1399: mrp_low_level_codes mllc1

1395: sysdate
1396: FROM
1397: mtl_item_categories mic,
1398: mtl_kanban_pull_sequences kbn_items,
1399: mrp_low_level_codes mllc1
1400: WHERE
1401: mllc1.plan_id = mrp_kanban_plan_pk.g_kanban_info_rec.kanban_plan_id AND
1402: mllc1.organization_id =
1403: mrp_kanban_plan_pk.g_kanban_info_rec.organization_id AND

Line 1415: FROM mrp_low_level_codes mllc2

1411: mrp_kanban_plan_pk.g_kanban_info_rec.category_set_id AND
1412: --select only the assembly items that do not exist as components
1413: NOT EXISTS
1414: (SELECT 'Exists'
1415: FROM mrp_low_level_codes mllc2
1416: WHERE mllc2.plan_id = mllc1.plan_id AND
1417: mllc2.organization_id = mllc1.organization_id AND
1418: mllc2.component_item_id = mllc1.assembly_item_id );
1419:

Line 1431: -- intra-org transfers and insert into mrp_low_level_codes

1427: END IF;
1428:
1429: -- ------------------------------------------------------------------------
1430: -- Now find information in mtl_kanban_pull_sequences about inter-org and
1431: -- intra-org transfers and insert into mrp_low_level_codes
1432: -- Note here that replan flag drives whether I pull infomation from the
1433: -- production kanban plan or the current kanban plan itself. Replan_flag
1434: -- = 2 is not a replan and if its 1 then its a replan run.
1435: -- We are not including supplier kind of replenishment here because we

Line 1441: INSERT INTO mrp_low_level_codes (

1437: -- (since we know that's the end point in the chain, we can stop one point
1438: -- before that).
1439: -- ------------------------------------------------------------------------
1440:
1441: INSERT INTO mrp_low_level_codes (
1442: plan_id,
1443: organization_id,
1444: assembly_item_id,
1445: to_subinventory,

Line 1488: mrp_low_level_codes mllc

1484: sysdate,
1485: fnd_global.user_id,
1486: sysdate
1487: FROM mtl_kanban_pull_sequences ps,
1488: mrp_low_level_codes mllc
1489: WHERE ps.source_type = 3 -- only intra org replenishments
1490: AND ps.kanban_plan_id =
1491: decode(mrp_kanban_plan_pk.g_kanban_info_rec.replan_flag,
1492: 2, mrp_kanban_plan_pk.G_PRODUCTION_KANBAN,

Line 1505: 'Completed inserting into mrp_low_level_codes table';

1501:
1502:
1503: IF mrp_kanban_plan_pk.g_debug THEN
1504: mrp_kanban_plan_pk.g_log_message :=
1505: 'Completed inserting into mrp_low_level_codes table';
1506: MRP_UTIL.MRP_LOG (mrp_kanban_plan_pk.g_log_message);
1507: END IF;
1508: mrp_kanban_plan_pk.g_stmt_num := 110;
1509: IF mrp_kanban_plan_pk.g_debug THEN

Line 1517: -- mrp_low_level_codes table. If the kanban items do not have

1513: END IF;
1514:
1515: -- call the check_item_locations procedure to ensure that
1516: -- kanban items have the from-locations populated in the
1517: -- mrp_low_level_codes table. If the kanban items do not have
1518: -- the from locations populated, we can run into issues while
1519: -- calculating low_level_codes
1520:
1521: IF NOT Check_Item_Locations THEN