154: begin
155: write_log('set_periods_exist entered');
156: if g_measure_code is null then
157: if p_start_date is not null then
158: g_period_start_date := fnd_date.canonical_to_date(p_start_date);
159: else
160: select fnd_profile.value('BIC_SMRY_EXTRACTION_DATE') into x_date
161: from dual;
162: if x_date is null then
171: write_log('Start Date as obtained from Profile Value:'||
172: to_char(g_period_start_date,'dd-mm-yyyy'));
173: end if;
174: if p_end_date is not null then
175: g_period_end_date := fnd_date.canonical_to_date(p_end_date);
176: else
177: select max(act_period_start_date) into g_period_end_date
178: from bic_dimv_time
179: where trunc(act_period_end_date) < trunc(sysdate);
186: generate_error('Main',' Error: Start Date or End Date should not be null
187: while extracting only for a measure_code ' );
188: return false;
189: else
190: g_period_start_date := fnd_date.canonical_to_date(p_start_date);
191: g_period_end_date := fnd_date.canonical_to_date(p_end_date);
192: end if;
193: end if;
194: if ( if_exists(g_period_start_date) AND
187: while extracting only for a measure_code ' );
188: return false;
189: else
190: g_period_start_date := fnd_date.canonical_to_date(p_start_date);
191: g_period_end_date := fnd_date.canonical_to_date(p_end_date);
192: end if;
193: end if;
194: if ( if_exists(g_period_start_date) AND
195: if_exists(g_period_end_date) ) then