Você está na página 1de 3

declare

v_ae_header_id number;
v_event_id number;
v_period_name varchar2(100);
v_creation_date date;
v_created_by number;
v_last_update_date date;
v_last_updated_by number;
v_last_update_login number;
v_retcode number;

v_return_status VARCHAR2(100);
v_msg_count number;
v_msg_data VARCHAR2(1000);

v_recerrorflag VARCHAR2(100);
v_errordetails VARCHAR2(2000);

begin
dbms_output.put_line('Calling the Create Journal Entry Header Package..');
fnd_global.apps_initialize(
fnd_global.user_id,
fnd_global.resp_id,
fnd_global.resp_appl_id);
--mo_global.set_policy_context('S',2);
xla_journal_entries_pub_pkg.create_journal_entry_header
(p_api_version => 1.0
,p_init_msg_list => apps.fnd_api.g_true
,p_application_id => 200
,p_ledger_id => 1
,p_legal_entity_id => 1
,p_gl_date => SYSDATE
,p_description => null
,p_je_category_name => 'Purchase Invoices'
,p_balance_type_code => 'A'
,p_budget_version_id => null
,p_reference_date => SYSDATE
,p_budgetary_control_flag => 'N'
,p_attribute_category => null
,p_attribute1 => null
,p_attribute2 => null
,p_attribute3 => null
,p_attribute4 => null
,p_attribute5 => null
,p_attribute6 => null
,p_attribute7 => null
,p_attribute8 => null
,p_attribute9 => null
,p_attribute10 => null
,p_attribute11 => null
,p_attribute12 => null
,p_attribute13 => null
,p_attribute14 => null
,p_attribute15 => null
,x_return_status => v_return_status
,x_msg_count => v_msg_count
,x_msg_data => v_msg_data
,x_ae_header_id => v_ae_header_id
,x_event_id => v_event_id
);
commit;
dbms_output.put_line('v_return_status : '||v_return_status);
dbms_output.put_line('v_msg_count : '||v_msg_count);
dbms_output.put_line('v_msg_data : '||v_msg_data);
dbms_output.put_line('v_ae_header_id : '||v_ae_header_id);
dbms_output.put_line('v_event_id : '||v_event_id);

IF v_return_status <> 'S'


THEN
v_recerrorflag := 'Y';
FOR i IN 1 .. v_msg_count
LOOP
v_errordetails :=
SUBSTR
( v_errordetails
|| 'creating je '
|| SUBSTR
(apps.fnd_msg_pub.get
(p_msg_index => i,
p_encoded =>
apps.fnd_api.g_false
),
1,
255
)
|| CHR (10),
1,
10000
);
END LOOP;
END IF;
dbms_output.put_line('v_errordetails : '||v_errordetails);

exception
when others then
dbms_output.put_line('sqlcode : '||sqlcode);
dbms_output.put_line('sqlerrm : '||sqlerrm);
end;

==============================================================================

Errors :
--------
Calling the Create Journal Entry Header Package..
v_return_status : U
v_msg_count : 1
v_msg_data : FND FND_AS_UNEXPECTED_ERROR N PKG_NAME
xla.plsql.xla_journal_entries_pub_pkg N PROCEDURE_NAME create_journal_entry_header
N ERROR_TEXT ORA-20001: -: XLA-: XLA_MJE_INVALID_JOURNAL_CAT (JE_CATEGORY=Purchase
Invoices)
v_ae_header_id :
v_event_id :
v_errordetails : creating jeORA-20001: -: XLA-: XLA_MJE_INVALID_JOURNAL_CAT
(JE_CATEGORY=Purchase Invoices) in Package xla.plsql.xla_journal_entries_pub_pkg
Procedure create_journal_entry_header

Você também pode gostar