SELECT pvs.vendor_site_id,
pvs.party_site_id,
hps.party_site_name,
hps.object_version_number,
hps.party_site_number,
pvs.location_id,
hl.object_version_number,
hps.STATUS FROM ap_supplier_sites_all pvs,
hz_party_sites hps,
hz_locations hl
WHERE pvs.vendor_site_code = '采购'--
AND pvs.org_id = 82 --
AND pvs.party_site_id = hps.party_site_id
AND pvs.location_id = hl.location_id
and rownum =1;
--供应商地址失效
DECLARE
l_return_status VARCHAR2(1) := NULL;
l_msg_count NUMBER;
l_errmsg VARCHAR2(5000);
l_vendor_site_rec ap_vendor_pub_pkg.r_vendor_site_rec_type;
l_party_site_rec hz_party_site_v2pub.party_site_rec_type;
l_location_rec hz_location_v2pub.location_rec_type;
l_object_version_number NUMBER;
l_object_version_number2 NUMBER;
l_vendor_site_id NUMBER := NULL;
l_party_site_id NUMBER := NULL;
l_party_site_name VARCHAR2(240);
l_party_site_number VARCHAR2(30);
l_location_id NUMBER; BEGIN
fnd_global.apps_initialize(0, 50738, 20003);
BEGIN
SELECT pvs.vendor_site_id,
pvs.party_site_id,
hps.party_site_name,
hps.object_version_number,
hps.party_site_number,
pvs.location_id,
hl.object_version_number
INTO l_vendor_site_id,
l_party_site_id,
l_party_site_name,
l_object_version_number,
l_party_site_number,
l_location_id,
l_object_version_number2
FROM ap_supplier_sites_all pvs,
hz_party_sites hps,
hz_locations hl
WHERE pvs.vendor_site_code = '采购'--
AND pvs.org_id = 82 --
AND pvs.party_site_id = hps.party_site_id
AND pvs.location_id = hl.location_id
and rownum =1;
EXCEPTION
WHEN no_data_found THEN
l_errmsg := 'Can not find the vendor site need to update!The site code is:' || '采购';
dbms_output.put_line(l_errmsg);
END;
--
l_vendor_site_rec.vendor_site_id := l_vendor_site_id;
l_vendor_site_rec.vendor_site_code := '采购';
l_vendor_site_rec.inactive_date := SYSDATE; --UPDATE vendor_site_code
ap_vendor_pub_pkg.update_vendor_site(p_api_version => 1.0,
p_init_msg_list => fnd_api.g_true,
p_commit => fnd_api.g_false,
p_validation_level => fnd_api.g_valid_level_full,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_errmsg,
p_vendor_site_rec => l_vendor_site_rec,
p_vendor_site_id => l_vendor_site_id);
IF (nvl(l_return_status, fnd_api.g_ret_sts_error) <> fnd_api.g_ret_sts_success) THEN
l_msg_count := fnd_msg_pub.count_msg;
IF l_msg_count > 0 THEN
l_errmsg := substr(fnd_msg_pub.get(fnd_msg_pub.g_first, fnd_api.g_false), 1, 512); FOR i IN 1 .. (l_msg_count - 1) LOOP l_errmsg := l_errmsg || chr(10) || substr(fnd_msg_pub.get(fnd_msg_pub.g_next, fnd_api.g_false), 1, 512);
END LOOP;
fnd_msg_pub.delete_msg();
END IF;
dbms_output.put_line('------------------Update Error-------------------');
dbms_output.put_line('Error1 :' || l_errmsg);
END IF;
--UPDATE party_site_name
l_party_site_rec.party_site_id := l_party_site_id;
l_party_site_rec.party_site_name := l_party_site_name || 'disable';
l_party_site_rec.status := 'I';
--
hz_party_site_v2pub.update_party_site(p_init_msg_list => fnd_api.g_false,
p_party_site_rec => l_party_site_rec,
p_object_version_number => l_object_version_number,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_errmsg);
IF (nvl(l_return_status, fnd_api.g_ret_sts_error) <> fnd_api.g_ret_sts_success) THEN
l_msg_count := fnd_msg_pub.count_msg;
IF l_msg_count > 0 THEN
l_errmsg := substr(fnd_msg_pub.get(fnd_msg_pub.g_first, fnd_api.g_false), 1, 512); FOR i IN 1 .. (l_msg_count - 1) LOOP l_errmsg := l_errmsg || chr(10) || substr(fnd_msg_pub.get(fnd_msg_pub.g_next, fnd_api.g_false), 1, 512);
END LOOP;
fnd_msg_pub.delete_msg();
END IF;
dbms_output.put_line('------------------Update Error-------------------');
dbms_output.put_line('Error2 :' || l_errmsg);
END IF;
--update location
l_location_rec.address_style := 'POSTAL_ADDR_DEF';
l_location_rec.location_id := l_location_id; hz_location_v2pub.update_location(p_init_msg_list => fnd_api.g_true,
p_location_rec => l_location_rec,
p_object_version_number => l_object_version_number2,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_errmsg);
IF (nvl(l_return_status, fnd_api.g_ret_sts_error) <> fnd_api.g_ret_sts_success) THEN
l_msg_count := fnd_msg_pub.count_msg;
IF l_msg_count > 0 THEN
l_errmsg := substr(fnd_msg_pub.get(fnd_msg_pub.g_first, fnd_api.g_false), 1, 512); FOR i IN 1 .. (l_msg_count - 1) LOOP l_errmsg := l_errmsg || chr(10) || substr(fnd_msg_pub.get(fnd_msg_pub.g_next, fnd_api.g_false), 1, 512);
END LOOP;
fnd_msg_pub.delete_msg();
END IF;
dbms_output.put_line('------------------Update Error-------------------');
dbms_output.put_line('Error3 :' || l_errmsg);
END IF;
-- END;

