Search This Blog

Sunday, November 28, 2010

Create Event in Oracle Projects - pa_event_pub.create_event

API to Create Event in Oracle Projects:

create or replace procedure xxpa_create_project_event(errbuf in varchar2,retcode in number)
as
l_msg_count    NUMBER;
l_msg_data     varchar2(2000);
l_return_status VARCHAR2(10);
l_event_in_tbl   PA_EVENT_PUB.Event_In_Tbl_Type;
l_event_out_tbl  PA_EVENT_PUB.Event_out_Tbl_Type;
ln_line_no number;
cursor cur is
select * from XXPA_CREATE_PRO_EVENT ;
begin
for i in cur
loop
ln_line_no := NVL(ln_line_no,0) + 1;
l_event_in_tbl (ln_line_no).p_pm_event_reference := i.project_number ;
l_event_in_tbl (ln_line_no).p_task_number := NULL;
l_event_in_tbl (ln_line_no).p_event_type :=
'Data Migration';
l_event_in_tbl (ln_line_no).p_description :=
'Data Migration';
l_event_in_tbl (ln_line_no).p_completion_date :=
to_date('31-DEC-2008');
l_event_in_tbl (ln_line_no).p_project_number :=
i.project_number;
l_event_in_tbl (ln_line_no).p_organization_name :=
'Eros Electricals';
l_event_in_tbl (ln_line_no).p_bill_trans_bill_amount := I.bill_amount;
l_event_in_tbl (ln_line_no).p_bill_trans_rev_amount := I.revenue_amount;
l_event_in_tbl (ln_line_no).p_bill_trans_currency_code :=
'AED';
end loop;
pa_event_pub.create_event (p_api_version_number => 1.0,
p_commit => fnd_api.g_false,
p_init_msg_list => 'T',
p_pm_product_code => 'XXXX',
p_event_in_tbl => l_event_in_tbl,
p_event_out_tbl => l_event_out_tbl,
p_msg_count => l_msg_count,
p_msg_data => l_msg_data,
p_return_status => l_return_status
);
Fnd_File.put_line(Fnd_File.LOG, 'Error Message: '||l_msg_data);
dbms_output.put_line(l_msg_data);
commit;
end;
/

4 comments: