300: WHEN NO_DATA_FOUND THEN
301: NULL;
302: END;
303: --Bugfix 6195807: To check if the process_identifier is already exists in gcs_cons_eng_runs.
304: fnd_file.put_line(fnd_file.log, 'Beginning Consolidation Submission Execution');
305:
306: fnd_file.put_line(fnd_file.log, '<
307: fnd_file.put_line(fnd_file.log, 'Consolidation Hierarchy : ' || p_consolidation_hierarchy);
308: fnd_file.put_line(fnd_file.log, 'Consolidation Entity : ' || p_consolidation_entity);
302: END;
303: --Bugfix 6195807: To check if the process_identifier is already exists in gcs_cons_eng_runs.
304: fnd_file.put_line(fnd_file.log, 'Beginning Consolidation Submission Execution');
305:
306: fnd_file.put_line(fnd_file.log, '<
308: fnd_file.put_line(fnd_file.log, 'Consolidation Entity : ' || p_consolidation_entity);
309: fnd_file.put_line(fnd_file.log, 'Process Identifier : ' || p_run_identifier);
310: fnd_file.put_line(fnd_file.log, 'Calendar Period : ' || p_cal_period_id);
303: --Bugfix 6195807: To check if the process_identifier is already exists in gcs_cons_eng_runs.
304: fnd_file.put_line(fnd_file.log, 'Beginning Consolidation Submission Execution');
305:
306: fnd_file.put_line(fnd_file.log, '<
307: fnd_file.put_line(fnd_file.log, 'Consolidation Hierarchy : ' || p_consolidation_hierarchy);
308: fnd_file.put_line(fnd_file.log, 'Consolidation Entity : ' || p_consolidation_entity);
309: fnd_file.put_line(fnd_file.log, 'Process Identifier : ' || p_run_identifier);
310: fnd_file.put_line(fnd_file.log, 'Calendar Period : ' || p_cal_period_id);
311: fnd_file.put_line(fnd_file.log, 'Balance Type : ' || p_balance_type_code);
304: fnd_file.put_line(fnd_file.log, 'Beginning Consolidation Submission Execution');
305:
306: fnd_file.put_line(fnd_file.log, '<
307: fnd_file.put_line(fnd_file.log, 'Consolidation Hierarchy : ' || p_consolidation_hierarchy);
308: fnd_file.put_line(fnd_file.log, 'Consolidation Entity : ' || p_consolidation_entity);
309: fnd_file.put_line(fnd_file.log, 'Process Identifier : ' || p_run_identifier);
310: fnd_file.put_line(fnd_file.log, 'Calendar Period : ' || p_cal_period_id);
311: fnd_file.put_line(fnd_file.log, 'Balance Type : ' || p_balance_type_code);
312: fnd_file.put_line(fnd_file.log, 'Process Method : ' || p_process_method);
305:
306: fnd_file.put_line(fnd_file.log, '<
307: fnd_file.put_line(fnd_file.log, 'Consolidation Hierarchy : ' || p_consolidation_hierarchy);
308: fnd_file.put_line(fnd_file.log, 'Consolidation Entity : ' || p_consolidation_entity);
309: fnd_file.put_line(fnd_file.log, 'Process Identifier : ' || p_run_identifier);
310: fnd_file.put_line(fnd_file.log, 'Calendar Period : ' || p_cal_period_id);
311: fnd_file.put_line(fnd_file.log, 'Balance Type : ' || p_balance_type_code);
312: fnd_file.put_line(fnd_file.log, 'Process Method : ' || p_process_method);
313: fnd_file.put_line(fnd_file.log, 'Called via SRS : ' || p_called_via_srs);
306: fnd_file.put_line(fnd_file.log, '<
307: fnd_file.put_line(fnd_file.log, 'Consolidation Hierarchy : ' || p_consolidation_hierarchy);
308: fnd_file.put_line(fnd_file.log, 'Consolidation Entity : ' || p_consolidation_entity);
309: fnd_file.put_line(fnd_file.log, 'Process Identifier : ' || p_run_identifier);
310: fnd_file.put_line(fnd_file.log, 'Calendar Period : ' || p_cal_period_id);
311: fnd_file.put_line(fnd_file.log, 'Balance Type : ' || p_balance_type_code);
312: fnd_file.put_line(fnd_file.log, 'Process Method : ' || p_process_method);
313: fnd_file.put_line(fnd_file.log, 'Called via SRS : ' || p_called_via_srs);
314: fnd_file.put_line(fnd_file.log, 'Analysis Cycle Id : ' || p_analysis_cycle_id);
307: fnd_file.put_line(fnd_file.log, 'Consolidation Hierarchy : ' || p_consolidation_hierarchy);
308: fnd_file.put_line(fnd_file.log, 'Consolidation Entity : ' || p_consolidation_entity);
309: fnd_file.put_line(fnd_file.log, 'Process Identifier : ' || p_run_identifier);
310: fnd_file.put_line(fnd_file.log, 'Calendar Period : ' || p_cal_period_id);
311: fnd_file.put_line(fnd_file.log, 'Balance Type : ' || p_balance_type_code);
312: fnd_file.put_line(fnd_file.log, 'Process Method : ' || p_process_method);
313: fnd_file.put_line(fnd_file.log, 'Called via SRS : ' || p_called_via_srs);
314: fnd_file.put_line(fnd_file.log, 'Analysis Cycle Id : ' || p_analysis_cycle_id);
315: fnd_file.put_line(fnd_file.log, '<
308: fnd_file.put_line(fnd_file.log, 'Consolidation Entity : ' || p_consolidation_entity);
309: fnd_file.put_line(fnd_file.log, 'Process Identifier : ' || p_run_identifier);
310: fnd_file.put_line(fnd_file.log, 'Calendar Period : ' || p_cal_period_id);
311: fnd_file.put_line(fnd_file.log, 'Balance Type : ' || p_balance_type_code);
312: fnd_file.put_line(fnd_file.log, 'Process Method : ' || p_process_method);
313: fnd_file.put_line(fnd_file.log, 'Called via SRS : ' || p_called_via_srs);
314: fnd_file.put_line(fnd_file.log, 'Analysis Cycle Id : ' || p_analysis_cycle_id);
315: fnd_file.put_line(fnd_file.log, '<
316:
309: fnd_file.put_line(fnd_file.log, 'Process Identifier : ' || p_run_identifier);
310: fnd_file.put_line(fnd_file.log, 'Calendar Period : ' || p_cal_period_id);
311: fnd_file.put_line(fnd_file.log, 'Balance Type : ' || p_balance_type_code);
312: fnd_file.put_line(fnd_file.log, 'Process Method : ' || p_process_method);
313: fnd_file.put_line(fnd_file.log, 'Called via SRS : ' || p_called_via_srs);
314: fnd_file.put_line(fnd_file.log, 'Analysis Cycle Id : ' || p_analysis_cycle_id);
315: fnd_file.put_line(fnd_file.log, '<
316:
317: --Bugfix 5505707: Validating Default Member Setup
310: fnd_file.put_line(fnd_file.log, 'Calendar Period : ' || p_cal_period_id);
311: fnd_file.put_line(fnd_file.log, 'Balance Type : ' || p_balance_type_code);
312: fnd_file.put_line(fnd_file.log, 'Process Method : ' || p_process_method);
313: fnd_file.put_line(fnd_file.log, 'Called via SRS : ' || p_called_via_srs);
314: fnd_file.put_line(fnd_file.log, 'Analysis Cycle Id : ' || p_analysis_cycle_id);
315: fnd_file.put_line(fnd_file.log, '<
316:
317: --Bugfix 5505707: Validating Default Member Setup
318: fnd_file.put_line(fnd_file.log, '<
311: fnd_file.put_line(fnd_file.log, 'Balance Type : ' || p_balance_type_code);
312: fnd_file.put_line(fnd_file.log, 'Process Method : ' || p_process_method);
313: fnd_file.put_line(fnd_file.log, 'Called via SRS : ' || p_called_via_srs);
314: fnd_file.put_line(fnd_file.log, 'Analysis Cycle Id : ' || p_analysis_cycle_id);
315: fnd_file.put_line(fnd_file.log, '<
317: --Bugfix 5505707: Validating Default Member Setup
318: fnd_file.put_line(fnd_file.log, '<
319: l_dimension_info := gcs_utility_pkg.g_gcs_dimension_info;
314: fnd_file.put_line(fnd_file.log, 'Analysis Cycle Id : ' || p_analysis_cycle_id);
315: fnd_file.put_line(fnd_file.log, '<
316:
317: --Bugfix 5505707: Validating Default Member Setup
318: fnd_file.put_line(fnd_file.log, '<
320: l_column_name := l_dimension_info.FIRST;
321:
322: WHILE (l_column_name <= l_dimension_info.LAST) LOOP
344: fnd_message.set_name('GCS', 'GCS_CONS_PROC_INV_VALUESETS');
345: fnd_message.set_token('VALUESETS', l_value_set_tokens);
346: l_error_message := fnd_message.get;
347:
348: fnd_file.put_line(fnd_file.log, '<<<
350: fnd_file.put_line(fnd_file.log, '<<<
351:
352: l_ret_status := fnd_concurrent.set_completion_status(status => 'ERROR',
345: fnd_message.set_token('VALUESETS', l_value_set_tokens);
346: l_error_message := fnd_message.get;
347:
348: fnd_file.put_line(fnd_file.log, '<<<
349: fnd_file.put_line(fnd_file.log, l_error_message);
350: fnd_file.put_line(fnd_file.log, '<<<
351:
352: l_ret_status := fnd_concurrent.set_completion_status(status => 'ERROR',
353: message => l_error_message);
346: l_error_message := fnd_message.get;
347:
348: fnd_file.put_line(fnd_file.log, '<<<
349: fnd_file.put_line(fnd_file.log, l_error_message);
350: fnd_file.put_line(fnd_file.log, '<<<
352: l_ret_status := fnd_concurrent.set_completion_status(status => 'ERROR',
353: message => l_error_message);
354: GOTO endofprogram;
354: GOTO endofprogram;
355: END IF;
356: --End of Bugfix 5505707: Validating Default Member Setup
357:
358: fnd_file.put_line(fnd_file.log, '<
360: --Bugfix 5017120: Added support for additional data types
361: fnd_file.put_line(fnd_file.log, '<>');
362:
357:
358: fnd_file.put_line(fnd_file.log, '<
359:
360: --Bugfix 5017120: Added support for additional data types
361: fnd_file.put_line(fnd_file.log, '<>');
362:
363: --Bugfix 5505707: Added validation for source dataset and hierarchy dataset
364: BEGIN
365: SELECT source_dataset_code
372: FROM gcs_dataset_codes
373: WHERE hierarchy_id = p_consolidation_hierarchy
374: AND balance_type_code = p_balance_type_code;
375:
376: fnd_file.put_line(fnd_file.log, 'Source Dataset : ' || l_source_dataset_code);
377: fnd_file.put_line(fnd_file.log,' Hierarchy Dataset : ' || l_hierarchy_dataset_code);
378: EXCEPTION
379: WHEN OTHERS THEN
380: IF (l_source_dataset_code IS NULL) THEN
373: WHERE hierarchy_id = p_consolidation_hierarchy
374: AND balance_type_code = p_balance_type_code;
375:
376: fnd_file.put_line(fnd_file.log, 'Source Dataset : ' || l_source_dataset_code);
377: fnd_file.put_line(fnd_file.log,' Hierarchy Dataset : ' || l_hierarchy_dataset_code);
378: EXCEPTION
379: WHEN OTHERS THEN
380: IF (l_source_dataset_code IS NULL) THEN
381: fnd_message.set_name('GCS', 'GCS_CONS_PROC_INV_SRC_DATASET');
384: fnd_message.set_name('GCS', 'GCS_CONS_PROC_INV_HIER_DATASET');
385: l_error_message := fnd_message.get;
386: END IF;
387:
388: fnd_file.put_line(fnd_file.log, '<<<
390: fnd_file.put_line(fnd_file.log, '<<<
391:
392: l_ret_status := fnd_concurrent.set_completion_status(status => 'ERROR',
385: l_error_message := fnd_message.get;
386: END IF;
387:
388: fnd_file.put_line(fnd_file.log, '<<<
389: fnd_file.put_line(fnd_file.log, l_error_message);
390: fnd_file.put_line(fnd_file.log, '<<<
391:
392: l_ret_status := fnd_concurrent.set_completion_status(status => 'ERROR',
393: message => l_error_message);
386: END IF;
387:
388: fnd_file.put_line(fnd_file.log, '<<<
389: fnd_file.put_line(fnd_file.log, l_error_message);
390: fnd_file.put_line(fnd_file.log, '<<<
392: l_ret_status := fnd_concurrent.set_completion_status(status => 'ERROR',
393: message => l_error_message);
394: GOTO endofprogram;
394: GOTO endofprogram;
395: END;
396: --End of Bugfix 5505707
397:
398: fnd_file.put_line(fnd_file.log, '<
400: SELECT to_char(date_assign_value, 'DD-MM-RR')
401: INTO l_cal_period_end_date
402: FROM fem_cal_periods_attr
404: AND version_id = l_end_date_version_id
405: AND cal_period_id = p_cal_period_id;
406:
407: IF (p_called_via_srs = 'Y') THEN
408: fnd_file.put_line(fnd_file.log, 'Resetting consolidation status to IN_PROGRESS');
409:
410: fnd_file.put_line(fnd_file.log, 'End Date : ' || l_cal_period_end_date);
411: UPDATE gcs_cons_eng_runs
412: SET most_recent_flag = 'X'
406:
407: IF (p_called_via_srs = 'Y') THEN
408: fnd_file.put_line(fnd_file.log, 'Resetting consolidation status to IN_PROGRESS');
409:
410: fnd_file.put_line(fnd_file.log, 'End Date : ' || l_cal_period_end_date);
411: UPDATE gcs_cons_eng_runs
412: SET most_recent_flag = 'X'
413: WHERE most_recent_flag = 'Y'
414: AND run_entity_id = p_consolidation_entity
436: AND gcr.hierarchy_id = p_consolidation_hierarchy
437: AND TO_DATE(l_cal_period_end_date, 'DD-MM-RR')
438: BETWEEN gcr.start_date AND NVL(gcr.end_date,
439: TO_DATE(l_cal_period_end_date, 'DD-MM-RR')));
440: fnd_file.put_line(fnd_file.log, 'End of resetting consolidation status to IN_PROGRESS');
441: END IF;
442:
443:
444: SELECT entity_name || ' (' || FND_GLOBAL.CONC_REQUEST_ID || ')'
445: INTO l_event_key
446: FROM fem_entities_vl
447: WHERE entity_id = p_consolidation_entity;
448:
449: fnd_file.put_line(fnd_file.log, 'The event key is : ' || l_event_key);
450:
451: GCS_CONS_ENG_RUNS_PKG.insert_row
452: (
453: p_run_name => p_run_identifier,
502: BETWEEN gcr.start_date AND NVL(gcr.end_date, TO_DATE(l_cal_period_end_date, 'DD-MM-RR'));
503:
504: COMMIT;
505:
506: fnd_file.put_line(fnd_file.log, 'Submitting Workflow');
507:
508: --Bugfix 5197891: Assign the correct user rather than putting a null value
509: WF_ENGINE.CreateProcess('GCSENGNE', l_event_key, 'CONS_ENTITY_PROCESS', l_event_key, FND_GLOBAL.USER_NAME);
510: WF_ENGINE.SetItemAttrNumber('GCSENGNE', l_event_key, 'CONS_HIERARCHY', p_consolidation_hierarchy);
522: -- set the value passed from the Submit Consolidation UI.
523: WF_ENGINE.SetItemAttrNumber('GCSENGNE', l_event_key, 'ANALYSIS_CYCLE_ID', p_analysis_cycle_id);
524: WF_ENGINE.StartProcess('GCSENGNE', l_event_key);
525:
526: fnd_file.put_line(fnd_file.log, 'End of Workflow');
527:
528: COMMIT;
529:
530: --Bugfix 5505707: Added label to end at and reset status of UI if consolidation kicked off from the self service interface
568: END IF;
569:
570: EXCEPTION
571: WHEN OTHERS THEN
572: fnd_file.put_line(fnd_file.log, 'Error message is ' || SQLERRM);
573: x_retcode := '2';
574: END;
575:
576: END;