Oracle EBS AP更新供应商地址的更多相关文章

  1. Oracle EBS AP 供应商API

    --创建供应商地址上的电话号码 created by jenrry 20170419 DECLARE l_return_status VARCHAR2(1); l_msg_count NUMBER; ...

  2. AP*更新供应商地点

    --更新供应商地点 PROCEDURE update_vendor_site(p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false, x_return ...

  3. Oracle EBS AP 供应商取值

    SELECT --nvl(substr(po.vendor_name,1,instr(po.vendor_name,',',1)-1),po.vendor_name) vendor_name, po. ...

  4. Oracle EBS AP 供应商地点失效

    /* 供应商地点失效 creation: created by jenrry 20161108 1.00 */ DECLARE lv_return_status ) := NULL; ln_msg_c ...

  5. Oracle AP更新供应商

    /*l_return_status:S l_msg_count:0 l_msg_data: l_vendor_id:133003 l_party_id:236055  */ DECLARE    l_ ...

  6. Oracle EBS AP 已经完全付款的发票仍然可以选择并进行零金额的付款

    1>找出相应的发票; SELECT DISTINCT ai.invoice_id, ai.invoice_num invoice_num, pv.segment1 vendor_num, pv. ...

  7. Oracle EBS AP取消核销

    --取消核销 created by jenrry 20170425 DECLARE l_result BOOLEAN; l_msg_count NUMBER; l_result_n varchar2( ...

  8. ORACLE EBS AP invoice 到付款的数据流

    --1.Invoice创建时生成数据如下表 --Invoice主表 SELECT * FROM AP_INVOICES_ALL A WHERE A.INVOICE_NUM = '20111213001 ...

  9. Oracle EBS INV 更新物料慢

    失效 ICX SELECT FA.APPLICATION_SHORT_NAME, FA.APPLICATION_ID, PI.STATUS, PI.PRODUCT_VERSION, PI.PATCH_ ...

随机推荐

  1. CDH版本大数据集群下搭建Hue(hadoop-2.6.0-cdh5.5.4.gz + hue-3.9.0-cdh5.5.4.tar.gz)(博主推荐)

    不多说,直接上干货! 我的集群机器情况是 bigdatamaster(192.168.80.10).bigdataslave1(192.168.80.11)和bigdataslave2(192.168 ...

  2. docker “no space left on device”问题定位解决

    在paas环境上使用docker加载镜像的时候出现了如下问题 第一反应应该是存储镜像的路径磁盘满了 docker info查看docker的根路径,可以看到为/opt/docker: 查看/opt/d ...

  3. Etcd安全配置之Basic Auth认证

    <中小团队落地配置中心详解>文章中我们介绍了如何基于Etcd+Confd构建配置中心,最后提到Etcd的安全问题时说了可以使用账号密码认证以达到安全访问的目的,究竟该如何开启认证以及怎么设 ...

  4. elasticsearch 导入基础数据并索引之 geo_shape

    我们看到的图形, 实际是由点来完成的, 有2种类型的格子模型可用于地理星座, 默认使用的是geoHash, 还有一种4叉树(quad trees), 也可用于 判断形状与索引的形状关系 1), int ...

  5. Hive和SparkSQL: 基于 Hadoop 的数据仓库工具

    Hive: 基于 Hadoop 的数据仓库工具 前言 Hive 是基于 Hadoop 的一个数据仓库工具,可以将结构化的数据文件映射为一张数据库表,并提供完整的 SQL 查询功能,将类 SQL 语句转 ...

  6. Linux errno详解

    1. 错误码 / errno Linux中系统调用的错误都存储于 errno中,errno由操作系统维护,存储就近发生的错误,即下一次的错误码会覆盖掉上一次的错误. PS: 只有当系统调用或者调用li ...

  7. SqlServer入门学习

    --distinct(去除重复数据)select distinct Time from HightTable--Between select * from HightTable where ID BE ...

  8. Uploadify火狐出现302错误

    $(function () { var auth = "@(Request.Cookies[FormsAuthentication.FormsCookieName] == null ? st ...

  9. centos7 离线安装Ambari

    准备工作: 新下载的centos7 安装 createrepo,用于制作源 yum install createrepo 安装java (推荐 java 1.7以上版本,如果有,则跳过此步骤) yum ...

  10. clipboard.js实现复制功能

    项目地址:https://github.com/zenorocha/clipboard.js 现代化的“复制到剪切板”插件.不包含 Flash.gzip 压缩后仅 3kb. 为什么使用它 复制文字到剪 ...