------------------------------------

-- 1a. Setup the Org_id

------------------------------------

exec dbms_application_info.set_client_info('204');

------------------------------------

-- 1b. Show the output variables

------------------------------------

set serveroutput on

------------------------------------

-- 2a. 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);

 p_create_profile_amt  VARCHAR2(2000);



BEGIN

-- record for the account

 p_cust_account_rec.account_name := 'FennerProfAPIamtc002';

 p_cust_account_rec.created_by_module := 'TCAPI_EXAMPLE';

 -- p_cust_account_rec.orig_system_reference := '001_001';  -- is not mandatory



-- record for the organization

 p_organization_rec.organization_name := 'FennerProfAPIamtc002';

 p_organization_rec.created_by_module := 'TCAPI_EXAMPLE';



-- record for the profile (this will use he DEFAULT profile but change these fields)

 p_customer_profile_rec.credit_checking := 'Y';

 p_customer_profile_rec.interest_charges := 'N';

 -- as interest charges is N, you need to set this two values in null

   p_customer_profile_rec.charge_on_finance_charge_flag := FND_API.G_MISS_CHAR;

   p_customer_profile_rec.interest_period_days := FND_API.G_MISS_NUM;

 p_customer_profile_rec.created_by_module := 'TCAPI_EXAMPLE';



-- Record for the profile amounts

-- You are not able to assign values for the amounts in this API

-- As you want to create specific values for the amounts set the field in 'F'

