76:
77: l_functional_currency fnd_currencies_vl.NAME%TYPE;
78: l_functional_currency_code fnd_currencies_vl.CURRENCY_CODE%TYPE;
79: ln_flex_value_set_id fnd_id_flex_segments.flex_value_set_id%TYPE;
80: l_ja_cn_dff_assignments_row ja_cn_dff_assignments%ROWTYPE;
81: l_context_code ja_cn_dff_assignments.context_code%TYPE;
82: l_attribute_column4balanceside ja_cn_dff_assignments.attribute_column%TYPE;
83: l_attribute_column4account_lev ja_cn_dff_assignments.attribute_column%TYPE;
84: l_account_segment ja_cn_journal_lines.account_segment%TYPE;
77: l_functional_currency fnd_currencies_vl.NAME%TYPE;
78: l_functional_currency_code fnd_currencies_vl.CURRENCY_CODE%TYPE;
79: ln_flex_value_set_id fnd_id_flex_segments.flex_value_set_id%TYPE;
80: l_ja_cn_dff_assignments_row ja_cn_dff_assignments%ROWTYPE;
81: l_context_code ja_cn_dff_assignments.context_code%TYPE;
82: l_attribute_column4balanceside ja_cn_dff_assignments.attribute_column%TYPE;
83: l_attribute_column4account_lev ja_cn_dff_assignments.attribute_column%TYPE;
84: l_account_segment ja_cn_journal_lines.account_segment%TYPE;
85: l_ja_cn_subsidiary_gbl_tmp_row ja_cn_subsidiary_gt%ROWTYPE;
78: l_functional_currency_code fnd_currencies_vl.CURRENCY_CODE%TYPE;
79: ln_flex_value_set_id fnd_id_flex_segments.flex_value_set_id%TYPE;
80: l_ja_cn_dff_assignments_row ja_cn_dff_assignments%ROWTYPE;
81: l_context_code ja_cn_dff_assignments.context_code%TYPE;
82: l_attribute_column4balanceside ja_cn_dff_assignments.attribute_column%TYPE;
83: l_attribute_column4account_lev ja_cn_dff_assignments.attribute_column%TYPE;
84: l_account_segment ja_cn_journal_lines.account_segment%TYPE;
85: l_ja_cn_subsidiary_gbl_tmp_row ja_cn_subsidiary_gt%ROWTYPE;
86: ln_row_count NUMBER := 0;
79: ln_flex_value_set_id fnd_id_flex_segments.flex_value_set_id%TYPE;
80: l_ja_cn_dff_assignments_row ja_cn_dff_assignments%ROWTYPE;
81: l_context_code ja_cn_dff_assignments.context_code%TYPE;
82: l_attribute_column4balanceside ja_cn_dff_assignments.attribute_column%TYPE;
83: l_attribute_column4account_lev ja_cn_dff_assignments.attribute_column%TYPE;
84: l_account_segment ja_cn_journal_lines.account_segment%TYPE;
85: l_ja_cn_subsidiary_gbl_tmp_row ja_cn_subsidiary_gt%ROWTYPE;
86: ln_row_count NUMBER := 0;
87:
199: l_current_period GL_PERIOD_STATUSES.Period_Name%TYPE;
200: ld_current_start_date DATE;
201:
202: --cursors start here
203: CURSOR c_in_ja_cn_dff_assignments
204: IS
205: SELECT *
206: FROM ja_cn_dff_assignments
207: WHERE chart_of_accounts_id = pn_coa_id
202: --cursors start here
203: CURSOR c_in_ja_cn_dff_assignments
204: IS
205: SELECT *
206: FROM ja_cn_dff_assignments
207: WHERE chart_of_accounts_id = pn_coa_id
208: AND (dff_title_code = 'ACBS' -- Balance Side
209: OR dff_title_code = 'ACLE' -- Account Level
210: );
364: '.variable:' ||
365: 'ln_flex_value_set_id=' || ln_flex_value_set_id);
366:
367: --Fetch which attribute column for stroing balance side and account level
368: OPEN c_in_ja_cn_dff_assignments;
369: LOOP
370: FETCH c_in_ja_cn_dff_assignments
371: INTO l_ja_cn_dff_assignments_row;
372: EXIT WHEN c_in_ja_cn_dff_assignments%NOTFOUND;
366:
367: --Fetch which attribute column for stroing balance side and account level
368: OPEN c_in_ja_cn_dff_assignments;
369: LOOP
370: FETCH c_in_ja_cn_dff_assignments
371: INTO l_ja_cn_dff_assignments_row;
372: EXIT WHEN c_in_ja_cn_dff_assignments%NOTFOUND;
373: IF l_ja_cn_dff_assignments_row.context_code IS NOT NULL THEN
374: l_context_code := l_ja_cn_dff_assignments_row.context_code;
367: --Fetch which attribute column for stroing balance side and account level
368: OPEN c_in_ja_cn_dff_assignments;
369: LOOP
370: FETCH c_in_ja_cn_dff_assignments
371: INTO l_ja_cn_dff_assignments_row;
372: EXIT WHEN c_in_ja_cn_dff_assignments%NOTFOUND;
373: IF l_ja_cn_dff_assignments_row.context_code IS NOT NULL THEN
374: l_context_code := l_ja_cn_dff_assignments_row.context_code;
375: END IF; --l_ja_cn_dff_assignments_row.context_code IS NOT NULL
368: OPEN c_in_ja_cn_dff_assignments;
369: LOOP
370: FETCH c_in_ja_cn_dff_assignments
371: INTO l_ja_cn_dff_assignments_row;
372: EXIT WHEN c_in_ja_cn_dff_assignments%NOTFOUND;
373: IF l_ja_cn_dff_assignments_row.context_code IS NOT NULL THEN
374: l_context_code := l_ja_cn_dff_assignments_row.context_code;
375: END IF; --l_ja_cn_dff_assignments_row.context_code IS NOT NULL
376: CASE l_ja_cn_dff_assignments_row.dff_title_code
369: LOOP
370: FETCH c_in_ja_cn_dff_assignments
371: INTO l_ja_cn_dff_assignments_row;
372: EXIT WHEN c_in_ja_cn_dff_assignments%NOTFOUND;
373: IF l_ja_cn_dff_assignments_row.context_code IS NOT NULL THEN
374: l_context_code := l_ja_cn_dff_assignments_row.context_code;
375: END IF; --l_ja_cn_dff_assignments_row.context_code IS NOT NULL
376: CASE l_ja_cn_dff_assignments_row.dff_title_code
377: WHEN 'ACBS' THEN
370: FETCH c_in_ja_cn_dff_assignments
371: INTO l_ja_cn_dff_assignments_row;
372: EXIT WHEN c_in_ja_cn_dff_assignments%NOTFOUND;
373: IF l_ja_cn_dff_assignments_row.context_code IS NOT NULL THEN
374: l_context_code := l_ja_cn_dff_assignments_row.context_code;
375: END IF; --l_ja_cn_dff_assignments_row.context_code IS NOT NULL
376: CASE l_ja_cn_dff_assignments_row.dff_title_code
377: WHEN 'ACBS' THEN
378: l_attribute_column4balanceside := l_ja_cn_dff_assignments_row.attribute_column;
371: INTO l_ja_cn_dff_assignments_row;
372: EXIT WHEN c_in_ja_cn_dff_assignments%NOTFOUND;
373: IF l_ja_cn_dff_assignments_row.context_code IS NOT NULL THEN
374: l_context_code := l_ja_cn_dff_assignments_row.context_code;
375: END IF; --l_ja_cn_dff_assignments_row.context_code IS NOT NULL
376: CASE l_ja_cn_dff_assignments_row.dff_title_code
377: WHEN 'ACBS' THEN
378: l_attribute_column4balanceside := l_ja_cn_dff_assignments_row.attribute_column;
379: WHEN 'ACLE' THEN
372: EXIT WHEN c_in_ja_cn_dff_assignments%NOTFOUND;
373: IF l_ja_cn_dff_assignments_row.context_code IS NOT NULL THEN
374: l_context_code := l_ja_cn_dff_assignments_row.context_code;
375: END IF; --l_ja_cn_dff_assignments_row.context_code IS NOT NULL
376: CASE l_ja_cn_dff_assignments_row.dff_title_code
377: WHEN 'ACBS' THEN
378: l_attribute_column4balanceside := l_ja_cn_dff_assignments_row.attribute_column;
379: WHEN 'ACLE' THEN
380: l_attribute_column4account_lev := l_ja_cn_dff_assignments_row.attribute_column;
374: l_context_code := l_ja_cn_dff_assignments_row.context_code;
375: END IF; --l_ja_cn_dff_assignments_row.context_code IS NOT NULL
376: CASE l_ja_cn_dff_assignments_row.dff_title_code
377: WHEN 'ACBS' THEN
378: l_attribute_column4balanceside := l_ja_cn_dff_assignments_row.attribute_column;
379: WHEN 'ACLE' THEN
380: l_attribute_column4account_lev := l_ja_cn_dff_assignments_row.attribute_column;
381: END CASE; END LOOP;
382: CLOSE c_in_ja_cn_dff_assignments;
376: CASE l_ja_cn_dff_assignments_row.dff_title_code
377: WHEN 'ACBS' THEN
378: l_attribute_column4balanceside := l_ja_cn_dff_assignments_row.attribute_column;
379: WHEN 'ACLE' THEN
380: l_attribute_column4account_lev := l_ja_cn_dff_assignments_row.attribute_column;
381: END CASE; END LOOP;
382: CLOSE c_in_ja_cn_dff_assignments;
383:
384: --logging the variables
378: l_attribute_column4balanceside := l_ja_cn_dff_assignments_row.attribute_column;
379: WHEN 'ACLE' THEN
380: l_attribute_column4account_lev := l_ja_cn_dff_assignments_row.attribute_column;
381: END CASE; END LOOP;
382: CLOSE c_in_ja_cn_dff_assignments;
383:
384: --logging the variables
385: IF (ln_statement_level >= ln_dbg_level)
386: THEN