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 929: to_char(l_rows_processed) || ' into mrp_low_level_codes table';

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

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

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

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

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

Line 961: INSERT INTO mrp_low_level_codes (

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

Line 1031: mrp_low_level_codes mllc

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

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

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

Line 1068: FROM mrp_low_level_codes mllc2

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

Line 1081: INSERT INTO mrp_low_level_codes (

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

Line 1148: mrp_low_level_codes mllc

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

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

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

Line 1215: FROM mrp_low_level_codes mllc2

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

Line 1242: UPDATE mrp_low_level_codes mllc

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

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

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

Line 1278: UPDATE mrp_low_level_codes mllc

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

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

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

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

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

Line 1358: -- insert him into the mrp_low_level_codes table

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

Line 1361: INSERT INTO mrp_low_level_codes (

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

Line 1400: mrp_low_level_codes mllc1

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

Line 1416: FROM mrp_low_level_codes mllc2

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

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

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

Line 1442: INSERT INTO mrp_low_level_codes (

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

Line 1489: mrp_low_level_codes mllc

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

Line 1506: 'Completed inserting into mrp_low_level_codes table';

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

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

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