-- You will insertthe information later

 p_create_profile_amt := 'F';





 hz_cust_account_v2pub.create_cust_account(

 'T',

 p_cust_account_rec,

 p_organization_rec,

 p_customer_profile_rec,

 p_create_profile_amt,

 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('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('***************************');



END;

/

***************************

Output information ....

x_cust_account_id: 7744

x_account_number: 3991

x_party_id: 19566

x_party_number: 16479

x_profile_id: 8679

x_return_status: S

x_msg_count: 0

x_msg_data:

***************************





------------------------------------

-- 2b. Create the profile amounts record

------------------------------------

DECLARE

 p_cpamt_rec HZ_CUSTOMER_PROFILE_V2PUB.cust_profile_amt_rec_type;

 v_cust_account_profile_id NUMBER;



 x_return_status VARCHAR2(2000);

 x_msg_count NUMBER;

 x_msg_data VARCHAR2(2000);

 x_cust_acct_profile_amt_id NUMBER;



BEGIN



select cust_account_profile_id into v_cust_account_profile_id

from hz_customer_profiles where cust_account_id = 7744; --<<value for cust_account_id from step 2a



p_cpamt_rec.cust_account_profile_id := v_cust_account_profile_id;

p_cpamt_rec.currency_code := 'USD'; --<< Currency Code

p_cpamt_rec.created_by_module := 'TCAPI_EXAMPLE';

p_cpamt_rec.overall_credit_limit := 1000000;

p_cpamt_rec.cust_account_id := 7744;  --<<value for cust_account_id from step 2a



HZ_CUSTOMER_PROFILE_V2PUB.create_cust_profile_amt (

 'T',

 'T',

 p_cpamt_rec,

 x_cust_acct_profile_amt_id,

 x_return_status,

 x_msg_count,

 x_msg_data

);

dbms_output.put_line('***************************');

dbms_output.put_line('Output information ....');

dbms_output.put_line('<x_cust_acct_profile_amt_id: '||x_cust_acct_profile_amt_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('***************************');



END;

/

***************************

Output information ....

<x_cust_acct_profile_amt_id: 14883

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 := 'FennerProfAPIamtc002';

 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('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('***************************');





END;

/

***************************

Output information ....

x_location_id: 15538

x_return_status: S

x_msg_count: 0

x_msg_data:

***************************



------------------------------------

-- 4. Create a party site using party_id from step 2a 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 := 19566; --<<value for party_id from step 2a>

 p_party_site_rec.location_id := 15538; --<<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('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('***************************');



END;

/

***************************

Output information ....

x_party_site_id: 10710

x_party_site_number: 8437

x_return_status: S

x_msg_count: 0

x_msg_data:

***************************



------------------------------------

-- 5. Create an account site using cust_account_id from step 2a 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 := 7744; --<<value for cust_account_id you get from step 2a>

 p_cust_acct_site_rec.party_site_id := 10710; --<<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('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('***************************');



END;

/

***************************

Output information ....

x_cust_acct_site_id: 7261

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 := 7261; --<<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('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('***************************');



END;

/

***************************

Output information ....

x_site_use_id: 8943

x_return_status: S

x_msg_count: 0

x_msg_data: 0

***************************



/* END address  */

commit;

详解ebs接口之客户配置文件导入(二)的更多相关文章

  1. 详解ebs接口之客户配置文件导入(一)

    DECLARE l_rec_profile_t hz_customer_profile_v2pub.customer_profile_rec_type; l_rec_profile hz_custom ...

  2. 供应商API补充(详解EBS接口开发之供应商导入)(转)

    原文地址  供应商导入的API补充(详解EBS接口开发之供应商导入) --供应商 --创建 AP_VENDOR_PUB_PKG.Create_Vendor ( p_api_version IN NUM ...

  3. 详解EBS接口开发之供应商导入

    (一)供应商常用标准表简介 1.1   常用标准表 如下表中列出了与供应商相关的表和说明: 表名 说明 其他信息 ap_suppliers 供应商头表 供应商的头信息如:供应商名.供应商编码.税号等 ...

  4. 供应商导入的API补充(详解EBS接口开发之供应商导入)

    --供应商 --创建 AP_VENDOR_PUB_PKG.Create_Vendor ( p_api_version IN NUMBER, p_init_msg_list IN VARCHAR2 := ...

  5. 详解EBS接口开发之供应商导入(补充)--错误信息处理

    check reject details on records of AP_SUPPLIER_INT SELECT s.parent_table,s.reject_lookup_code,S.LAST ...

  6. 详解EBS接口开发之供应商导入补充-供应商地点增加实例

    DECLARE --v_org_id number; v_vendor_interface_id NUMBER; v_vendor_site_interface_id NUMBER; --接口表的id ...

  7. 详解EBS接口开发之供应商导入(补充)--供应商银行账户更新

    CREATE OR REPLACE PACKAGE BODY update_vendor_account IS PROCEDURE main(errbuf OUT VARCHAR2, retcode ...

  8. 详解EBS接口开发之物料导入API

    create_item inv_item_grp.create_item(p_commit => fnd_api.g_true, -- p_item_rec => l_item_rec, ...

  9. 具体解释ebs接口之客户配置文件导入(二)

    ------------------------------------ -- 1a. Setup the Org_id ------------------------------------ ex ...

随机推荐

  1. COCO 数据集的使用

    Windows 10 编译 Pycocotools 踩坑记 COCO数据库简介 微软发布的COCO数据库, 除了图片以外还提供物体检测, 分割(segmentation)和对图像的语义文本描述信息. ...

  2. PHP Zip File 函数

    通过 PHP 中的相关函数,你可以实现 zip 文件的解压缩操作! PHP Zip File 简介 Zip File 函数允许您读取压缩文件. 安装 如需在服务器上运行 Zip File 函数,必须安 ...

  3. Java课程设计常见技术问题(程序部署、数据库、JSP)

    1. 部署方法 Eclipse下打包 右键点击项目-Export-Runnable JAR file,选择正确的Launch configuration,接下来根据提示可以将项目中用到的jar打入包中 ...

  4. iOS objc_msgSend 野指针Crash 从 Log 提取 Crash 时 selector 的地址和名字并打印

    从 crash stack log 里面,提取 objc_msgSend 关键字,定位是否是野指针问题导致的crash,如果是则打印 crash 时的 objc_msgSend 调用的第二个参数,即 ...

  5. Android开发学习之路--Java和Js互相调用

      随着前端的火热,以前开发的快速,越来越多的native app在其中融合了h5,就拿淘宝就是很多的h5组成的,一旦出现什么节日,他都可以不用通过更新app来实现界面的改变,而且android和io ...

  6. lucene创建索引

    创建索引. 1.lucene下载. 下载地址:http://archive.apache.org/dist/lucene/java/. lucene不同版本之间有不小的差别,这里下载的是lucene ...

  7. Appium移动自动化框架初探

    作者:cryanimal QQ:164166060 本文简要介绍了appnium自动化框架的架构.加载流程.支持语言.相关配置,以及元素定位工具等. 官方网站: http://appium.io Ap ...

  8. 理解性能的奥秘——应用程序中慢,SSMS中快(5)——案例:如何应对参数嗅探

    本文属于<理解性能的奥秘--应用程序中慢,SSMS中快>系列 接上文:理解性能的奥秘--应用程序中慢,SSMS中快(4)--收集解决参数嗅探问题的信息 首先我们需要明白,参数嗅探本身不是问 ...

  9. 探究java接口中的变量与方法

    关于变量 java接口里的变量都是默认 pubic static final的 为啥? public 接口得能被所有对象调用 static 这个变量是属于接口本身,而不是实现了接口的对象的 具体来说  ...

  10. 有两个序列a,b,大小都为n,序列元素的值是任意整数,无序。

    要求:通过交换a,b中的元素,使[序列a元素的和]与[序列b元素的和]之间的差最小. 例如: var a=[100,99,98,1,2, 3]; var b=[1, 2, 3, 4,5,40]. in ...