GL Interface Batch
GL Interface Batch
GL Interface Batch
varchar2,
retcode out varchar2) is
----Cursor Declaration for Journal----------Cursor Journals_cur is select
STATUS,
SET_OF_BOOKS_ID,
ACCOUNTING_DATE,
CURRENCY,
DATE_CREATED,
CREATED_BY,
ACTUAL_FLAG,
CATEGORY,
SOURCE,
CURR_CONVERSION,
SEGMENT1,
SEGMENT2,
SEGMENT3,
SEGMENT4,
SEGMENT5,
ENTERED_DR,
ENTERED_CR,
ACCOUNTED_DR,
ACCOUNTED_CR,
GROUP_ID from XXX_GL_DATA;
---VariAble Declaration
V_SET_OF_BOOKS_ID VARCHAR2(200);
V_CURRENCY
VARCHAR2(200);
V_CATEGORY
VARCHAR2(200);
V_CREATED_BY VARCHAR2(200);
l_count
varchar2(5) default 0;
v_flag
varchar2(20);
v_error_message varchar2(200);
begin
delete from gl_interface;
commit;
for Journals_rec in journals_cur loop
l_count:=l_count+1;
v_flag:='A';
Begin
/*************************************************
Set of Books id validations
/*************************************************/
select set_of_books_id into v_set_of_books_id
from
gl_sets_of_books
where set_of_books_id=journals_rec.set_of_books_id;
Exception
WHEN NO_DATA_FOUND THEN
fnd_file.put_line(fnd_file.log,'No Records availble in Gl sets of books' ||'-'||
l_count);
WHEN OTHERS THEN
V_FLAG:='E';
V_ERROR_MESSAGE:='Set of books id does not existed';
fnd_file.put_line(fnd_file.log,'Set of books id is not existed '||'-'||l_count||'-'||
v_error_message);
End;
/***********************************************************
End of Set of books id validations
************************************************************/
/*************************************************
Category validations
/*************************************************/
Begin
Select USER_JE_CATEGORY_NAME INTO V_CATEGORY
FROM GL_JE_CATEGORIES
WHERE JE_CATEGORY_NAME=Journals_rec.CATEGORY;
EXCEPTION
WHEN NO_DATA_FOUND THEN
fnd_file.put_line(fnd_file.log,'No Records availble in Category' ||'-'||l_count);
WHEN OTHERS THEN
V_FLAG:='E';
V_ERROR_MESSAGE:='Category does not existed';
fnd_file.put_line(fnd_file.log,'Category is nto existed '||'-'||l_count||'-'||
v_error_message);
End;
/*************************************************
End of Category validations
/*************************************************/
/*************************************************
USER ID validations
/*************************************************/
begin
Select user_id into v_created_by
From fnd_user
WHERE USER_ID=journals_rec.created_by;
Exception
USER_CURRENCY_CONVERSION_TYPE,
SEGMENT1,
SEGMENT2,
SEGMENT3,
SEGMENT4,
SEGMENT5,
ENTERED_DR,
ENTERED_CR,
ACCOUNTED_DR,
ACCOUNTED_CR,
group_id)
VALUES ( Journals_rec.STATUS,
Journals_rec.SET_OF_BOOKS_ID,
Journals_rec.ACCOUNTING_DATE,
Journals_rec.CURRENCY,
Journals_rec.DATE_CREATED,
Journals_rec.CREATED_BY,
Journals_rec.ACTUAL_FLAG,
Journals_rec.CATEGORY,
Journals_rec.SOURCE,
Journals_rec.CURR_CONVERSION,
Journals_rec.SEGMENT1,
Journals_rec.SEGMENT2,
Journals_rec.SEGMENT3,
Journals_rec.SEGMENT4,
Journals_rec.SEGMENT5,
Journals_rec.ENTERED_DR,
Journals_rec.ENTERED_CR,
Journals_rec.ACCOUNTED_DR,
Journals_rec.ACCOUNTED_CR,
Journals_rec.GROUP_ID);
END IF;
Fnd_file.put_line(fnd_file.log,'Records inserted Successfully');
end;
END LOOP;
COMMIT;
V_FLAG:=NULL;
V_ERROR_MESSAGE:=NULL;
END JOURNALS_PROCEDURE1;
SELECT * FROM USER_ERRORS WHERE NAME=PROCEDURE NAME OR
TABLE NAME;