445: p_token2 => 'PRO',
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),
6901: --
6902: -- gmd_ss_storage_package quantity_uom
6903: -- gmd_stability_studies_b organization_id
6904: -- gmd_stability_studies_b lab_organization_id
6905: -- gmd_ss_material_sources source_organization_id
6906: -- gmd_ss_material_sources sample_quantity_uom
6907: -- gmd_ss_variants sample_quantity_uom
6908: --=========================================================================== */
6909:
6902: -- gmd_ss_storage_package quantity_uom
6903: -- gmd_stability_studies_b organization_id
6904: -- gmd_stability_studies_b lab_organization_id
6905: -- gmd_ss_material_sources source_organization_id
6906: -- gmd_ss_material_sources sample_quantity_uom
6907: -- gmd_ss_variants sample_quantity_uom
6908: --=========================================================================== */
6909:
6910: PROCEDURE GMD_QC_MIGRATE_STABS
7037: l_def_ss_org_id sy_orgn_mst.organization_id%TYPE;
7038: l_ss_org_id sy_orgn_mst.organization_id%TYPE;
7039:
7040: /*=========================================
7041: Cursor to get gmd_ss_material_sources.
7042: Get org id null to exclude records
7043: added after migration is run and then
7044: rerun.
7045: =========================================*/
7048: -- Removed source_organization_id IS NULL from the where clause since lot info needs to be migrated.
7049: CURSOR get_matl_src IS
7050: SELECT plant_code, source_organization_id,
7051: lot_id, ss_id, source_id
7052: FROM gmd_ss_material_sources
7053: WHERE migrated_ind IS NULL;
7054: --AND source_organization_id IS NULL;
7055:
7056: l_plant_org_id gmd_ss_material_sources.source_organization_id%TYPE;
7052: FROM gmd_ss_material_sources
7053: WHERE migrated_ind IS NULL;
7054: --AND source_organization_id IS NULL;
7055:
7056: l_plant_org_id gmd_ss_material_sources.source_organization_id%TYPE;
7057:
7058: /*===============================================
7059: Cursor to get stability study org and item.
7060: ===============================================*/
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.
7522: ==============================================*/
7523:
7524: GMA_COMMON_LOGGING.gma_migration_central_log (
7525: p_run_id => p_migration_run_id,
7524: GMA_COMMON_LOGGING.gma_migration_central_log (
7525: p_run_id => p_migration_run_id,
7526: p_log_level => FND_LOG.LEVEL_EVENT,
7527: p_message_token => 'GMA_MIGRATION_TABLE_STARTED',
7528: p_table_name => 'GMD_SS_MATERIAL_SOURCES',
7529: p_token1 => 'TABLE_NAME',
7530: p_param1 => 'GMD_SS_MATERIAL_SOURCES',
7531: p_context => 'Quality Stability Studies',
7532: p_app_short_name => 'GMA');
7526: p_log_level => FND_LOG.LEVEL_EVENT,
7527: p_message_token => 'GMA_MIGRATION_TABLE_STARTED',
7528: p_table_name => 'GMD_SS_MATERIAL_SOURCES',
7529: p_token1 => 'TABLE_NAME',
7530: p_param1 => 'GMD_SS_MATERIAL_SOURCES',
7531: p_context => 'Quality Stability Studies',
7532: p_app_short_name => 'GMA');
7533:
7534: /*=======================================
7531: p_context => 'Quality Stability Studies',
7532: p_app_short_name => 'GMA');
7533:
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;
7611: l_lot_number := NULL;
7612: END IF;
7613:
7614: /*==================================
7615: Update gmd_ss_material_sources.
7616: ==================================*/
7617:
7618: UPDATE gmd_ss_material_sources
7619: SET source_organization_id = l_plant_org_id,
7614: /*==================================
7615: Update gmd_ss_material_sources.
7616: ==================================*/
7617:
7618: UPDATE gmd_ss_material_sources
7619: SET source_organization_id = l_plant_org_id,
7620: lot_number = l_lot_number,
7621: migrated_ind = 1
7622: WHERE source_id = l_matl_rec.source_id
7632: GMA_COMMON_LOGGING.gma_migration_central_log (
7633: p_run_id => p_migration_run_id,
7634: p_log_level => FND_LOG.LEVEL_ERROR,
7635: p_message_token => 'GMD_MIG_NO_ORG',
7636: p_context => 'Quality Stability Studies - gmd_ss_material_sources',
7637: p_token1 => 'ORG',
7638: p_token2 => 'ONAME',
7639: p_token3 => 'ROWK',
7640: p_token4 => 'ROWV',
7650: GMA_COMMON_LOGGING.gma_migration_central_log (
7651: p_run_id => p_migration_run_id,
7652: p_log_level => FND_LOG.LEVEL_ERROR,
7653: p_message_token => 'GMD_MIG_GET_SS_ERROR',
7654: p_context => 'Quality Stability Studies - gmd_ss_material_sources',
7655: p_token1 => 'STABID',
7656: p_token2 => 'ROWK',
7657: p_token3 => 'ROWV',
7658: p_param1 => to_char(l_matl_rec.ss_id),
7666: GMA_COMMON_LOGGING.gma_migration_central_log (
7667: p_run_id => p_migration_run_id,
7668: p_log_level => FND_LOG.LEVEL_ERROR,
7669: p_message_token => 'GMD_MIG_PLANT_ORG_ID',
7670: p_context => 'Quality Stability Studies - gmd_ss_material_sources',
7671: p_token1 => 'ORG',
7672: p_token2 => 'SRC',
7673: p_token3 => 'ROWK',
7674: p_token4 => 'ROWV',
7684: GMA_COMMON_LOGGING.gma_migration_central_log (
7685: p_run_id => p_migration_run_id,
7686: p_log_level => FND_LOG.LEVEL_ERROR,
7687: p_message_token => 'GMD_MIG_LOT',
7688: p_context => 'Quality Stability Studies - gmd_ss_material_sources',
7689: p_token1 => 'ROWK',
7690: p_token2 => 'ROWV',
7691: p_param1 => 'SOURCE_ID',
7692: p_param2 => to_char(l_matl_rec.source_id),
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',
7703: p_context => 'Quality Stability Studies - gmd_ss_material_sources',
7704: p_db_error => SQLERRM,
7705: p_app_short_name => 'GMA');
7706: x_exception_count := x_exception_count + 1;
7707: ROLLBACK;
7712:
7713:
7714:
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: