CREATE OR REPLACE PACKAGE BODY cux_ar_party_location_pkg IS

    g_pkg_name CONSTANT VARCHAR2() := 'CUX_AR_PARTY_LOCATION_PKG';
-- Debug
g_debug VARCHAR2() := nvl(fnd_profile.value('AFLOG_ENABLED'),
'N');
g_space VARCHAR2() := chr() || 'nbsp';
/*==================================================
Program Name:
PROCESS_REQUEST
Description: History:
* 1.00 2018-04-19 wang.chen Creation
==================================================*/
PROCEDURE process_request(p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false,
p_commit 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) IS
l_api_name CONSTANT VARCHAR2() := 'PROCESS_REQUEST';
l_savepoint_name CONSTANT VARCHAR2() := 'PROCESS_REQUEST'; CURSOR cur IS
SELECT t.import_id,
t.party_name,
t.contract_name,
t.contract_phone,
t.address
FROM cux_ar_party_loc_import t; l_location_rec hz_location_v2pub.location_rec_type;
l_object_version_number NUMBER;
--x_return_status VARCHAR2();
--x_msg_count NUMBER;
--x_msg_data VARCHAR2();
l_error_message VARCHAR2(); BEGIN x_return_status := cux_api.start_activity(p_pkg_name => g_pkg_name,
p_api_name => l_api_name,
p_init_msg_list => fnd_api.g_true); 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 IN cur
LOOP
FOR rec1 IN (SELECT DISTINCT hl.location_id, hl.object_version_number
FROM hz_locations hl, hz_party_sites hps, hz_parties hp
WHERE hps.location_id = hl.location_id
AND hps.party_id = hp.party_id
AND hp.party_name = rec.party_name)
LOOP l_location_rec.location_id := rec1.location_id;
l_location_rec.address1 := rec.address;
l_location_rec.address2 := rec.contract_name;
l_location_rec.address3 := rec.contract_phone; hz_location_v2pub.update_location(p_location_rec => l_location_rec,
p_object_version_number => rec1.object_version_number,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data);
IF x_msg_count > AND x_return_status <> fnd_api.g_ret_sts_success THEN
FOR i IN .. x_msg_count
LOOP
l_error_message := i || ' . ' || substr(fnd_msg_pub.get(p_encoded => fnd_api.g_false),
,
);
cux_conc_utl.log_msg('Party Name: ' || rec.party_name);
cux_conc_utl.log_msg('Orig Location ID: ' || rec1.location_id || ',' ||
l_error_message);
END LOOP;
END IF; END LOOP;
END LOOP; -- 输出表尾
cux_api.end_activity(p_pkg_name => g_pkg_name,
p_api_name => l_api_name,
p_commit => p_commit,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data);
EXCEPTION
WHEN fnd_api.g_exc_error THEN
x_return_status := cux_api.handle_exceptions(p_pkg_name => g_pkg_name,
p_api_name => l_api_name,
--p_savepoint_name => l_savepoint_name,
p_exc_name => cux_api.g_exc_name_error,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data);
WHEN fnd_api.g_exc_unexpected_error THEN
x_return_status := cux_api.handle_exceptions(p_pkg_name => g_pkg_name,
p_api_name => l_api_name,
-- p_savepoint_name => l_savepoint_name,
p_exc_name => cux_api.g_exc_name_unexp,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data);
WHEN OTHERS THEN
x_return_status := cux_api.handle_exceptions(p_pkg_name => g_pkg_name,
p_api_name => l_api_name,
--- p_savepoint_name => l_savepoint_name,
p_exc_name => cux_api.g_exc_name_others,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data); END process_request;
/*==================================================
* FUNCTION / PROCEDURE
* NAME :
* main
* DESCRIPTION:
* 报表主程序
* HISTORY:
* 1.00 2018-04-19 wang.chen Creation
2 *
================================================== */
PROCEDURE main(errbuf OUT VARCHAR2, retcode OUT VARCHAR2) IS l_return_status VARCHAR2() := fnd_api.g_ret_sts_success;
l_msg_count NUMBER;
l_msg_data VARCHAR2();
l_api_name CONSTANT VARCHAR2() := 'MAIN';
l_date_from DATE;
l_date_to DATE; BEGIN
retcode := '';
cux_conc_utl.log_header; process_request(p_init_msg_list => fnd_api.g_true,
p_commit => fnd_api.g_true,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data); IF (l_return_status = fnd_api.g_ret_sts_unexp_error) THEN
RAISE fnd_api.g_exc_unexpected_error;
ELSIF (l_return_status = fnd_api.g_ret_sts_error) THEN
RAISE fnd_api.g_exc_error;
END IF; -- concurrent footer log
cux_conc_utl.log_footer; EXCEPTION
WHEN fnd_api.g_exc_error THEN
cux_conc_utl.log_message_list;
retcode := '';
errbuf := REPLACE(l_msg_data,
chr(),
' '); WHEN fnd_api.g_exc_unexpected_error THEN
cux_conc_utl.log_message_list;
retcode := '';
errbuf := REPLACE(l_msg_data,
chr(),
' '); WHEN OTHERS THEN
fnd_msg_pub.add_exc_msg(p_pkg_name => g_pkg_name,
p_procedure_name => l_api_name,
p_error_text => substrb(SQLERRM,
,
));
cux_conc_utl.log_message_list;
retcode := '';
errbuf := SQLERRM; END main;
END cux_ar_party_location_pkg;
create table cux_ar_party_loc_import
(IMPORT_ID NUMBER,
PARTY_NAME VARCHAR2(240),
CONTRACT_NAME VARCHAR2(240),
CONTRACT_PHONE VARCHAR2(240),
ADDRESS VARCHAR2(240)
) select * from cux_ar_party_loc_import for update

  

