declare
x_return_status VARCHAR2 (200) := NULL;
x_msg_count NUMBER := 0;
x_msg_data VARCHAR2 (200) := NULL;
p_external_payee_tab_type iby_disbursement_setup_pub.external_payee_tab_type;
p_ext_payee_id_tab_type iby_disbursement_setup_pub.ext_payee_id_tab_type;
l_payee_upd_status iby_disbursement_setup_pub.ext_payee_update_tab_type;
g_org_id NUMBER := 223;
g_user_id NUMBER := 48866;
g_resp_id NUMBER := 50916;
g_resp_appl_id NUMBER := 200;
i NUMBER := 0;
/*select distinct asa.vendor_id,aps.vendor_name,
asa.vendor_site_code,
asa.vendor_site_id supplier_site_id ,
iep.ext_payee_id,iep.payee_party_id,
asa.org_id,
asa.party_site_id
from ap_invoices_interface api,
iby_external_payees_all iep,
ap_supplier_sites_all asa,
ap_suppliers aps
where iep.supplier_site_id = api.vendor_site_id
and aps.vendor_id = asa.vendor_id
and asa.vendor_site_id = api.vendor_site_id
and asa.org_id = api.org_id
and source is not null
and invoice_num like'CONV%'
and status = 'REJECTED-1';*/
begin
fnd_global.apps_initialize (user_id => g_user_id,
resp_id => g_resp_id,
resp_appl_id => g_resp_appl_id);
for j in (select distinct asa.vendor_id,
asa.vendor_site_code,
asa.vendor_site_id supplier_site_id ,
iep.ext_payee_id,iep.payee_party_id,
asa.org_id,
asa.party_site_id
from ap_invoices_interface api,
iby_external_payees_all iep,
ap_supplier_sites_all asa
where iep.supplier_site_id = api.vendor_site_id
and asa.vendor_site_id = api.vendor_site_id
and asa.org_id = api.org_id
and source is not null
and invoice_num like'CONV%'
and status = 'REJECTED-1' and rownum=1)
loop
mo_global.set_policy_context ('S', j.org_id);
p_external_payee_tab_type (i).default_pmt_method := 'EFT';
p_external_payee_tab_type (i).payment_function := 'PAYABLES_DISB';
p_external_payee_tab_type (i).exclusive_pay_flag := 'N';
p_external_payee_tab_type (i).payee_party_id := j.payee_party_id;
p_external_payee_tab_type (i).payer_org_id := j.org_id;
p_external_payee_tab_type (i).payer_org_type := 'OPERATING_UNIT';
p_external_payee_tab_type (i).supplier_site_id := j.supplier_site_id;
p_external_payee_tab_type (i).Payee_Party_Site_Id := j.party_site_id;
p_ext_payee_id_tab_type (i).ext_payee_id := j.ext_payee_id;
iby_disbursement_setup_pub.update_external_payee (
p_api_version => 1.0,
p_init_msg_list => 'T',
p_ext_payee_tab => p_external_payee_tab_type,
p_ext_payee_id_tab => p_ext_payee_id_tab_type,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
x_ext_payee_status_tab => l_payee_upd_status
);
i:=0;
IF x_return_status != 'S' THEN
DBMS_OUTPUT.PUT_LINE ('External Payee Update :' || j.vendor_id||'-'||j.vendor_site_code);
DBMS_OUTPUT.PUT_LINE ('x_return_status: ' || x_return_status);
END IF;
end loop;
end;
No comments:
Post a Comment