Oracle Application - How To Check Budget Fund For Specific Account - Oracle Query
Oracle Application - How To Check Budget Fund For Specific Account - Oracle Query
Oracle Application
Solution: Following procedure will return the available fund amount & status (Y- Available, N-InSufficient
Fund)
PLSQL Procedure:
https://chetanrajputoracleapps.blogspot.com/2019/07/oracle-budget-fund-check-procedure-for.html 1/6
3/23/24, 10:29 AM Oracle Application: How to check budget fund for specific account - Oracle Query
p_ledger_id NUMBER := 2021; Production Support in Oracle EBS - R12 and
p_rei_curr_code VARCHAR2 (10) := 'QAR'; Oracle Fusion Application environment.
l_req_encumbrance_id NUMBER; View my complete profile
l_po_encumbrance_id NUMBER;
l_oblig_revresal_amount NUMBER := 0;
Total Pageviews
l_oblig_revresal_enucm_id NUMBER := NULL;
lx_funds_available_temp NUMBER := 0;
9 6 6 6 5
CURSOR get_period_year
IS
Blog Archive
SELECT period_year
FROM gl_periods ►
► 2024 (3)
WHERE p_date BETWEEN start_date AND end_date;
►
► 2023 (17)
►
► 2022 (37)
CURSOR get_last_period
IS ►
► 2021 (36)
SELECT gp.period_type, ►
► 2020 (29)
gsob.period_set_name,
▼
▼ 2019 (22)
gp.period_name,
►
► November (3)
gp.period_num,
gp.quarter_num, ►
► September (2)
gp.period_year, ►
► August (1)
gp.start_date, ▼
▼ July (2)
gp.end_date,
How to check budget fund for specific
gp.year_start_date account - Or...
FROM gl_sets_of_books gsob, gl_periods gp
How to define event-based Oracle Alert
WHERE gsob.period_set_name = gp.period_set_name on Custom T...
AND gp.period_year = ln_period_year
AND gsob.set_of_books_id = p_ledger_id ►
► May (1)
AND adjustment_period_flag != 'Y' ►
► April (2)
ORDER BY period_num;
►
► March (2)
►
► February (4)
lcu_get_last_period get_last_period%ROWTYPE;
BEGIN ►
► January (5)
BEGIN
►
► 2018 (30)
SELECT code_combination_id
INTO l_code_combination_id ►
► 2017 (6)
FROM gl_code_combinations_kfv x
WHERE x.concatenated_segments = TRIM (p_gl_account);
EXCEPTION
WHEN OTHERS
THEN
x_msg_status := x_msg_status || 'ERR:CCD';
END;
DBMS_OUTPUT.put_line (
'Code combination id is ' || l_code_combination_id);
DBMS_OUTPUT.put_line ('Set of books id is :' || p_ledger_id);
BEGIN
SELECT 1
INTO ln_fund_exclusion
FROM gl_budget_assignments
WHERE ledger_id = p_ledger_id --l_set_of_books_id
AND code_combination_id = l_code_combination_id--AND amount_type = 'YTD'
--AND funds_check_level_code = 'B'
;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
ln_fund_exclusion := 0;
WHEN OTHERS
THEN
ln_fund_exclusion := 0;
END;
IF NVL (ln_fund_exclusion, 0) = 1
THEN
BEGIN
SELECT period_name,
period_set_name,
period_type,
period_num,
quarter_num,
https://chetanrajputoracleapps.blogspot.com/2019/07/oracle-budget-fund-check-procedure-for.html 2/6
3/23/24, 10:29 AM Oracle Application: How to check budget fund for specific account - Oracle Query
period_year
INTO l_period_name,
l_period_set_name,
l_period_type,
l_period_num,
l_quarter_num,
l_period_year
FROM gl_periods
WHERE period_name = TO_CHAR (p_date, 'Mon-rr');
EXCEPTION
WHEN OTHERS
THEN
x_msg_status := x_msg_status || 'ERR:Period';
--RAISE expense_exception;
END;
BEGIN
SELECT currency_code
INTO l_currency_code
FROM gl_sets_of_books
WHERE set_of_books_id = NVL (p_ledger_id, 1001);
EXCEPTION
WHEN OTHERS
THEN
l_currency_code := 'QAR';
END;
BEGIN
SELECT budget_version_id
INTO l_budget_version_id
FROM gl_budgets_with_dates_v
WHERE set_of_books_id = NVL (p_ledger_id, 1001)
AND status != 'R'
AND status = 'C'
-- Status 'C' denotes the Current Active Budget
AND p_date BETWEEN start_date AND end_date;
EXCEPTION
WHEN OTHERS
THEN
l_budget_version_id := 1000; --Approved Budget
END;
OPEN get_period_year;
CLOSE get_period_year;
BEGIN
SELECT closing_status
INTO l_closing_status
FROM gl_period_statuses
WHERE period_name = l_period_name
AND application_id = 101
AND set_of_books_id = NVL (p_ledger_id, 1001);
EXCEPTION
WHEN OTHERS
THEN
x_msg_status := x_msg_status || 'ERR:Closing status';
END;
/* l_period_type := lcu_get_last_period.period_type;
l_period_set_name := lcu_get_last_period.period_set_name;
l_period_name := lcu_get_last_period.period_name;
l_period_num := lcu_get_last_period.period_num;
l_quarter_num := lcu_get_last_period.quarter_num;
l_period_year := lcu_get_last_period.period_year;*/
https://chetanrajputoracleapps.blogspot.com/2019/07/oracle-budget-fund-check-procedure-for.html 3/6
3/23/24, 10:29 AM Oracle Application: How to check budget fund for specific account - Oracle Query
x_code_combination_id => l_code_combination_id,
x_account_type => 'A',
x_template_id => NULL,
x_ledger_id => p_ledger_id,
x_currency_code => l_currency_code,
x_po_install_flag => 'Y',
x_accounted_period_type => l_period_type,
x_period_set_name => l_period_set_name,
x_period_name => l_period_name,
x_period_num => l_period_num,
x_quarter_num => l_quarter_num,
x_period_year => l_period_year,
x_closing_status => l_closing_status,
x_budget_version_id => l_budget_version_id,
x_encumbrance_type_id => NVL (-1, --l_encumbrance_type_id,
-1), ---1,
x_req_encumbrance_id => NULL, --1000,--l_req_encumbrance_id ,
x_po_encumbrance_id => NULL, --1001,--l_po_encumbrance_id,
x_budget => lx_budget,
x_encumbrance => lx_encumbrance,
x_actual => lx_actual,
x_funds_available => lx_funds_available_temp,
x_req_encumbrance_amount => lx_req_encumbrance_amount,
x_po_encumbrance_amount => lx_po_encumbrance_amount,
x_other_encumbrance_amount => lx_other_encumbrance_amount);
DBMS_OUTPUT.put_line (
'Amount Available (lx_funds_available_temp):'
|| lx_funds_available_temp);
------------------------
END IF;
END IF;
px_result := x_msg_status;
px_fund_available := NVL (lx_funds_available_temp, 0);
EXCEPTION
WHEN OTHERS
THEN
x_msg_data := 'Insufficient Funds';
DBMS_OUTPUT.put_line ('Error:' || SQLERRM);
x_msg_status := 'insufficient fund3';
px_result := x_msg_status;
END is_fund_available;
DECLARE
px_fund_available NUMBER:=0;
px_result VARCHAR2(1000):=NULL;
begin
https://chetanrajputoracleapps.blogspot.com/2019/07/oracle-budget-fund-check-procedure-for.html 4/6
3/23/24, 10:29 AM Oracle Application: How to check budget fund for specific account - Oracle Query
is_fund_available('100.21000.120402.0000000.000.0002.000',0,'01-JUL-
19',NULL,px_fund_available,px_result);
insert into temp_tbl values(1,px_fund_available);
insert into temp_tbl values(2,px_result);
commit;
end;
---Output---
You can able check fund for the specific account from oracle application screen.
You can query that specific account code for a specific period and check the funds available.
No comments:
Post a Comment
https://chetanrajputoracleapps.blogspot.com/2019/07/oracle-budget-fund-check-procedure-for.html 5/6
3/23/24, 10:29 AM Oracle Application: How to check budget fund for specific account - Oracle Query
To leave a comment, click the button below to sign in with Google.
Pages
Home
Terms and Conditions
Privacy Policy
https://chetanrajputoracleapps.blogspot.com/2019/07/oracle-budget-fund-check-procedure-for.html 6/6