Oracle EBS AR 客户API
------------------------------------
1. Set Environment ------------------------------------ -- 1a. Setup the Org_id
------------------------------------ exec dbms_application_info.set_client_info('204'); ------------------------------------
-- 1b. Show the output variables
------------------------------------
set serveroutput on ------------------------------------
2. Create a party and an account ------------------------------------ DECLARE
p_cust_account_rec HZ_CUST_ACCOUNT_V2PUB.CUST_ACCOUNT_REC_TYPE;
p_organization_rec HZ_PARTY_V2PUB.ORGANIZATION_REC_TYPE;
p_customer_profile_rec
HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE;
x_cust_account_id NUMBER;
x_account_number VARCHAR2(2000);
x_party_id NUMBER;
x_party_number VARCHAR2(2000);
x_profile_id NUMBER;
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000); BEGIN
p_cust_account_rec.account_name := 'CUSEXAPIFIG02';
p_cust_account_rec.created_by_module := 'TCAPI_EXAMPLE'; p_organization_rec.organization_name := 'CUSEXAPIFIG02';
p_organization_rec.created_by_module := 'TCAPI_EXAMPLE'; hz_cust_account_v2pub.create_cust_account(
'T',
p_cust_account_rec,
p_organization_rec,
p_customer_profile_rec,
'F',
x_cust_account_id,
x_account_number,
x_party_id,
x_party_number,
x_profile_id,
x_return_status,
x_msg_count,
x_msg_data); dbms_output.put_line('***************************');
dbms_output.put_line('Output information ....');
dbms_output.put_line('***************************');
dbms_output.put_line('x_cust_account_id: '||x_cust_account_id);
dbms_output.put_line('x_account_number: '||x_account_number);
dbms_output.put_line('x_party_id: '||x_party_id);
dbms_output.put_line('x_party_number: '||x_party_number);
dbms_output.put_line('x_profile_id: '||x_profile_id);
dbms_output.put_line('x_return_status: '||x_return_status);
dbms_output.put_line('x_msg_count: '||x_msg_count);
dbms_output.put_line('x_msg_data: '||x_msg_data);
dbms_output.put_line('***************************'); IF x_msg_count >1 THEN
FOR I IN 1..x_msg_count
LOOP
dbms_output.put_line(I||'. '||SubStr(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));
END LOOP;
END IF; END;
/ ***************************
Output information ....
***************************
x_cust_account_id: 6075
x_account_number: 3040
x_party_id: 17092
x_party_number: 14444
x_profile_id: 5290
x_return_status: S
x_msg_count: 0
x_msg_data:
*************************** /* BEGIN address */ ------------------------------------
3. Create a physical location ------------------------------------ DECLARE
p_location_rec HZ_LOCATION_V2PUB.LOCATION_REC_TYPE;
x_location_id NUMBER;
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000);
BEGIN
p_location_rec.country := 'US';
p_location_rec.address1 := 'Address4';
p_location_rec.city := 'San Mateo';
p_location_rec.postal_code := '94401';
p_location_rec.state := 'CA';
p_location_rec.created_by_module := 'TCAPI_EXAMPLE';
hz_location_v2pub.create_location(
'T',
p_location_rec,
x_location_id,
x_return_status,
x_msg_count,
x_msg_data); dbms_output.put_line('***************************');
dbms_output.put_line('Output information ....');
dbms_output.put_line('***************************');
dbms_output.put_line('x_location_id: '||x_location_id);
dbms_output.put_line('x_return_status: '||x_return_status);
dbms_output.put_line('x_msg_count: '||x_msg_count);
dbms_output.put_line('x_msg_data: '||x_msg_data);
dbms_output.put_line('***************************'); IF x_msg_count >1 THEN
FOR I IN 1..x_msg_count
LOOP
dbms_output.put_line(I||'. '||SubStr(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));
END LOOP;
END IF; END;
/ ***************************
Output information ....
***************************
x_location_id: 13326
x_return_status: S
x_msg_count: 0
x_msg_data:
*************************** ------------------------------------
4. Create a party site using party_id from step 2 and location_id from step 3 ------------------------------------ DECLARE
p_party_site_rec HZ_PARTY_SITE_V2PUB.PARTY_SITE_REC_TYPE;
x_party_site_id NUMBER;
x_party_site_number VARCHAR2(2000);
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000);
BEGIN
p_party_site_rec.party_id := 17092; --value for party_id from step 2>
p_party_site_rec.location_id := 13326; --value for location_id from step 3>
p_party_site_rec.identifying_address_flag := 'Y';
p_party_site_rec.created_by_module := 'TCAPI_EXAMPLE';
hz_party_site_v2pub.create_party_site(
'T',
p_party_site_rec,
x_party_site_id,
x_party_site_number,
x_return_status,
x_msg_count,
x_msg_data); dbms_output.put_line('***************************');
dbms_output.put_line('Output information ....');
dbms_output.put_line('***************************');
dbms_output.put_line('x_party_site_id: '||x_party_site_id);
dbms_output.put_line('x_party_site_number: '||x_party_site_number);
dbms_output.put_line('x_return_status: '||x_return_status);
dbms_output.put_line('x_msg_count: '||x_msg_count);
dbms_output.put_line('x_msg_data: '||x_msg_data);
dbms_output.put_line('***************************'); IF x_msg_count >1 THEN
FOR I IN 1..x_msg_count
LOOP
dbms_output.put_line(I||'. '||SubStr(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));
END LOOP;
END IF; END;
/ ***************************
Output information ....
***************************
x_party_site_id: 8885
x_party_site_number: 6893
x_return_status: S
x_msg_count: 0
x_msg_data:
*************************** ------------------------------------
5. Create an account site using cust_account_id from step 2 and party_site_id from step 4. ------------------------------------ DECLARE
p_cust_acct_site_rec hz_cust_account_site_v2pub.cust_acct_site_rec_type;
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000);
x_cust_acct_site_id NUMBER;
BEGIN
p_cust_acct_site_rec.cust_account_id := 6075; --value for cust_account_id you get from step 2>
p_cust_acct_site_rec.party_site_id := 8885; --value for party_site_id from step 4>
p_cust_acct_site_rec.language := 'US';
p_cust_acct_site_rec.created_by_module := 'TCAPI_EXAMPLE';
hz_cust_account_site_v2pub.create_cust_acct_site(
'T',
p_cust_acct_site_rec,
x_cust_acct_site_id,
x_return_status,
x_msg_count,
x_msg_data); dbms_output.put_line('***************************');
dbms_output.put_line('Output information ....');
dbms_output.put_line('***************************');
dbms_output.put_line('x_cust_acct_site_id: '||x_cust_acct_site_id);
dbms_output.put_line('x_return_status: '||x_return_status);
dbms_output.put_line('x_msg_count: '||x_msg_count);
dbms_output.put_line('x_msg_data: '||x_msg_data);
dbms_output.put_line('***************************'); IF x_msg_count >1 THEN
FOR I IN 1..x_msg_count
LOOP
dbms_output.put_line(I||'. '||SubStr(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));
END LOOP;
END IF; END;
/ ***************************
Output information ....
***************************
x_cust_acct_site_id: 6155
x_return_status: S
x_msg_count: 0
x_msg_data:
*************************** ------------------------------------
6. Create an account site use using cust_acct_site_id from step 5 and site_use_code='BILL_TO' ------------------------------------ DECLARE
p_cust_site_use_rec HZ_CUST_ACCOUNT_SITE_V2PUB.CUST_SITE_USE_REC_TYPE;
p_customer_profile_rec HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE;
x_site_use_id NUMBER;
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000);
BEGIN
p_cust_site_use_rec.cust_acct_site_id := 6155; --value for cust_acct_site_id from step 5>
p_cust_site_use_rec.site_use_code := 'BILL_TO';
p_cust_site_use_rec.created_by_module := 'TCAPI_EXAMPLE';
hz_cust_account_site_v2pub.create_cust_site_use(
'T',
p_cust_site_use_rec,
p_customer_profile_rec,
'',
'',
x_site_use_id,
x_return_status,
x_msg_count,
x_msg_data); dbms_output.put_line('***************************');
dbms_output.put_line('Output information ....');
dbms_output.put_line('***************************');
dbms_output.put_line('x_site_use_id: '||x_site_use_id);
dbms_output.put_line('x_return_status: '||x_return_status);
dbms_output.put_line('x_msg_count: '||x_msg_count);
dbms_output.put_line('x_msg_data: '||x_msg_count);
dbms_output.put_line('***************************'); IF x_msg_count >1 THEN
FOR I IN 1..x_msg_count
LOOP
dbms_output.put_line(I||'. '||SubStr(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));
END LOOP;
END IF; END;
/ ***************************
Output information ....
***************************
x_site_use_id: 7149
x_return_status: S
x_msg_count: 0
x_msg_data: 0
*************************** /* END address */ commit; /* BEGIN contact to an organization */ ------------------------------------
7. Create a definition contact ------------------------------------ DECLARE
p_create_person_rec HZ_PARTY_V2PUB.person_rec_type;
x_party_id NUMBER;
x_party_number VARCHAR2(2000);
x_profile_id NUMBER;
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000); BEGIN
p_create_person_rec.person_pre_name_adjunct := 'MR.';
p_create_person_rec.person_first_name := 'ExFennerct4';
p_create_person_rec.person_last_name := 'ExGiraldoct4';
p_create_person_rec.created_by_module := 'TCAPI_EXAMPLE'; HZ_PARTY_V2PUB.create_person(
'T',
p_create_person_rec,
x_party_id,
x_party_number,
x_profile_id,
x_return_status,
x_msg_count,
x_msg_data); dbms_output.put_line('***************************');
dbms_output.put_line('Output information ....');
dbms_output.put_line('***************************');
dbms_output.put_line('x_party_id: '||x_party_id);
dbms_output.put_line('x_party_number: '||x_party_number);
dbms_output.put_line('x_profile_id: '||x_profile_id);
dbms_output.put_line('x_return_status: '||x_return_status);
dbms_output.put_line('x_msg_count: '||x_msg_count);
dbms_output.put_line('x_msg_data: '||x_msg_data);
dbms_output.put_line('***************************'); IF x_msg_count >1 THEN
FOR I IN 1..x_msg_count
LOOP
dbms_output.put_line(I||'. '||SubStr(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));
END LOOP;
END IF; END;
/ ***************************
Output information ....
***************************
x_party_id: 17093
x_party_number: 14445
x_profile_id: 17187
x_return_status: S
x_msg_count: 0
x_msg_data:
*************************** ------------------------------------
8. Create a relation cont-org using party_id from step 7 and party_id from step 2 ------------------------------------ DECLARE
p_org_contact_rec HZ_PARTY_CONTACT_V2PUB.ORG_CONTACT_REC_TYPE;
x_org_contact_id NUMBER;
x_party_rel_id NUMBER;
x_party_id NUMBER;
x_party_number VARCHAR2(2000);
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000);
BEGIN
p_org_contact_rec.department_code := 'ACCOUNTING';
-- p_org_contact_rec.job_title := 'ACCOUNTS OFFICER';
-- p_org_contact_rec.decision_maker_flag := 'Y';
-- p_org_contact_rec.job_title_code := 'APC';
p_org_contact_rec.created_by_module := 'TCAPI_EXAMPLE';
p_org_contact_rec.party_rel_rec.subject_id := 17093; --value for party_id from step 7>
p_org_contact_rec.party_rel_rec.subject_type := 'PERSON';
p_org_contact_rec.party_rel_rec.subject_table_name := 'HZ_PARTIES';
p_org_contact_rec.party_rel_rec.object_id := 17092; --Value for party_id from step 2>
p_org_contact_rec.party_rel_rec.object_type := 'ORGANIZATION';
p_org_contact_rec.party_rel_rec.object_table_name := 'HZ_PARTIES';
p_org_contact_rec.party_rel_rec.relationship_code := 'CONTACT_OF';
p_org_contact_rec.party_rel_rec.relationship_type := 'CONTACT';
p_org_contact_rec.party_rel_rec.start_date := SYSDATE;
hz_party_contact_v2pub.create_org_contact(
'T',
p_org_contact_rec,
x_org_contact_id,
x_party_rel_id,
x_party_id,
x_party_number,
x_return_status,
x_msg_count,
x_msg_data); dbms_output.put_line('***************************');
dbms_output.put_line('Output information ....');
dbms_output.put_line('***************************');
dbms_output.put_line('x_org_contact_id: '||x_org_contact_id);
dbms_output.put_line('x_party_rel_id: '||x_party_rel_id);
dbms_output.put_line('x_party_id: '||x_party_id);
dbms_output.put_line('x_party_number: '||x_party_number);
dbms_output.put_line('x_return_status: '||x_return_status);
dbms_output.put_line('x_msg_count: '||x_msg_count);
dbms_output.put_line('x_msg_data: '||x_msg_data);
dbms_output.put_line('***************************'); IF x_msg_count >1 THEN
FOR I IN 1..x_msg_count
LOOP
dbms_output.put_line(I||'. '||SubStr(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));
END LOOP;
END IF; END;
/ ***************************
Output information ....
***************************
x_org_contact_id: 7110
x_party_rel_id: 7788
x_party_id: 17094
x_party_number: 14446
x_return_status: S
x_msg_count: 0
x_msg_data:
*************************** ------------------------------------
9. Create a contact using party_id you get 8 and cust_account_id from step 2 ------------------------------------ DECLARE
p_cr_cust_acc_role_rec HZ_CUST_ACCOUNT_ROLE_V2PUB.cust_account_role_rec_type;
x_cust_account_role_id NUMBER;
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000); BEGIN -- NOTE:
-- must be unique CUST_ACCOUNT_ID, PARTY_ID,ROLE_TYPE
-- must be unique CUST_ACCT_SITE_ID, PARTY_ID,ROLE_TYPE p_cr_cust_acc_role_rec.party_id := 17094; --value for party_id from step 8>
p_cr_cust_acc_role_rec.cust_account_id := 6075; --value for cust_account_id from step 2>
p_cr_cust_acc_role_rec.primary_flag := 'Y';
p_cr_cust_acc_role_rec.role_type := 'CONTACT';
p_cr_cust_acc_role_rec.created_by_module := 'TCAPI_EXAMPLE'; HZ_CUST_ACCOUNT_ROLE_V2PUB.create_cust_account_role(
'T',
p_cr_cust_acc_role_rec,
x_cust_account_role_id,
x_return_status,
x_msg_count,
x_msg_data); dbms_output.put_line('***************************');
dbms_output.put_line('Output information ....');
dbms_output.put_line('***************************');
dbms_output.put_line('x_cust_account_role_id: '||x_cust_account_role_id);
dbms_output.put_line('x_return_status: '||x_return_status);
dbms_output.put_line('x_msg_count: '||x_msg_count);
dbms_output.put_line('x_msg_data: '||x_msg_data);
dbms_output.put_line('***************************'); IF x_msg_count >1 THEN
FOR I IN 1..x_msg_count
LOOP
dbms_output.put_line(I||'. '||SubStr(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));
END LOOP;
END IF; END;
/ ***************************
Output information ....
***************************
x_cust_account_role_id: 5857
x_return_status: S
x_msg_count: 0
x_msg_data:
*************************** /* END contact */ /* Create the contact ROLE for the Org Contact - (Contact Roles zone on Customers Form)*/ ------------------------------------
10. Create the org contact role using x_cust_account_role_id from step 9 ------------------------------------ DECLARE
p_role_responsibility_rec HZ_CUST_ACCOUNT_ROLE_V2PUB.ROLE_RESPONSIBILITY_REC_TYPE;
x_responsibility_id NUMBER;
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000); BEGIN p_role_responsibility_rec.cust_account_role_id := 5857; --value for x_cust_account_role_id from step 9>
p_role_responsibility_rec.responsibility_type := 'SOLD_TO';
p_role_responsibility_rec.created_by_module := 'TCAPI_EXAMPLE'; HZ_CUST_ACCOUNT_ROLE_V2PUB.create_role_responsibility (
'T',
p_role_responsibility_rec,
x_responsibility_id,
x_return_status,
x_msg_count,
x_msg_data
); dbms_output.put_line('***************************');
dbms_output.put_line('Output information ....');
dbms_output.put_line('***************************');
dbms_output.put_line('x_responsibility_id: '||x_responsibility_id);
dbms_output.put_line('x_return_status: '||x_return_status);
dbms_output.put_line('x_msg_count: '||x_msg_count);
dbms_output.put_line('x_msg_data: '||x_msg_data);
dbms_output.put_line('***************************'); IF x_msg_count >1 THEN
FOR I IN 1..x_msg_count
LOOP
dbms_output.put_line(I||'. '||SubStr(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));
END LOOP;
END IF; END;
/ ***************************
Output information ....
***************************
x_responsibility_id: 3162
x_return_status: S
x_msg_count: 0
x_msg_data:
*************************** /* End contact ROLE */ commit;
Oracle EBS AR 客户API的更多相关文章
- Oracle EBS AR 其他API
DECLARE L_CR_ID NUMBER; L_ATTRIBUTE_REC AR_RECEIPT_API_PUB.ATTRIBUTE_REC_TYPE; L_GLOBAL_ATT_REC AR_R ...
- Oracle EBS AR 收款API收款方法标识无效
1.确认是不是没有收款方法 methods那个表的问题2.查看收款方法那个LOV的问题3.界面录入 是否会有问题 碰到的问题是 收款日期比较早时 找不到对应的收款方法 银行账户需要重新设置
- Oracle EBS AR 客户取数SQL
SELECT acct.cust_account_id, acct.party_id, acct.account_number, party.party_name, lkp1.meaning part ...
- Oracle EBS R12 客户表结构
参考链接: Oracle EBS R12 客户表结构 Oracle EBS中的“客户”."客户地点".‘订单’之间的关系 Oracle EBS中的“客户”."客户地点&q ...
- Oracle EBS AR 更新客户配置文件
DECLARE l_rec_profile_t hz_customer_profile_v2pub.customer_profile_rec_type; l_rec_profile hz_custom ...
- Oracle EBS AR 事务处理到期余额总计API
declare -- Local variables here i integer; x_line_original NUMBER; x_line_remaining NUMBER; ...
- Oracle EBS AR 更新客户组织层
declare -- Local variables here i integer; g_module ) := 'TCA_V2_API'; lrec_org hz_party_v2pub.organ ...
- Oracle EBS AR 更新客户账户层
declare x_return_status ); x_msg_count NUMBER; x_msg_data ); x_profile_id NUMBER; l_location_id NUMB ...
- Oracle EBS AR 更新客户
DECLARE l_return_status ); l_msg_count NUMBER; l_msg_data ); l_rec_type hz ...
随机推荐
- JavaScript -- URL编码
----- 010-escape.html ----- <!DOCTYPE html> <html> <head> <meta http-equiv=&quo ...
- Python -- 多媒体编程 -- 音乐播放
使用win32库的WMPlayer.OCX开发一个简易的音乐播放器 import sys from PyQt4 import QtGui, QtCore from win32com.client im ...
- wordpress给文章添加缩略图
百度是个好东西,翻了半个小时的文章,终于把这个问题解决了. 一个问题的解决方法很多,但要找到一个自己理解的方法,缺比较难找,不管怎样,多动手,可能弄着弄着就会了. 教程开始: 1.先去后台管理安装Ea ...
- 高可用Hadoop平台-答疑篇
1.概述 这篇博客不涉及到具体的编码,只是解答最近一些朋友心中的疑惑.最近,一些朋友和网友纷纷私密我,我总结了一下,疑问大致包含以下几点: 我学 Hadoop 后能从事什么岗位? 在遇到问题,我该如何 ...
- <Think Python>中斐波那契使用memo实现的章节
If you played with the fibonacci function from Section 6.7, you might have noticed thatthe bigger th ...
- SpringMVC融合Swagger UI使用
相信大家都很熟悉springmvc,在用其进行开发工作的时候,有没有遇到几个小问题?比如: 1.前后端分离的模式下,前端开发人员如何得知后端的开发进度,有哪些接口可用? 2.后端开发人员在测试自己的接 ...
- es6学习笔记12--Class
Class基本语法 概述 JavaScript语言的传统方法是通过构造函数,定义并生成新对象.下面是一个例子. function Point(x,y){ this.x = x; this.y = y; ...
- PHP filter_input() 函数
以往,对于常见的SQL注入等漏洞,采取的方式一般都是对数据进行过滤,而对$_GET/$_POST/$_COOKIE/$_SERVER等全局数组变量的直接使用是不够安全的,故PHP 5.2.0版本以后, ...
- 启用sa账号
第一部分: 如果在安装的时候选中的是Window身份验证,后来需要SQLServer身份验证登录,那么 一.先用window账号登录数据库 二.启用window身份验证和sql sever身份验证方式 ...
- Maven为不同环境配置打包
在开发过程中经常要遇到为不同的环境打包,这里面最主要的问题在于,不同环境的配置是不一样的,如果为不同环境打包每次都手工修改配置,那不但工作量大,而且很容易出错.如果用ant的话,用变量加上replac ...