Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Pre-requisites:
a) Vendors and their Sites Should Be Setup
b) Currency and exchange Rates Should Be setup
c) Source and invoice type lookup code must be defined
d) Account Payables Account and Distribution Account must be defined.
e) Payment Terms should be defines and GL Period must be in opened status.
Interface Tables:
AP_INVOICES_INTERFACE
AP_INVOCE_LINES_INTERFACE
BASE TABLES :
AP_INVOICES_ALL
AP_INVOICE_LINES_ALL
AP_INVOICE_DISTRIBUTIONS_ALL
AP_PAYMENT_SCHEDULES
INTERFACE PROGRAM:
23-Dec-13
AP_INTERFACE_REJECTIONS
AP_INTERFACE_CONTROLS
Main Columns In AP_INVOICES_INTERFACE:
INVOICE_ID,
INVOICE_NUM, INVOICE_DATE ,INVOICE_AMOUNT
VENDOR_ID ,
VENDOR_NUM, VENDOR_NAME ,VENDOR_SITE_CODE,
VENDOR_SITE_ID
TERMS_NAME,
TERM_ID,
TERM_DATE, SOURCE,
PAYMENT_METHOD_LOOKUP_CODE,
GL_DATE,
PO_NUMBER, INVOICE_CURRENCE_CODE,
EXCHANGE_RATE_TYPE
VOUCHER_NUMBER, PAYMENT_CURRENCY_CODE, DOC_CATEGPRY_CODE
Main Columns In AP_INVOICE_LINES_INTERFACE:
INVOICE_ID , INVOICE_LINE_ID ,
LINE_NUM, LINE_TYPE_LOOKUP_CODE
AMOUNR
, DIST_CODE_COMBINATION_ID, DIST_CODE_CONCATENATED
PO_HEADER_ID, PO_LINE_ID,
PO_LINE_NUMBER
Tables To Be Used For Validation:
PO_VENDORS
AP_TERMS
ORG_ORGANIZATION_DEFINITIONS
FND_CURRNECIES
AP_INVOICES_ALL GL_DAILY_CONVERSION_TYPES
GL_CODE_COMBINATIONS AP_LOOKUP_CODES GL_PERIOD_STATUSES
Control file for Headers:OPTIONS(SKIP=1)
LOAD DATA
INFILE '/apps/aptest/visappl/xxcus/11.5.0/bin/ap_int_temp.csv'
truncate into table ap_int_temp
fields terminated by ',' optionally enclosed by '"'
trailing nullcols
(
INVOICE_NUM
INVOICE_DATE ,
INVOICE_TYPE_LOOKUP_CODE ,
VENDOR_NAME ,
VENDOR_SITE_CODE ,
23-Dec-13
INVOICE_AMOUNT ,
INVOICE_CURRENCY_CODE ,
DESCRIPTION ,
SOURCE ,
PAYMENT_METHOD_LOOKUP_CODE ,
PAY_GROUP_LOOKUP_CODE ,
OU_NAME
"REPLACE(:OU_NAME,CHR(13),'')"
For Lines:OPTIONS(SKIP=1)
LOAD DATA
INFILE '/apps/aptest/visappl/xxcus/11.5.0/bin/ap_int_line_temp.csv'
truncate into table ap_int_line_temp
fields terminated by ',' optionally enclosed by '"'
trailing nullcols
(
INVOICE_NUM
OU_NAME ,
LINE_NUMBER ,
LINE_TYPE_LOOKUP_CODE ,
AMOUNT ,
DESCRIPTION ,
DIST_CODE_CONCATENATED "REPLACE(:DIST_CODE_CONCATENATED,CHR(13),'')"
)
23-Dec-13
sqlldr apps/apps
control='/apps/aptest/visappl/xxcus/11.5.0/bin/ap_int_line_temp.ctl'
log='/apps/aptest/visappl/xxcus/11.5.0/bin/ap_int_line_temp.log'
exit 0
varchar2(50),
table_name
varchar2(50),
column_name
varchar2(50),
error_message
varchar2(100),
created_by
varchar2(10),
creation_date
date,
last_updated_by varchar2(10),
last_update_date date,
request_id
varchar2(10)
);
varchar2,
varchar2,
p_column_name
varchar2,
p_error_message
varchar2
)
is
23-Dec-13
begin
insert into ap_common_err_tab
values
(
p_interface_name,
p_table_name,
p_column_name,
p_error_message,
fnd_profile.value('USER_ID'),
SYSDATE,
fnd_profile.value('USER_ID'),
SYSDATE,
fnd_profile.value('CONC_REQUEST_ID')
);
23-Dec-13
v_tot_rec number;
v_sus_rec number;
v_err_rec number;
begin
23-Dec-13
for info1 in c2
loop
fnd_file.put_line(fnd_file.output,'---------------------------');
fnd_file.put_line(fnd_file.output,'FOR ERROR INFORMATION');
fnd_file.put_line(fnd_file.output,'---------------------------');
fnd_file.put_line(fnd_file.output,'INVOICE NUM =>'||info1.invoice_num);
fnd_file.put_line(fnd_file.output,'VENDOR NAME =>'||info1.vendor_name);
fnd_file.put_line(fnd_file.output,'TOTAL RECORDS =>'||v_tot_rec);
fnd_file.put_line(fnd_file.output,'TOTAL SUCESS RECORDS =>'||v_sus_rec);
fnd_file.put_line(fnd_file.output,'TOTAL ERROR RECORDS =>'||v_err_rec);
fnd_file.put_line(fnd_file.output,'ERROR MESSAGE =>'||info1.error_message);
end loop;
end ap_record_details;
---arch table information
procedure arch_proc
is
begin
insert into ap_inv_head_arch select * from ap_inv_head;
insert into ap_inv_line_arch select * from ap_inv_line;
delete from ap_inv_head;
delete from ap_inv_line;
commit;
end;
procedure dis_log(p_msg in varchar2)
is
begin
fnd_file.put_line(fnd_file.log,p_msg);
end dis_log;
23-Dec-13
v_head ap_invoices_interface%rowtype;
v_line ap_invoice_lines_interface%rowtype;
v_head_tab varchar2(100):='AP_INV_HEAD';
v_line_tab varchar2(100):='AP_INV_LINE';
v_conc_program varchar2(100);
v_process_flag varchar2(1);
v_error_message varchar2(100);
v_tot_err_msg varchar2(1000);
v_count number;
v_inv_num_exists exception;
v_amount number;
begin
---concurrent program-----select fcp.user_concurrent_program_name
into v_conc_program
from fnd_concurrent_programs_vl fcp,
fnd_concurrent_requests fcr
where fcp.concurrent_program_id=fcr.concurrent_program_id
23-Dec-13
and fcr.request_id=g_request_id;
---end of concurrent program------
23-Dec-13
v_process_flag:='E';
v_error_message:='EXCEPTION AT INVOICE TYPE LOOKUP CODE
VALIDATION =>'||rec_head.invoice_type_lookup_code||' '||sqlerrm;
v_tot_err_msg:=v_tot_err_msg||' '||v_error_message;
ee_ap_comm_err_procedure(p_interface_name => v_conc_program,
p_table_name => v_head_tab,
p_column_name => 'INVOICE TYPE LOOKYP CODE',
p_error_message => v_error_message
);
end;
23-Dec-13
end;
23-Dec-13
23-Dec-13
v_process_flag:='E';
v_error_message:='EXCEPTION AT ORG_NAME VALIDATION =>'||
rec_head.vendor_site_code||' '||sqlerrm;
v_tot_err_msg:=v_tot_err_msg||' '||v_error_message;
ee_ap_comm_err_procedure(p_interface_name => v_conc_program,
p_table_name => v_head_tab,
p_column_name => 'VENDOR_SITE_CODE',
p_error_message => v_error_message
);
end;
-----****source validation****-----
begin
select lookup_code into v_head.source
23-Dec-13
from ap_lookup_codes
where lookup_type='SOURCE'
and displayed_field=rec_head.source;
exception
when no_data_found then
v_process_flag:='E';
v_error_message:='INVALID SOURCE =>'||rec_head.source;
v_tot_err_msg:=v_tot_err_msg||' '||v_error_message;
ee_ap_comm_err_procedure(p_interface_name => v_conc_program,
p_table_name => v_head_tab,
p_column_name => 'SOURCE',
p_error_message => v_error_message
);
when others then
v_process_flag:='E';
v_error_message:='EXCEPTION AT SOURCE VALIDATION =>'||
rec_head.source||' '||sqlerrm;
v_tot_err_msg:=v_tot_err_msg||' '||v_error_message;
ee_ap_comm_err_procedure(p_interface_name => v_conc_program,
p_table_name => v_head_tab,
p_column_name => 'SOURCE',
p_error_message => v_error_message
);
end;
23-Dec-13
begin
select term_id into v_head.terms_id
from ap_terms
where name=rec_head.terms_name;
exception
when no_data_found then
v_process_flag:='E';
v_error_message:='INVALID TERMS NAME =>'||rec_head.terms_name;
v_tot_err_msg:=v_tot_err_msg||' '||v_error_message;
ee_ap_comm_err_procedure(p_interface_name => v_conc_program,
p_table_name => v_head_tab,
p_column_name => 'TERMS_NAME',
p_error_message => v_error_message
);
when others then
v_process_flag:='E';
v_error_message:='EXCEPTION AT TERMS NAME VALIDATION =>'||
rec_head.terms_name||' '||sqlerrm;
v_tot_err_msg:=v_tot_err_msg||' '||v_error_message;
ee_ap_comm_err_procedure(p_interface_name => v_conc_program,
p_table_name => v_head_tab,
p_column_name => 'TERMS_NAME',
p_error_message => v_error_message
);
end;
23-Dec-13
begin
v_head.invoice_num
:= rec_head.invoice_num;
-- v_head.invoice_type_lookup_code
rec_head.invoice_type_lookup_code;
:=
v_head.vendor_name
:= rec_head.vendor_name;
v_head.vendor_site_code
:= rec_head.vendor_site_code;
v_head.invoice_amount
:= rec_head.invoice_amount;
v_head.terms_name
v_head.created_by
:= rec_head.terms_name;
:= g_user_id;
23-Dec-13
v_head.creation_date
:= g_date;
v_head.last_updated_by
:= g_user_id;
v_head.last_update_date
:= g_date;
exception
when no_data_found then
v_process_flag:='E';
v_error_message:='INVALID LINE TYPE LOOKUP CODE =>'||
rec_line.line_type_lookup_code;
v_tot_err_msg:=v_tot_err_msg||' '||v_error_message;
ee_ap_comm_err_procedure(p_interface_name => v_conc_program,
p_table_name => v_line_tab ,
p_column_name => 'LINE TYPE LOOKUP CODE',
p_error_message => v_error_message
);
when others then
v_process_flag:='E';
v_error_message:='EXCEPTION AT LINE TYPE LOOKUP CODE VALIDATION
=>'||rec_line.line_type_lookup_code||' '||sqlerrm;
23-Dec-13
v_tot_err_msg:=v_tot_err_msg||' '||v_error_message;
ee_ap_comm_err_procedure(p_interface_name => v_conc_program,
p_table_name => v_line_tab ,
p_column_name => 'LINE TYPE LOOKUP CODE',
p_error_message => v_error_message
);
end;
23-Dec-13
);
when others then
v_process_flag:='E';
v_error_message:='EXCEPTION AT CHARGE ACCOUNT VALIDATION =>'||
rec_line.dist_code_concatenated||' '||sqlerrm;
v_tot_err_msg:=v_tot_err_msg||' '||v_error_message;
ee_ap_comm_err_procedure(p_interface_name => v_conc_program,
p_table_name => v_line_tab ,
p_column_name => 'CHARGE ACCOUNT',
p_error_message => v_error_message
);
end;
v_line.invoice_id
v_line.line_number
:= v_head.invoice_id;
:= rec_line.line_number;
--v_line.line_type_lookup_code
v_line.amount
:= rec_line.amount;
v_line.dist_code_concatenated
v_line.created_by
v_line.creation_date
:= rec_line.line_type_lookup_code;
:= rec_line.dist_code_concatenated;
:= g_user_id;
:= g_date;
v_line.last_updated_by
:= g_user_id;
v_line.last_update_date
:= g_date;
v_line.org_id
:= v_head.org_id;
23-Dec-13
dis_log('PROCESS_FLAG =>'||v_process_flag);
end loop;
dis_log('PROCESS_FLAG =>'||v_process_flag);
23-Dec-13
exception
when others then
dis_log('EXCEPTION AT PACKAGE =>'||sqlerrm);
end main;
end ee_ap_inv_pkg;
/
23-Dec-13