DECLARE
vnext_no NUMBER (15);
l_segment1 VARCHAR2 (25);
l_segment2 VARCHAR2 (25);
l_segment3 VARCHAR2 (25);
l_segment4 VARCHAR2 (25);
l_segment5 VARCHAR2 (25);
l_segment6 VARCHAR2 (25);
l_segment7 VARCHAR2 (25);
l_segment8 VARCHAR2 (25);
CURSOR c_get_jv
IS
SELECT *
FROM oomco_gl_trailbalance
ORDER BY 1;
-- r_get_jv c_get_jv%ROWTYPE;
/*
==========================================================================
Set up variables
Changed on 25th Jun2 1998
New Old
vuser_id : bpfnd_users_idev.user_id fnd_user.user_id
vset_of_books_id: bpgl_periods_idev gl_sets_of_books
vacct_orgn_code : bpfnd_organizations_idev
==========================================================================
*/
vset_of_books_id NUMBER (15);
vuser_id NUMBER (15);
vbase_currency_code VARCHAR2 (5) := 'RO';
vconversion_date DATE;
vconversion_type VARCHAR2 (20);
vconversion_rate NUMBER (15, 8);
/* =============New Variables with cont_provn_easylink===================== */
vsequence_number NUMBER (15);
vwork_grp_id NUMBER (5);
vrfslock VARCHAR2 (1);
vupdt_seq_num NUMBER (10);
vcrt_userid VARCHAR2 (8);
vcrt_date_time DATE;
vlast_updt_userid VARCHAR2 (8);
vlast_updt_date_time DATE;
vrow_vers_num NUMBER (10);
vacct_orgn_code VARCHAR2 (30);
cfgn_curcy_code VARCHAR2 (4);
ccurcy_code VARCHAR2 (4);
l_new_account VARCHAR2 (250);
l_code_combination_id NUMBER (15);
l_ledger_id NUMBER;
/* ======================================================================== */
BEGIN
vuser_id := 0 /* constant */;
vset_of_books_id := 1; /* constant */
BEGIN
SELECT ledger_id
INTO l_ledger_id
FROM gl_ledgers
WHERE NAME = 'OOMCO Ledger';
EXCEPTION
WHEN NO_DATA_FOUND
THEN
DBMS_OUTPUT.put_line ('Cannot get the ACCT_ORGN_CODE ...');
raise_application_error (-20000, 'Fatal Error...');
END;
DBMS_OUTPUT.put_line ('I am in');
FOR r_get_jv IN c_get_jv
LOOP
vconversion_type := 'User';
/*====================Values for The New variables ======================*/
vsequence_number := 1; /* constant */
vwork_grp_id := 0;
vrfslock := 'N';
vupdt_seq_num := 1;
vcrt_userid := 'RFS';
vcrt_date_time := SYSDATE;
vlast_updt_userid := 'RFS';
vlast_updt_date_time := SYSDATE;
vrow_vers_num := 1;
BEGIN
SELECT code_combination_id,segment1,segment2,segment3,segment4,segment5,segment6,segment7,segment8
INTO l_code_combination_id,l_segment1, l_segment2, l_segment3,
l_segment4, l_segment5, l_segment6,
l_segment7, l_segment8
FROM gl_code_combinations
WHERE segment1
|| '.'
|| segment2
|| '.'
|| segment3
|| '.'
|| segment4
|| '.'
|| segment5
|| '.'
|| segment6
|| '.'
|| segment7
|| '.'
|| segment8 = r_get_jv.new_combination;
EXCEPTION
WHEN OTHERS
THEN
Dbms_output.put_line('Account combination does not exist'||r_get_jv.new_combination);
l_code_combination_id := NULL;
END;
/*=======================================================================*/
INSERT INTO gl_interface
(status, ledger_id, accounting_date, currency_code,
date_created, created_by, actual_flag,
user_je_category_name, user_je_source_name,
currency_conversion_date, currency_conversion_rate,
code_combination_id, segment1, segment2, segment3,
segment4, segment5, segment6, segment7, segment8,
entered_dr, entered_cr, accounted_dr,
accounted_cr, transaction_date, reference1, reference2,
reference4, reference10, GROUP_ID, period_name
)
VALUES ('NEW', l_ledger_id, TO_DATE ('31-JAN-2013'), 'OMR',
SYSDATE, 1131, 'A',
'Miscellaneous', 'DATA MIGRATION',
TO_DATE ('31-JAN-2013'), 1,
l_code_combination_id, l_segment1,l_segment2,l_segment3,
l_segment4, l_segment5, l_segment6, l_segment7, l_segment8,
r_get_jv.debit, r_get_jv.credit, r_get_jv.debit,
r_get_jv.credit, TO_DATE ('31-JAN-2013'), NULL, NULL,
NULL, r_get_jv.DESCRIPTION, 5555, 'Jan-13'
);
END LOOP;
COMMIT;
END;
No comments :
Post a Comment