AR*更新客户地址联系人的更多相关文章

  1. Oracle EBS AR 更新客户配置文件

    DECLARE l_rec_profile_t hz_customer_profile_v2pub.customer_profile_rec_type; l_rec_profile hz_custom ...

  2. Oracle EBS AR 更新客户组织层

    declare -- Local variables here i integer; g_module ) := 'TCA_V2_API'; lrec_org hz_party_v2pub.organ ...

  3. Oracle EBS AR 更新客户账户层

    declare x_return_status ); x_msg_count NUMBER; x_msg_data ); x_profile_id NUMBER; l_location_id NUMB ...

  4. Oracle EBS AR 更新客户

    DECLARE    l_return_status );    l_msg_count     NUMBER;    l_msg_data      );    l_rec_type      hz ...

  5. Oracle EBS 更新客户地点

    --更新客户地点 declare x_return_status ); x_msg_count NUMBER; x_msg_data ); x_profile_id NUMBER; l_locatio ...

  6. AX2012 常用表关系(客户地址,联系信息)

    //客户地址信息 static void CustAddressInformation(Args _args) { CustTable custTable; DirPartyTable dirPart ...

  7. auto uninstaller (autodesk 修复大师) 简体中文版 更新下载地址

    小伙伴是不是遇到 CAD/3dmax/maya/Revit/Inventor 安装失败或者安装不了的问题了呢?AUTODESK系列软件着实令人头疼,CAD/3dmax/maya/Revit/Inven ...

  8. 第一阶段,第二阶段,第三阶段团队github更新项目地址

    第一阶段:https://github.com/yuhancheng/stage-1--last-sprint 第二阶段:https://github.com/yuhancheng/stage-2-- ...

  9. Oracle EBS AP更新供应商地址

    SELECT pvs.vendor_site_id, pvs.party_site_id, hps.party_site_name, hps.object_version_number, hps.pa ...

随机推荐

  1. C++报错:全局变量重定义或是多次定义

    如何在C++中定义全局变量时避免重复定义呢? 只要在定义时尽量在.cpp文件中进行,而不要在.h 文件中定义,定义好了之后,可以在.h文件中利用extern关键字进行声明. 如果在.h文件中定义的话, ...

  2. 15-Flutter移动电商实战-商品推荐区域制作

    1.推荐商品类的编写 这个类接收一个List参数,就是推荐商品的列表,这个列表是可以左右滚动的. /*商品推荐*/class Recommend extends StatelessWidget {   ...

  3. LeetCode 1135. Connecting Cities With Minimum Cost

    原题链接在这里:https://leetcode.com/problems/connecting-cities-with-minimum-cost/ 题目: There are N cities nu ...

  4. 使用Quasar设计Material和IOS风格的响应式网站

    使用Quasar设计Material和IOS风格的响应式网站 栏目: CSS · 发布时间: 8个月前 来源: segmentfault.com   本文转载自:https://segmentfaul ...

  5. 好的想法只是OKR的开始--创业者谨记

    每一个出版过作品的作家都有这样的体验:有人找到你,说他有一个极妙的想法,并迫不及待的想和你一起实现这个想法:结局也总是差不多,它们艰难的完成了灵感部分,而你只需要简单的把它写成小说,收益则需要五五分成 ...

  6. MQTT 遗嘱使用

    大部分人应该有这个需求: 我想让我的APP或者上位机或者网页一登录的时候获取设备的状态   在线还是离线 设备端只需要这样设置 注意:MQTT本身有遗嘱设置 所以大家可以设置遗嘱 ,注意哈,发布的主题 ...

  7. 计蒜客 39268.Tasks-签到 (The 2019 ACM-ICPC China Shannxi Provincial Programming Contest A.) 2019ICPC西安邀请赛现场赛重现赛

    Tasks It's too late now, but you still have too much work to do. There are nn tasks on your list. Th ...

  8. log4j 1.2 配置和使用简述

    本文通过MetaWeblog自动发布,原文及更新链接:https://extendswind.top/posts/technical/log4j_properties_simple_introduct ...

  9. mysql 修改字段名称以及长度

    //修改字段长度 alter table table1 modify name ); //修改字段名称以及长度 alter table table1 change name name_new ); a ...

  10. 分布式并行计算MapReduce

    作业要求来自:https://edu.cnblogs.com/campus/gzcc/GZCC-16SE2/homework/3319 1.用自己的话阐明Hadoop平台上HDFS和MapReduce ...