2056: l_success_rec NUMBER := 0;
2057: l_error_rec NUMBER := 0;
2058: BEGIN
2059:
2060: fnd_file.put_line(fnd_file.log,'------------Parameters-----------');
2061: fnd_file.put_line(fnd_file.log,'Batch Code : '||p_batch_code);
2062: fnd_file.put_line(fnd_file.log,'Purge Mode : '||p_purge_mode);
2063: fnd_file.put_line(fnd_file.log,'---------------------------------');
2064:
2057: l_error_rec NUMBER := 0;
2058: BEGIN
2059:
2060: fnd_file.put_line(fnd_file.log,'------------Parameters-----------');
2061: fnd_file.put_line(fnd_file.log,'Batch Code : '||p_batch_code);
2062: fnd_file.put_line(fnd_file.log,'Purge Mode : '||p_purge_mode);
2063: fnd_file.put_line(fnd_file.log,'---------------------------------');
2064:
2065: IF g_log_enabled THEN
2058: BEGIN
2059:
2060: fnd_file.put_line(fnd_file.log,'------------Parameters-----------');
2061: fnd_file.put_line(fnd_file.log,'Batch Code : '||p_batch_code);
2062: fnd_file.put_line(fnd_file.log,'Purge Mode : '||p_purge_mode);
2063: fnd_file.put_line(fnd_file.log,'---------------------------------');
2064:
2065: IF g_log_enabled THEN
2066: l_log_module := C_DEFAULT_MODULE||'.update_balances';
2059:
2060: fnd_file.put_line(fnd_file.log,'------------Parameters-----------');
2061: fnd_file.put_line(fnd_file.log,'Batch Code : '||p_batch_code);
2062: fnd_file.put_line(fnd_file.log,'Purge Mode : '||p_purge_mode);
2063: fnd_file.put_line(fnd_file.log,'---------------------------------');
2064:
2065: IF g_log_enabled THEN
2066: l_log_module := C_DEFAULT_MODULE||'.update_balances';
2067: END IF;
2073: END IF;
2074:
2075: FOR l_balances_int_rec IN c_balances_int(p_batch_code) LOOP
2076: BEGIN
2077: fnd_file.new_line(fnd_file.log,2);
2078: fnd_file.put_line(fnd_file.log,'Processing record with:');
2079: fnd_file.put_line(fnd_file.log,'Supporting Reference Name : '||l_balances_int_rec.analytical_criterion_code);
2080: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2081: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2074:
2075: FOR l_balances_int_rec IN c_balances_int(p_batch_code) LOOP
2076: BEGIN
2077: fnd_file.new_line(fnd_file.log,2);
2078: fnd_file.put_line(fnd_file.log,'Processing record with:');
2079: fnd_file.put_line(fnd_file.log,'Supporting Reference Name : '||l_balances_int_rec.analytical_criterion_code);
2080: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2081: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2082: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2075: FOR l_balances_int_rec IN c_balances_int(p_batch_code) LOOP
2076: BEGIN
2077: fnd_file.new_line(fnd_file.log,2);
2078: fnd_file.put_line(fnd_file.log,'Processing record with:');
2079: fnd_file.put_line(fnd_file.log,'Supporting Reference Name : '||l_balances_int_rec.analytical_criterion_code);
2080: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2081: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2082: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2083: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2076: BEGIN
2077: fnd_file.new_line(fnd_file.log,2);
2078: fnd_file.put_line(fnd_file.log,'Processing record with:');
2079: fnd_file.put_line(fnd_file.log,'Supporting Reference Name : '||l_balances_int_rec.analytical_criterion_code);
2080: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2081: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2082: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2083: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2084: fnd_file.put_line(fnd_file.log,'Supporting Reference 4 : '||l_balances_int_rec.ac4);
2077: fnd_file.new_line(fnd_file.log,2);
2078: fnd_file.put_line(fnd_file.log,'Processing record with:');
2079: fnd_file.put_line(fnd_file.log,'Supporting Reference Name : '||l_balances_int_rec.analytical_criterion_code);
2080: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2081: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2082: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2083: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2084: fnd_file.put_line(fnd_file.log,'Supporting Reference 4 : '||l_balances_int_rec.ac4);
2085: fnd_file.put_line(fnd_file.log,'Supporting Reference 5 : '||l_balances_int_rec.ac5);
2078: fnd_file.put_line(fnd_file.log,'Processing record with:');
2079: fnd_file.put_line(fnd_file.log,'Supporting Reference Name : '||l_balances_int_rec.analytical_criterion_code);
2080: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2081: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2082: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2083: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2084: fnd_file.put_line(fnd_file.log,'Supporting Reference 4 : '||l_balances_int_rec.ac4);
2085: fnd_file.put_line(fnd_file.log,'Supporting Reference 5 : '||l_balances_int_rec.ac5);
2086: fnd_file.put_line(fnd_file.log,'Period : '||l_balances_int_rec.period_name);
2079: fnd_file.put_line(fnd_file.log,'Supporting Reference Name : '||l_balances_int_rec.analytical_criterion_code);
2080: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2081: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2082: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2083: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2084: fnd_file.put_line(fnd_file.log,'Supporting Reference 4 : '||l_balances_int_rec.ac4);
2085: fnd_file.put_line(fnd_file.log,'Supporting Reference 5 : '||l_balances_int_rec.ac5);
2086: fnd_file.put_line(fnd_file.log,'Period : '||l_balances_int_rec.period_name);
2087:
2080: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2081: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2082: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2083: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2084: fnd_file.put_line(fnd_file.log,'Supporting Reference 4 : '||l_balances_int_rec.ac4);
2085: fnd_file.put_line(fnd_file.log,'Supporting Reference 5 : '||l_balances_int_rec.ac5);
2086: fnd_file.put_line(fnd_file.log,'Period : '||l_balances_int_rec.period_name);
2087:
2088: IF NOT validate_balances_rec(l_balances_int_rec,l_message_codes) THEN
2081: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2082: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2083: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2084: fnd_file.put_line(fnd_file.log,'Supporting Reference 4 : '||l_balances_int_rec.ac4);
2085: fnd_file.put_line(fnd_file.log,'Supporting Reference 5 : '||l_balances_int_rec.ac5);
2086: fnd_file.put_line(fnd_file.log,'Period : '||l_balances_int_rec.period_name);
2087:
2088: IF NOT validate_balances_rec(l_balances_int_rec,l_message_codes) THEN
2089: /*
2082: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2083: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2084: fnd_file.put_line(fnd_file.log,'Supporting Reference 4 : '||l_balances_int_rec.ac4);
2085: fnd_file.put_line(fnd_file.log,'Supporting Reference 5 : '||l_balances_int_rec.ac5);
2086: fnd_file.put_line(fnd_file.log,'Period : '||l_balances_int_rec.period_name);
2087:
2088: IF NOT validate_balances_rec(l_balances_int_rec,l_message_codes) THEN
2089: /*
2090: * Some validations failed
2094: (p_module => l_log_module
2095: ,p_msg => 'validations failed with l_message_codes:'||l_message_codes
2096: ,p_level => C_LEVEL_STATEMENT);
2097: END IF;
2098: fnd_file.put_line(fnd_file.log,'Import Failed with error codes: '||l_message_codes);
2099: fnd_file.new_line(fnd_file.log,2);
2100: UPDATE xla_ac_balances_int
2101: SET status = 'ERROR',
2102: message_codes = l_message_codes,
2095: ,p_msg => 'validations failed with l_message_codes:'||l_message_codes
2096: ,p_level => C_LEVEL_STATEMENT);
2097: END IF;
2098: fnd_file.put_line(fnd_file.log,'Import Failed with error codes: '||l_message_codes);
2099: fnd_file.new_line(fnd_file.log,2);
2100: UPDATE xla_ac_balances_int
2101: SET status = 'ERROR',
2102: message_codes = l_message_codes,
2103: last_updated_by = g_user_id,
2119: merge_balances_rec(l_balances_int_rec);
2120: /*
2121: * Successfully merged the records. Update the status of the interface record
2122: */
2123: fnd_file.put_line(fnd_file.log,'Import Succeeded');
2124: fnd_file.new_line(fnd_file.log,2);
2125: UPDATE xla_ac_balances_int
2126: SET status = 'IMPORTED',
2127: message_codes = NULL,
2120: /*
2121: * Successfully merged the records. Update the status of the interface record
2122: */
2123: fnd_file.put_line(fnd_file.log,'Import Succeeded');
2124: fnd_file.new_line(fnd_file.log,2);
2125: UPDATE xla_ac_balances_int
2126: SET status = 'IMPORTED',
2127: message_codes = NULL,
2128: last_updated_by = g_user_id,