[Home] [Help]
1: PACKAGE BODY GMD_QC_MIG12 AS
2: /* $Header: gmdmg12b.pls 120.19 2006/09/27 11:18:31 ragsriva noship $
3: +==========================================================================+
4: | Copyright (c) 1998 Oracle Corporation |
5: | Redwood Shores, CA, USA |
8: | FILE NAME |
9: | gmdmg12b.pls |
10: | |
11: | PACKAGE NAME |
12: | GMD_QC_MIG12 |
13: | |
14: | DESCRIPTION |
15: | This package contains migration procedures/functions |
16: | for Quality for 12 migration. |
53: p_token3 => 'UPD',
54: p_token4 => 'INS',
55: p_token5 => 'ERR',
56: p_param1 => 'gmd_test_methods_b',
57: p_param2 => to_char(GMD_QC_MIG12.g_test_method_pro_count),
58: p_param3 => to_char(GMD_QC_MIG12.g_test_method_upd_count),
59: p_param4 => 0,
60: p_param5 => to_char(GMD_QC_MIG12.g_test_method_err_count),
61: p_app_short_name => 'GMD');
54: p_token4 => 'INS',
55: p_token5 => 'ERR',
56: p_param1 => 'gmd_test_methods_b',
57: p_param2 => to_char(GMD_QC_MIG12.g_test_method_pro_count),
58: p_param3 => to_char(GMD_QC_MIG12.g_test_method_upd_count),
59: p_param4 => 0,
60: p_param5 => to_char(GMD_QC_MIG12.g_test_method_err_count),
61: p_app_short_name => 'GMD');
62: END IF;
56: p_param1 => 'gmd_test_methods_b',
57: p_param2 => to_char(GMD_QC_MIG12.g_test_method_pro_count),
58: p_param3 => to_char(GMD_QC_MIG12.g_test_method_upd_count),
59: p_param4 => 0,
60: p_param5 => to_char(GMD_QC_MIG12.g_test_method_err_count),
61: p_app_short_name => 'GMD');
62: END IF;
63:
64:
73: p_token3 => 'UPD',
74: p_token4 => 'INS',
75: p_token5 => 'ERR',
76: p_param1 => 'gmd_quality_config',
77: p_param2 => to_char(GMD_QC_MIG12.g_quality_config_pro_count),
78: p_param3 => to_char(GMD_QC_MIG12.g_quality_config_upd_count),
79: p_param4 => to_char(GMD_QC_MIG12.g_quality_config_ins_count),
80: p_param5 => to_char(GMD_QC_MIG12.g_quality_config_err_count),
81: p_app_short_name => 'GMD');
74: p_token4 => 'INS',
75: p_token5 => 'ERR',
76: p_param1 => 'gmd_quality_config',
77: p_param2 => to_char(GMD_QC_MIG12.g_quality_config_pro_count),
78: p_param3 => to_char(GMD_QC_MIG12.g_quality_config_upd_count),
79: p_param4 => to_char(GMD_QC_MIG12.g_quality_config_ins_count),
80: p_param5 => to_char(GMD_QC_MIG12.g_quality_config_err_count),
81: p_app_short_name => 'GMD');
82: END IF;
75: p_token5 => 'ERR',
76: p_param1 => 'gmd_quality_config',
77: p_param2 => to_char(GMD_QC_MIG12.g_quality_config_pro_count),
78: p_param3 => to_char(GMD_QC_MIG12.g_quality_config_upd_count),
79: p_param4 => to_char(GMD_QC_MIG12.g_quality_config_ins_count),
80: p_param5 => to_char(GMD_QC_MIG12.g_quality_config_err_count),
81: p_app_short_name => 'GMD');
82: END IF;
83:
76: p_param1 => 'gmd_quality_config',
77: p_param2 => to_char(GMD_QC_MIG12.g_quality_config_pro_count),
78: p_param3 => to_char(GMD_QC_MIG12.g_quality_config_upd_count),
79: p_param4 => to_char(GMD_QC_MIG12.g_quality_config_ins_count),
80: p_param5 => to_char(GMD_QC_MIG12.g_quality_config_err_count),
81: p_app_short_name => 'GMD');
82: END IF;
83:
84: IF (p_progress_ind = 3) THEN
92: p_token3 => 'UPD',
93: p_token4 => 'INS',
94: p_token5 => 'ERR',
95: p_param1 => 'gmd_sampling_plans_b',
96: p_param2 => to_char(GMD_QC_MIG12.g_sampling_plan_pro_count),
97: p_param3 => to_char(GMD_QC_MIG12.g_sampling_plan_upd_count),
98: p_param4 => 0,
99: p_param5 => to_char(GMD_QC_MIG12.g_sampling_plan_err_count),
100: p_app_short_name => 'GMD');
93: p_token4 => 'INS',
94: p_token5 => 'ERR',
95: p_param1 => 'gmd_sampling_plans_b',
96: p_param2 => to_char(GMD_QC_MIG12.g_sampling_plan_pro_count),
97: p_param3 => to_char(GMD_QC_MIG12.g_sampling_plan_upd_count),
98: p_param4 => 0,
99: p_param5 => to_char(GMD_QC_MIG12.g_sampling_plan_err_count),
100: p_app_short_name => 'GMD');
101: END IF;
95: p_param1 => 'gmd_sampling_plans_b',
96: p_param2 => to_char(GMD_QC_MIG12.g_sampling_plan_pro_count),
97: p_param3 => to_char(GMD_QC_MIG12.g_sampling_plan_upd_count),
98: p_param4 => 0,
99: p_param5 => to_char(GMD_QC_MIG12.g_sampling_plan_err_count),
100: p_app_short_name => 'GMD');
101: END IF;
102:
103: END LOG_SETUP_COUNTS;
136: p_token3 => 'UPD',
137: p_token4 => 'INS',
138: p_token5 => 'ERR',
139: p_param1 => 'gmd_samples',
140: p_param2 => to_char(GMD_QC_MIG12.g_sample_pro_count),
141: p_param3 => to_char(GMD_QC_MIG12.g_sample_upd_count),
142: p_param4 => 0,
143: p_param5 => to_char(GMD_QC_MIG12.g_sample_err_count),
144: p_app_short_name => 'GMD');
137: p_token4 => 'INS',
138: p_token5 => 'ERR',
139: p_param1 => 'gmd_samples',
140: p_param2 => to_char(GMD_QC_MIG12.g_sample_pro_count),
141: p_param3 => to_char(GMD_QC_MIG12.g_sample_upd_count),
142: p_param4 => 0,
143: p_param5 => to_char(GMD_QC_MIG12.g_sample_err_count),
144: p_app_short_name => 'GMD');
145: END IF;
139: p_param1 => 'gmd_samples',
140: p_param2 => to_char(GMD_QC_MIG12.g_sample_pro_count),
141: p_param3 => to_char(GMD_QC_MIG12.g_sample_upd_count),
142: p_param4 => 0,
143: p_param5 => to_char(GMD_QC_MIG12.g_sample_err_count),
144: p_app_short_name => 'GMD');
145: END IF;
146:
147: IF (p_progress_ind = 2) THEN
155: p_token3 => 'UPD',
156: p_token4 => 'INS',
157: p_token5 => 'ERR',
158: p_param1 => 'gmd_sampling_events',
159: p_param2 => to_char(GMD_QC_MIG12.g_sample_event_pro_count),
160: p_param3 => to_char(GMD_QC_MIG12.g_sample_event_upd_count),
161: p_param4 => 0,
162: p_param5 => to_char(GMD_QC_MIG12.g_sample_event_err_count),
163: p_app_short_name => 'GMD');
156: p_token4 => 'INS',
157: p_token5 => 'ERR',
158: p_param1 => 'gmd_sampling_events',
159: p_param2 => to_char(GMD_QC_MIG12.g_sample_event_pro_count),
160: p_param3 => to_char(GMD_QC_MIG12.g_sample_event_upd_count),
161: p_param4 => 0,
162: p_param5 => to_char(GMD_QC_MIG12.g_sample_event_err_count),
163: p_app_short_name => 'GMD');
164: END IF;
158: p_param1 => 'gmd_sampling_events',
159: p_param2 => to_char(GMD_QC_MIG12.g_sample_event_pro_count),
160: p_param3 => to_char(GMD_QC_MIG12.g_sample_event_upd_count),
161: p_param4 => 0,
162: p_param5 => to_char(GMD_QC_MIG12.g_sample_event_err_count),
163: p_app_short_name => 'GMD');
164: END IF;
165:
166: IF (p_progress_ind = 3) THEN
174: p_token3 => 'UPD',
175: p_token4 => 'INS',
176: p_token5 => 'ERR',
177: p_param1 => 'gmd_results',
178: p_param2 => to_char(GMD_QC_MIG12.g_result_pro_count),
179: p_param3 => to_char(GMD_QC_MIG12.g_result_upd_count),
180: p_param4 => 0,
181: p_param5 => to_char(GMD_QC_MIG12.g_result_err_count),
182: p_app_short_name => 'GMD');
175: p_token4 => 'INS',
176: p_token5 => 'ERR',
177: p_param1 => 'gmd_results',
178: p_param2 => to_char(GMD_QC_MIG12.g_result_pro_count),
179: p_param3 => to_char(GMD_QC_MIG12.g_result_upd_count),
180: p_param4 => 0,
181: p_param5 => to_char(GMD_QC_MIG12.g_result_err_count),
182: p_app_short_name => 'GMD');
183: END IF;
177: p_param1 => 'gmd_results',
178: p_param2 => to_char(GMD_QC_MIG12.g_result_pro_count),
179: p_param3 => to_char(GMD_QC_MIG12.g_result_upd_count),
180: p_param4 => 0,
181: p_param5 => to_char(GMD_QC_MIG12.g_result_err_count),
182: p_app_short_name => 'GMD');
183: END IF;
184:
185: END LOG_SAMPLE_COUNTS;
218: p_token3 => 'UPD',
219: p_token4 => 'INS',
220: p_token5 => 'ERR',
221: p_param1 => 'gmd_specifications_b',
222: p_param2 => to_char(GMD_QC_MIG12.g_specs_pro_count),
223: p_param3 => to_char(GMD_QC_MIG12.g_specs_upd_count),
224: p_param4 => 0,
225: p_param5 => to_char(GMD_QC_MIG12.g_specs_err_count),
226: p_app_short_name => 'GMD');
219: p_token4 => 'INS',
220: p_token5 => 'ERR',
221: p_param1 => 'gmd_specifications_b',
222: p_param2 => to_char(GMD_QC_MIG12.g_specs_pro_count),
223: p_param3 => to_char(GMD_QC_MIG12.g_specs_upd_count),
224: p_param4 => 0,
225: p_param5 => to_char(GMD_QC_MIG12.g_specs_err_count),
226: p_app_short_name => 'GMD');
227: END IF;
221: p_param1 => 'gmd_specifications_b',
222: p_param2 => to_char(GMD_QC_MIG12.g_specs_pro_count),
223: p_param3 => to_char(GMD_QC_MIG12.g_specs_upd_count),
224: p_param4 => 0,
225: p_param5 => to_char(GMD_QC_MIG12.g_specs_err_count),
226: p_app_short_name => 'GMD');
227: END IF;
228:
229: IF (p_progress_ind = 2) THEN
237: p_token3 => 'UPD',
238: p_token4 => 'INS',
239: p_token5 => 'ERR',
240: p_param1 => 'gmd_inventory_spec_vrs',
241: p_param2 => to_char(GMD_QC_MIG12.g_inv_spec_pro_count),
242: p_param3 => to_char(GMD_QC_MIG12.g_inv_spec_upd_count),
243: p_param4 => to_char(GMD_QC_MIG12.g_inv_spec_ins_count),
244: p_param5 => to_char(GMD_QC_MIG12.g_inv_spec_err_count),
245: p_app_short_name => 'GMD');
238: p_token4 => 'INS',
239: p_token5 => 'ERR',
240: p_param1 => 'gmd_inventory_spec_vrs',
241: p_param2 => to_char(GMD_QC_MIG12.g_inv_spec_pro_count),
242: p_param3 => to_char(GMD_QC_MIG12.g_inv_spec_upd_count),
243: p_param4 => to_char(GMD_QC_MIG12.g_inv_spec_ins_count),
244: p_param5 => to_char(GMD_QC_MIG12.g_inv_spec_err_count),
245: p_app_short_name => 'GMD');
246: GMA_COMMON_LOGGING.gma_migration_central_log (
239: p_token5 => 'ERR',
240: p_param1 => 'gmd_inventory_spec_vrs',
241: p_param2 => to_char(GMD_QC_MIG12.g_inv_spec_pro_count),
242: p_param3 => to_char(GMD_QC_MIG12.g_inv_spec_upd_count),
243: p_param4 => to_char(GMD_QC_MIG12.g_inv_spec_ins_count),
244: p_param5 => to_char(GMD_QC_MIG12.g_inv_spec_err_count),
245: p_app_short_name => 'GMD');
246: GMA_COMMON_LOGGING.gma_migration_central_log (
247: p_run_id => p_migration_run_id,
240: p_param1 => 'gmd_inventory_spec_vrs',
241: p_param2 => to_char(GMD_QC_MIG12.g_inv_spec_pro_count),
242: p_param3 => to_char(GMD_QC_MIG12.g_inv_spec_upd_count),
243: p_param4 => to_char(GMD_QC_MIG12.g_inv_spec_ins_count),
244: p_param5 => to_char(GMD_QC_MIG12.g_inv_spec_err_count),
245: p_app_short_name => 'GMD');
246: GMA_COMMON_LOGGING.gma_migration_central_log (
247: p_run_id => p_migration_run_id,
248: p_log_level => FND_LOG.LEVEL_EVENT,
250: p_context => 'Quality Specifications',
251: p_token1 => 'TAB',
252: p_token2 => 'DEL',
253: p_param1 => 'gmd_inventory_spec_vrs',
254: p_param2 => to_char(GMD_QC_MIG12.g_inv_spec_del_count),
255: p_app_short_name => 'GMD');
256: END IF;
257:
258: IF (p_progress_ind = 3) THEN
266: p_token3 => 'UPD',
267: p_token4 => 'INS',
268: p_token5 => 'ERR',
269: p_param1 => 'gmd_wip_spec_vrs',
270: p_param2 => to_char(GMD_QC_MIG12.g_wip_spec_pro_count),
271: p_param3 => to_char(GMD_QC_MIG12.g_wip_spec_upd_count),
272: p_param4 => to_char(GMD_QC_MIG12.g_wip_spec_ins_count),
273: p_param5 => to_char(GMD_QC_MIG12.g_wip_spec_err_count),
274: p_app_short_name => 'GMD');
267: p_token4 => 'INS',
268: p_token5 => 'ERR',
269: p_param1 => 'gmd_wip_spec_vrs',
270: p_param2 => to_char(GMD_QC_MIG12.g_wip_spec_pro_count),
271: p_param3 => to_char(GMD_QC_MIG12.g_wip_spec_upd_count),
272: p_param4 => to_char(GMD_QC_MIG12.g_wip_spec_ins_count),
273: p_param5 => to_char(GMD_QC_MIG12.g_wip_spec_err_count),
274: p_app_short_name => 'GMD');
275: GMA_COMMON_LOGGING.gma_migration_central_log (
268: p_token5 => 'ERR',
269: p_param1 => 'gmd_wip_spec_vrs',
270: p_param2 => to_char(GMD_QC_MIG12.g_wip_spec_pro_count),
271: p_param3 => to_char(GMD_QC_MIG12.g_wip_spec_upd_count),
272: p_param4 => to_char(GMD_QC_MIG12.g_wip_spec_ins_count),
273: p_param5 => to_char(GMD_QC_MIG12.g_wip_spec_err_count),
274: p_app_short_name => 'GMD');
275: GMA_COMMON_LOGGING.gma_migration_central_log (
276: p_run_id => p_migration_run_id,
269: p_param1 => 'gmd_wip_spec_vrs',
270: p_param2 => to_char(GMD_QC_MIG12.g_wip_spec_pro_count),
271: p_param3 => to_char(GMD_QC_MIG12.g_wip_spec_upd_count),
272: p_param4 => to_char(GMD_QC_MIG12.g_wip_spec_ins_count),
273: p_param5 => to_char(GMD_QC_MIG12.g_wip_spec_err_count),
274: p_app_short_name => 'GMD');
275: GMA_COMMON_LOGGING.gma_migration_central_log (
276: p_run_id => p_migration_run_id,
277: p_log_level => FND_LOG.LEVEL_EVENT,
279: p_context => 'Quality Specifications',
280: p_token1 => 'TAB',
281: p_token2 => 'DEL',
282: p_param1 => 'gmd_wip_spec_vrs',
283: p_param2 => to_char(GMD_QC_MIG12.g_wip_spec_del_count),
284: p_app_short_name => 'GMD');
285: END IF;
286:
287: IF (p_progress_ind = 4) THEN
295: p_token3 => 'UPD',
296: p_token4 => 'INS',
297: p_token5 => 'ERR',
298: p_param1 => 'gmd_customer_spec_vrs',
299: p_param2 => to_char(GMD_QC_MIG12.g_cust_spec_pro_count),
300: p_param3 => to_char(GMD_QC_MIG12.g_cust_spec_upd_count),
301: p_param4 => to_char(GMD_QC_MIG12.g_cust_spec_ins_count),
302: p_param5 => to_char(GMD_QC_MIG12.g_cust_spec_err_count),
303: p_app_short_name => 'GMD');
296: p_token4 => 'INS',
297: p_token5 => 'ERR',
298: p_param1 => 'gmd_customer_spec_vrs',
299: p_param2 => to_char(GMD_QC_MIG12.g_cust_spec_pro_count),
300: p_param3 => to_char(GMD_QC_MIG12.g_cust_spec_upd_count),
301: p_param4 => to_char(GMD_QC_MIG12.g_cust_spec_ins_count),
302: p_param5 => to_char(GMD_QC_MIG12.g_cust_spec_err_count),
303: p_app_short_name => 'GMD');
304: GMA_COMMON_LOGGING.gma_migration_central_log (
297: p_token5 => 'ERR',
298: p_param1 => 'gmd_customer_spec_vrs',
299: p_param2 => to_char(GMD_QC_MIG12.g_cust_spec_pro_count),
300: p_param3 => to_char(GMD_QC_MIG12.g_cust_spec_upd_count),
301: p_param4 => to_char(GMD_QC_MIG12.g_cust_spec_ins_count),
302: p_param5 => to_char(GMD_QC_MIG12.g_cust_spec_err_count),
303: p_app_short_name => 'GMD');
304: GMA_COMMON_LOGGING.gma_migration_central_log (
305: p_run_id => p_migration_run_id,
298: p_param1 => 'gmd_customer_spec_vrs',
299: p_param2 => to_char(GMD_QC_MIG12.g_cust_spec_pro_count),
300: p_param3 => to_char(GMD_QC_MIG12.g_cust_spec_upd_count),
301: p_param4 => to_char(GMD_QC_MIG12.g_cust_spec_ins_count),
302: p_param5 => to_char(GMD_QC_MIG12.g_cust_spec_err_count),
303: p_app_short_name => 'GMD');
304: GMA_COMMON_LOGGING.gma_migration_central_log (
305: p_run_id => p_migration_run_id,
306: p_log_level => FND_LOG.LEVEL_EVENT,
308: p_context => 'Quality Specifications',
309: p_token1 => 'TAB',
310: p_token2 => 'DEL',
311: p_param1 => 'gmd_customer_spec_vrs',
312: p_param2 => to_char(GMD_QC_MIG12.g_cust_spec_del_count),
313: p_app_short_name => 'GMD');
314: END IF;
315:
316: IF (p_progress_ind = 5) THEN
324: p_token3 => 'UPD',
325: p_token4 => 'INS',
326: p_token5 => 'ERR',
327: p_param1 => 'gmd_supplier_spec_vrs',
328: p_param2 => to_char(GMD_QC_MIG12.g_supl_spec_pro_count),
329: p_param3 => to_char(GMD_QC_MIG12.g_supl_spec_upd_count),
330: p_param4 => to_char(GMD_QC_MIG12.g_supl_spec_ins_count),
331: p_param5 => to_char(GMD_QC_MIG12.g_supl_spec_err_count),
332: p_app_short_name => 'GMD');
325: p_token4 => 'INS',
326: p_token5 => 'ERR',
327: p_param1 => 'gmd_supplier_spec_vrs',
328: p_param2 => to_char(GMD_QC_MIG12.g_supl_spec_pro_count),
329: p_param3 => to_char(GMD_QC_MIG12.g_supl_spec_upd_count),
330: p_param4 => to_char(GMD_QC_MIG12.g_supl_spec_ins_count),
331: p_param5 => to_char(GMD_QC_MIG12.g_supl_spec_err_count),
332: p_app_short_name => 'GMD');
333: GMA_COMMON_LOGGING.gma_migration_central_log (
326: p_token5 => 'ERR',
327: p_param1 => 'gmd_supplier_spec_vrs',
328: p_param2 => to_char(GMD_QC_MIG12.g_supl_spec_pro_count),
329: p_param3 => to_char(GMD_QC_MIG12.g_supl_spec_upd_count),
330: p_param4 => to_char(GMD_QC_MIG12.g_supl_spec_ins_count),
331: p_param5 => to_char(GMD_QC_MIG12.g_supl_spec_err_count),
332: p_app_short_name => 'GMD');
333: GMA_COMMON_LOGGING.gma_migration_central_log (
334: p_run_id => p_migration_run_id,
327: p_param1 => 'gmd_supplier_spec_vrs',
328: p_param2 => to_char(GMD_QC_MIG12.g_supl_spec_pro_count),
329: p_param3 => to_char(GMD_QC_MIG12.g_supl_spec_upd_count),
330: p_param4 => to_char(GMD_QC_MIG12.g_supl_spec_ins_count),
331: p_param5 => to_char(GMD_QC_MIG12.g_supl_spec_err_count),
332: p_app_short_name => 'GMD');
333: GMA_COMMON_LOGGING.gma_migration_central_log (
334: p_run_id => p_migration_run_id,
335: p_log_level => FND_LOG.LEVEL_EVENT,
337: p_context => 'Quality Specifications',
338: p_token1 => 'TAB',
339: p_token2 => 'DEL',
340: p_param1 => 'gmd_supplier_spec_vrs',
341: p_param2 => to_char(GMD_QC_MIG12.g_supl_spec_del_count),
342: p_app_short_name => 'GMD');
343: END IF;
344:
345: IF (p_progress_ind = 6) THEN
353: p_token3 => 'UPD',
354: p_token4 => 'INS',
355: p_token5 => 'ERR',
356: p_param1 => 'gmd_monitoring_spec_vrs',
357: p_param2 => to_char(GMD_QC_MIG12.g_mon_spec_pro_count),
358: p_param3 => to_char(GMD_QC_MIG12.g_mon_spec_upd_count),
359: p_param4 => to_char(GMD_QC_MIG12.g_mon_spec_ins_count),
360: p_param5 => to_char(GMD_QC_MIG12.g_mon_spec_err_count),
361: p_app_short_name => 'GMD');
354: p_token4 => 'INS',
355: p_token5 => 'ERR',
356: p_param1 => 'gmd_monitoring_spec_vrs',
357: p_param2 => to_char(GMD_QC_MIG12.g_mon_spec_pro_count),
358: p_param3 => to_char(GMD_QC_MIG12.g_mon_spec_upd_count),
359: p_param4 => to_char(GMD_QC_MIG12.g_mon_spec_ins_count),
360: p_param5 => to_char(GMD_QC_MIG12.g_mon_spec_err_count),
361: p_app_short_name => 'GMD');
362: GMA_COMMON_LOGGING.gma_migration_central_log (
355: p_token5 => 'ERR',
356: p_param1 => 'gmd_monitoring_spec_vrs',
357: p_param2 => to_char(GMD_QC_MIG12.g_mon_spec_pro_count),
358: p_param3 => to_char(GMD_QC_MIG12.g_mon_spec_upd_count),
359: p_param4 => to_char(GMD_QC_MIG12.g_mon_spec_ins_count),
360: p_param5 => to_char(GMD_QC_MIG12.g_mon_spec_err_count),
361: p_app_short_name => 'GMD');
362: GMA_COMMON_LOGGING.gma_migration_central_log (
363: p_run_id => p_migration_run_id,
356: p_param1 => 'gmd_monitoring_spec_vrs',
357: p_param2 => to_char(GMD_QC_MIG12.g_mon_spec_pro_count),
358: p_param3 => to_char(GMD_QC_MIG12.g_mon_spec_upd_count),
359: p_param4 => to_char(GMD_QC_MIG12.g_mon_spec_ins_count),
360: p_param5 => to_char(GMD_QC_MIG12.g_mon_spec_err_count),
361: p_app_short_name => 'GMD');
362: GMA_COMMON_LOGGING.gma_migration_central_log (
363: p_run_id => p_migration_run_id,
364: p_log_level => FND_LOG.LEVEL_EVENT,
366: p_context => 'Quality Specifications',
367: p_token1 => 'TAB',
368: p_token2 => 'DEL',
369: p_param1 => 'gmd_monitoring_spec_vrs',
370: p_param2 => to_char(GMD_QC_MIG12.g_mon_spec_del_count),
371: p_app_short_name => 'GMD');
372: END IF;
373:
374: END LOG_SPEC_COUNTS;
408: p_token3 => 'UPD',
409: p_token4 => 'INS',
410: p_token5 => 'ERR',
411: p_param1 => 'gmd_storage_plan_details',
412: p_param2 => to_char(GMD_QC_MIG12.g_store_plan_pro_count),
413: p_param3 => to_char(GMD_QC_MIG12.g_store_plan_upd_count),
414: p_param4 => 0,
415: p_param5 => to_char(GMD_QC_MIG12.g_store_plan_err_count),
416: p_app_short_name => 'GMD');
409: p_token4 => 'INS',
410: p_token5 => 'ERR',
411: p_param1 => 'gmd_storage_plan_details',
412: p_param2 => to_char(GMD_QC_MIG12.g_store_plan_pro_count),
413: p_param3 => to_char(GMD_QC_MIG12.g_store_plan_upd_count),
414: p_param4 => 0,
415: p_param5 => to_char(GMD_QC_MIG12.g_store_plan_err_count),
416: p_app_short_name => 'GMD');
417: END IF;
411: p_param1 => 'gmd_storage_plan_details',
412: p_param2 => to_char(GMD_QC_MIG12.g_store_plan_pro_count),
413: p_param3 => to_char(GMD_QC_MIG12.g_store_plan_upd_count),
414: p_param4 => 0,
415: p_param5 => to_char(GMD_QC_MIG12.g_store_plan_err_count),
416: p_app_short_name => 'GMD');
417: END IF;
418:
419: IF (p_progress_ind = 2) THEN
427: p_token3 => 'UPD',
428: p_token4 => 'INS',
429: p_token5 => 'ERR',
430: p_param1 => 'gmd_ss_stability_studies_b',
431: p_param2 => to_char(GMD_QC_MIG12.g_stab_pro_count),
432: p_param3 => to_char(GMD_QC_MIG12.g_stab_upd_count),
433: p_param4 => 0,
434: p_param5 => to_char(GMD_QC_MIG12.g_stab_err_count),
435: p_app_short_name => 'GMD');
428: p_token4 => 'INS',
429: p_token5 => 'ERR',
430: p_param1 => 'gmd_ss_stability_studies_b',
431: p_param2 => to_char(GMD_QC_MIG12.g_stab_pro_count),
432: p_param3 => to_char(GMD_QC_MIG12.g_stab_upd_count),
433: p_param4 => 0,
434: p_param5 => to_char(GMD_QC_MIG12.g_stab_err_count),
435: p_app_short_name => 'GMD');
436: END IF;
430: p_param1 => 'gmd_ss_stability_studies_b',
431: p_param2 => to_char(GMD_QC_MIG12.g_stab_pro_count),
432: p_param3 => to_char(GMD_QC_MIG12.g_stab_upd_count),
433: p_param4 => 0,
434: p_param5 => to_char(GMD_QC_MIG12.g_stab_err_count),
435: p_app_short_name => 'GMD');
436: END IF;
437:
438: IF (p_progress_ind = 3) THEN
446: p_token3 => 'UPD',
447: p_token4 => 'INS',
448: p_token5 => 'ERR',
449: p_param1 => 'gmd_ss_material_sources',
450: p_param2 => to_char(GMD_QC_MIG12.g_matl_source_pro_count),
451: p_param3 => to_char(GMD_QC_MIG12.g_matl_source_upd_count),
452: p_param4 => 0,
453: p_param5 => to_char(GMD_QC_MIG12.g_matl_source_err_count),
454: p_app_short_name => 'GMD');
447: p_token4 => 'INS',
448: p_token5 => 'ERR',
449: p_param1 => 'gmd_ss_material_sources',
450: p_param2 => to_char(GMD_QC_MIG12.g_matl_source_pro_count),
451: p_param3 => to_char(GMD_QC_MIG12.g_matl_source_upd_count),
452: p_param4 => 0,
453: p_param5 => to_char(GMD_QC_MIG12.g_matl_source_err_count),
454: p_app_short_name => 'GMD');
455: END IF;
449: p_param1 => 'gmd_ss_material_sources',
450: p_param2 => to_char(GMD_QC_MIG12.g_matl_source_pro_count),
451: p_param3 => to_char(GMD_QC_MIG12.g_matl_source_upd_count),
452: p_param4 => 0,
453: p_param5 => to_char(GMD_QC_MIG12.g_matl_source_err_count),
454: p_app_short_name => 'GMD');
455: END IF;
456:
457: IF (p_progress_ind = 4) THEN
465: p_token3 => 'UPD',
466: p_token4 => 'INS',
467: p_token5 => 'ERR',
468: p_param1 => 'gmd_ss_variants',
469: p_param2 => to_char(GMD_QC_MIG12.g_ss_variant_pro_count),
470: p_param3 => to_char(GMD_QC_MIG12.g_ss_variant_upd_count),
471: p_param4 => 0,
472: p_param5 => to_char(GMD_QC_MIG12.g_ss_variant_err_count),
473: p_app_short_name => 'GMD');
466: p_token4 => 'INS',
467: p_token5 => 'ERR',
468: p_param1 => 'gmd_ss_variants',
469: p_param2 => to_char(GMD_QC_MIG12.g_ss_variant_pro_count),
470: p_param3 => to_char(GMD_QC_MIG12.g_ss_variant_upd_count),
471: p_param4 => 0,
472: p_param5 => to_char(GMD_QC_MIG12.g_ss_variant_err_count),
473: p_app_short_name => 'GMD');
474: END IF;
468: p_param1 => 'gmd_ss_variants',
469: p_param2 => to_char(GMD_QC_MIG12.g_ss_variant_pro_count),
470: p_param3 => to_char(GMD_QC_MIG12.g_ss_variant_upd_count),
471: p_param4 => 0,
472: p_param5 => to_char(GMD_QC_MIG12.g_ss_variant_err_count),
473: p_app_short_name => 'GMD');
474: END IF;
475:
476: IF (p_progress_ind = 5) THEN
484: p_token3 => 'UPD',
485: p_token4 => 'INS',
486: p_token5 => 'ERR',
487: p_param1 => 'gmd_ss_storage_package',
488: p_param2 => to_char(GMD_QC_MIG12.g_store_pack_pro_count),
489: p_param3 => to_char(GMD_QC_MIG12.g_store_pack_upd_count),
490: p_param4 => to_char(GMD_QC_MIG12.g_store_pack_ins_count),
491: p_param5 => to_char(GMD_QC_MIG12.g_store_pack_err_count),
492: p_app_short_name => 'GMD');
485: p_token4 => 'INS',
486: p_token5 => 'ERR',
487: p_param1 => 'gmd_ss_storage_package',
488: p_param2 => to_char(GMD_QC_MIG12.g_store_pack_pro_count),
489: p_param3 => to_char(GMD_QC_MIG12.g_store_pack_upd_count),
490: p_param4 => to_char(GMD_QC_MIG12.g_store_pack_ins_count),
491: p_param5 => to_char(GMD_QC_MIG12.g_store_pack_err_count),
492: p_app_short_name => 'GMD');
493: END IF;
486: p_token5 => 'ERR',
487: p_param1 => 'gmd_ss_storage_package',
488: p_param2 => to_char(GMD_QC_MIG12.g_store_pack_pro_count),
489: p_param3 => to_char(GMD_QC_MIG12.g_store_pack_upd_count),
490: p_param4 => to_char(GMD_QC_MIG12.g_store_pack_ins_count),
491: p_param5 => to_char(GMD_QC_MIG12.g_store_pack_err_count),
492: p_app_short_name => 'GMD');
493: END IF;
494:
487: p_param1 => 'gmd_ss_storage_package',
488: p_param2 => to_char(GMD_QC_MIG12.g_store_pack_pro_count),
489: p_param3 => to_char(GMD_QC_MIG12.g_store_pack_upd_count),
490: p_param4 => to_char(GMD_QC_MIG12.g_store_pack_ins_count),
491: p_param5 => to_char(GMD_QC_MIG12.g_store_pack_err_count),
492: p_app_short_name => 'GMD');
493: END IF;
494:
495: IF (p_progress_ind = 6) THEN
503: p_token3 => 'UPD',
504: p_token4 => 'INS',
505: p_token5 => 'ERR',
506: p_param1 => 'gmd_ss_storage_history',
507: p_param2 => to_char(GMD_QC_MIG12.g_ss_storehist_pro_count),
508: p_param3 => to_char(GMD_QC_MIG12.g_ss_storehist_upd_count),
509: p_param4 => 0,
510: p_param5 => to_char(GMD_QC_MIG12.g_ss_storehist_err_count),
511: p_app_short_name => 'GMD');
504: p_token4 => 'INS',
505: p_token5 => 'ERR',
506: p_param1 => 'gmd_ss_storage_history',
507: p_param2 => to_char(GMD_QC_MIG12.g_ss_storehist_pro_count),
508: p_param3 => to_char(GMD_QC_MIG12.g_ss_storehist_upd_count),
509: p_param4 => 0,
510: p_param5 => to_char(GMD_QC_MIG12.g_ss_storehist_err_count),
511: p_app_short_name => 'GMD');
512: END IF;
506: p_param1 => 'gmd_ss_storage_history',
507: p_param2 => to_char(GMD_QC_MIG12.g_ss_storehist_pro_count),
508: p_param3 => to_char(GMD_QC_MIG12.g_ss_storehist_upd_count),
509: p_param4 => 0,
510: p_param5 => to_char(GMD_QC_MIG12.g_ss_storehist_err_count),
511: p_app_short_name => 'GMD');
512: END IF;
513:
514: END LOG_SS_COUNTS;
976: l_config_rec.SS_LAST_ASSIGNED,
977: 1
978: );
979:
980: GMD_QC_MIG12.g_quality_config_ins_count := GMD_QC_MIG12.g_quality_config_ins_count + 1;
981:
982: IF (p_commit = FND_API.G_TRUE) THEN
983: COMMIT;
984: END IF;
995: p_message_token => 'GMA_MIGRATION_DB_ERROR',
996: p_context => 'Quality Setup - quality config ins',
997: p_db_error => SQLERRM,
998: p_app_short_name => 'GMA');
999: GMD_QC_MIG12.g_quality_config_err_count := GMD_QC_MIG12.g_quality_config_err_count + 1;
1000:
1001: END CREATE_CONFIG_ROWS_FOR_WHSE;
1002:
1003:
1277: l_config_org NUMBER;
1278:
1279: BEGIN
1280:
1281: GMD_QC_MIG12.g_progress_ind := 0;
1282:
1283: x_exception_count := 0;
1284:
1285: /*==============================================
1285: /*==============================================
1286: Get Default Lab Type Profile Value
1287: ==============================================*/
1288:
1289: l_lab_profile := GMD_QC_MIG12.GET_PROFILE_VALUE('GEMMS_DEFAULT_LAB_TYPE');
1290:
1291: IF (l_lab_profile IS NULL) THEN
1292: RAISE DEFAULT_LAB_NULL;
1293: END IF;
1338: p_param1 => 'GMD_TEST_METHODS_B',
1339: p_context => 'Quality Setup',
1340: p_app_short_name => 'GMA');
1341:
1342: GMD_QC_MIG12.g_progress_ind := 1;
1343:
1344: /*================================================
1345: Loop through all test methods and assign
1346: inventory_item_id.
1345: Loop through all test methods and assign
1346: inventory_item_id.
1347: ================================================*/
1348:
1349: GMD_QC_MIG12.g_test_method_upd_count := 0;
1350: GMD_QC_MIG12.g_test_method_pro_count := 0;
1351: GMD_QC_MIG12.g_test_method_err_count := 0;
1352:
1353:
1346: inventory_item_id.
1347: ================================================*/
1348:
1349: GMD_QC_MIG12.g_test_method_upd_count := 0;
1350: GMD_QC_MIG12.g_test_method_pro_count := 0;
1351: GMD_QC_MIG12.g_test_method_err_count := 0;
1352:
1353:
1354: FOR v_test_method IN get_test_methods LOOP
1347: ================================================*/
1348:
1349: GMD_QC_MIG12.g_test_method_upd_count := 0;
1350: GMD_QC_MIG12.g_test_method_pro_count := 0;
1351: GMD_QC_MIG12.g_test_method_err_count := 0;
1352:
1353:
1354: FOR v_test_method IN get_test_methods LOOP
1355:
1354: FOR v_test_method IN get_test_methods LOOP
1355:
1356: BEGIN -- subprogram
1357:
1358: GMD_QC_MIG12.g_test_method_pro_count := GMD_QC_MIG12.g_test_method_pro_count + 1;
1359:
1360: IF (v_test_method.test_kit_item_id IS NOT NULL) THEN
1361:
1362: INV_OPM_ITEM_MIGRATION.GET_ODM_ITEM(
1394: IF (p_commit = FND_API.G_TRUE) THEN
1395: COMMIT;
1396: END IF;
1397:
1398: GMD_QC_MIG12.g_test_method_upd_count := GMD_QC_MIG12.g_test_method_upd_count + 1;
1399:
1400: EXCEPTION
1401:
1402: WHEN METHOD_ITEM_ERROR THEN
1413: p_param2 => to_char(v_test_method.test_kit_item_id),
1414: p_param3 => 'TEST_METHOD_ID',
1415: p_param4 => to_char(v_test_method.test_method_id),
1416: p_app_short_name => 'GMD');
1417: GMD_QC_MIG12.g_test_method_err_count := GMD_QC_MIG12.g_test_method_err_count + 1;
1418: x_exception_count := x_exception_count + 1;
1419:
1420: WHEN NEXT_TEST_METHOD THEN
1421: NULL;
1427: p_message_token => 'GMA_MIGRATION_DB_ERROR',
1428: p_context => 'Quality Setup - gmd_test_methods_b',
1429: p_db_error => SQLERRM,
1430: p_app_short_name => 'GMA');
1431: GMD_QC_MIG12.g_test_method_err_count := GMD_QC_MIG12.g_test_method_err_count + 1;
1432: x_exception_count := x_exception_count + 1;
1433:
1434: END; -- subprogram
1435:
1439: /*==============================================
1440: Log end of gmd_test_method migration.
1441: ==============================================*/
1442:
1443: LOG_SETUP_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
1444:
1445:
1446: /*=========================================
1447: Migrate gmd_quality_config.
1447: Migrate gmd_quality_config.
1448: First get profile values.
1449: =========================================*/
1450:
1451: P_exact_match := GMD_QC_MIG12.GET_PROFILE_VALUE('QC$EXACTSPECMATCH');
1452:
1453: /*================================================
1454: Log Exact Match Profile
1455: ================================================*/
1473: IF (P_exact_match = 'N') THEN
1474: P_exact_match := NULL;
1475: END IF;
1476:
1477: P_inc_opt := GMD_QC_MIG12.GET_PROFILE_VALUE('GMD_INCLUDE_OPTIONAL_TEST');
1478:
1479: /*================================================
1480: Log Include Optional Test Profile
1481: ================================================*/
1503: IF (P_inc_opt = 'N') THEN
1504: P_inc_opt := NULL;
1505: END IF;
1506:
1507: P_version_control := GMD_QC_MIG12.GET_PROFILE_VALUE('GMD_OPERATION_VERSION_CONTROL');
1508:
1509: /*================================================
1510: Log Operation Version Control Profile
1511: ================================================*/
1550: where org is null. First pass gets
1551: non_null records.
1552: ==============================================*/
1553:
1554: GMD_QC_MIG12.g_quality_config_upd_count :=0;
1555: GMD_QC_MIG12.g_quality_config_ins_count :=0;
1556: GMD_QC_MIG12.g_quality_config_pro_count :=0;
1557: GMD_QC_MIG12.g_quality_config_err_count :=0;
1558: GMD_QC_MIG12.g_progress_ind := 2;
1551: non_null records.
1552: ==============================================*/
1553:
1554: GMD_QC_MIG12.g_quality_config_upd_count :=0;
1555: GMD_QC_MIG12.g_quality_config_ins_count :=0;
1556: GMD_QC_MIG12.g_quality_config_pro_count :=0;
1557: GMD_QC_MIG12.g_quality_config_err_count :=0;
1558: GMD_QC_MIG12.g_progress_ind := 2;
1559:
1552: ==============================================*/
1553:
1554: GMD_QC_MIG12.g_quality_config_upd_count :=0;
1555: GMD_QC_MIG12.g_quality_config_ins_count :=0;
1556: GMD_QC_MIG12.g_quality_config_pro_count :=0;
1557: GMD_QC_MIG12.g_quality_config_err_count :=0;
1558: GMD_QC_MIG12.g_progress_ind := 2;
1559:
1560:
1553:
1554: GMD_QC_MIG12.g_quality_config_upd_count :=0;
1555: GMD_QC_MIG12.g_quality_config_ins_count :=0;
1556: GMD_QC_MIG12.g_quality_config_pro_count :=0;
1557: GMD_QC_MIG12.g_quality_config_err_count :=0;
1558: GMD_QC_MIG12.g_progress_ind := 2;
1559:
1560:
1561: FOR v_qual_config IN get_quality_config LOOP
1554: GMD_QC_MIG12.g_quality_config_upd_count :=0;
1555: GMD_QC_MIG12.g_quality_config_ins_count :=0;
1556: GMD_QC_MIG12.g_quality_config_pro_count :=0;
1557: GMD_QC_MIG12.g_quality_config_err_count :=0;
1558: GMD_QC_MIG12.g_progress_ind := 2;
1559:
1560:
1561: FOR v_qual_config IN get_quality_config LOOP
1562:
1562:
1563: BEGIN -- start of subprogram
1564:
1565:
1566: GMD_QC_MIG12.g_quality_config_pro_count := GMD_QC_MIG12.g_quality_config_pro_count + 1;
1567:
1568: /*=====================================
1569: Check if organization migrated.
1570: ======================================*/
1594:
1595: IF (v_qual_config.in_spec_lot_status IS NULL) THEN
1596: l_in_spec_status_id := NULL;
1597: ELSE
1598: l_in_spec_status_id := GMD_QC_MIG12.GET_STATUS_ID(v_qual_config.in_spec_lot_status);
1599: IF (l_in_spec_status_id IS NULL) THEN
1600: RAISE IN_SPEC_ERROR;
1601: END IF;
1602: END IF;
1603:
1604: IF (v_qual_config.out_of_spec_lot_status IS NULL) THEN
1605: l_out_spec_status_id := NULL;
1606: ELSE
1607: l_out_spec_status_id := GMD_QC_MIG12.GET_STATUS_ID(v_qual_config.out_of_spec_lot_status);
1608: IF (l_out_spec_status_id IS NULL) THEN
1609: RAISE OUT_SPEC_ERROR;
1610: END IF;
1611: END IF;
1671: IF (p_commit = FND_API.G_TRUE) THEN
1672: COMMIT;
1673: END IF;
1674:
1675: GMD_QC_MIG12.g_quality_config_upd_count := GMD_QC_MIG12.g_quality_config_upd_count + 1;
1676:
1677: EXCEPTION
1678:
1679: WHEN MIG_NO_ORG THEN
1691: p_param3 => 'ORGN_CODE',
1692: p_param4 => v_qual_config.orgn_code,
1693: p_app_short_name => 'GMD');
1694:
1695: GMD_QC_MIG12.g_quality_config_err_count := GMD_QC_MIG12.g_quality_config_err_count + 1;
1696: x_exception_count := x_exception_count + 1;
1697:
1698:
1699: WHEN REASON_CODE_ERROR THEN
1708: p_param1 => v_qual_config.inv_trans_reason_code,
1709: p_param2 => 'orgn_code',
1710: p_param3 => v_qual_config.orgn_code,
1711: p_app_short_name => 'GMD');
1712: GMD_QC_MIG12.g_quality_config_err_count := GMD_QC_MIG12.g_quality_config_err_count + 1;
1713: x_exception_count := x_exception_count + 1;
1714:
1715: WHEN IN_SPEC_ERROR THEN
1716: GMA_COMMON_LOGGING.gma_migration_central_log (
1724: p_param1 => v_qual_config.in_spec_lot_status,
1725: p_param2 => 'orgn_code',
1726: p_param3 => v_qual_config.orgn_code,
1727: p_app_short_name => 'GMD');
1728: GMD_QC_MIG12.g_quality_config_err_count := GMD_QC_MIG12.g_quality_config_err_count + 1;
1729: x_exception_count := x_exception_count + 1;
1730:
1731: WHEN OUT_SPEC_ERROR THEN
1732: GMA_COMMON_LOGGING.gma_migration_central_log (
1740: p_param1 => v_qual_config.out_of_spec_lot_status,
1741: p_param2 => 'orgn_code',
1742: p_param3 => v_qual_config.orgn_code,
1743: p_app_short_name => 'GMD');
1744: GMD_QC_MIG12.g_quality_config_err_count := GMD_QC_MIG12.g_quality_config_err_count + 1;
1745: x_exception_count := x_exception_count + 1;
1746:
1747: WHEN GET_LAB_ERROR THEN
1748: GMA_COMMON_LOGGING.gma_migration_central_log (
1756: p_param1 => v_qual_config.orgn_code,
1757: p_param2 => 'orgn_code',
1758: p_param3 => v_qual_config.orgn_code,
1759: p_app_short_name => 'GMD');
1760: GMD_QC_MIG12.g_quality_config_err_count := GMD_QC_MIG12.g_quality_config_err_count + 1;
1761: x_exception_count := x_exception_count + 1;
1762:
1763: WHEN OTHERS THEN
1764: GMA_COMMON_LOGGING.gma_migration_central_log (
1767: p_message_token => 'GMA_MIGRATION_DB_ERROR',
1768: p_context => 'Quality Setup - quality config update',
1769: p_db_error => SQLERRM,
1770: p_app_short_name => 'GMA');
1771: GMD_QC_MIG12.g_quality_config_err_count := GMD_QC_MIG12.g_quality_config_err_count + 1;
1772: x_exception_count := x_exception_count + 1;
1773:
1774: END; -- end of subprogram
1775:
1796: Do not process the null record
1797: if existing gmd_quality_config row
1798: were not successfully migrated.
1799: ====================================*/
1800: GMD_QC_MIG12.g_quality_config_pro_count := GMD_QC_MIG12.g_quality_config_pro_count + 1;
1801: END IF;
1802:
1803: CLOSE get_null_quality_config;
1804:
1848:
1849: IF (l_config_rec.in_spec_lot_status IS NULL) THEN
1850: l_in_spec_status_id := NULL;
1851: ELSE
1852: l_in_spec_status_id := GMD_QC_MIG12.GET_STATUS_ID(l_config_rec.in_spec_lot_status);
1853: IF (l_in_spec_status_id IS NULL) THEN
1854: RAISE IN_SPEC_ERROR;
1855: END IF;
1856: END IF;
1857:
1858: IF (l_config_rec.out_of_spec_lot_status IS NULL) THEN
1859: l_out_spec_status_id := NULL;
1860: ELSE
1861: l_out_spec_status_id := GMD_QC_MIG12.GET_STATUS_ID(l_config_rec.out_of_spec_lot_status);
1862: IF (l_out_spec_status_id IS NULL) THEN
1863: RAISE OUT_SPEC_ERROR;
1864: END IF;
1865: END IF;
1901: /*=================================
1902: Create Text Code if it exists.
1903: =================================*/
1904: IF (l_config_rec.text_code IS NOT NULL AND l_config_rec.text_code > 0) THEN
1905: l_text_code := GMD_QC_MIG12.COPY_TEXT(l_config_rec.text_code, p_migration_run_id);
1906: ELSE
1907: l_text_code := NULL;
1908: END IF;
1909:
2027: l_stbl_last_assigned,
2028: 1
2029: );
2030:
2031: GMD_QC_MIG12.g_quality_config_ins_count := GMD_QC_MIG12.g_quality_config_ins_count + 1;
2032:
2033: IF (p_commit = FND_API.G_TRUE) THEN
2034: COMMIT;
2035: END IF;
2054: p_param1 => to_char(v_orgs(l_org_count)),
2055: p_param2 => 'orgn_code',
2056: p_param3 => l_config_rec.orgn_code,
2057: p_app_short_name => 'GMD');
2058: GMD_QC_MIG12.g_quality_config_err_count := GMD_QC_MIG12.g_quality_config_err_count + 1;
2059: x_exception_count := x_exception_count + 1;
2060:
2061: WHEN GET_LAB_ERROR THEN
2062: GMA_COMMON_LOGGING.gma_migration_central_log (
2070: p_param1 => l_orgn_code,
2071: p_param2 => 'orgn_code',
2072: p_param3 => l_orgn_code,
2073: p_app_short_name => 'GMD');
2074: GMD_QC_MIG12.g_quality_config_err_count := GMD_QC_MIG12.g_quality_config_err_count + 1;
2075: x_exception_count := x_exception_count + 1;
2076:
2077: WHEN OTHERS THEN
2078: GMA_COMMON_LOGGING.gma_migration_central_log (
2081: p_message_token => 'GMA_MIGRATION_DB_ERROR',
2082: p_context => 'Quality Setup - quality config ins',
2083: p_db_error => SQLERRM,
2084: p_app_short_name => 'GMA');
2085: GMD_QC_MIG12.g_quality_config_err_count := GMD_QC_MIG12.g_quality_config_err_count + 1;
2086: x_exception_count := x_exception_count + 1;
2087:
2088:
2089: END; -- subprogram
2110:
2111: IF (p_commit = FND_API.G_TRUE) THEN
2112: COMMIT;
2113: END IF;
2114: GMD_QC_MIG12.g_quality_config_upd_count := GMD_QC_MIG12.g_quality_config_upd_count + 1;
2115:
2116: END IF;
2117:
2118:
2193: p_param1 => l_config_rec.inv_trans_reason_code,
2194: p_param2 => 'orgn_code',
2195: p_param3 => l_config_rec.orgn_code,
2196: p_app_short_name => 'GMD');
2197: GMD_QC_MIG12.g_quality_config_err_count := GMD_QC_MIG12.g_quality_config_err_count + 1;
2198: x_exception_count := x_exception_count + 1;
2199:
2200: WHEN IN_SPEC_ERROR THEN
2201: GMA_COMMON_LOGGING.gma_migration_central_log (
2209: p_param1 => l_config_rec.in_spec_lot_status,
2210: p_param2 => 'orgn_code',
2211: p_param3 => l_config_rec.orgn_code,
2212: p_app_short_name => 'GMD');
2213: GMD_QC_MIG12.g_quality_config_err_count := GMD_QC_MIG12.g_quality_config_err_count + 1;
2214: x_exception_count := x_exception_count + 1;
2215:
2216: WHEN OUT_SPEC_ERROR THEN
2217: GMA_COMMON_LOGGING.gma_migration_central_log (
2225: p_param1 => l_config_rec.out_of_spec_lot_status,
2226: p_param2 => 'orgn_code',
2227: p_param3 => l_config_rec.orgn_code,
2228: p_app_short_name => 'GMD');
2229: GMD_QC_MIG12.g_quality_config_err_count := GMD_QC_MIG12.g_quality_config_err_count + 1;
2230: x_exception_count := x_exception_count + 1;
2231:
2232: WHEN OTHERS THEN
2233: GMA_COMMON_LOGGING.gma_migration_central_log (
2236: p_message_token => 'GMA_MIGRATION_DB_ERROR',
2237: p_context => 'Quality Setup - quality config ins',
2238: p_db_error => SQLERRM,
2239: p_app_short_name => 'GMA');
2240: GMD_QC_MIG12.g_quality_config_err_count := GMD_QC_MIG12.g_quality_config_err_count + 1;
2241: x_exception_count := x_exception_count + 1;
2242:
2243: END; -- end of null subprogram
2244:
2248:
2249: /*==============================================
2250: Log end of gmd_quality_config migration.
2251: ==============================================*/
2252: LOG_SETUP_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
2253:
2254: /*==============================================
2255: Log Start of gmd_sampling_plan_b migration.
2256: ==============================================*/
2264: p_param1 => 'GMD_SAMPLING_PLAN_B',
2265: p_context => 'Quality Setup',
2266: p_app_short_name => 'GMA');
2267:
2268: GMD_QC_MIG12.g_progress_ind := 3;
2269:
2270:
2271: /*==============================================
2272: Loop through gmd_sampling_plans.
2273: Check that uom migrated and migrate uom for
2274: Quantity type plan.
2275: ==============================================*/
2276:
2277: GMD_QC_MIG12.g_sampling_plan_upd_count :=0;
2278: GMD_QC_MIG12.g_sampling_plan_pro_count :=0;
2279: GMD_QC_MIG12.g_sampling_plan_err_count :=0;
2280:
2281:
2274: Quantity type plan.
2275: ==============================================*/
2276:
2277: GMD_QC_MIG12.g_sampling_plan_upd_count :=0;
2278: GMD_QC_MIG12.g_sampling_plan_pro_count :=0;
2279: GMD_QC_MIG12.g_sampling_plan_err_count :=0;
2280:
2281:
2282: FOR l_sampling_plan IN get_sampling_plan LOOP
2275: ==============================================*/
2276:
2277: GMD_QC_MIG12.g_sampling_plan_upd_count :=0;
2278: GMD_QC_MIG12.g_sampling_plan_pro_count :=0;
2279: GMD_QC_MIG12.g_sampling_plan_err_count :=0;
2280:
2281:
2282: FOR l_sampling_plan IN get_sampling_plan LOOP
2283:
2282: FOR l_sampling_plan IN get_sampling_plan LOOP
2283:
2284: BEGIN -- subprogram
2285:
2286: GMD_QC_MIG12.g_sampling_plan_pro_count := GMD_QC_MIG12.g_sampling_plan_pro_count + 1;
2287:
2288: IF (l_sampling_plan.frequency_type = 'Q' and l_sampling_plan.frequency_per IS NOT NULL) THEN
2289: l_sampling_uom := GMA_MIGRATION_UTILS.get_uom_code(l_sampling_plan.frequency_per);
2290: IF (l_sampling_uom IS NULL) THEN
2302: IF (p_commit = FND_API.G_TRUE) THEN
2303: COMMIT;
2304: END IF;
2305:
2306: GMD_QC_MIG12.g_sampling_plan_upd_count := GMD_QC_MIG12.g_sampling_plan_upd_count + 1;
2307:
2308: EXCEPTION
2309:
2310: WHEN MIG_NO_UOM THEN
2320: p_param2 => to_char(l_sampling_plan.sampling_plan_id),
2321: p_param3 => l_sampling_plan.frequency_per,
2322: p_app_short_name => 'GMD');
2323:
2324: GMD_QC_MIG12.g_sampling_plan_err_count := GMD_QC_MIG12.g_sampling_plan_err_count + 1;
2325: x_exception_count := x_exception_count + 1;
2326:
2327: WHEN OTHERS THEN
2328: GMA_COMMON_LOGGING.gma_migration_central_log (
2331: p_message_token => 'GMA_MIGRATION_DB_ERROR',
2332: p_context => 'Quality Setup - gmd_sampling_plan',
2333: p_db_error => SQLERRM,
2334: p_app_short_name => 'GMA');
2335: GMD_QC_MIG12.g_sampling_plan_err_count := GMD_QC_MIG12.g_sampling_plan_err_count + 1;
2336: x_exception_count := x_exception_count + 1;
2337:
2338:
2339: END; -- end subprogram
2343:
2344: /*=================================
2345: Log sampling plan migration.
2346: =================================*/
2347: LOG_SETUP_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
2348:
2349: RETURN;
2350:
2351: EXCEPTION
2373: x_exception_count := x_exception_count + 1;
2374:
2375: WHEN OTHERS THEN
2376:
2377: LOG_SETUP_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
2378:
2379: GMA_COMMON_LOGGING.gma_migration_central_log (
2380: p_run_id => p_migration_run_id,
2381: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
2537:
2538: BEGIN
2539:
2540: x_exception_count := 0;
2541: GMD_QC_MIG12.g_progress_ind := 0;
2542:
2543: /*==============================================
2544: Log Start of gmd_samples migration.
2545: ==============================================*/
2557: /*=======================================
2558: Migrate gmd_samples.
2559: =======================================*/
2560:
2561: GMD_QC_MIG12.g_sample_upd_count := 0;
2562: GMD_QC_MIG12.g_sample_err_count := 0;
2563: GMD_QC_MIG12.g_sample_pro_count := 0;
2564: GMD_QC_MIG12.g_progress_ind := 1;
2565:
2558: Migrate gmd_samples.
2559: =======================================*/
2560:
2561: GMD_QC_MIG12.g_sample_upd_count := 0;
2562: GMD_QC_MIG12.g_sample_err_count := 0;
2563: GMD_QC_MIG12.g_sample_pro_count := 0;
2564: GMD_QC_MIG12.g_progress_ind := 1;
2565:
2566: FOR v_samp_rec IN get_samples LOOP
2559: =======================================*/
2560:
2561: GMD_QC_MIG12.g_sample_upd_count := 0;
2562: GMD_QC_MIG12.g_sample_err_count := 0;
2563: GMD_QC_MIG12.g_sample_pro_count := 0;
2564: GMD_QC_MIG12.g_progress_ind := 1;
2565:
2566: FOR v_samp_rec IN get_samples LOOP
2567:
2560:
2561: GMD_QC_MIG12.g_sample_upd_count := 0;
2562: GMD_QC_MIG12.g_sample_err_count := 0;
2563: GMD_QC_MIG12.g_sample_pro_count := 0;
2564: GMD_QC_MIG12.g_progress_ind := 1;
2565:
2566: FOR v_samp_rec IN get_samples LOOP
2567:
2568: BEGIN -- start sample subprogram
2566: FOR v_samp_rec IN get_samples LOOP
2567:
2568: BEGIN -- start sample subprogram
2569:
2570: GMD_QC_MIG12.g_sample_pro_count := GMD_QC_MIG12.g_sample_pro_count + 1;
2571:
2572: /*======================================
2573: Get Organization ID.
2574: ======================================*/
2598: /*========================
2599: Get Subinventory.
2600: ========================*/
2601: IF (v_samp_rec.whse_code IS NOT NULL) THEN
2602: GMD_QC_MIG12.GET_WHSE_INFO(
2603: v_samp_rec.whse_code,
2604: ls_organization_id,
2605: l_subinv_ind,
2606: l_loct_ctl);
2633: IF (v_samp_rec.location IS NOT NULL) THEN
2634: IF (v_samp_rec.location = 'NONE') THEN
2635: l_locator_id := NULL;
2636: ELSE
2637: l_locator_id := GMD_QC_MIG12.GET_LOCATOR_ID(v_samp_rec.whse_code, v_samp_rec.location);
2638: IF (l_locator_id IS NULL) THEN
2639: IF (l_loct_ctl = 2) THEN
2640: /*======================================
2641: Create a Non-validated location.
2667: associated with the locator matches the
2668: subinventory code already assigned.
2669: ==============================================*/
2670:
2671: GMD_QC_MIG12.GET_SUBINV_DATA(l_locator_id,
2672: l_subinv,
2673: lsub_organization_id);
2674:
2675: IF (lsub_organization_id IS NULL) THEN
2703: Get Storage Organization id and Subinventory.
2704: =================================================*/
2705:
2706: IF (v_samp_rec.storage_whse IS NOT NULL) THEN
2707: GMD_QC_MIG12.GET_WHSE_INFO (
2708: p_whse_code => v_samp_rec.storage_whse,
2709: x_organization_id => l_storage_org_id,
2710: x_subinv_ind => l_store_subinv_ind,
2711: x_loct_ctl => l_store_loct_ctl);
2723: IF (v_samp_rec.storage_location IS NOT NULL) THEN
2724: IF (v_samp_rec.storage_location = 'NONE') THEN
2725: l_storage_locator_id := NULL;
2726: ELSE
2727: l_storage_locator_id := GMD_QC_MIG12.GET_LOCATOR_ID(v_samp_rec.storage_whse, v_samp_rec.storage_location);
2728: IF (l_storage_locator_id IS NULL) THEN
2729: IF (l_loct_ctl = 2) THEN
2730: /*======================================
2731: Create a Non-validated location.
2764: /*=================================================
2765: Get Source Organization id and Subinventory.
2766: =================================================*/
2767: IF (v_samp_rec.source_whse IS NOT NULL) THEN
2768: gmd_qc_mig12.get_whse_info (p_whse_code => v_samp_rec.source_whse
2769: , x_organization_id => l_source_org_id
2770: , x_subinv_ind => l_source_subinv_ind
2771: , x_loct_ctl => l_source_loct_ctl);
2772:
2783: IF (v_samp_rec.source_location = 'NONE') THEN
2784: l_source_locator_id := NULL;
2785: ELSE
2786: l_source_locator_id :=
2787: gmd_qc_mig12.get_locator_id (v_samp_rec.source_whse, v_samp_rec.source_location);
2788:
2789: IF (l_source_locator_id IS NULL) THEN
2790: IF (l_loct_ctl = 2) THEN
2791: /*======================================
2815: Locator. Check to see if the subinventory
2816: associated with the locator matches the
2817: subinventory code already assigned.
2818: ==============================================*/
2819: gmd_qc_mig12.get_subinv_data (l_source_locator_id
2820: , l_source_subinv_loc
2821: , l_src_sub_organization_id);
2822:
2823: IF (l_src_sub_organization_id IS NULL) THEN
2958: IF (p_commit = FND_API.G_TRUE) THEN
2959: COMMIT;
2960: END IF;
2961:
2962: GMD_QC_MIG12.g_sample_upd_count := GMD_QC_MIG12.g_sample_upd_count + 1;
2963:
2964: EXCEPTION
2965:
2966: WHEN MIG_NO_ORG THEN
2977: p_param2 => 'ORGN_CODE',
2978: p_param3 => 'SAMPLE_ID',
2979: p_param4 => to_char(v_samp_rec.sample_id),
2980: p_app_short_name => 'GMD');
2981: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
2982: x_exception_count := x_exception_count + 1;
2983:
2984: WHEN MIG_NO_LAB_ORG THEN
2985: GMA_COMMON_LOGGING.gma_migration_central_log (
2995: p_param2 => 'QC_LAB_ORGN_CODE',
2996: p_param3 => 'SAMPLE_ID',
2997: p_param4 => to_char(v_samp_rec.sample_id),
2998: p_app_short_name => 'GMD');
2999: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3000: x_exception_count := x_exception_count + 1;
3001:
3002: WHEN MIG_WHSE_ERROR THEN
3003: GMA_COMMON_LOGGING.gma_migration_central_log (
3014: p_param3 => 'SAMPLE_ID',
3015: p_param4 => to_char(v_samp_rec.sample_id),
3016: p_app_short_name => 'GMD');
3017: ROLLBACK;
3018: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3019: x_exception_count := x_exception_count + 1;
3020:
3021: WHEN MIG_SUBINV_MISMATCH THEN
3022: GMA_COMMON_LOGGING.gma_migration_central_log (
3036: p_param4 => to_char(l_organization_id),
3037: p_param5 => to_char(ls_organization_id),
3038: p_app_short_name => 'GMD');
3039: ROLLBACK;
3040: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3041: x_exception_count := x_exception_count + 1;
3042:
3043: WHEN MIG_NON_LOC_FAIL THEN
3044: GMA_COMMON_LOGGING.gma_migration_central_log (
3053: p_param2 => to_char(v_samp_rec.sample_id),
3054: p_param3 => 'LOCATION',
3055: p_app_short_name => 'GMD');
3056: ROLLBACK;
3057: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3058: x_exception_count := x_exception_count + 1;
3059:
3060: WHEN MIG_LOCATOR_ID THEN
3061: GMA_COMMON_LOGGING.gma_migration_central_log (
3074: p_param4 => 'SAMPLE_ID',
3075: p_param5 => to_char(v_samp_rec.sample_id),
3076: p_app_short_name => 'GMD');
3077: ROLLBACK;
3078: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3079: x_exception_count := x_exception_count + 1;
3080:
3081: WHEN MIG_SUBINV_ERROR THEN
3082: GMA_COMMON_LOGGING.gma_migration_central_log (
3091: p_param2 => 'SAMPLE_ID',
3092: p_param3 => to_char(v_samp_rec.sample_id),
3093: p_app_short_name => 'GMD');
3094: ROLLBACK;
3095: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3096: x_exception_count := x_exception_count + 1;
3097:
3098:
3099: WHEN MIG_STORE_WHSE_ERROR THEN
3111: p_param3 => 'SAMPLE_ID',
3112: p_param4 => to_char(v_samp_rec.sample_id),
3113: p_app_short_name => 'GMD');
3114: ROLLBACK;
3115: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3116: x_exception_count := x_exception_count + 1;
3117:
3118: WHEN MIG_STORE_NON_LOC_ERROR THEN
3119: GMA_COMMON_LOGGING.gma_migration_central_log (
3128: p_param2 => to_char(v_samp_rec.sample_id),
3129: p_param3 => 'STORAGE_OCATION',
3130: p_app_short_name => 'GMD');
3131: ROLLBACK;
3132: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3133: x_exception_count := x_exception_count + 1;
3134:
3135: WHEN MIG_STORE_LOCATOR_ID THEN
3136: GMA_COMMON_LOGGING.gma_migration_central_log (
3149: p_param4 => 'SAMPLE_ID',
3150: p_param5 => to_char(v_samp_rec.sample_id),
3151: p_app_short_name => 'GMD');
3152: ROLLBACK;
3153: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3154: x_exception_count := x_exception_count + 1;
3155:
3156: -- BEGIN Bug# 5261810
3157: -- Added code to handle exceptions for source_whse and source_location
3170: p_param3 => 'SAMPLE_ID',
3171: p_param4 => to_char(v_samp_rec.sample_id),
3172: p_app_short_name => 'GMD');
3173: ROLLBACK;
3174: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3175: x_exception_count := x_exception_count + 1;
3176:
3177: WHEN MIG_SOURCE_NON_LOC_ERROR THEN
3178: GMA_COMMON_LOGGING.gma_migration_central_log (
3187: p_param2 => to_char(v_samp_rec.sample_id),
3188: p_param3 => 'SOURCE_LOCATION',
3189: p_app_short_name => 'GMD');
3190: ROLLBACK;
3191: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3192: x_exception_count := x_exception_count + 1;
3193:
3194: WHEN MIG_SOURCE_LOCATOR_ID THEN
3195: GMA_COMMON_LOGGING.gma_migration_central_log (
3208: p_param4 => 'SAMPLE_ID',
3209: p_param5 => to_char(v_samp_rec.sample_id),
3210: p_app_short_name => 'GMD');
3211: ROLLBACK;
3212: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3213: x_exception_count := x_exception_count + 1;
3214:
3215: WHEN MIG_SOURCE_SUBINV_ERROR THEN
3216: GMA_COMMON_LOGGING.gma_migration_central_log (
3225: p_param2 => 'SAMPLE_ID',
3226: p_param3 => to_char(v_samp_rec.sample_id),
3227: p_app_short_name => 'GMD');
3228: ROLLBACK;
3229: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3230: x_exception_count := x_exception_count + 1;
3231: -- End Bug# 5261810
3232: WHEN MIG_ODM_ITEM THEN
3233: GMA_COMMON_LOGGING.gma_migration_central_log (
3244: p_param3 => 'SAMPLE_ID',
3245: p_param4 => to_char(v_samp_rec.sample_id),
3246: p_app_short_name => 'GMD');
3247: ROLLBACK;
3248: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3249: x_exception_count := x_exception_count + 1;
3250:
3251: WHEN MIG_OPM_ITEM THEN
3252: GMA_COMMON_LOGGING.gma_migration_central_log (
3261: p_param2 => 'SAMPLE_ID',
3262: p_param3 => to_char(v_samp_rec.sample_id),
3263: p_app_short_name => 'GMD');
3264: ROLLBACK;
3265: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3266: x_exception_count := x_exception_count + 1;
3267:
3268: WHEN MIG_LOT_ERROR THEN
3269: GMA_COMMON_LOGGING.gma_migration_central_log (
3276: p_param1 => 'SAMPLE_ID',
3277: p_param2 => to_char(v_samp_rec.sample_id),
3278: p_app_short_name => 'GMD');
3279: ROLLBACK;
3280: GMD_QC_MIG12.g_sample_err_count := GMD_QC_MIG12.g_sample_err_count + 1;
3281: x_exception_count := x_exception_count + 1;
3282:
3283: WHEN OTHERS THEN
3284:
3300: /*==============================================
3301: Log number of updates to gmd_samples.
3302: ==============================================*/
3303:
3304: LOG_SAMPLE_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
3305:
3306:
3307: /*==============================================
3308: Log Start of gmd_sampling_events migration.
3318: p_context => 'Quality Samples',
3319: p_app_short_name => 'GMA');
3320:
3321:
3322: GMD_QC_MIG12.g_sample_event_upd_count := 0;
3323: GMD_QC_MIG12.g_sample_event_err_count := 0;
3324: GMD_QC_MIG12.g_sample_event_pro_count := 0;
3325: GMD_QC_MIG12.g_progress_ind := 2;
3326:
3319: p_app_short_name => 'GMA');
3320:
3321:
3322: GMD_QC_MIG12.g_sample_event_upd_count := 0;
3323: GMD_QC_MIG12.g_sample_event_err_count := 0;
3324: GMD_QC_MIG12.g_sample_event_pro_count := 0;
3325: GMD_QC_MIG12.g_progress_ind := 2;
3326:
3327: FOR v_samp_event IN get_sampling_event LOOP
3320:
3321:
3322: GMD_QC_MIG12.g_sample_event_upd_count := 0;
3323: GMD_QC_MIG12.g_sample_event_err_count := 0;
3324: GMD_QC_MIG12.g_sample_event_pro_count := 0;
3325: GMD_QC_MIG12.g_progress_ind := 2;
3326:
3327: FOR v_samp_event IN get_sampling_event LOOP
3328:
3321:
3322: GMD_QC_MIG12.g_sample_event_upd_count := 0;
3323: GMD_QC_MIG12.g_sample_event_err_count := 0;
3324: GMD_QC_MIG12.g_sample_event_pro_count := 0;
3325: GMD_QC_MIG12.g_progress_ind := 2;
3326:
3327: FOR v_samp_event IN get_sampling_event LOOP
3328:
3329: BEGIN -- sample event subprogram
3327: FOR v_samp_event IN get_sampling_event LOOP
3328:
3329: BEGIN -- sample event subprogram
3330:
3331: GMD_QC_MIG12.g_sample_event_pro_count := GMD_QC_MIG12.g_sample_event_pro_count + 1;
3332: /*===============================
3333: Get Data from gmd_samples.
3334: ===============================*/
3335: OPEN get_sample_data(v_samp_event.sampling_event_id);
3358: IF (p_commit = FND_API.G_TRUE) THEN
3359: COMMIT;
3360: END IF;
3361:
3362: GMD_QC_MIG12.g_sample_event_upd_count := GMD_QC_MIG12.g_sample_event_upd_count + 1;
3363:
3364: EXCEPTION
3365:
3366: WHEN MIG_GET_SAMPLE_ERROR THEN
3373: p_context => 'Quality Samples - gmd_sampling_events',
3374: p_token1 => 'SAMPLEVT',
3375: p_param1 => to_char(v_samp_event.sampling_event_id),
3376: p_app_short_name => 'GMD'); */
3377: GMD_QC_MIG12.g_sample_event_err_count := GMD_QC_MIG12.g_sample_event_err_count + 1;
3378: x_exception_count := x_exception_count + 1;
3379:
3380: WHEN OTHERS THEN
3381: LOG_SAMPLE_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
3377: GMD_QC_MIG12.g_sample_event_err_count := GMD_QC_MIG12.g_sample_event_err_count + 1;
3378: x_exception_count := x_exception_count + 1;
3379:
3380: WHEN OTHERS THEN
3381: LOG_SAMPLE_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
3382: GMA_COMMON_LOGGING.gma_migration_central_log (
3383: p_run_id => p_migration_run_id,
3384: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
3385: p_message_token => 'GMA_MIGRATION_DB_ERROR',
3395: /*==============================================
3396: Log number of updates to gmd_sampling_event.
3397: ==============================================*/
3398:
3399: LOG_SAMPLE_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
3400:
3401:
3402: /*=====================================
3403: Log Start of gmd_results.
3412: p_param1 => 'GMD_RESULTS',
3413: p_context => 'Quality Samples',
3414: p_app_short_name => 'GMA');
3415:
3416: GMD_QC_MIG12.g_result_upd_count := 0;
3417: GMD_QC_MIG12.g_result_pro_count := 0;
3418: GMD_QC_MIG12.g_result_err_count := 0;
3419: GMD_QC_MIG12.g_progress_ind := 3;
3420:
3413: p_context => 'Quality Samples',
3414: p_app_short_name => 'GMA');
3415:
3416: GMD_QC_MIG12.g_result_upd_count := 0;
3417: GMD_QC_MIG12.g_result_pro_count := 0;
3418: GMD_QC_MIG12.g_result_err_count := 0;
3419: GMD_QC_MIG12.g_progress_ind := 3;
3420:
3421: FOR v_result IN get_results LOOP
3414: p_app_short_name => 'GMA');
3415:
3416: GMD_QC_MIG12.g_result_upd_count := 0;
3417: GMD_QC_MIG12.g_result_pro_count := 0;
3418: GMD_QC_MIG12.g_result_err_count := 0;
3419: GMD_QC_MIG12.g_progress_ind := 3;
3420:
3421: FOR v_result IN get_results LOOP
3422:
3415:
3416: GMD_QC_MIG12.g_result_upd_count := 0;
3417: GMD_QC_MIG12.g_result_pro_count := 0;
3418: GMD_QC_MIG12.g_result_err_count := 0;
3419: GMD_QC_MIG12.g_progress_ind := 3;
3420:
3421: FOR v_result IN get_results LOOP
3422:
3423: BEGIN -- results subprogram
3421: FOR v_result IN get_results LOOP
3422:
3423: BEGIN -- results subprogram
3424:
3425: GMD_QC_MIG12.g_result_pro_count := GMD_QC_MIG12.g_result_pro_count + 1;
3426: /*======================================
3427: Check if organizations migrated.
3428: ======================================*/
3429: IF (v_result.lab_organization_id IS NULL and v_result.qc_lab_orgn_code IS NOT NULL) THEN
3506: IF (p_commit = FND_API.G_TRUE) THEN
3507: COMMIT;
3508: END IF;
3509:
3510: GMD_QC_MIG12.g_result_upd_count := GMD_QC_MIG12.g_result_upd_count + 1;
3511:
3512: EXCEPTION
3513:
3514: WHEN MIG_NO_LAB_ORG THEN
3525: p_param2 => 'QC_LAB_ORGN_CODE',
3526: p_param3 => 'RESULT_ID',
3527: p_param4 => to_char(v_result.result_id),
3528: p_app_short_name => 'GMD');
3529: GMD_QC_MIG12.g_result_err_count := GMD_QC_MIG12.g_result_err_count + 1;
3530: x_exception_count := x_exception_count + 1;
3531:
3532: WHEN NEXTRESULT THEN
3533: NULL;
3546: p_param2 => to_char(v_result.test_kit_item_id),
3547: p_param3 => 'RESULT_ID',
3548: p_param4 => to_char(v_result.result_id),
3549: p_app_short_name => 'GMD');
3550: GMD_QC_MIG12.g_result_err_count := GMD_QC_MIG12.g_result_err_count + 1;
3551: x_exception_count := x_exception_count + 1;
3552:
3553: WHEN MIG_LOT_ERROR THEN
3554: GMA_COMMON_LOGGING.gma_migration_central_log (
3560: p_token2 => 'ROWV',
3561: p_param1 => 'RESULT_ID',
3562: p_param2 => to_char(v_result.result_id),
3563: p_app_short_name => 'GMD');
3564: GMD_QC_MIG12.g_result_err_count := GMD_QC_MIG12.g_result_err_count + 1;
3565: x_exception_count := x_exception_count + 1;
3566:
3567: WHEN OTHERS THEN
3568: LOG_SAMPLE_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
3564: GMD_QC_MIG12.g_result_err_count := GMD_QC_MIG12.g_result_err_count + 1;
3565: x_exception_count := x_exception_count + 1;
3566:
3567: WHEN OTHERS THEN
3568: LOG_SAMPLE_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
3569: GMA_COMMON_LOGGING.gma_migration_central_log (
3570: p_run_id => p_migration_run_id,
3571: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
3572: p_message_token => 'GMA_MIGRATION_DB_ERROR',
3582: /*==============================================
3583: Log number of updates to gmd_results.
3584: ==============================================*/
3585:
3586: LOG_SAMPLE_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
3587:
3588: EXCEPTION
3589:
3590: WHEN OTHERS THEN
3587:
3588: EXCEPTION
3589:
3590: WHEN OTHERS THEN
3591: LOG_SAMPLE_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
3592: GMA_COMMON_LOGGING.gma_migration_central_log (
3593: p_run_id => p_migration_run_id,
3594: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
3595: p_message_token => 'GMA_MIGRATION_DB_ERROR',
4101: /*====================================
4102: Migrate gmd_specifications_b.
4103: ====================================*/
4104:
4105: GMD_QC_MIG12.g_progress_ind := 1;
4106: GMD_QC_MIG12.g_specs_pro_count := 0;
4107: GMD_QC_MIG12.g_specs_upd_count := 0;
4108: GMD_QC_MIG12.g_specs_err_count := 0;
4109:
4102: Migrate gmd_specifications_b.
4103: ====================================*/
4104:
4105: GMD_QC_MIG12.g_progress_ind := 1;
4106: GMD_QC_MIG12.g_specs_pro_count := 0;
4107: GMD_QC_MIG12.g_specs_upd_count := 0;
4108: GMD_QC_MIG12.g_specs_err_count := 0;
4109:
4110: FOR v_specs_b IN get_specs LOOP
4103: ====================================*/
4104:
4105: GMD_QC_MIG12.g_progress_ind := 1;
4106: GMD_QC_MIG12.g_specs_pro_count := 0;
4107: GMD_QC_MIG12.g_specs_upd_count := 0;
4108: GMD_QC_MIG12.g_specs_err_count := 0;
4109:
4110: FOR v_specs_b IN get_specs LOOP
4111: BEGIN -- specs subprogram
4104:
4105: GMD_QC_MIG12.g_progress_ind := 1;
4106: GMD_QC_MIG12.g_specs_pro_count := 0;
4107: GMD_QC_MIG12.g_specs_upd_count := 0;
4108: GMD_QC_MIG12.g_specs_err_count := 0;
4109:
4110: FOR v_specs_b IN get_specs LOOP
4111: BEGIN -- specs subprogram
4112: GMD_QC_MIG12.g_specs_pro_count := GMD_QC_MIG12.g_specs_pro_count + 1;
4108: GMD_QC_MIG12.g_specs_err_count := 0;
4109:
4110: FOR v_specs_b IN get_specs LOOP
4111: BEGIN -- specs subprogram
4112: GMD_QC_MIG12.g_specs_pro_count := GMD_QC_MIG12.g_specs_pro_count + 1;
4113: /*==========================================
4114: Get organization_id.
4115: ==========================================*/
4116: l_owner_org_id := GMA_MIGRATION_UTILS.GET_ORGANIZATION_ID(v_specs_b.owner_orgn_code);
4155: IF (p_commit = FND_API.G_TRUE) THEN
4156: COMMIT;
4157: END IF;
4158:
4159: GMD_QC_MIG12.g_specs_upd_count := GMD_QC_MIG12.g_specs_upd_count + 1;
4160:
4161: EXCEPTION
4162:
4163: WHEN MIG_NO_ORG THEN
4175: p_param2 => 'OWNER_ORGN_CODE',
4176: p_param3 => 'SPEC_ID',
4177: p_param4 => to_char(v_specs_b.spec_id),
4178: p_app_short_name => 'GMD');
4179: GMD_QC_MIG12.g_specs_err_count := GMD_QC_MIG12.g_specs_err_count + 1;
4180: x_exception_count := x_exception_count + 1;
4181:
4182: WHEN MIG_ODM_ITEM THEN
4183: GMA_COMMON_LOGGING.gma_migration_central_log (
4193: p_param2 => to_char(v_specs_b.item_id),
4194: p_param3 => 'SPEC_ID',
4195: p_param4 => to_char(v_specs_b.spec_id),
4196: p_app_short_name => 'GMD');
4197: GMD_QC_MIG12.g_specs_err_count := GMD_QC_MIG12.g_specs_err_count + 1;
4198: x_exception_count := x_exception_count + 1;
4199:
4200: WHEN OTHERS THEN
4201: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
4197: GMD_QC_MIG12.g_specs_err_count := GMD_QC_MIG12.g_specs_err_count + 1;
4198: x_exception_count := x_exception_count + 1;
4199:
4200: WHEN OTHERS THEN
4201: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
4202: GMA_COMMON_LOGGING.gma_migration_central_log (
4203: p_run_id => p_migration_run_id,
4204: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
4205: p_message_token => 'GMA_MIGRATION_DB_ERROR',
4215: /*==============================================
4216: Log end of gmd_specifications_b migration.
4217: ==============================================*/
4218:
4219: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
4220:
4221: /*===============================================
4222: NOTE: gmd_spec_tests_b will be migrated by
4223: Common migration scripts. We will not
4238: p_param1 => 'GMD_INVENTORY_SPEC_VRS',
4239: p_context => 'Quality Specifications',
4240: p_app_short_name => 'GMA');
4241:
4242: GMD_QC_MIG12.g_progress_ind := 2;
4243: GMD_QC_MIG12.g_inv_spec_pro_count := 0;
4244: GMD_QC_MIG12.g_inv_spec_ins_count := 0;
4245: GMD_QC_MIG12.g_inv_spec_del_count := 0;
4246: GMD_QC_MIG12.g_inv_spec_upd_count := 0;
4239: p_context => 'Quality Specifications',
4240: p_app_short_name => 'GMA');
4241:
4242: GMD_QC_MIG12.g_progress_ind := 2;
4243: GMD_QC_MIG12.g_inv_spec_pro_count := 0;
4244: GMD_QC_MIG12.g_inv_spec_ins_count := 0;
4245: GMD_QC_MIG12.g_inv_spec_del_count := 0;
4246: GMD_QC_MIG12.g_inv_spec_upd_count := 0;
4247: GMD_QC_MIG12.g_inv_spec_err_count := 0;
4240: p_app_short_name => 'GMA');
4241:
4242: GMD_QC_MIG12.g_progress_ind := 2;
4243: GMD_QC_MIG12.g_inv_spec_pro_count := 0;
4244: GMD_QC_MIG12.g_inv_spec_ins_count := 0;
4245: GMD_QC_MIG12.g_inv_spec_del_count := 0;
4246: GMD_QC_MIG12.g_inv_spec_upd_count := 0;
4247: GMD_QC_MIG12.g_inv_spec_err_count := 0;
4248:
4241:
4242: GMD_QC_MIG12.g_progress_ind := 2;
4243: GMD_QC_MIG12.g_inv_spec_pro_count := 0;
4244: GMD_QC_MIG12.g_inv_spec_ins_count := 0;
4245: GMD_QC_MIG12.g_inv_spec_del_count := 0;
4246: GMD_QC_MIG12.g_inv_spec_upd_count := 0;
4247: GMD_QC_MIG12.g_inv_spec_err_count := 0;
4248:
4249: FOR l_inv_spec IN get_inv_spec LOOP
4242: GMD_QC_MIG12.g_progress_ind := 2;
4243: GMD_QC_MIG12.g_inv_spec_pro_count := 0;
4244: GMD_QC_MIG12.g_inv_spec_ins_count := 0;
4245: GMD_QC_MIG12.g_inv_spec_del_count := 0;
4246: GMD_QC_MIG12.g_inv_spec_upd_count := 0;
4247: GMD_QC_MIG12.g_inv_spec_err_count := 0;
4248:
4249: FOR l_inv_spec IN get_inv_spec LOOP
4250: BEGIN -- inv spec subprogram
4243: GMD_QC_MIG12.g_inv_spec_pro_count := 0;
4244: GMD_QC_MIG12.g_inv_spec_ins_count := 0;
4245: GMD_QC_MIG12.g_inv_spec_del_count := 0;
4246: GMD_QC_MIG12.g_inv_spec_upd_count := 0;
4247: GMD_QC_MIG12.g_inv_spec_err_count := 0;
4248:
4249: FOR l_inv_spec IN get_inv_spec LOOP
4250: BEGIN -- inv spec subprogram
4251: GMD_QC_MIG12.g_inv_spec_pro_count := GMD_QC_MIG12.g_inv_spec_pro_count + 1;
4247: GMD_QC_MIG12.g_inv_spec_err_count := 0;
4248:
4249: FOR l_inv_spec IN get_inv_spec LOOP
4250: BEGIN -- inv spec subprogram
4251: GMD_QC_MIG12.g_inv_spec_pro_count := GMD_QC_MIG12.g_inv_spec_pro_count + 1;
4252: /*======================================
4253: Check if organizations migrated.
4254: ======================================*/
4255: IF (l_inv_spec.organization_id IS NULL and l_inv_spec.orgn_code IS NOT NULL) THEN
4278: /*========================
4279: Get Subinventory.
4280: ========================*/
4281: IF (l_inv_spec.whse_code IS NOT NULL) THEN
4282: GMD_QC_MIG12.GET_WHSE_INFO(
4283: l_inv_spec.whse_code,
4284: ls_organization_id,
4285: l_subinv_ind,
4286: l_loct_ctl);
4314: IF (l_inv_spec.location IS NOT NULL) THEN
4315: IF (l_inv_spec.location = 'NONE') THEN
4316: l_locator_id := NULL;
4317: ELSE
4318: l_locator_id := GMD_QC_MIG12.GET_LOCATOR_ID(l_inv_spec.whse_code, l_inv_spec.location);
4319: IF (l_locator_id IS NULL) THEN
4320: IF (l_loct_ctl = 2) THEN
4321: /*======================================
4322: Create a Non-validated location.
4338: ELSE
4339: RAISE ISPEC_LOCATOR_ID;
4340: END IF;
4341: ELSE
4342: GMD_QC_MIG12.GET_SUBINV_DATA(l_locator_id,
4343: l_subinv,
4344: lsub_organization_id);
4345:
4346: IF (lsub_organization_id IS NULL) THEN
4438:
4439: IF (l_inv_spec.in_spec_lot_status IS NULL) THEN
4440: l_in_spec_status_id := NULL;
4441: ELSE
4442: l_in_spec_status_id := GMD_QC_MIG12.GET_STATUS_ID(l_inv_spec.in_spec_lot_status);
4443: IF (l_in_spec_status_id IS NULL) THEN
4444: RAISE ISPEC_IN_STATUS;
4445: END IF;
4446: END IF;
4447:
4448: IF (l_inv_spec.out_of_spec_lot_status IS NULL) THEN
4449: l_out_spec_status_id := NULL;
4450: ELSE
4451: l_out_spec_status_id := GMD_QC_MIG12.GET_STATUS_ID(l_inv_spec.out_of_spec_lot_status);
4452: IF (l_out_spec_status_id IS NULL) THEN
4453: RAISE ISPEC_OUT_STATUS;
4454: END IF;
4455: END IF;
4474: IF (p_commit = FND_API.G_TRUE) THEN
4475: COMMIT;
4476: END IF;
4477:
4478: GMD_QC_MIG12.g_inv_spec_upd_count := GMD_QC_MIG12.g_inv_spec_upd_count + 1;
4479:
4480: ELSE -- clone else
4481: /*================================================
4482: For each Sample orgn the rule is attached to
4516: IF (p_commit = FND_API.G_TRUE) THEN
4517: COMMIT;
4518: END IF;
4519:
4520: GMD_QC_MIG12.g_inv_spec_del_count := GMD_QC_MIG12.g_inv_spec_del_count + 1;
4521: RAISE ISPEC_DELETE_INVSPEC; -- goes to next invspec record.
4522: END IF;
4523:
4524: /*================================
4609: in_spec_lot_status_id = l_in_spec_status_id,
4610: migrated_ind = 1
4611: WHERE spec_vr_id = l_inv_spec.spec_vr_id;
4612:
4613: GMD_QC_MIG12.g_inv_spec_upd_count := GMD_QC_MIG12.g_inv_spec_upd_count + 1;
4614:
4615: EXCEPTION
4616: WHEN NEXT_IN_INV_LINE THEN
4617: NULL;
4707: Note erecord field assignment.
4708: ================================*/
4709:
4710: IF (l_inv_spec.text_code IS NOT NULL AND l_inv_spec.text_code > 0) THEN
4711: l_text_code := GMD_QC_MIG12.COPY_TEXT(l_inv_spec.text_code, p_migration_run_id);
4712: ELSE
4713: l_text_code := NULL;
4714: END IF;
4715:
4813: l_out_spec_status_id,
4814: l_in_spec_status_id
4815: );
4816:
4817: GMD_QC_MIG12.g_inv_spec_ins_count := GMD_QC_MIG12.g_inv_spec_ins_count + 1;
4818:
4819: <
4820:
4821: FETCH get_sample_org INTO l_sample_orgn_code, l_sample_organization_id;
4847: p_param3 => 'SPEC_VR_ID',
4848: p_param4 => to_char(l_inv_spec.spec_vr_id),
4849: p_app_short_name => 'GMD');
4850: ROLLBACK;
4851: GMD_QC_MIG12.g_inv_spec_err_count := GMD_QC_MIG12.g_inv_spec_err_count + 1;
4852: x_exception_count := x_exception_count + 1;
4853:
4854:
4855: WHEN ISPEC_WHSE_ERROR THEN
4869: p_param3 => 'SPEC_VR_ID',
4870: p_param4 => to_char(l_inv_spec.spec_vr_id),
4871: p_app_short_name => 'GMD');
4872: ROLLBACK;
4873: GMD_QC_MIG12.g_inv_spec_err_count := GMD_QC_MIG12.g_inv_spec_err_count + 1;
4874: x_exception_count := x_exception_count + 1;
4875:
4876: WHEN ISPEC_SUB_MISMATCH THEN
4877: GMA_COMMON_LOGGING.gma_migration_central_log (
4891: p_param4 => to_char(l_organization_id),
4892: p_param5 => to_char(ls_organization_id),
4893: p_app_short_name => 'GMD');
4894: ROLLBACK;
4895: GMD_QC_MIG12.g_inv_spec_err_count := GMD_QC_MIG12.g_inv_spec_err_count + 1;
4896: x_exception_count := x_exception_count + 1;
4897:
4898: WHEN ISPEC_NON_LOC THEN
4899: GMA_COMMON_LOGGING.gma_migration_central_log (
4907: p_param1 => 'SPEC_VR_ID',
4908: p_param2 => to_char(l_inv_spec.spec_vr_id),
4909: p_param3 => 'LOCATION',
4910: p_app_short_name => 'GMD');
4911: GMD_QC_MIG12.g_inv_spec_err_count := GMD_QC_MIG12.g_inv_spec_err_count + 1;
4912: x_exception_count := x_exception_count + 1;
4913:
4914:
4915:
4930: p_param4 => 'SPEC_VR_ID',
4931: p_param5 => to_char(l_inv_spec.spec_vr_id),
4932: p_app_short_name => 'GMD');
4933: ROLLBACK;
4934: GMD_QC_MIG12.g_inv_spec_err_count := GMD_QC_MIG12.g_inv_spec_err_count + 1;
4935: x_exception_count := x_exception_count + 1;
4936:
4937:
4938: WHEN ISPEC_SUBINV THEN
4948: p_param2 => 'SPEC_VR_ID',
4949: p_param3 => to_char(l_inv_spec.spec_vr_id),
4950: p_app_short_name => 'GMD');
4951: ROLLBACK;
4952: GMD_QC_MIG12.g_inv_spec_err_count := GMD_QC_MIG12.g_inv_spec_err_count + 1;
4953: x_exception_count := x_exception_count + 1;
4954:
4955:
4956: WHEN ISPEC_GET_OPM_LOT THEN
4966: p_param2 => 'SPEC_VR_ID',
4967: p_param3 => to_char(l_inv_spec.spec_vr_id),
4968: p_app_short_name => 'GMD');
4969: ROLLBACK;
4970: GMD_QC_MIG12.g_inv_spec_err_count := GMD_QC_MIG12.g_inv_spec_err_count + 1;
4971: x_exception_count := x_exception_count + 1;
4972:
4973: WHEN ISPEC_GET_SPEC_ITEM THEN
4974: GMA_COMMON_LOGGING.gma_migration_central_log (
4983: p_param2 => 'SPEC_VR_ID',
4984: p_param3 => to_char(l_inv_spec.spec_vr_id),
4985: p_app_short_name => 'GMD');
4986: ROLLBACK;
4987: GMD_QC_MIG12.g_inv_spec_err_count := GMD_QC_MIG12.g_inv_spec_err_count + 1;
4988: x_exception_count := x_exception_count + 1;
4989:
4990:
4991: WHEN ISPEC_GET_OPM_ITEM THEN
5001: p_param2 => 'SPEC_VR_ID',
5002: p_param3 => to_char(l_inv_spec.spec_vr_id),
5003: p_app_short_name => 'GMD');
5004: ROLLBACK;
5005: GMD_QC_MIG12.g_inv_spec_err_count := GMD_QC_MIG12.g_inv_spec_err_count + 1;
5006: x_exception_count := x_exception_count + 1;
5007:
5008:
5009: WHEN ISPEC_MIG_LOT THEN
5017: p_param1 => 'SPEC_VR_ID',
5018: p_param2 => to_char(l_inv_spec.spec_vr_id),
5019: p_app_short_name => 'GMD');
5020: ROLLBACK;
5021: GMD_QC_MIG12.g_inv_spec_err_count := GMD_QC_MIG12.g_inv_spec_err_count + 1;
5022: x_exception_count := x_exception_count + 1;
5023:
5024:
5025: WHEN ISPEC_IN_STATUS THEN
5035: p_param2 => 'SPEC_VR_ID',
5036: p_param3 => to_char(l_inv_spec.spec_vr_id),
5037: p_app_short_name => 'GMD');
5038: ROLLBACK;
5039: GMD_QC_MIG12.g_inv_spec_err_count := GMD_QC_MIG12.g_inv_spec_err_count + 1;
5040: x_exception_count := x_exception_count + 1;
5041:
5042:
5043: WHEN ISPEC_OUT_STATUS THEN
5053: p_param2 => 'SPEC_VR_ID',
5054: p_param3 => to_char(l_inv_spec.spec_vr_id),
5055: p_app_short_name => 'GMD');
5056: ROLLBACK;
5057: GMD_QC_MIG12.g_inv_spec_err_count := GMD_QC_MIG12.g_inv_spec_err_count + 1;
5058: x_exception_count := x_exception_count + 1;
5059:
5060: WHEN ISPEC_DELETE_INVSPEC THEN
5061: NULL;
5074: p_param2 => 'SPEC_VR_ID',
5075: p_param3 => to_char(l_inv_spec.spec_vr_id),
5076: p_app_short_name => 'GMD');
5077: ROLLBACK;
5078: GMD_QC_MIG12.g_inv_spec_err_count := GMD_QC_MIG12.g_inv_spec_err_count + 1;
5079: x_exception_count := x_exception_count + 1;
5080:
5081:
5082: WHEN ISPEC_SAMPLE_ORG_ID THEN
5093: p_param2 => 'SPEC_VR_ID',
5094: p_param3 => to_char(l_inv_spec.spec_vr_id),
5095: p_app_short_name => 'GMD');
5096: ROLLBACK;
5097: GMD_QC_MIG12.g_inv_spec_err_count := GMD_QC_MIG12.g_inv_spec_err_count + 1;
5098: x_exception_count := x_exception_count + 1;
5099:
5100: WHEN OTHERS THEN
5101: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
5097: GMD_QC_MIG12.g_inv_spec_err_count := GMD_QC_MIG12.g_inv_spec_err_count + 1;
5098: x_exception_count := x_exception_count + 1;
5099:
5100: WHEN OTHERS THEN
5101: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
5102: GMA_COMMON_LOGGING.gma_migration_central_log (
5103: p_run_id => p_migration_run_id,
5104: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
5105: p_message_token => 'GMA_MIGRATION_DB_ERROR',
5118: /*==============================================
5119: Log end of gmd_inventory_spec_vrs migration.
5120: ==============================================*/
5121:
5122: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
5123:
5124:
5125: /*================================
5126: Migrate gmd_wip_spec_vrs.
5135: p_param1 => 'GMD_WIP_SPEC_VRS',
5136: p_context => 'Quality Specifications',
5137: p_app_short_name => 'GMA');
5138:
5139: GMD_QC_MIG12.g_progress_ind := 3;
5140: GMD_QC_MIG12.g_wip_spec_pro_count := 0;
5141: GMD_QC_MIG12.g_wip_spec_ins_count := 0;
5142: GMD_QC_MIG12.g_wip_spec_del_count := 0;
5143: GMD_QC_MIG12.g_wip_spec_upd_count := 0;
5136: p_context => 'Quality Specifications',
5137: p_app_short_name => 'GMA');
5138:
5139: GMD_QC_MIG12.g_progress_ind := 3;
5140: GMD_QC_MIG12.g_wip_spec_pro_count := 0;
5141: GMD_QC_MIG12.g_wip_spec_ins_count := 0;
5142: GMD_QC_MIG12.g_wip_spec_del_count := 0;
5143: GMD_QC_MIG12.g_wip_spec_upd_count := 0;
5144: GMD_QC_MIG12.g_wip_spec_err_count := 0;
5137: p_app_short_name => 'GMA');
5138:
5139: GMD_QC_MIG12.g_progress_ind := 3;
5140: GMD_QC_MIG12.g_wip_spec_pro_count := 0;
5141: GMD_QC_MIG12.g_wip_spec_ins_count := 0;
5142: GMD_QC_MIG12.g_wip_spec_del_count := 0;
5143: GMD_QC_MIG12.g_wip_spec_upd_count := 0;
5144: GMD_QC_MIG12.g_wip_spec_err_count := 0;
5145:
5138:
5139: GMD_QC_MIG12.g_progress_ind := 3;
5140: GMD_QC_MIG12.g_wip_spec_pro_count := 0;
5141: GMD_QC_MIG12.g_wip_spec_ins_count := 0;
5142: GMD_QC_MIG12.g_wip_spec_del_count := 0;
5143: GMD_QC_MIG12.g_wip_spec_upd_count := 0;
5144: GMD_QC_MIG12.g_wip_spec_err_count := 0;
5145:
5146: FOR l_wip_spec IN get_wip_spec LOOP
5139: GMD_QC_MIG12.g_progress_ind := 3;
5140: GMD_QC_MIG12.g_wip_spec_pro_count := 0;
5141: GMD_QC_MIG12.g_wip_spec_ins_count := 0;
5142: GMD_QC_MIG12.g_wip_spec_del_count := 0;
5143: GMD_QC_MIG12.g_wip_spec_upd_count := 0;
5144: GMD_QC_MIG12.g_wip_spec_err_count := 0;
5145:
5146: FOR l_wip_spec IN get_wip_spec LOOP
5147: BEGIN -- wip spec subprogram
5140: GMD_QC_MIG12.g_wip_spec_pro_count := 0;
5141: GMD_QC_MIG12.g_wip_spec_ins_count := 0;
5142: GMD_QC_MIG12.g_wip_spec_del_count := 0;
5143: GMD_QC_MIG12.g_wip_spec_upd_count := 0;
5144: GMD_QC_MIG12.g_wip_spec_err_count := 0;
5145:
5146: FOR l_wip_spec IN get_wip_spec LOOP
5147: BEGIN -- wip spec subprogram
5148: GMD_QC_MIG12.g_wip_spec_pro_count := GMD_QC_MIG12.g_wip_spec_pro_count + 1;
5144: GMD_QC_MIG12.g_wip_spec_err_count := 0;
5145:
5146: FOR l_wip_spec IN get_wip_spec LOOP
5147: BEGIN -- wip spec subprogram
5148: GMD_QC_MIG12.g_wip_spec_pro_count := GMD_QC_MIG12.g_wip_spec_pro_count + 1;
5149: /*===============================
5150: Migrate orgn_code.
5151: ===============================*/
5152:
5165:
5166: IF (l_wip_spec.in_spec_lot_status IS NULL) THEN
5167: l_in_spec_status_id := NULL;
5168: ELSE
5169: l_in_spec_status_id := GMD_QC_MIG12.GET_STATUS_ID(l_wip_spec.in_spec_lot_status);
5170: IF (l_in_spec_status_id IS NULL) THEN
5171: RAISE WIP_IN_STATUS;
5172: END IF;
5173: END IF;
5174:
5175: IF (l_wip_spec.out_of_spec_lot_status IS NULL) THEN
5176: l_out_spec_status_id := NULL;
5177: ELSE
5178: l_out_spec_status_id := GMD_QC_MIG12.GET_STATUS_ID(l_wip_spec.out_of_spec_lot_status);
5179: IF (l_out_spec_status_id IS NULL) THEN
5180: RAISE WIP_OUT_STATUS;
5181: END IF;
5182: END IF;
5212: material_detail_id = l_material_detail_id, -- Bug# 5482253
5213: migrated_ind = 1
5214: WHERE spec_vr_id = l_wip_spec.spec_vr_id;
5215:
5216: GMD_QC_MIG12.g_wip_spec_upd_count := GMD_QC_MIG12.g_wip_spec_upd_count + 1;
5217:
5218: IF (p_commit = FND_API.G_TRUE) THEN
5219: COMMIT;
5220: END IF;
5242: IF (p_commit = FND_API.G_TRUE) THEN
5243: COMMIT;
5244: END IF;
5245:
5246: GMD_QC_MIG12.g_wip_spec_del_count := GMD_QC_MIG12.g_wip_spec_del_count + 1;
5247:
5248: RAISE WIP_SPEC_DELETE;
5249:
5250: END IF ;
5285: material_detail_id = l_material_detail_id, -- Bug# 5482253
5286: migrated_ind = 1
5287: WHERE spec_vr_id = l_wip_spec.spec_vr_id;
5288:
5289: GMD_QC_MIG12.g_wip_spec_upd_count := GMD_QC_MIG12.g_wip_spec_upd_count + 1;
5290:
5291: EXCEPTION
5292: WHEN NEXT_IN_WIP_LINE THEN
5293: NULL;
5327: Clone the null orgn_code record using the
5328: Sample orgn_code.
5329: ==============================================*/
5330: IF (l_wip_spec.text_code IS NOT NULL AND l_wip_spec.text_code > 0) THEN
5331: l_text_code := GMD_QC_MIG12.COPY_TEXT(l_wip_spec.text_code, p_migration_run_id);
5332: ELSE
5333: l_text_code := NULL;
5334: END IF;
5335:
5452: l_in_spec_status_id,
5453: l_material_detail_id -- Bug# 5482253
5454: );
5455:
5456: GMD_QC_MIG12.g_wip_spec_ins_count := GMD_QC_MIG12.g_wip_spec_ins_count + 1;
5457:
5458: << NEXT_WIP_SAMPLE_HEADER >>
5459:
5460: FETCH get_wip_sample_org INTO l_sample_orgn_code, l_sample_organization_id;
5481: p_param2 => 'ORGN_CODE',
5482: p_param3 => 'SPEC_VR_ID',
5483: p_param4 => to_char(l_wip_spec.spec_vr_id),
5484: p_app_short_name => 'GMD');
5485: GMD_QC_MIG12.g_wip_spec_err_count := GMD_QC_MIG12.g_wip_spec_err_count + 1;
5486: x_exception_count := x_exception_count + 1;
5487:
5488: WHEN WIP_IN_STATUS THEN
5489: GMA_COMMON_LOGGING.gma_migration_central_log (
5497: p_param1 => l_wip_spec.in_spec_lot_status,
5498: p_param2 => 'SPEC_VR_ID',
5499: p_param3 => to_char(l_wip_spec.spec_vr_id),
5500: p_app_short_name => 'GMD');
5501: GMD_QC_MIG12.g_wip_spec_err_count := GMD_QC_MIG12.g_wip_spec_err_count + 1;
5502: x_exception_count := x_exception_count + 1;
5503:
5504:
5505: WHEN WIP_OUT_STATUS THEN
5514: p_param1 => l_wip_spec.out_of_spec_lot_status,
5515: p_param2 => 'SPEC_VR_ID',
5516: p_param3 => to_char(l_wip_spec.spec_vr_id),
5517: p_app_short_name => 'GMD');
5518: GMD_QC_MIG12.g_wip_spec_err_count := GMD_QC_MIG12.g_wip_spec_err_count + 1;
5519: x_exception_count := x_exception_count + 1;
5520:
5521:
5522: WHEN WIP_SPEC_DELETE THEN
5543: p_param1 => l_sample_orgn_code,
5544: p_param2 => 'SPEC_VR_ID',
5545: p_param3 => to_char(l_wip_spec.spec_vr_id),
5546: p_app_short_name => 'GMD');
5547: GMD_QC_MIG12.g_wip_spec_err_count := GMD_QC_MIG12.g_wip_spec_err_count + 1;
5548: x_exception_count := x_exception_count + 1;
5549:
5550: WHEN WIP_SAMPLE_ORG_ID THEN
5551: GMA_COMMON_LOGGING.gma_migration_central_log (
5560: p_param1 => l_sample_orgn_code,
5561: p_param2 => 'SPEC_VR_ID',
5562: p_param3 => to_char(l_wip_spec.spec_vr_id),
5563: p_app_short_name => 'GMD');
5564: GMD_QC_MIG12.g_wip_spec_err_count := GMD_QC_MIG12.g_wip_spec_err_count + 1;
5565: x_exception_count := x_exception_count + 1;
5566:
5567:
5568: WHEN OTHERS THEN
5565: x_exception_count := x_exception_count + 1;
5566:
5567:
5568: WHEN OTHERS THEN
5569: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
5570: GMA_COMMON_LOGGING.gma_migration_central_log (
5571: p_run_id => p_migration_run_id,
5572: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
5573: p_message_token => 'GMA_MIGRATION_DB_ERROR',
5587: /*==============================================
5588: Log end of gmd_wip_spec_vrs migration.
5589: ==============================================*/
5590:
5591: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
5592:
5593: /*=======================================
5594: Migrate gmd_customer_spec_vrs.
5595: =======================================*/
5603: p_param1 => 'GMD_CUSTOMER_SPEC_VRS',
5604: p_context => 'Quality Specifications',
5605: p_app_short_name => 'GMA');
5606:
5607: GMD_QC_MIG12.g_progress_ind := 4;
5608: GMD_QC_MIG12.g_cust_spec_pro_count := 0;
5609: GMD_QC_MIG12.g_cust_spec_ins_count := 0;
5610: GMD_QC_MIG12.g_cust_spec_del_count := 0;
5611: GMD_QC_MIG12.g_cust_spec_upd_count := 0;
5604: p_context => 'Quality Specifications',
5605: p_app_short_name => 'GMA');
5606:
5607: GMD_QC_MIG12.g_progress_ind := 4;
5608: GMD_QC_MIG12.g_cust_spec_pro_count := 0;
5609: GMD_QC_MIG12.g_cust_spec_ins_count := 0;
5610: GMD_QC_MIG12.g_cust_spec_del_count := 0;
5611: GMD_QC_MIG12.g_cust_spec_upd_count := 0;
5612: GMD_QC_MIG12.g_cust_spec_err_count := 0;
5605: p_app_short_name => 'GMA');
5606:
5607: GMD_QC_MIG12.g_progress_ind := 4;
5608: GMD_QC_MIG12.g_cust_spec_pro_count := 0;
5609: GMD_QC_MIG12.g_cust_spec_ins_count := 0;
5610: GMD_QC_MIG12.g_cust_spec_del_count := 0;
5611: GMD_QC_MIG12.g_cust_spec_upd_count := 0;
5612: GMD_QC_MIG12.g_cust_spec_err_count := 0;
5613:
5606:
5607: GMD_QC_MIG12.g_progress_ind := 4;
5608: GMD_QC_MIG12.g_cust_spec_pro_count := 0;
5609: GMD_QC_MIG12.g_cust_spec_ins_count := 0;
5610: GMD_QC_MIG12.g_cust_spec_del_count := 0;
5611: GMD_QC_MIG12.g_cust_spec_upd_count := 0;
5612: GMD_QC_MIG12.g_cust_spec_err_count := 0;
5613:
5614: FOR l_cust_spec IN get_cust_spec LOOP
5607: GMD_QC_MIG12.g_progress_ind := 4;
5608: GMD_QC_MIG12.g_cust_spec_pro_count := 0;
5609: GMD_QC_MIG12.g_cust_spec_ins_count := 0;
5610: GMD_QC_MIG12.g_cust_spec_del_count := 0;
5611: GMD_QC_MIG12.g_cust_spec_upd_count := 0;
5612: GMD_QC_MIG12.g_cust_spec_err_count := 0;
5613:
5614: FOR l_cust_spec IN get_cust_spec LOOP
5615: BEGIN -- cust spec subprogram
5608: GMD_QC_MIG12.g_cust_spec_pro_count := 0;
5609: GMD_QC_MIG12.g_cust_spec_ins_count := 0;
5610: GMD_QC_MIG12.g_cust_spec_del_count := 0;
5611: GMD_QC_MIG12.g_cust_spec_upd_count := 0;
5612: GMD_QC_MIG12.g_cust_spec_err_count := 0;
5613:
5614: FOR l_cust_spec IN get_cust_spec LOOP
5615: BEGIN -- cust spec subprogram
5616: GMD_QC_MIG12.g_cust_spec_pro_count := GMD_QC_MIG12.g_cust_spec_pro_count + 1;
5612: GMD_QC_MIG12.g_cust_spec_err_count := 0;
5613:
5614: FOR l_cust_spec IN get_cust_spec LOOP
5615: BEGIN -- cust spec subprogram
5616: GMD_QC_MIG12.g_cust_spec_pro_count := GMD_QC_MIG12.g_cust_spec_pro_count + 1;
5617: IF (l_cust_spec.organization_id IS NULL and l_cust_spec.orgn_code IS NOT NULL) THEN
5618: RAISE CUST_NO_ORG;
5619: END IF;
5620:
5629: IF (p_commit = FND_API.G_TRUE) THEN
5630: COMMIT;
5631: END IF;
5632:
5633: GMD_QC_MIG12.g_cust_spec_upd_count := GMD_QC_MIG12.g_cust_spec_upd_count + 1;
5634:
5635: ELSE -- org is null
5636: /*=======================================
5637: Loop and get all samples orgs that
5655: IF (p_commit = FND_API.G_TRUE) THEN
5656: COMMIT;
5657: END IF;
5658:
5659: GMD_QC_MIG12.g_cust_spec_del_count := GMD_QC_MIG12.g_cust_spec_del_count + 1;
5660: RAISE CUST_SPEC_DELETE;
5661: END IF ;
5662:
5663: /*================================
5692: organization_id = l_sample_organization_id,
5693: migrated_ind = 1
5694: WHERE spec_vr_id = l_cust_spec.spec_vr_id;
5695:
5696: GMD_QC_MIG12.g_cust_spec_upd_count := GMD_QC_MIG12.g_cust_spec_upd_count + 1;
5697:
5698: EXCEPTION
5699:
5700: WHEN NEXT_IN_CUST_LINE THEN
5700: WHEN NEXT_IN_CUST_LINE THEN
5701: NULL;
5702:
5703: WHEN OTHERS THEN
5704: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
5705: GMA_COMMON_LOGGING.gma_migration_central_log (
5706: p_run_id => p_migration_run_id,
5707: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
5708: p_message_token => 'GMA_MIGRATION_DB_ERROR',
5745: /*===========================
5746: Clone the record.
5747: ===========================*/
5748: IF (l_cust_spec.text_code IS NOT NULL AND l_cust_spec.text_code > 0) THEN
5749: l_text_code := GMD_QC_MIG12.COPY_TEXT(l_cust_spec.text_code, p_migration_run_id);
5750: ELSE
5751: l_text_code := NULL;
5752: END IF;
5753:
5830: l_cust_spec.SPEC_VR_ID,
5831: l_sample_organization_id
5832: );
5833:
5834: GMD_QC_MIG12.g_cust_spec_ins_count := GMD_QC_MIG12.g_cust_spec_ins_count + 1;
5835:
5836: << NEXT_CUST_SAMPLE>>
5837:
5838: FETCH get_cust_sample_org INTO l_sample_orgn_code, l_sample_organization_id;
5864: p_param3 => 'SPEC_VR_ID',
5865: p_param4 => to_char(l_cust_spec.spec_vr_id),
5866: p_app_short_name => 'GMD');
5867: ROLLBACK;
5868: GMD_QC_MIG12.g_cust_spec_err_count := GMD_QC_MIG12.g_cust_spec_err_count + 1;
5869: x_exception_count := x_exception_count + 1;
5870:
5871: WHEN CUST_SPEC_DELETE THEN
5872: GMA_COMMON_LOGGING.gma_migration_central_log (
5894: p_param2 => 'SPEC_VR_ID',
5895: p_param3 => to_char(l_cust_spec.spec_vr_id),
5896: p_app_short_name => 'GMD');
5897: ROLLBACK;
5898: GMD_QC_MIG12.g_cust_spec_err_count := GMD_QC_MIG12.g_cust_spec_err_count + 1;
5899: x_exception_count := x_exception_count + 1;
5900:
5901: WHEN OTHERS THEN
5902: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
5898: GMD_QC_MIG12.g_cust_spec_err_count := GMD_QC_MIG12.g_cust_spec_err_count + 1;
5899: x_exception_count := x_exception_count + 1;
5900:
5901: WHEN OTHERS THEN
5902: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
5903: GMA_COMMON_LOGGING.gma_migration_central_log (
5904: p_run_id => p_migration_run_id,
5905: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
5906: p_message_token => 'GMA_MIGRATION_DB_ERROR',
5920: /*==============================================
5921: Log end of gmd_customer_spec_vrs migration.
5922: ==============================================*/
5923:
5924: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
5925:
5926:
5927:
5928: /*===================================
5938: p_param1 => 'GMD_SUPPLIER_SPEC_VRS',
5939: p_context => 'Quality Specifications',
5940: p_app_short_name => 'GMA');
5941:
5942: GMD_QC_MIG12.g_progress_ind := 5;
5943: GMD_QC_MIG12.g_supl_spec_pro_count := 0;
5944: GMD_QC_MIG12.g_supl_spec_ins_count := 0;
5945: GMD_QC_MIG12.g_supl_spec_del_count := 0;
5946: GMD_QC_MIG12.g_supl_spec_upd_count := 0;
5939: p_context => 'Quality Specifications',
5940: p_app_short_name => 'GMA');
5941:
5942: GMD_QC_MIG12.g_progress_ind := 5;
5943: GMD_QC_MIG12.g_supl_spec_pro_count := 0;
5944: GMD_QC_MIG12.g_supl_spec_ins_count := 0;
5945: GMD_QC_MIG12.g_supl_spec_del_count := 0;
5946: GMD_QC_MIG12.g_supl_spec_upd_count := 0;
5947: GMD_QC_MIG12.g_supl_spec_err_count := 0;
5940: p_app_short_name => 'GMA');
5941:
5942: GMD_QC_MIG12.g_progress_ind := 5;
5943: GMD_QC_MIG12.g_supl_spec_pro_count := 0;
5944: GMD_QC_MIG12.g_supl_spec_ins_count := 0;
5945: GMD_QC_MIG12.g_supl_spec_del_count := 0;
5946: GMD_QC_MIG12.g_supl_spec_upd_count := 0;
5947: GMD_QC_MIG12.g_supl_spec_err_count := 0;
5948:
5941:
5942: GMD_QC_MIG12.g_progress_ind := 5;
5943: GMD_QC_MIG12.g_supl_spec_pro_count := 0;
5944: GMD_QC_MIG12.g_supl_spec_ins_count := 0;
5945: GMD_QC_MIG12.g_supl_spec_del_count := 0;
5946: GMD_QC_MIG12.g_supl_spec_upd_count := 0;
5947: GMD_QC_MIG12.g_supl_spec_err_count := 0;
5948:
5949: FOR l_supl_spec IN get_supplier_spec LOOP
5942: GMD_QC_MIG12.g_progress_ind := 5;
5943: GMD_QC_MIG12.g_supl_spec_pro_count := 0;
5944: GMD_QC_MIG12.g_supl_spec_ins_count := 0;
5945: GMD_QC_MIG12.g_supl_spec_del_count := 0;
5946: GMD_QC_MIG12.g_supl_spec_upd_count := 0;
5947: GMD_QC_MIG12.g_supl_spec_err_count := 0;
5948:
5949: FOR l_supl_spec IN get_supplier_spec LOOP
5950: BEGIN -- supplier_spec subprogram
5943: GMD_QC_MIG12.g_supl_spec_pro_count := 0;
5944: GMD_QC_MIG12.g_supl_spec_ins_count := 0;
5945: GMD_QC_MIG12.g_supl_spec_del_count := 0;
5946: GMD_QC_MIG12.g_supl_spec_upd_count := 0;
5947: GMD_QC_MIG12.g_supl_spec_err_count := 0;
5948:
5949: FOR l_supl_spec IN get_supplier_spec LOOP
5950: BEGIN -- supplier_spec subprogram
5951: GMD_QC_MIG12.g_supl_spec_pro_count := GMD_QC_MIG12.g_supl_spec_pro_count + 1;
5947: GMD_QC_MIG12.g_supl_spec_err_count := 0;
5948:
5949: FOR l_supl_spec IN get_supplier_spec LOOP
5950: BEGIN -- supplier_spec subprogram
5951: GMD_QC_MIG12.g_supl_spec_pro_count := GMD_QC_MIG12.g_supl_spec_pro_count + 1;
5952: IF (l_supl_spec.organization_id IS NULL and l_supl_spec.orgn_code IS NOT NULL) THEN
5953: RAISE SUP_NO_ORG;
5954: END IF;
5955:
5973:
5974: IF (l_supl_spec.in_spec_lot_status IS NULL) THEN
5975: l_in_spec_status_id := NULL;
5976: ELSE
5977: l_in_spec_status_id := GMD_QC_MIG12.GET_STATUS_ID(l_supl_spec.in_spec_lot_status);
5978: IF (l_in_spec_status_id IS NULL) THEN
5979: RAISE SUP_IN_STATUS;
5980: END IF;
5981: END IF;
5982:
5983: IF (l_supl_spec.out_of_spec_lot_status IS NULL) THEN
5984: l_out_spec_status_id := NULL;
5985: ELSE
5986: l_out_spec_status_id := GMD_QC_MIG12.GET_STATUS_ID(l_supl_spec.out_of_spec_lot_status);
5987: IF (l_out_spec_status_id IS NULL) THEN
5988: RAISE SUP_OUT_STATUS;
5989: END IF;
5990: END IF;
6007: IF (p_commit = FND_API.G_TRUE) THEN
6008: COMMIT;
6009: END IF;
6010:
6011: GMD_QC_MIG12.g_supl_spec_upd_count := GMD_QC_MIG12.g_supl_spec_upd_count + 1;
6012:
6013: ELSE
6014: /*=========================================
6015: Loop and get all samples orgs that
6033: IF (p_commit = FND_API.G_TRUE) THEN
6034: COMMIT;
6035: END IF;
6036:
6037: GMD_QC_MIG12.g_supl_spec_del_count := GMD_QC_MIG12.g_supl_spec_del_count + 1;
6038:
6039: RAISE SUP_SPEC_DELETE;
6040:
6041: END IF;
6078: IF (p_commit = FND_API.G_TRUE) THEN
6079: COMMIT;
6080: END IF;
6081:
6082: GMD_QC_MIG12.g_supl_spec_upd_count := GMD_QC_MIG12.g_supl_spec_upd_count + 1;
6083:
6084: EXCEPTION
6085: WHEN NEXT_IN_SUPL_LINE THEN
6086: NULL;
6117: /*===========================
6118: Clone the record.
6119: ===========================*/
6120: IF (l_supl_spec.text_code IS NOT NULL AND l_supl_spec.text_code > 0) THEN
6121: l_text_code := GMD_QC_MIG12.COPY_TEXT(l_supl_spec.text_code, p_migration_run_id);
6122: ELSE
6123: l_text_code := NULL;
6124: END IF;
6125:
6214: l_out_spec_status_id,
6215: l_in_spec_status_id
6216: );
6217:
6218: GMD_QC_MIG12.g_supl_spec_ins_count := GMD_QC_MIG12.g_supl_spec_ins_count + 1;
6219:
6220: << NEXT_SUPL_SAMPLE >>
6221:
6222: FETCH get_supl_sample_org INTO l_sample_orgn_code, l_sample_organization_id;
6248: p_param2 => 'ORGN_CODE',
6249: p_param3 => 'SPEC_VR_ID',
6250: p_param4 => to_char(l_supl_spec.spec_vr_id),
6251: p_app_short_name => 'GMD');
6252: GMD_QC_MIG12.g_supl_spec_err_count := GMD_QC_MIG12.g_supl_spec_err_count + 1;
6253: x_exception_count := x_exception_count + 1;
6254:
6255: WHEN SUP_IN_STATUS THEN
6256: GMA_COMMON_LOGGING.gma_migration_central_log (
6264: p_param1 => l_supl_spec.in_spec_lot_status,
6265: p_param2 => 'SPEC_VR_ID',
6266: p_param3 => to_char(l_supl_spec.spec_vr_id),
6267: p_app_short_name => 'GMD');
6268: GMD_QC_MIG12.g_supl_spec_err_count := GMD_QC_MIG12.g_supl_spec_err_count + 1;
6269: x_exception_count := x_exception_count + 1;
6270:
6271: WHEN SUP_OUT_STATUS THEN
6272: GMA_COMMON_LOGGING.gma_migration_central_log (
6280: p_param1 => l_supl_spec.out_of_spec_lot_status,
6281: p_param2 => 'SPEC_VR_ID',
6282: p_param3 => to_char(l_supl_spec.spec_vr_id),
6283: p_app_short_name => 'GMD');
6284: GMD_QC_MIG12.g_supl_spec_err_count := GMD_QC_MIG12.g_supl_spec_err_count + 1;
6285: x_exception_count := x_exception_count + 1;
6286:
6287: WHEN SUP_SPEC_DELETE THEN
6288: GMA_COMMON_LOGGING.gma_migration_central_log (
6309: p_param1 => l_sample_orgn_code,
6310: p_param2 => 'SPEC_VR_ID',
6311: p_param3 => to_char(l_supl_spec.spec_vr_id),
6312: p_app_short_name => 'GMD');
6313: GMD_QC_MIG12.g_supl_spec_err_count := GMD_QC_MIG12.g_supl_spec_err_count + 1;
6314: x_exception_count := x_exception_count + 1;
6315:
6316: WHEN OTHERS THEN
6317: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
6313: GMD_QC_MIG12.g_supl_spec_err_count := GMD_QC_MIG12.g_supl_spec_err_count + 1;
6314: x_exception_count := x_exception_count + 1;
6315:
6316: WHEN OTHERS THEN
6317: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
6318: GMA_COMMON_LOGGING.gma_migration_central_log (
6319: p_run_id => p_migration_run_id,
6320: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
6321: p_message_token => 'GMA_MIGRATION_DB_ERROR',
6335: /*==============================================
6336: Log end of gmd_supplier_spec_vrs migration.
6337: ==============================================*/
6338:
6339: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
6340:
6341: /*====================================
6342: Migrate gmd_monitoring_spec_vrs;
6343: ====================================*/
6351: p_param1 => 'GMD_MONITORING_SPEC_VRS',
6352: p_context => 'Quality Specifications',
6353: p_app_short_name => 'GMA');
6354:
6355: GMD_QC_MIG12.g_progress_ind := 6;
6356: GMD_QC_MIG12.g_mon_spec_pro_count := 0;
6357: GMD_QC_MIG12.g_mon_spec_ins_count := 0;
6358: GMD_QC_MIG12.g_mon_spec_del_count := 0;
6359: GMD_QC_MIG12.g_mon_spec_upd_count := 0;
6352: p_context => 'Quality Specifications',
6353: p_app_short_name => 'GMA');
6354:
6355: GMD_QC_MIG12.g_progress_ind := 6;
6356: GMD_QC_MIG12.g_mon_spec_pro_count := 0;
6357: GMD_QC_MIG12.g_mon_spec_ins_count := 0;
6358: GMD_QC_MIG12.g_mon_spec_del_count := 0;
6359: GMD_QC_MIG12.g_mon_spec_upd_count := 0;
6360: GMD_QC_MIG12.g_mon_spec_err_count := 0;
6353: p_app_short_name => 'GMA');
6354:
6355: GMD_QC_MIG12.g_progress_ind := 6;
6356: GMD_QC_MIG12.g_mon_spec_pro_count := 0;
6357: GMD_QC_MIG12.g_mon_spec_ins_count := 0;
6358: GMD_QC_MIG12.g_mon_spec_del_count := 0;
6359: GMD_QC_MIG12.g_mon_spec_upd_count := 0;
6360: GMD_QC_MIG12.g_mon_spec_err_count := 0;
6361:
6354:
6355: GMD_QC_MIG12.g_progress_ind := 6;
6356: GMD_QC_MIG12.g_mon_spec_pro_count := 0;
6357: GMD_QC_MIG12.g_mon_spec_ins_count := 0;
6358: GMD_QC_MIG12.g_mon_spec_del_count := 0;
6359: GMD_QC_MIG12.g_mon_spec_upd_count := 0;
6360: GMD_QC_MIG12.g_mon_spec_err_count := 0;
6361:
6362:
6355: GMD_QC_MIG12.g_progress_ind := 6;
6356: GMD_QC_MIG12.g_mon_spec_pro_count := 0;
6357: GMD_QC_MIG12.g_mon_spec_ins_count := 0;
6358: GMD_QC_MIG12.g_mon_spec_del_count := 0;
6359: GMD_QC_MIG12.g_mon_spec_upd_count := 0;
6360: GMD_QC_MIG12.g_mon_spec_err_count := 0;
6361:
6362:
6363: FOR l_mon_spec IN get_monitor_spec LOOP
6356: GMD_QC_MIG12.g_mon_spec_pro_count := 0;
6357: GMD_QC_MIG12.g_mon_spec_ins_count := 0;
6358: GMD_QC_MIG12.g_mon_spec_del_count := 0;
6359: GMD_QC_MIG12.g_mon_spec_upd_count := 0;
6360: GMD_QC_MIG12.g_mon_spec_err_count := 0;
6361:
6362:
6363: FOR l_mon_spec IN get_monitor_spec LOOP
6364:
6362:
6363: FOR l_mon_spec IN get_monitor_spec LOOP
6364:
6365: BEGIN -- monitor spec subprogram
6366: GMD_QC_MIG12.g_mon_spec_pro_count := GMD_QC_MIG12.g_mon_spec_pro_count + 1;
6367:
6368: IF (l_mon_spec.locator_organization_id IS NULL and l_mon_spec.loct_orgn_code IS NOT NULL) THEN
6369: RAISE MON_NO_ORG;
6370: END IF;
6377: /*========================
6378: Get Subinventory.
6379: ========================*/
6380: IF (l_mon_spec.whse_code IS NOT NULL) THEN
6381: GMD_QC_MIG12.GET_WHSE_INFO(
6382: l_mon_spec.whse_code,
6383: ls_organization_id,
6384: l_subinv_ind,
6385: l_mon_loct_ctl);
6410: Get Locator Id.
6411: =========================*/
6412:
6413: IF (l_mon_spec.location IS NOT NULL) THEN
6414: l_locator_id := GMD_QC_MIG12.GET_LOCATOR_ID(l_mon_spec.whse_code, l_mon_spec.location);
6415: IF (l_locator_id IS NULL) THEN
6416: IF (l_mon_loct_ctl = 2) THEN
6417: /*======================================
6418: Create a Non-validated location.
6434: ELSE
6435: RAISE MON_LOCATOR_ID;
6436: END IF;
6437: ELSE
6438: GMD_QC_MIG12.GET_SUBINV_DATA(l_locator_id,
6439: l_subinv,
6440: lsub_organization_id);
6441:
6442: IF (lsub_organization_id IS NULL) THEN
6482: IF (p_commit = FND_API.G_TRUE) THEN
6483: COMMIT;
6484: END IF;
6485:
6486: GMD_QC_MIG12.g_mon_spec_upd_count := GMD_QC_MIG12.g_mon_spec_upd_count + 1;
6487:
6488: ELSE --orgn code is null
6489: /*=========================================
6490: Loop and get all samples orgs that
6508: IF (p_commit = FND_API.G_TRUE) THEN
6509: COMMIT;
6510: END IF;
6511:
6512: GMD_QC_MIG12.g_mon_spec_del_count := GMD_QC_MIG12.g_mon_spec_del_count + 1;
6513: RAISE MON_SPEC_DELETE;
6514:
6515: END IF; -- check if sample found.
6516:
6550: IF (p_commit = FND_API.G_TRUE) THEN
6551: COMMIT;
6552: END IF;
6553:
6554: GMD_QC_MIG12.g_mon_spec_upd_count := GMD_QC_MIG12.g_mon_spec_upd_count + 1;
6555:
6556: EXCEPTION
6557: WHEN NEXT_IN_MON_LINE THEN
6558: NULL;
6595: Clone the record using the Sample organization.
6596: ==================================================*/
6597:
6598: IF (l_mon_spec.text_code IS NOT NULL AND l_mon_spec.text_code > 0) THEN
6599: l_text_code := GMD_QC_MIG12.COPY_TEXT(l_mon_spec.text_code, p_migration_run_id);
6600: ELSE
6601: l_text_code := NULL;
6602: END IF;
6603:
6675: l_mon_spec.RESOURCE_ORGANIZATION_ID
6676: );
6677:
6678:
6679: GMD_QC_MIG12.g_mon_spec_ins_count := GMD_QC_MIG12.g_mon_spec_ins_count + 1;
6680:
6681: << NEXT_MON_SAMPLE >>
6682:
6683: FETCH get_mon_sample_org INTO l_sample_orgn_code, l_sample_organization_id;
6709: p_param2 => 'LOCT_ORGN_CODE',
6710: p_param3 => 'SPEC_VR_ID',
6711: p_param4 => to_char(l_mon_spec.spec_vr_id),
6712: p_app_short_name => 'GMD');
6713: GMD_QC_MIG12.g_mon_spec_err_count := GMD_QC_MIG12.g_mon_spec_err_count + 1;
6714: x_exception_count := x_exception_count + 1;
6715:
6716: WHEN MON_NO_RES_ORG THEN
6717: GMA_COMMON_LOGGING.gma_migration_central_log (
6727: p_param2 => 'RESOURCE_ORGN_CODE',
6728: p_param3 => 'SPEC_VR_ID',
6729: p_param4 => to_char(l_mon_spec.spec_vr_id),
6730: p_app_short_name => 'GMD');
6731: GMD_QC_MIG12.g_mon_spec_err_count := GMD_QC_MIG12.g_mon_spec_err_count + 1;
6732: x_exception_count := x_exception_count + 1;
6733:
6734: WHEN MON_WHSE_ERROR THEN
6735: GMA_COMMON_LOGGING.gma_migration_central_log (
6745: p_param2 => 'WHSE_CODE',
6746: p_param3 => 'SPEC_VR_ID',
6747: p_param4 => to_char(l_mon_spec.spec_vr_id),
6748: p_app_short_name => 'GMD');
6749: GMD_QC_MIG12.g_mon_spec_err_count := GMD_QC_MIG12.g_mon_spec_err_count + 1;
6750: x_exception_count := x_exception_count + 1;
6751:
6752: WHEN MON_SUB_MISMATCH THEN
6753: GMA_COMMON_LOGGING.gma_migration_central_log (
6766: p_param3 => l_mon_spec.whse_code,
6767: p_param4 => to_char(l_organization_id),
6768: p_param5 => to_char(ls_organization_id),
6769: p_app_short_name => 'GMD');
6770: GMD_QC_MIG12.g_mon_spec_err_count := GMD_QC_MIG12.g_mon_spec_err_count + 1;
6771: x_exception_count := x_exception_count + 1;
6772:
6773: WHEN MON_CREATE_LOC THEN
6774: GMA_COMMON_LOGGING.gma_migration_central_log (
6782: p_param1 => 'SPEC_VR_ID',
6783: p_param2 => to_char(l_mon_spec.spec_vr_id),
6784: p_param3 => 'LOCATION',
6785: p_app_short_name => 'GMD');
6786: GMD_QC_MIG12.g_mon_spec_err_count := GMD_QC_MIG12.g_mon_spec_err_count + 1;
6787: x_exception_count := x_exception_count + 1;
6788:
6789: WHEN MON_LOCATOR_ID THEN
6790: GMA_COMMON_LOGGING.gma_migration_central_log (
6802: p_param3 => 'LOCATION',
6803: p_param4 => 'SPEC_VR_ID',
6804: p_param5 => to_char(l_mon_spec.spec_vr_id),
6805: p_app_short_name => 'GMD');
6806: GMD_QC_MIG12.g_mon_spec_err_count := GMD_QC_MIG12.g_mon_spec_err_count + 1;
6807: x_exception_count := x_exception_count + 1;
6808:
6809: WHEN MON_SUBINV_ERROR THEN
6810: GMA_COMMON_LOGGING.gma_migration_central_log (
6818: p_param1 => to_char(l_locator_id),
6819: p_param2 => 'SPEC_VR_ID',
6820: p_param3 => to_char(l_mon_spec.spec_vr_id),
6821: p_app_short_name => 'GMD');
6822: GMD_QC_MIG12.g_mon_spec_err_count := GMD_QC_MIG12.g_mon_spec_err_count + 1;
6823: x_exception_count := x_exception_count + 1;
6824:
6825:
6826: WHEN MON_SPEC_DELETE THEN
6847: p_param1 => l_sample_orgn_code,
6848: p_param2 => 'SPEC_VR_ID',
6849: p_param3 => to_char(l_mon_spec.spec_vr_id),
6850: p_app_short_name => 'GMD');
6851: GMD_QC_MIG12.g_mon_spec_err_count := GMD_QC_MIG12.g_mon_spec_err_count + 1;
6852: x_exception_count := x_exception_count + 1;
6853:
6854: END; -- monitor spec subprogram
6855:
6859: /*==============================================
6860: Log end of gmd_monitoring_spec_vrs migration.
6861: ==============================================*/
6862:
6863: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
6864:
6865:
6866: RETURN;
6867:
6868:
6869: EXCEPTION
6870:
6871: WHEN OTHERS THEN
6872: LOG_SPEC_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
6873: GMA_COMMON_LOGGING.gma_migration_central_log (
6874: p_run_id => p_migration_run_id,
6875: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
6876: p_message_token => 'GMA_MIGRATION_DB_ERROR',
7116: l_text_code NUMBER;
7117:
7118: BEGIN
7119:
7120: GMD_QC_MIG12.g_progress_ind := 0;
7121: x_exception_count := 0;
7122:
7123:
7124: /*==============================================
7138: /*===================================
7139: Process gmd_storage_plan_details.
7140: ====================================*/
7141:
7142: GMD_QC_MIG12.g_store_plan_upd_count := 0;
7143: GMD_QC_MIG12.g_store_plan_pro_count := 0;
7144: GMD_QC_MIG12.g_store_plan_err_count := 0;
7145: GMD_QC_MIG12.g_progress_ind := 1;
7146:
7139: Process gmd_storage_plan_details.
7140: ====================================*/
7141:
7142: GMD_QC_MIG12.g_store_plan_upd_count := 0;
7143: GMD_QC_MIG12.g_store_plan_pro_count := 0;
7144: GMD_QC_MIG12.g_store_plan_err_count := 0;
7145: GMD_QC_MIG12.g_progress_ind := 1;
7146:
7147: FOR l_plan_det IN get_plan_details LOOP
7140: ====================================*/
7141:
7142: GMD_QC_MIG12.g_store_plan_upd_count := 0;
7143: GMD_QC_MIG12.g_store_plan_pro_count := 0;
7144: GMD_QC_MIG12.g_store_plan_err_count := 0;
7145: GMD_QC_MIG12.g_progress_ind := 1;
7146:
7147: FOR l_plan_det IN get_plan_details LOOP
7148: BEGIN -- plan details subprogram
7141:
7142: GMD_QC_MIG12.g_store_plan_upd_count := 0;
7143: GMD_QC_MIG12.g_store_plan_pro_count := 0;
7144: GMD_QC_MIG12.g_store_plan_err_count := 0;
7145: GMD_QC_MIG12.g_progress_ind := 1;
7146:
7147: FOR l_plan_det IN get_plan_details LOOP
7148: BEGIN -- plan details subprogram
7149:
7146:
7147: FOR l_plan_det IN get_plan_details LOOP
7148: BEGIN -- plan details subprogram
7149:
7150: GMD_QC_MIG12.g_store_plan_pro_count := GMD_QC_MIG12.g_store_plan_pro_count + 1;
7151:
7152: /*=============================================
7153: Get organization id for the subinventory.
7154: =============================================*/
7153: Get organization id for the subinventory.
7154: =============================================*/
7155:
7156: IF (l_plan_det.whse_code IS NOT NULL) THEN
7157: GMD_QC_MIG12.GET_WHSE_INFO (
7158: p_whse_code => l_plan_det.whse_code,
7159: x_organization_id => l_plan_org_id,
7160: x_subinv_ind => l_plan_subinv_ind,
7161: x_loct_ctl => l_splan_loct_ctl);
7173: IF (l_plan_det.location IS NOT NULL) THEN
7174: IF (l_plan_det.location = 'NONE') THEN
7175: l_plan_locator_id := NULL;
7176: ELSE
7177: l_plan_locator_id := GMD_QC_MIG12.GET_LOCATOR_ID (
7178: p_whse_code => l_plan_det.whse_code,
7179: p_location => l_plan_det.location);
7180:
7181: IF (l_plan_locator_id IS NULL) THEN
7204: /*=========================================
7205: Compare locator's subinventory to
7206: subinventory already mapped.
7207: =========================================*/
7208: GMD_QC_MIG12.GET_SUBINV_DATA(l_plan_locator_id,
7209: l_subinv,
7210: lsub_organization_id);
7211:
7212: IF (lsub_organization_id IS NULL) THEN
7252: IF (p_commit = FND_API.G_TRUE) THEN
7253: COMMIT;
7254: END IF;
7255:
7256: GMD_QC_MIG12.g_store_plan_upd_count := GMD_QC_MIG12.g_store_plan_upd_count + 1;
7257:
7258: EXCEPTION
7259:
7260: WHEN SP_WHSE_ERROR THEN
7271: p_param2 => 'WHSE_CODE',
7272: p_param3 => 'STORAGE_PLAN_DETAIL_ID',
7273: p_param4 => l_plan_det.storage_plan_detail_id,
7274: p_app_short_name => 'GMD');
7275: GMD_QC_MIG12.g_store_plan_err_count := GMD_QC_MIG12.g_store_plan_err_count + 1;
7276: x_exception_count := x_exception_count + 1;
7277:
7278: WHEN SP_CREATE_LOCATION THEN
7279: GMA_COMMON_LOGGING.gma_migration_central_log (
7287: p_param1 => 'STORAGE_PLAN_DETAIL_ID',
7288: p_param2 => l_plan_det.storage_plan_detail_id,
7289: p_param3 => 'LOCATION',
7290: p_app_short_name => 'GMD');
7291: GMD_QC_MIG12.g_store_plan_err_count := GMD_QC_MIG12.g_store_plan_err_count + 1;
7292: x_exception_count := x_exception_count + 1;
7293:
7294: WHEN SP_LOCATOR_ID THEN
7295: GMA_COMMON_LOGGING.gma_migration_central_log (
7307: p_param3 => 'LOCATION',
7308: p_param4 => 'STORAGE_PLAN_DETAIL_ID',
7309: p_param5 => l_plan_det.storage_plan_detail_id,
7310: p_app_short_name => 'GMD');
7311: GMD_QC_MIG12.g_store_plan_err_count := GMD_QC_MIG12.g_store_plan_err_count + 1;
7312: x_exception_count := x_exception_count + 1;
7313:
7314:
7315: WHEN SP_SUBINV_ERROR THEN
7324: p_param1 => to_char(l_plan_locator_id),
7325: p_param2 => 'STORAGE_PLAN_DETAIL_ID',
7326: p_param3 => to_char(l_plan_det.storage_plan_detail_id),
7327: p_app_short_name => 'GMD');
7328: GMD_QC_MIG12.g_store_plan_err_count := GMD_QC_MIG12.g_store_plan_err_count + 1;
7329: x_exception_count := x_exception_count + 1;
7330:
7331: -- Bug# 5109039
7332: WHEN DEFAULT_SS_ORG_ERROR THEN
7335: p_log_level => FND_LOG.LEVEL_ERROR,
7336: p_message_token => 'GMD_MIG_DEF_SS_ORG_ERROR',
7337: p_context => 'Quality Stability Studies - gmd_storage_plan_details',
7338: p_app_short_name => 'GMD');
7339: GMD_QC_MIG12.g_store_plan_err_count := GMD_QC_MIG12.g_store_plan_err_count + 1;
7340: x_exception_count := x_exception_count + 1;
7341:
7342: WHEN OTHERS THEN
7343: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
7339: GMD_QC_MIG12.g_store_plan_err_count := GMD_QC_MIG12.g_store_plan_err_count + 1;
7340: x_exception_count := x_exception_count + 1;
7341:
7342: WHEN OTHERS THEN
7343: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
7344: GMA_COMMON_LOGGING.gma_migration_central_log (
7345: p_run_id => p_migration_run_id,
7346: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
7347: p_message_token => 'GMA_MIGRATION_DB_ERROR',
7359: /*=====================================================
7360: Log number of updates to gmd_storage_plan_details.
7361: =====================================================*/
7362:
7363: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
7364:
7365:
7366: /*==============================================
7367: Log Start of gmd_stability_studies.
7380: /*=====================================
7381: Migrate gmd_stability_studies_b.
7382: =====================================*/
7383:
7384: GMD_QC_MIG12.g_stab_pro_count := 0;
7385: GMD_QC_MIG12.g_stab_upd_count := 0;
7386: GMD_QC_MIG12.g_stab_err_count := 0;
7387: GMD_QC_MIG12.g_progress_ind := 2;
7388:
7381: Migrate gmd_stability_studies_b.
7382: =====================================*/
7383:
7384: GMD_QC_MIG12.g_stab_pro_count := 0;
7385: GMD_QC_MIG12.g_stab_upd_count := 0;
7386: GMD_QC_MIG12.g_stab_err_count := 0;
7387: GMD_QC_MIG12.g_progress_ind := 2;
7388:
7389: FOR l_stab_rec in get_stab LOOP
7382: =====================================*/
7383:
7384: GMD_QC_MIG12.g_stab_pro_count := 0;
7385: GMD_QC_MIG12.g_stab_upd_count := 0;
7386: GMD_QC_MIG12.g_stab_err_count := 0;
7387: GMD_QC_MIG12.g_progress_ind := 2;
7388:
7389: FOR l_stab_rec in get_stab LOOP
7390: BEGIN -- stab study subprogram
7383:
7384: GMD_QC_MIG12.g_stab_pro_count := 0;
7385: GMD_QC_MIG12.g_stab_upd_count := 0;
7386: GMD_QC_MIG12.g_stab_err_count := 0;
7387: GMD_QC_MIG12.g_progress_ind := 2;
7388:
7389: FOR l_stab_rec in get_stab LOOP
7390: BEGIN -- stab study subprogram
7391: GMD_QC_MIG12.g_stab_pro_count := GMD_QC_MIG12.g_stab_pro_count + 1;
7387: GMD_QC_MIG12.g_progress_ind := 2;
7388:
7389: FOR l_stab_rec in get_stab LOOP
7390: BEGIN -- stab study subprogram
7391: GMD_QC_MIG12.g_stab_pro_count := GMD_QC_MIG12.g_stab_pro_count + 1;
7392: /*================================
7393: Migrate organization.
7394: ================================*/
7395:
7434: IF (p_commit = FND_API.G_TRUE) THEN
7435: COMMIT;
7436: END IF;
7437:
7438: GMD_QC_MIG12.g_stab_upd_count := GMD_QC_MIG12.g_stab_upd_count + 1;
7439:
7440: EXCEPTION
7441: WHEN STAB_NO_ORG THEN
7442: GMA_COMMON_LOGGING.gma_migration_central_log (
7452: p_param2 => 'ORGN_CODE',
7453: p_param3 => 'SS_ID',
7454: p_param4 => to_char(l_stab_rec.ss_id),
7455: p_app_short_name => 'GMD');
7456: GMD_QC_MIG12.g_stab_err_count := GMD_QC_MIG12.g_stab_err_count + 1;
7457: x_exception_count := x_exception_count + 1;
7458:
7459: WHEN STAB_NO_LAB_ORG THEN
7460: GMA_COMMON_LOGGING.gma_migration_central_log (
7470: p_param2 => 'QC_LAB_ORGN_CODE',
7471: p_param3 => 'SS_ID',
7472: p_param4 => to_char(l_stab_rec.ss_id),
7473: p_app_short_name => 'GMD');
7474: GMD_QC_MIG12.g_stab_err_count := GMD_QC_MIG12.g_stab_err_count + 1;
7475: x_exception_count := x_exception_count + 1;
7476:
7477: WHEN STAB_ODM_ITEM THEN
7478: GMA_COMMON_LOGGING.gma_migration_central_log (
7488: p_param2 => to_char(l_stab_rec.item_id),
7489: p_param3 => 'SS_ID',
7490: p_param4 => to_char(l_stab_rec.ss_id),
7491: p_app_short_name => 'GMD');
7492: GMD_QC_MIG12.g_stab_err_count := GMD_QC_MIG12.g_stab_err_count + 1;
7493: x_exception_count := x_exception_count + 1;
7494:
7495: WHEN OTHERS THEN
7496: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
7492: GMD_QC_MIG12.g_stab_err_count := GMD_QC_MIG12.g_stab_err_count + 1;
7493: x_exception_count := x_exception_count + 1;
7494:
7495: WHEN OTHERS THEN
7496: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
7497: GMA_COMMON_LOGGING.gma_migration_central_log (
7498: p_run_id => p_migration_run_id,
7499: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
7500: p_message_token => 'GMA_MIGRATION_DB_ERROR',
7513: /*==============================================
7514: Log End of gmd_stability_studies_b.
7515: ==============================================*/
7516:
7517: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
7518:
7519:
7520: /*==============================================
7521: Log Start of gmd_ss_material_sources.
7534: /*=======================================
7535: Migrate gmd_ss_material_sources.
7536: =======================================*/
7537:
7538: GMD_QC_MIG12.g_matl_source_pro_count := 0;
7539: GMD_QC_MIG12.g_matl_source_err_count := 0;
7540: GMD_QC_MIG12.g_matl_source_upd_count := 0;
7541: GMD_QC_MIG12.g_progress_ind := 3;
7542:
7535: Migrate gmd_ss_material_sources.
7536: =======================================*/
7537:
7538: GMD_QC_MIG12.g_matl_source_pro_count := 0;
7539: GMD_QC_MIG12.g_matl_source_err_count := 0;
7540: GMD_QC_MIG12.g_matl_source_upd_count := 0;
7541: GMD_QC_MIG12.g_progress_ind := 3;
7542:
7543: FOR l_matl_rec IN get_matl_src LOOP
7536: =======================================*/
7537:
7538: GMD_QC_MIG12.g_matl_source_pro_count := 0;
7539: GMD_QC_MIG12.g_matl_source_err_count := 0;
7540: GMD_QC_MIG12.g_matl_source_upd_count := 0;
7541: GMD_QC_MIG12.g_progress_ind := 3;
7542:
7543: FOR l_matl_rec IN get_matl_src LOOP
7544: BEGIN -- matl src subprogram
7537:
7538: GMD_QC_MIG12.g_matl_source_pro_count := 0;
7539: GMD_QC_MIG12.g_matl_source_err_count := 0;
7540: GMD_QC_MIG12.g_matl_source_upd_count := 0;
7541: GMD_QC_MIG12.g_progress_ind := 3;
7542:
7543: FOR l_matl_rec IN get_matl_src LOOP
7544: BEGIN -- matl src subprogram
7545: GMD_QC_MIG12.g_matl_source_pro_count := GMD_QC_MIG12.g_matl_source_pro_count + 1;
7541: GMD_QC_MIG12.g_progress_ind := 3;
7542:
7543: FOR l_matl_rec IN get_matl_src LOOP
7544: BEGIN -- matl src subprogram
7545: GMD_QC_MIG12.g_matl_source_pro_count := GMD_QC_MIG12.g_matl_source_pro_count + 1;
7546: /*===================================
7547: Migrate organization.
7548: Convert plant code if it exists.
7549: ===================================*/
7624:
7625: IF (p_commit = FND_API.G_TRUE) THEN
7626: COMMIT;
7627: END IF;
7628: GMD_QC_MIG12.g_matl_source_upd_count := GMD_QC_MIG12.g_matl_source_upd_count + 1;
7629:
7630: EXCEPTION
7631: WHEN MATL_NO_ORG THEN
7632: GMA_COMMON_LOGGING.gma_migration_central_log (
7642: p_param2 => 'PLANT_CODE',
7643: p_param3 => 'SOURCE_ID',
7644: p_param4 => to_char(l_matl_rec.source_id),
7645: p_app_short_name => 'GMD');
7646: GMD_QC_MIG12.g_matl_source_err_count := GMD_QC_MIG12.g_matl_source_err_count + 1;
7647: x_exception_count := x_exception_count + 1;
7648:
7649: WHEN MATL_GET_SS THEN
7650: GMA_COMMON_LOGGING.gma_migration_central_log (
7658: p_param1 => to_char(l_matl_rec.ss_id),
7659: p_param2 => 'SOURCE_ID',
7660: p_param3 => to_char(l_matl_rec.source_id),
7661: p_app_short_name => 'GMD');
7662: GMD_QC_MIG12.g_matl_source_err_count := GMD_QC_MIG12.g_matl_source_err_count + 1;
7663: x_exception_count := x_exception_count + 1;
7664:
7665: WHEN MATL_PLANT_ORG THEN
7666: GMA_COMMON_LOGGING.gma_migration_central_log (
7676: p_param2 => 'SS_ORGN_CODE',
7677: p_param3 => 'SOURCE_ID',
7678: p_param4 => to_char(l_matl_rec.source_id),
7679: p_app_short_name => 'GMD');
7680: GMD_QC_MIG12.g_matl_source_err_count := GMD_QC_MIG12.g_matl_source_err_count + 1;
7681: x_exception_count := x_exception_count + 1;
7682:
7683: WHEN MATL_MIG_LOT THEN
7684: GMA_COMMON_LOGGING.gma_migration_central_log (
7690: p_token2 => 'ROWV',
7691: p_param1 => 'SOURCE_ID',
7692: p_param2 => to_char(l_matl_rec.source_id),
7693: p_app_short_name => 'GMD');
7694: GMD_QC_MIG12.g_matl_source_err_count := GMD_QC_MIG12.g_matl_source_err_count + 1;
7695: x_exception_count := x_exception_count + 1;
7696:
7697: WHEN OTHERS THEN
7698: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
7694: GMD_QC_MIG12.g_matl_source_err_count := GMD_QC_MIG12.g_matl_source_err_count + 1;
7695: x_exception_count := x_exception_count + 1;
7696:
7697: WHEN OTHERS THEN
7698: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
7699: GMA_COMMON_LOGGING.gma_migration_central_log (
7700: p_run_id => p_migration_run_id,
7701: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
7702: p_message_token => 'GMA_MIGRATION_DB_ERROR',
7715: /*==============================================
7716: Log End of gmd_ss_material_sources.
7717: ==============================================*/
7718:
7719: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
7720:
7721: /*===================================
7722: Log Start of gmd_ss_variants.
7723: ===================================*/
7731: p_param1 => 'GMD_SS_VARIANTS',
7732: p_context => 'Quality Stability Studies',
7733: p_app_short_name => 'GMA');
7734:
7735: GMD_QC_MIG12.g_ss_variant_pro_count := 0;
7736: GMD_QC_MIG12.g_ss_variant_err_count := 0;
7737: GMD_QC_MIG12.g_ss_variant_upd_count := 0;
7738: GMD_QC_MIG12.g_progress_ind := 4;
7739:
7732: p_context => 'Quality Stability Studies',
7733: p_app_short_name => 'GMA');
7734:
7735: GMD_QC_MIG12.g_ss_variant_pro_count := 0;
7736: GMD_QC_MIG12.g_ss_variant_err_count := 0;
7737: GMD_QC_MIG12.g_ss_variant_upd_count := 0;
7738: GMD_QC_MIG12.g_progress_ind := 4;
7739:
7740: /*==============================
7733: p_app_short_name => 'GMA');
7734:
7735: GMD_QC_MIG12.g_ss_variant_pro_count := 0;
7736: GMD_QC_MIG12.g_ss_variant_err_count := 0;
7737: GMD_QC_MIG12.g_ss_variant_upd_count := 0;
7738: GMD_QC_MIG12.g_progress_ind := 4;
7739:
7740: /*==============================
7741: Migrate gmd_ss_variants.
7734:
7735: GMD_QC_MIG12.g_ss_variant_pro_count := 0;
7736: GMD_QC_MIG12.g_ss_variant_err_count := 0;
7737: GMD_QC_MIG12.g_ss_variant_upd_count := 0;
7738: GMD_QC_MIG12.g_progress_ind := 4;
7739:
7740: /*==============================
7741: Migrate gmd_ss_variants.
7742: ==============================*/
7742: ==============================*/
7743:
7744: FOR l_var_rec IN get_ss_variant LOOP
7745: BEGIN -- variant subprogram
7746: GMD_QC_MIG12.g_ss_variant_pro_count := GMD_QC_MIG12.g_ss_variant_pro_count + 1;
7747:
7748: /*======================================
7749: Check if uom migrated successfully.
7750: Removed this check.
7754: Get org_id and subinventory
7755: *===============================*/
7756:
7757: IF (l_var_rec.storage_whse_code IS NOT NULL) THEN
7758: GMD_QC_MIG12.GET_WHSE_INFO (
7759: p_whse_code => l_var_rec.storage_whse_code,
7760: x_organization_id => l_storage_organization_id,
7761: x_subinv_ind => l_storage_subinvind,
7762: x_loct_ctl => l_svar_loct_ctl);
7773: IF (l_var_rec.storage_location IS NOT NULL) THEN
7774: IF (l_var_rec.storage_location = 'NONE') THEN
7775: l_storage_locator_id := NULL;
7776: ELSE
7777: l_storage_locator_id := GMD_QC_MIG12.GET_LOCATOR_ID (
7778: p_whse_code => l_var_rec.storage_whse_code,
7779: p_location => l_var_rec.storage_location);
7780: IF (l_storage_locator_id IS NULL) THEN
7781: IF (l_svar_loct_ctl = 2) THEN
7799: ELSE -- validated location
7800: RAISE VAR_LOCATOR_ID;
7801: END IF; -- validated location
7802: ELSE -- locator is not null
7803: GMD_QC_MIG12.GET_SUBINV_DATA(l_storage_locator_id,
7804: l_subinv,
7805: lsub_organization_id);
7806:
7807: IF (lsub_organization_id IS NULL) THEN
7840: IF (p_commit = FND_API.G_TRUE) THEN
7841: COMMIT;
7842: END IF;
7843:
7844: GMD_QC_MIG12.g_ss_variant_upd_count := GMD_QC_MIG12.g_ss_variant_upd_count + 1;
7845:
7846: EXCEPTION
7847:
7848: WHEN VAR_WHSE_ERROR THEN
7859: p_param2 => 'STORAGE_WHSE_CODE',
7860: p_param3 => 'VARIANT_ID',
7861: p_param4 => to_char(l_var_rec.variant_id),
7862: p_app_short_name => 'GMD');
7863: GMD_QC_MIG12.g_ss_variant_err_count := GMD_QC_MIG12.g_ss_variant_err_count + 1;
7864: x_exception_count := x_exception_count + 1;
7865:
7866: WHEN VAR_CREATE_LOC THEN
7867: GMA_COMMON_LOGGING.gma_migration_central_log (
7875: p_param1 => 'VARIANT_ID',
7876: p_param2 => to_char(l_var_rec.variant_id),
7877: p_param3 => 'STORAGE_LOCATION',
7878: p_app_short_name => 'GMD');
7879: GMD_QC_MIG12.g_ss_variant_err_count := GMD_QC_MIG12.g_ss_variant_err_count + 1;
7880: x_exception_count := x_exception_count + 1;
7881:
7882: WHEN VAR_LOCATOR_ID THEN
7883: GMA_COMMON_LOGGING.gma_migration_central_log (
7895: p_param3 => 'STORAGE_LOCATION',
7896: p_param4 => 'VARIANT_ID',
7897: p_param5 => to_char(l_var_rec.variant_id),
7898: p_app_short_name => 'GMD');
7899: GMD_QC_MIG12.g_ss_variant_err_count := GMD_QC_MIG12.g_ss_variant_err_count + 1;
7900: x_exception_count := x_exception_count + 1;
7901:
7902: WHEN VAR_SUBINV_ERROR THEN
7903: GMA_COMMON_LOGGING.gma_migration_central_log (
7911: p_param1 => to_char(l_storage_locator_id),
7912: p_param2 => 'VARIANT_ID',
7913: p_param3 => to_char(l_var_rec.variant_id),
7914: p_app_short_name => 'GMD');
7915: GMD_QC_MIG12.g_ss_variant_err_count := GMD_QC_MIG12.g_ss_variant_err_count + 1;
7916: x_exception_count := x_exception_count + 1;
7917:
7918:
7919: WHEN OTHERS THEN
7916: x_exception_count := x_exception_count + 1;
7917:
7918:
7919: WHEN OTHERS THEN
7920: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
7921: GMA_COMMON_LOGGING.gma_migration_central_log (
7922: p_run_id => p_migration_run_id,
7923: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
7924: p_message_token => 'GMA_MIGRATION_DB_ERROR',
7937: /*==============================================
7938: Log End of gmd_ss_variants.
7939: ==============================================*/
7940:
7941: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
7942:
7943: /*==============================================
7944: Retrieve Default Storage Package Orgn Code.
7945: Source is gmd_migrate_parms.
7952: IF (l_def_ss_org IS NULL) THEN
7953: /*==============================================
7954: Get Default Lab Type Profile Value
7955: ==============================================*/
7956: l_def_ss_org := GMD_QC_MIG12.GET_PROFILE_VALUE('GEMMS_DEFAULT_LAB_TYPE');
7957:
7958: IF (l_def_ss_org IS NULL) THEN
7959: RAISE NULL_DEFAULT_LAB;
7960: END IF;
7992: ROLLBACK;
7993: RETURN;
7994:
7995: WHEN OTHERS THEN
7996: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
7997: GMA_COMMON_LOGGING.gma_migration_central_log (
7998: p_run_id => p_migration_run_id,
7999: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
8000: p_message_token => 'GMA_MIGRATION_DB_ERROR',
8021: p_param1 => 'GMD_SS_STORAGE_PACKAGE',
8022: p_context => 'Quality Stability Studies',
8023: p_app_short_name => 'GMA');
8024:
8025: GMD_QC_MIG12.g_store_pack_upd_count := 0;
8026: GMD_QC_MIG12.g_store_pack_ins_count := 0;
8027: GMD_QC_MIG12.g_store_pack_pro_count := 0;
8028: GMD_QC_MIG12.g_store_pack_err_count := 0;
8029: GMD_QC_MIG12.g_progress_ind := 5;
8022: p_context => 'Quality Stability Studies',
8023: p_app_short_name => 'GMA');
8024:
8025: GMD_QC_MIG12.g_store_pack_upd_count := 0;
8026: GMD_QC_MIG12.g_store_pack_ins_count := 0;
8027: GMD_QC_MIG12.g_store_pack_pro_count := 0;
8028: GMD_QC_MIG12.g_store_pack_err_count := 0;
8029: GMD_QC_MIG12.g_progress_ind := 5;
8030:
8023: p_app_short_name => 'GMA');
8024:
8025: GMD_QC_MIG12.g_store_pack_upd_count := 0;
8026: GMD_QC_MIG12.g_store_pack_ins_count := 0;
8027: GMD_QC_MIG12.g_store_pack_pro_count := 0;
8028: GMD_QC_MIG12.g_store_pack_err_count := 0;
8029: GMD_QC_MIG12.g_progress_ind := 5;
8030:
8031: FOR l_store_pack IN get_store_pack LOOP
8024:
8025: GMD_QC_MIG12.g_store_pack_upd_count := 0;
8026: GMD_QC_MIG12.g_store_pack_ins_count := 0;
8027: GMD_QC_MIG12.g_store_pack_pro_count := 0;
8028: GMD_QC_MIG12.g_store_pack_err_count := 0;
8029: GMD_QC_MIG12.g_progress_ind := 5;
8030:
8031: FOR l_store_pack IN get_store_pack LOOP
8032: BEGIN -- end get_store_pack subprogram
8025: GMD_QC_MIG12.g_store_pack_upd_count := 0;
8026: GMD_QC_MIG12.g_store_pack_ins_count := 0;
8027: GMD_QC_MIG12.g_store_pack_pro_count := 0;
8028: GMD_QC_MIG12.g_store_pack_err_count := 0;
8029: GMD_QC_MIG12.g_progress_ind := 5;
8030:
8031: FOR l_store_pack IN get_store_pack LOOP
8032: BEGIN -- end get_store_pack subprogram
8033: GMD_QC_MIG12.g_store_pack_pro_count := GMD_QC_MIG12.g_store_pack_pro_count + 1;
8029: GMD_QC_MIG12.g_progress_ind := 5;
8030:
8031: FOR l_store_pack IN get_store_pack LOOP
8032: BEGIN -- end get_store_pack subprogram
8033: GMD_QC_MIG12.g_store_pack_pro_count := GMD_QC_MIG12.g_store_pack_pro_count + 1;
8034: /*======================================
8035: Check if uom migrated successfully.
8036: Removed this check.
8037: ======================================*/
8077: inventory_item_id = l_store_pack_invitem_id,
8078: migrated_ind = 1
8079: WHERE package_id = l_store_pack.package_id;
8080:
8081: GMD_QC_MIG12.g_store_pack_upd_count := GMD_QC_MIG12.g_store_pack_upd_count + 1;
8082: ELSE
8083: /*========================================
8084: Use Org from Stability Study.
8085: ========================================*/
8120: migrated_ind = 1
8121: WHERE package_id = l_store_pack.package_id;
8122:
8123:
8124: GMD_QC_MIG12.g_store_pack_upd_count := GMD_QC_MIG12.g_store_pack_upd_count + 1;
8125:
8126: /*==========================================
8127: Continue with Stability Studies.
8128: ==========================================*/
8132: /*=================================
8133: Create Text Code if it exists.
8134: =================================*/
8135: IF (l_store_pack.text_code IS NOT NULL AND l_store_pack.text_code > 0) THEN
8136: l_text_code := GMD_QC_MIG12.COPY_TEXT(l_store_pack.text_code, p_migration_run_id);
8137: ELSE
8138: l_text_code := NULL;
8139: END IF;
8140:
8227: l_store_pack.QUANTITY_UOM,
8228: l_store_pack.INVENTORY_ITEM_ID
8229: );
8230:
8231: GMD_QC_MIG12.g_store_pack_ins_count := GMD_QC_MIG12.g_store_pack_ins_count + 1;
8232:
8233: /*================================
8234: Update gmd_ss_variants to point
8235: to new package record.
8270: p_param3 => 'PACKAGE_ID',
8271: p_param4 => to_char(l_store_pack.package_id),
8272: p_app_short_name => 'GMD');
8273: ROLLBACK;
8274: GMD_QC_MIG12.g_store_pack_err_count := GMD_QC_MIG12.g_store_pack_err_count + 1;
8275: x_exception_count := x_exception_count + 1;
8276:
8277:
8278: WHEN STORE_SS_ORG THEN
8288: p_param2 => 'PACKAGE_ID',
8289: p_param3 => to_char(l_store_pack.package_id),
8290: p_app_short_name => 'GMD');
8291: ROLLBACK;
8292: GMD_QC_MIG12.g_store_pack_err_count := GMD_QC_MIG12.g_store_pack_err_count + 1;
8293: x_exception_count := x_exception_count + 1;
8294:
8295: WHEN STORE_ODM_ITEM THEN
8296: GMA_COMMON_LOGGING.gma_migration_central_log (
8307: p_param3 => 'PACKAGE_ID',
8308: p_param4 => to_char(l_store_pack.package_id),
8309: p_app_short_name => 'GMD');
8310: ROLLBACK;
8311: GMD_QC_MIG12.g_store_pack_err_count := GMD_QC_MIG12.g_store_pack_err_count + 1;
8312: x_exception_count := x_exception_count + 1;
8313:
8314:
8315: WHEN OTHERS THEN
8312: x_exception_count := x_exception_count + 1;
8313:
8314:
8315: WHEN OTHERS THEN
8316: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
8317: GMA_COMMON_LOGGING.gma_migration_central_log (
8318: p_run_id => p_migration_run_id,
8319: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
8320: p_message_token => 'GMA_MIGRATION_DB_ERROR',
8332: /*==============================================
8333: Log End of gmd_ss_storage_package.
8334: ==============================================*/
8335:
8336: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
8337:
8338:
8339: /*==============================================
8340: Log Start of gmd_ss_storage_history.
8349: p_param1 => 'GMD_SS_STORAGE_HISTORY',
8350: p_context => 'Quality Stability Studies',
8351: p_app_short_name => 'GMA');
8352:
8353: GMD_QC_MIG12.g_ss_storehist_pro_count := 0;
8354: GMD_QC_MIG12.g_ss_storehist_err_count := 0;
8355: GMD_QC_MIG12.g_ss_storehist_upd_count := 0;
8356: GMD_QC_MIG12.g_progress_ind := 6;
8357:
8350: p_context => 'Quality Stability Studies',
8351: p_app_short_name => 'GMA');
8352:
8353: GMD_QC_MIG12.g_ss_storehist_pro_count := 0;
8354: GMD_QC_MIG12.g_ss_storehist_err_count := 0;
8355: GMD_QC_MIG12.g_ss_storehist_upd_count := 0;
8356: GMD_QC_MIG12.g_progress_ind := 6;
8357:
8358: /*====================================
8351: p_app_short_name => 'GMA');
8352:
8353: GMD_QC_MIG12.g_ss_storehist_pro_count := 0;
8354: GMD_QC_MIG12.g_ss_storehist_err_count := 0;
8355: GMD_QC_MIG12.g_ss_storehist_upd_count := 0;
8356: GMD_QC_MIG12.g_progress_ind := 6;
8357:
8358: /*====================================
8359: Migrate gmd_ss_storage_history.
8352:
8353: GMD_QC_MIG12.g_ss_storehist_pro_count := 0;
8354: GMD_QC_MIG12.g_ss_storehist_err_count := 0;
8355: GMD_QC_MIG12.g_ss_storehist_upd_count := 0;
8356: GMD_QC_MIG12.g_progress_ind := 6;
8357:
8358: /*====================================
8359: Migrate gmd_ss_storage_history.
8360: ====================================*/
8360: ====================================*/
8361:
8362: FOR l_hist_rec IN get_ss_history LOOP
8363: BEGIN -- end get_ss_hist subprogram
8364: GMD_QC_MIG12.g_ss_storehist_pro_count := GMD_QC_MIG12.g_ss_storehist_pro_count + 1;
8365: /*===============================
8366: Get org_id and subinventory
8367: ===============================*/
8368:
8366: Get org_id and subinventory
8367: ===============================*/
8368:
8369: IF (l_hist_rec.whse_code IS NOT NULL) THEN
8370: GMD_QC_MIG12.GET_WHSE_INFO (
8371: p_whse_code => l_hist_rec.whse_code,
8372: x_organization_id => l_hist_org_id,
8373: x_subinv_ind => l_hist_subinvind,
8374: x_loct_ctl => l_hist_loct_ctl);
8386: IF (l_hist_rec.location IS NOT NULL) THEN
8387: IF (l_hist_rec.location = 'NONE') THEN
8388: l_hist_locator_id := NULL;
8389: ELSE
8390: l_hist_locator_id := GMD_QC_MIG12.GET_LOCATOR_ID (
8391: p_whse_code => l_hist_rec.whse_code,
8392: p_location => l_hist_rec.location);
8393:
8394: IF (l_hist_locator_id IS NULL) THEN
8416: END IF; -- none location
8417: END IF;
8418:
8419: IF (l_hist_locator_id IS NOT NULL) THEN
8420: GMD_QC_MIG12.GET_SUBINV_DATA(l_hist_locator_id,
8421: l_subinv,
8422: lsub_organization_id);
8423:
8424: IF (lsub_organization_id IS NULL) THEN
8455: IF (p_commit = FND_API.G_TRUE) THEN
8456: COMMIT;
8457: END IF;
8458:
8459: GMD_QC_MIG12.g_ss_storehist_upd_count := GMD_QC_MIG12.g_ss_storehist_upd_count + 1;
8460:
8461: EXCEPTION
8462: WHEN HIST_WHSE_ERROR THEN
8463: GMA_COMMON_LOGGING.gma_migration_central_log (
8473: p_param2 => 'WHSE_CODE',
8474: p_param3 => 'STORAGE_HISTORY_ID',
8475: p_param4 => to_char(l_hist_rec.storage_history_id),
8476: p_app_short_name => 'GMD');
8477: GMD_QC_MIG12.g_ss_storehist_err_count := GMD_QC_MIG12.g_ss_storehist_err_count + 1;
8478: x_exception_count := x_exception_count + 1;
8479:
8480: WHEN HIST_CREATE_LOC THEN
8481: GMA_COMMON_LOGGING.gma_migration_central_log (
8489: p_param1 => 'STORAGE_HISTORY_ID',
8490: p_param2 => to_char(l_hist_rec.storage_history_id),
8491: p_param3 => 'LOCATION',
8492: p_app_short_name => 'GMD');
8493: GMD_QC_MIG12.g_ss_storehist_err_count := GMD_QC_MIG12.g_ss_storehist_err_count + 1;
8494: x_exception_count := x_exception_count + 1;
8495:
8496: WHEN HIST_LOCATOR_ID THEN
8497: GMA_COMMON_LOGGING.gma_migration_central_log (
8509: p_param3 => 'LOCATION',
8510: p_param4 => 'STORAGE_HISTORY_ID',
8511: p_param5 => to_char(l_hist_rec.storage_history_id),
8512: p_app_short_name => 'GMD');
8513: GMD_QC_MIG12.g_ss_storehist_err_count := GMD_QC_MIG12.g_ss_storehist_err_count + 1;
8514: x_exception_count := x_exception_count + 1;
8515:
8516: WHEN HIST_SUBINV_ERROR THEN
8517: GMA_COMMON_LOGGING.gma_migration_central_log (
8525: p_param1 => to_char(l_hist_locator_id),
8526: p_param2 => 'STORAGE_HISTORY_ID',
8527: p_param3 => to_char(l_hist_rec.storage_history_id),
8528: p_app_short_name => 'GMD');
8529: GMD_QC_MIG12.g_ss_storehist_err_count := GMD_QC_MIG12.g_ss_storehist_err_count + 1;
8530: x_exception_count := x_exception_count + 1;
8531:
8532: WHEN OTHERS THEN
8533: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
8529: GMD_QC_MIG12.g_ss_storehist_err_count := GMD_QC_MIG12.g_ss_storehist_err_count + 1;
8530: x_exception_count := x_exception_count + 1;
8531:
8532: WHEN OTHERS THEN
8533: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
8534: GMA_COMMON_LOGGING.gma_migration_central_log (
8535: p_run_id => p_migration_run_id,
8536: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
8537: p_message_token => 'GMA_MIGRATION_DB_ERROR',
8549: /*==============================================
8550: Log End of gmd_ss_storage_history.
8551: ==============================================*/
8552:
8553: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
8554:
8555:
8556: EXCEPTION
8557:
8565:
8566: x_exception_count := x_exception_count + 1;
8567:
8568: WHEN OTHERS THEN
8569: LOG_SS_COUNTS(p_migration_run_id, GMD_QC_MIG12.g_progress_ind);
8570: GMA_COMMON_LOGGING.gma_migration_central_log (
8571: p_run_id => p_migration_run_id,
8572: p_log_level => FND_LOG.LEVEL_UNEXPECTED,
8573: p_message_token => 'GMA_MIGRATION_DB_ERROR',