43: AND organization_id = P_organization_id);
44:
45: CURSOR Cur_get_details(V_organization_id NUMBER) IS
46: SELECT *
47: FROM mtl_parameters
48: WHERE organization_id = V_organization_id;
49:
50: --Local Variables
51: l_migrate_count NUMBER;
73: OPEN Cur_check_subinventory;
74: FETCH Cur_check_subinventory INTO l_temp;
75: IF (Cur_check_subinventory%NOTFOUND) THEN
76: CLOSE Cur_check_subinventory;
77: --Fetch some details from mtl_parameters table to pass the parameter values.
78: OPEN Cur_get_details(P_organization_id);
79: FETCH Cur_get_details INTO l_details;
80: CLOSE Cur_get_details;
81: IF (l_details.stock_locator_control_code = 4) THEN
225: P_commit IN VARCHAR2,
226: X_failure_count OUT NOCOPY NUMBER) IS
227: CURSOR Cur_get_orgn IS
228: SELECT organization_id, process_orgn_code
229: FROM mtl_parameters
230: WHERE process_enabled_flag = 'Y';
231:
232: CURSOR Cur_get_oper_unit (V_orgn_code VARCHAR2)IS
233: SELECT a.co_code
261: GMA_COMMON_LOGGING.gma_migration_central_log (
262: p_run_id => l_migration_id,
263: p_log_level => FND_LOG.LEVEL_PROCEDURE,
264: p_message_token => 'GMA_MIGRATION_TABLE_STARTED',
265: p_table_name => 'MTL_PARAMETERS',
266: p_context => 'ORGANIZATION',
267: p_app_short_name => 'GMA');
268:
269: /*Bug 5358112 - Setting the cost method to 1 and cost organization id to itself */
266: p_context => 'ORGANIZATION',
267: p_app_short_name => 'GMA');
268:
269: /*Bug 5358112 - Setting the cost method to 1 and cost organization id to itself */
270: UPDATE mtl_parameters
271: SET lot_number_uniqueness = 2,
272: primary_cost_method = 1,
273: cost_organization_id = organization_id
274: WHERE process_enabled_flag = 'Y';
272: primary_cost_method = 1,
273: cost_organization_id = organization_id
274: WHERE process_enabled_flag = 'Y';
275:
276: --Update some specific columns in the mtl_parameters table for existing organizations
277: FOR l_rec IN Cur_get_orgn LOOP
278: UPDATE mtl_parameters m
279: SET stock_locator_control_code = 4
280: WHERE organization_id = l_rec.organization_id
274: WHERE process_enabled_flag = 'Y';
275:
276: --Update some specific columns in the mtl_parameters table for existing organizations
277: FOR l_rec IN Cur_get_orgn LOOP
278: UPDATE mtl_parameters m
279: SET stock_locator_control_code = 4
280: WHERE organization_id = l_rec.organization_id
281: AND EXISTS (SELECT 1
282: FROM IC_WHSE_MST
305: WHERE loct_ctl > 0
306: AND mtl_organization_id = l_rec.organization_id);
307:
308: /* Update secondary inventories table for any rows that had the default cost group id */
309: /* missing - due to an issue in the gmf_mtl_parameters_biur_tg trigger code - Bug 5553034*/
310: UPDATE mtl_secondary_inventories
311: SET default_cost_group_id = (SELECT default_cost_group_id
312: FROM mtl_parameters
313: WHERE organization_id = l_rec.organization_id)
308: /* Update secondary inventories table for any rows that had the default cost group id */
309: /* missing - due to an issue in the gmf_mtl_parameters_biur_tg trigger code - Bug 5553034*/
310: UPDATE mtl_secondary_inventories
311: SET default_cost_group_id = (SELECT default_cost_group_id
312: FROM mtl_parameters
313: WHERE organization_id = l_rec.organization_id)
314: WHERE default_cost_group_id IS NULL
315: AND organization_id = l_rec.organization_id
316: AND secondary_inventory_name <> 'AX_INTRANS';
343: GMA_COMMON_LOGGING.gma_migration_central_log (
344: p_run_id => l_migration_id,
345: p_log_level => FND_LOG.LEVEL_PROCEDURE,
346: p_message_token => 'GMA_MIGRATION_TABLE_SUCCESS',
347: p_table_name => 'MTL_PARAMETERS',
348: p_context => 'ORGANIZATION',
349: p_param1 => l_migrate_count,
350: p_param2 => X_failure_count,
351: p_app_short_name => 'GMA');
360: GMA_COMMON_LOGGING.gma_migration_central_log (
361: p_run_id => l_migration_id,
362: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
363: p_message_token => 'GMA_MIGRATION_DB_ERROR',
364: p_table_name => 'MTL_PARAMETERS',
365: p_context => 'ORGANIZATION',
366: p_db_error => SQLERRM,
367: p_app_short_name => 'GMA');
368:
369: GMA_COMMON_LOGGING.gma_migration_central_log (
370: p_run_id => l_migration_id,
371: p_log_level => FND_LOG.LEVEL_PROCEDURE,
372: p_message_token => 'GMA_MIGRATION_TABLE_FAIL',
373: p_table_name => 'MTL_PARAMETERS',
374: p_context => 'ORGANIZATION',
375: p_app_short_name => 'GMA');
376:
377: END update_organization;
794: AND organization_id = V_organization_id);
795:
796: CURSOR Cur_get_details(V_orgn_id NUMBER) IS
797: SELECT *
798: FROM mtl_parameters
799: WHERE organization_id = V_orgn_id;
800:
801: --Local Variables
802: l_migration_id NUMBER;
843: ELSE
844: l_organization_id := l_rec.organization_id;
845: END IF;
846:
847: --Fecth some details from mtl_parameters table to pass the parameter values.
848: OPEN Cur_get_details(l_organization_id);
849: FETCH Cur_get_details INTO l_details;
850: CLOSE Cur_get_details;
851:
1082: X_organization_id OUT NOCOPY NUMBER) IS
1083: --CURSORS
1084: CURSOR Cur_get_organization_id (V_orgn_code VARCHAR2)IS
1085: SELECT m.organization_id
1086: FROM mtl_parameters m, ic_whse_mst w
1087: WHERE w.orgn_code = V_orgn_code
1088: AND w.mtl_organization_id = m.organization_id
1089: ORDER BY whse_code;
1090:
1115: FROM gl_sevt_ttl t1, gl_sevt_ttl t2
1116: WHERE rownum <= decode(v_start_ch, 0, 1000, 1, 100, 10)
1117: minus
1118: SELECT organization_code
1119: FROM mtl_parameters);
1120:
1121: CURSOR Cur_get_orgn_values(V_orgn_id NUMBER) IS
1122: SELECT *
1123: FROM mtl_parameters
1119: FROM mtl_parameters);
1120:
1121: CURSOR Cur_get_orgn_values(V_orgn_id NUMBER) IS
1122: SELECT *
1123: FROM mtl_parameters
1124: WHERE organization_id = V_orgn_id;
1125:
1126:
1127: --LOCAL VARIABLES
1296: 0,
1297: 0,
1298: sysdate);
1299:
1300: --Fetch the organization info from mtl_parameters and insert into the table.
1301: OPEN Cur_get_orgn_values(l_org_id);
1302: FETCH Cur_get_orgn_values INTO l_parameter;
1303: CLOSE Cur_get_orgn_values;
1304:
1351: RAISE COST_GROUP_SETUP_ERR;
1352: END IF;
1353:
1354: /* Bug 5358112 changed the primary cost method to 1 */
1355: INSERT INTO mtl_parameters(
1356: organization_id, last_update_date, last_updated_by, creation_date, created_by, last_update_login,
1357: organization_code, master_organization_id, primary_cost_method, cost_organization_id,
1358: default_material_cost_id, calendar_exception_set_id, calendar_code, general_ledger_update_code,
1359: default_atp_rule_id, default_picking_rule_id, default_locator_order_value, default_subinv_order_value,
1625: END IF;
1626: ELSE
1627: l_organization_id := l_rec.organization_id;
1628: --RLNAGARA Material Status Migration ME - Updating for already existing organizations
1629: UPDATE mtl_parameters
1630: SET default_status_id = l_default_status_id
1631: WHERE organization_id = l_rec.organization_id;
1632: END IF; /* IF NVL(l_rec.migrate_as_ind, 1) IN (1,3) */
1633: