最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

详解EBS接口开发之更新供应商付款方法

IT培训 admin 10浏览 0评论

详解EBS接口开发之更新供应商付款方法

更新供应商地点层的付款方法API

DECLARE--API 参数l_external_payee_rec_type iby_disbursement_setup_pub.external_payee_rec_type;l_ext_payee_id_rec_type   iby_disbursement_setup_pub.ext_payee_id_rec_type;l_ext_payee_tab           iby_disbursement_setup_pub.external_payee_tab_type;l_ext_payee_id_tab        iby_disbursement_setup_pub.ext_payee_id_tab_type;l_ext_payee_status_tab    iby_disbursement_setup_pub.ext_payee_update_tab_type;--变量l_api_version CONSTANT NUMBER := 1;l_msg_data      VARCHAR2(2000);l_msg           VARCHAR2(4000);l_msg_count     NUMBER;l_return_status VARCHAR2(1);l_method_code   VARCHAR2(50);l_vendor_id              NUMBER;l_party_id               NUMBER;l_party_site_id          NUMBER;l_location_id            NUMBER;l_vendor_site_id         NUMBER;l_object_version_number  NUMBER;l_loc_version_number     NUMBER;g_def_exclusive_pay_flag VARCHAR2(1) := 'Y';--l_party_id              NUMBER;--游标CURSOR cur_cux_vendor ISSELECT l.vendor_site_code, l.attribute2, l.line_idFROM cux_oms_vendor_site lWHERE l.attribute2 IS NULLFOR UPDATE NOWAIT;CURSOR cur_ap_vendor(p_vendor_site_code IN VARCHAR2) ISSELECT l.vendor_id, l.vendor_site_id, l.org_id, l.party_site_idFROM ap_supplier_sites_all lWHERE l.vendor_site_code = p_vendor_site_code;CURSOR c_payment_method(p_vendor_id      IN VARCHAR2,p_vendor_site_id IN NUMBER) ISSELECT a.ext_payee_id,a.payment_function,a.supplier_site_id,a.party_site_id,a.org_id,a.org_type,a.object_version_number,pv.party_id,s.attribute2FROM ap_supplier_sites_all   s,iby_external_payees_all a,po_vendors              pvWHERE (s.inactive_date IS NULL ORtrunc(s.inactive_date) >= trunc(SYSDATE))AND a.supplier_site_id(+) = s.vendor_site_idAND s.vendor_id = pv.vendor_idAND a.payee_party_id = pv.party_idAND s.org_id = a.org_id(+)AND s.party_site_id = a.party_site_id(+)AND s.vendor_site_id = p_vendor_site_idAND pv.vendor_id = p_vendor_id;BEGINfnd_global.apps_initialize(user_id      => 1110,resp_id      => 20639,resp_appl_id => 200);FOR rec_cux_vendor IN cur_cux_vendor LOOPFOR rec_ap_vendor IN cur_ap_vendor(p_vendor_site_code => rec_cux_vendor.vendor_site_code) LOOP--初始化参数mo_global.set_policy_context(p_access_mode => 'S',p_org_id      => rec_ap_vendor.org_id);FOR r_payment_method IN c_payment_method(p_vendor_id      => rec_ap_vendor.vendor_id,p_vendor_site_id => rec_ap_vendor.vendor_site_id) LOOPl_ext_payee_id_rec_type := NULL;l_ext_payee_id_tab.delete;l_external_payee_rec_type := NULL;l_ext_payee_tab.delete;SELECT l.party_idINTO l_party_idFROM ap_suppliers lWHERE l.vendor_id = rec_ap_vendor.vendor_id;--update site level ext pay inforl_ext_payee_id_rec_type := NULL;l_ext_payee_id_tab.delete;l_external_payee_rec_type := NULL;l_ext_payee_tab.delete;--init param p_ext_payee_id_tabl_ext_payee_id_rec_type.ext_payee_id := r_payment_method.ext_payee_id;l_ext_payee_id_tab(1) := l_ext_payee_id_rec_type;--init param p_ext_payee_tabl_external_payee_rec_type.payee_party_site_id := r_payment_method.party_site_id;l_external_payee_rec_type.payee_party_id      := r_payment_method.party_id; --p_party_id;l_external_payee_rec_type.payment_function    := r_payment_method.payment_function;l_external_payee_rec_type.payer_org_id        := r_payment_method.org_id;l_external_payee_rec_type.supplier_site_id    := r_payment_method.supplier_site_id;l_external_payee_rec_type.payer_org_type      := r_payment_method.org_type;l_external_payee_rec_type.exclusive_pay_flag  := g_def_exclusive_pay_flag;/*SELECT pmv.payment_method_codeINTO l_method_codeFROM iby_payment_methods_vl pmvWHERE pmv.payment_method_name = '银行电汇'AND SYSDATE < nvl(pmv.inactive_date, SYSDATE + 1);*/l_external_payee_rec_type.default_pmt_method := 'BZ_CHECK';l_ext_payee_tab(1) := l_external_payee_rec_type;iby_disbursement_setup_pub.update_external_payee(p_api_version          => l_api_version,p_init_msg_list        => 'T',p_ext_payee_tab        => l_ext_payee_tab,p_ext_payee_id_tab     => l_ext_payee_id_tab,x_return_status        => l_return_status,x_msg_count            => l_msg_count,x_msg_data             => l_msg_data,x_ext_payee_status_tab => l_ext_payee_status_tab);IF l_return_status != fnd_api.g_ret_sts_success THENIF l_msg_data IS NULL THENl_msg_data := fnd_msg_pub.get(p_msg_index => fnd_msg_pub.g_last,p_encoded   => 'F'); --get last messagedbms_output.put_line('l_msg_data:' || SQLERRM);END IF; --IF l_msg_data IS NULL THENEND IF; --IF l_return_status != fnd_api.g_ret_sts_success THENEND LOOP; --FOR r_payment_method IN c_payment_method(p_vendor_id      =>rec_ap_vendor.vendor_id,END LOOP; --for rec_ap_vendor in cur_ap_vendor(p_vendor_site_code =>rec_cux_vendor.vendor_site_code) loopUPDATE cux_oms_vendor_site LSET L.ATTRIBUTE2 = 'BZ_CHECK'WHERE L.LINE_ID = rec_cux_vendor.LINE_ID;END LOOP; --for rec_cux_vendor in cur_cux_vendor loop
END;

详解EBS接口开发之更新供应商付款方法

更新供应商地点层的付款方法API

DECLARE--API 参数l_external_payee_rec_type iby_disbursement_setup_pub.external_payee_rec_type;l_ext_payee_id_rec_type   iby_disbursement_setup_pub.ext_payee_id_rec_type;l_ext_payee_tab           iby_disbursement_setup_pub.external_payee_tab_type;l_ext_payee_id_tab        iby_disbursement_setup_pub.ext_payee_id_tab_type;l_ext_payee_status_tab    iby_disbursement_setup_pub.ext_payee_update_tab_type;--变量l_api_version CONSTANT NUMBER := 1;l_msg_data      VARCHAR2(2000);l_msg           VARCHAR2(4000);l_msg_count     NUMBER;l_return_status VARCHAR2(1);l_method_code   VARCHAR2(50);l_vendor_id              NUMBER;l_party_id               NUMBER;l_party_site_id          NUMBER;l_location_id            NUMBER;l_vendor_site_id         NUMBER;l_object_version_number  NUMBER;l_loc_version_number     NUMBER;g_def_exclusive_pay_flag VARCHAR2(1) := 'Y';--l_party_id              NUMBER;--游标CURSOR cur_cux_vendor ISSELECT l.vendor_site_code, l.attribute2, l.line_idFROM cux_oms_vendor_site lWHERE l.attribute2 IS NULLFOR UPDATE NOWAIT;CURSOR cur_ap_vendor(p_vendor_site_code IN VARCHAR2) ISSELECT l.vendor_id, l.vendor_site_id, l.org_id, l.party_site_idFROM ap_supplier_sites_all lWHERE l.vendor_site_code = p_vendor_site_code;CURSOR c_payment_method(p_vendor_id      IN VARCHAR2,p_vendor_site_id IN NUMBER) ISSELECT a.ext_payee_id,a.payment_function,a.supplier_site_id,a.party_site_id,a.org_id,a.org_type,a.object_version_number,pv.party_id,s.attribute2FROM ap_supplier_sites_all   s,iby_external_payees_all a,po_vendors              pvWHERE (s.inactive_date IS NULL ORtrunc(s.inactive_date) >= trunc(SYSDATE))AND a.supplier_site_id(+) = s.vendor_site_idAND s.vendor_id = pv.vendor_idAND a.payee_party_id = pv.party_idAND s.org_id = a.org_id(+)AND s.party_site_id = a.party_site_id(+)AND s.vendor_site_id = p_vendor_site_idAND pv.vendor_id = p_vendor_id;BEGINfnd_global.apps_initialize(user_id      => 1110,resp_id      => 20639,resp_appl_id => 200);FOR rec_cux_vendor IN cur_cux_vendor LOOPFOR rec_ap_vendor IN cur_ap_vendor(p_vendor_site_code => rec_cux_vendor.vendor_site_code) LOOP--初始化参数mo_global.set_policy_context(p_access_mode => 'S',p_org_id      => rec_ap_vendor.org_id);FOR r_payment_method IN c_payment_method(p_vendor_id      => rec_ap_vendor.vendor_id,p_vendor_site_id => rec_ap_vendor.vendor_site_id) LOOPl_ext_payee_id_rec_type := NULL;l_ext_payee_id_tab.delete;l_external_payee_rec_type := NULL;l_ext_payee_tab.delete;SELECT l.party_idINTO l_party_idFROM ap_suppliers lWHERE l.vendor_id = rec_ap_vendor.vendor_id;--update site level ext pay inforl_ext_payee_id_rec_type := NULL;l_ext_payee_id_tab.delete;l_external_payee_rec_type := NULL;l_ext_payee_tab.delete;--init param p_ext_payee_id_tabl_ext_payee_id_rec_type.ext_payee_id := r_payment_method.ext_payee_id;l_ext_payee_id_tab(1) := l_ext_payee_id_rec_type;--init param p_ext_payee_tabl_external_payee_rec_type.payee_party_site_id := r_payment_method.party_site_id;l_external_payee_rec_type.payee_party_id      := r_payment_method.party_id; --p_party_id;l_external_payee_rec_type.payment_function    := r_payment_method.payment_function;l_external_payee_rec_type.payer_org_id        := r_payment_method.org_id;l_external_payee_rec_type.supplier_site_id    := r_payment_method.supplier_site_id;l_external_payee_rec_type.payer_org_type      := r_payment_method.org_type;l_external_payee_rec_type.exclusive_pay_flag  := g_def_exclusive_pay_flag;/*SELECT pmv.payment_method_codeINTO l_method_codeFROM iby_payment_methods_vl pmvWHERE pmv.payment_method_name = '银行电汇'AND SYSDATE < nvl(pmv.inactive_date, SYSDATE + 1);*/l_external_payee_rec_type.default_pmt_method := 'BZ_CHECK';l_ext_payee_tab(1) := l_external_payee_rec_type;iby_disbursement_setup_pub.update_external_payee(p_api_version          => l_api_version,p_init_msg_list        => 'T',p_ext_payee_tab        => l_ext_payee_tab,p_ext_payee_id_tab     => l_ext_payee_id_tab,x_return_status        => l_return_status,x_msg_count            => l_msg_count,x_msg_data             => l_msg_data,x_ext_payee_status_tab => l_ext_payee_status_tab);IF l_return_status != fnd_api.g_ret_sts_success THENIF l_msg_data IS NULL THENl_msg_data := fnd_msg_pub.get(p_msg_index => fnd_msg_pub.g_last,p_encoded   => 'F'); --get last messagedbms_output.put_line('l_msg_data:' || SQLERRM);END IF; --IF l_msg_data IS NULL THENEND IF; --IF l_return_status != fnd_api.g_ret_sts_success THENEND LOOP; --FOR r_payment_method IN c_payment_method(p_vendor_id      =>rec_ap_vendor.vendor_id,END LOOP; --for rec_ap_vendor in cur_ap_vendor(p_vendor_site_code =>rec_cux_vendor.vendor_site_code) loopUPDATE cux_oms_vendor_site LSET L.ATTRIBUTE2 = 'BZ_CHECK'WHERE L.LINE_ID = rec_cux_vendor.LINE_ID;END LOOP; --for rec_cux_vendor in cur_cux_vendor loop
END;

11136
发布评论

评论列表 (0)

  1. 暂无评论