AP*更新供应商地点
--更新供应商地点
PROCEDURE update_vendor_site(p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_cust_vendor_id IN NUMBER) IS
l_api_name CONSTANT VARCHAR2(30) := 'UPDATE_VENDOR_SITE';
l_savepoint_name CONSTANT VARCHAR2(30) := 'UPDATE_VENDOR_SITE';
l_return_status VARCHAR2(1);
l_msg_count NUMBER;
l_msg_data VARCHAR2(4000);
v_return_mes VARCHAR2(4000);
l_message VARCHAR2(4000); lv_vendor_site_id NUMBER := 0; lv_vendor_site_rec_c ap_vendor_pub_pkg.r_vendor_site_rec_type;
lv_vendor_site_rec ap_vendor_pub_pkg.r_vendor_site_rec_type; l_vendor_site_id NUMBER;
l_party_site_id NUMBER;
l_location_id NUMBER; l_success_count NUMBER := 0;
l_error_count NUMBER := 0; l_party_id NUMBER; BEGIN
x_return_status := hss_api.start_activity(p_pkg_name => g_pkg_name,
p_api_name => l_api_name,
p_init_msg_list => p_init_msg_list);
IF (x_return_status = fnd_api.g_ret_sts_unexp_error) THEN
RAISE fnd_api.g_exc_unexpected_error;
ELSIF (x_return_status = fnd_api.g_ret_sts_error) THEN
RAISE fnd_api.g_exc_error;
END IF; FOR rec_pt IN (SELECT cva.party_id,
cva.party_name,
cva.attribute15,
cia.org_id
FROM cux_dis_cust_vendor_all cva,
cux_dis_org_info_all cia
WHERE cva.cust_vendor_id = p_cust_vendor_id
AND cva.party_id = cia.party_id
AND cva.attribute15 = cia.attribute15
AND cia.new_discription_flag = 'Y')
LOOP FOR i IN (SELECT *
FROM (SELECT pvs.*
FROM po_vendors pv,
po_vendor_sites_all pvs
WHERE pvs.vendor_id = pv.vendor_id
AND pv.vendor_name = rec_pt.party_name
ORDER BY pvs.last_update_date DESC)
WHERE rownum = 1)
LOOP --log('org_id' || l_line.org_id);
--log('vendor_site_code' || l_line.vendor_site_code);
--log('vendor_id' || l_line.vendor_id); lv_vendor_site_rec := lv_vendor_site_rec_c; fnd_global.apps_initialize(user_id => fnd_global.user_id,
resp_id => fnd_global.resp_id,
resp_appl_id => fnd_global.resp_appl_id); mo_global.set_policy_context('S',
rec_pt.org_id); --========================================================================
lv_vendor_site_id := i.vendor_site_id; -- 供应商地点ID
lv_vendor_site_rec.vendor_site_id := i.vendor_site_id;
lv_vendor_site_rec.vendor_id := i.vendor_id; -- 供应商ID
lv_vendor_site_rec.vendor_site_code := i.vendor_site_code;
lv_vendor_site_rec.vendor_site_code_alt := i.vendor_site_code_alt;
lv_vendor_site_rec.inactive_date := trunc(SYSDATE); -- 失效日期
lv_vendor_site_rec.org_id := rec_pt.org_id;
lv_vendor_site_rec.location_id := i.location_id;
lv_vendor_site_rec.party_site_id := i.party_site_id;
lv_vendor_site_rec.address_style := i.address_style;
lv_vendor_site_rec.address_line1 := i.address_line1;
lv_vendor_site_rec.address_line2 := i.address_line2;
lv_vendor_site_rec.address_line3 := i.address_line3;
lv_vendor_site_rec.address_line4 := i.address_line4;
lv_vendor_site_rec.address_lines_alt := i.address_lines_alt;
lv_vendor_site_rec.province := i.province;
lv_vendor_site_rec.country := i.country;
lv_vendor_site_rec.county := i.county;
lv_vendor_site_rec.city := i.city;
lv_vendor_site_rec.state := i.state;
lv_vendor_site_rec.area_code := i.area_code;
lv_vendor_site_rec.ship_to_location_id := i.ship_to_location_id;
lv_vendor_site_rec.bill_to_location_id := i.bill_to_location_id;
lv_vendor_site_rec.terms_date_basis := i.terms_date_basis;
lv_vendor_site_rec.accts_pay_code_combination_id := i.accts_pay_code_combination_id;
lv_vendor_site_rec.prepay_code_combination_id := i.prepay_code_combination_id;
lv_vendor_site_rec.payment_priority := i.payment_priority;
lv_vendor_site_rec.terms_id := i.terms_id;
lv_vendor_site_rec.pay_date_basis_lookup_code := i.pay_date_basis_lookup_code;
lv_vendor_site_rec.fax := i.fax;
lv_vendor_site_rec.phone := i.phone;
lv_vendor_site_rec.pcard_site_flag := i.pcard_site_flag;
lv_vendor_site_rec.match_option := i.match_option;
lv_vendor_site_rec.country_of_origin_code := i.country_of_origin_code;
lv_vendor_site_rec.future_dated_payment_ccid := i.future_dated_payment_ccid;
lv_vendor_site_rec.email_address := i.email_address;
lv_vendor_site_rec.primary_pay_site_flag := i.primary_pay_site_flag;
lv_vendor_site_rec.ship_via_lookup_code := i.ship_via_lookup_code;
lv_vendor_site_rec.freight_terms_lookup_code := i.freight_terms_lookup_code;
lv_vendor_site_rec.fob_lookup_code := i.fob_lookup_code;
lv_vendor_site_rec.pay_group_lookup_code := i.pay_group_lookup_code;
lv_vendor_site_rec.invoice_currency_code := i.invoice_currency_code;
lv_vendor_site_rec.payment_currency_code := i.payment_currency_code;
lv_vendor_site_rec.vat_code := i.vat_code;
lv_vendor_site_rec.auto_tax_calc_flag := i.auto_tax_calc_flag;
lv_vendor_site_rec.pay_site_flag := 'Y'; --i.pay_site_flag;
lv_vendor_site_rec.purchasing_site_flag := 'Y'; --i.purchasing_site_flag; pos_vendor_pub_pkg.create_vendor_site(x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_vendor_site_rec => lv_vendor_site_rec,
x_vendor_site_id => l_vendor_site_id,
x_party_site_id => l_party_site_id,
x_location_id => l_location_id); IF (x_return_status <> fnd_api.g_ret_sts_success) THEN l_msg_data := fnd_message.get || l_msg_data;
v_return_mes := cux_dis_cust_vdr_ipt_pkg.get_return_message(l_msg_count,
l_msg_data);
l_message := l_message || '.' || '新增地点:' || v_return_mes;
l_msg_data := l_message || '创建供应商地点失败!'; -- cux_conc_utl.log_msg('创建供应商地点失败!' || '-' || l_vendor_site_id || '-' || l_party_site_id || '-' || l_location_id || '-' || l_msg_data); log('创建供应商地点失败!' || '-' || l_vendor_site_id || '-' || l_party_site_id || '-' || l_location_id || '-' || l_msg_data);
RAISE fnd_api.g_exc_error;
ELSE
--导入后将party_id回写到客制化表中,并将状态更新为'已导入'
UPDATE cux_dis_cust_vendor_all cva
SET cva.status_code = 'ENABLED',
cva.attribute15 = 'Y'
WHERE cva.cust_vendor_id = p_cust_vendor_id; log('party_id:=' || '-' || rec_pt.party_id || '-' || 'org_id:=-' || '-' || rec_pt.org_id); UPDATE cux_dis_org_info_all cia
SET cia.discription_flag = 'Y',
cia.new_discription_flag = NULL,
cia.attribute15 = 'Y'
WHERE cia.party_id = rec_pt.party_id
AND cia.org_id = rec_pt.org_id
AND cia.new_discription_flag = 'Y';
END IF; END LOOP;
END LOOP;
--============================================================================ l_return_status := hss_api.end_activity(p_pkg_name => g_pkg_name,
p_api_name => l_api_name,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data);
EXCEPTION
WHEN fnd_api.g_exc_error THEN
ROLLBACK;
UPDATE cux_dis_cust_vendor_all cva
SET cva.status_code = 'IMPORT_FAILED'
WHERE cva.cust_vendor_id = p_cust_vendor_id;
x_return_status := hss_api.handle_exceptions(p_pkg_name => g_pkg_name,
p_api_name => l_api_name,
p_savepoint_name => l_savepoint_name,
p_exc_name => hss_api.g_exc_name_error,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data);
x_msg_data := x_msg_data || l_msg_data; WHEN fnd_api.g_exc_unexpected_error THEN
ROLLBACK;
UPDATE cux_dis_cust_vendor_all cva
SET cva.status_code = 'IMPORT_FAILED'
WHERE cva.cust_vendor_id = p_cust_vendor_id;
x_return_status := hss_api.handle_exceptions(p_pkg_name => g_pkg_name,
p_api_name => l_api_name,
p_savepoint_name => l_savepoint_name,
p_exc_name => hss_api.g_exc_name_unexp,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data);
x_msg_data := x_msg_data || l_msg_data;
WHEN OTHERS THEN
ROLLBACK;
UPDATE cux_dis_cust_vendor_all cva
SET cva.status_code = 'IMPORT_FAILED'
WHERE cva.cust_vendor_id = p_cust_vendor_id;
x_return_status := hss_api.handle_exceptions(p_pkg_name => g_pkg_name,
p_api_name => l_api_name,
p_savepoint_name => l_savepoint_name,
p_exc_name => hss_api.g_exc_name_others,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data);
x_msg_data := x_msg_data || l_msg_data;
END update_vendor_site;
AP*更新供应商地点的更多相关文章
- Oracle EBS AP更新供应商地址
SELECT pvs.vendor_site_id, pvs.party_site_id, hps.party_site_name, hps.object_version_number, hps.pa ...
- Oracle AP更新供应商
/*l_return_status:S l_msg_count:0 l_msg_data: l_vendor_id:133003 l_party_id:236055 */ DECLARE l_ ...
- 详解EBS接口开发之更新供应商付款方法
更新供应商地点层的付款方法API DECLARE --API 参数 l_external_payee_rec_type iby_disbursement_setup_pub.external_paye ...
- Oracle EBS AP 供应商地点失效
/* 供应商地点失效 creation: created by jenrry 20161108 1.00 */ DECLARE lv_return_status ) := NULL; ln_msg_c ...
- R12供应商地点层付款方法SQL
--R12供应商地点层付款方法SQL:SELECT ipmv.payment_method_name , ipmv.payment_method_code , 'N' primary_ ...
- EBS标准的查看供应商地点
VO数据源:oracle.apps.pos.supplier.server.SitesVO SELECT pvsa.address_style, hzl.language, pvsa.province ...
- 使用API更新供应商名称及曾用名
原文地址 更新供应商名称 EBS R12 (12.1.3) 更新供应商名称或替代供应商名称不能直接使用 pos_vendor_pub_pkg.update_vendor(p_vendor_rec =& ...
- Oracle EBS 更新客户地点
--更新客户地点 declare x_return_status ); x_msg_count NUMBER; x_msg_data ); x_profile_id NUMBER; l_locatio ...
- 详解EBS接口开发之供应商导入补充-供应商地点增加实例
DECLARE --v_org_id number; v_vendor_interface_id NUMBER; v_vendor_site_interface_id NUMBER; --接口表的id ...
随机推荐
- 1089 Intervals(中文版)
开始前先讲几句废话:这个题我开始也没看懂,后来借助百度翻译,明白了大概是什么意思. 试题描述 输入一个n,然后输入n组数据,每个数据有两个数,代表这个闭区间是从几到几.然后看,如果任意两个闭区间有相重 ...
- ACM -- 算法小结(四)KMP(POJ3461)
KMP -- POJ3461解题报告 问题描述:给出字符串P和字符串T,问字符串P在字符串T中出现的次数 Sample Input 3 BAPC BAPC AZA AZAZAZA VERDI ...
- js冒泡处理
<div id="first"> 外层 <span id="second"> 内层 </span> </div> ...
- Codeforces Round #194 (Div. 1) A. Secrets 数学
A. Secrets Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/333/problem/A ...
- Codeforces Round #304 (Div. 2) Break the Chocolate 水题
Break the Chocolate Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/546/ ...
- SqlServer 2008无法远程连接到服务器
其他的什么先别说,上来第一点,看看服务器防火墙,是否把SqlServer的端口号例外了. 别弄了半天发现防火墙问题,那就得不偿失了. 用户在使用SQL Server 2008远程链接时,可能会弹出如 ...
- js中常用日期时间转换
常用日期时间处理插件:1. timeago.js处理几分钟之前 2. day.js 3. moment.js 注意: 1. 此处的标准时间格式为 2018-03-23 13:35:47 ...
- CentOS 6.9/7通过yum安装指定版本的Tomcat
说明:通过yum好处其实很多,环境变量不用配置,配置文件放在大家都熟悉的地方,通过rpm -ql xxx可以知道全部文件的地方等等. 一.安装Tomcat(8+) // 下载脚本 # git clon ...
- JMX操作实例--做一回技术控
我来做一回技术控,这部分内容也是简单的API调用例子而已,做一回技术控,发点小骚文,不过你看了,也许知道JConsole是怎么做出来的了,呵呵! 先不用管他干什么,代码运行后,自己改改自然知道做什么的 ...
- mysql查询更新时的锁表机制分析(只介绍了MYISAM)
为了给高并发情况下的mysql进行更好的优化,有必要了解一下mysql查询更新时的锁表机制. 一.概述 MySQL有三种锁的级别:页级.表级.行级.MyISAM和MEMORY存储引擎采用的是表级锁(t ...