Sunday, December 19, 2010

Using TCA APIs to Create Customer Information

Oracle has provided TCA APIs, written in PL/SQL Procedures/Packages, that can be put to very good use for any Application that interfaces with Oracle Ebusiness Suite. We just need to be careful in the order in which these APIs need to be called, and the parameters that need to be passed for successful creation of customer related data.

Briefly, here is how we can call the APIs

– First, Creation the Location Record

p_location_rec.country := p_country;
p_location_rec.address1 := p_addr1;
p_location_rec.address2 := p_addr2;
p_location_rec.city := p_city;
p_location_rec.county := v_county;
p_location_rec.postal_code := p_zip;
p_location_rec.state := p_state;
p_location_rec.created_by_module := ‘ISTORE’;

hz_location_v2pub.create_location(
‘T’,
p_location_rec,
x_location_id,
x_return_status,
x_msg_count,
x_msg_data);

– If the location record has been successfully created, Create the Party Site

p_party_site_rec.party_id := x_party_id; –<
p_party_site_rec.location_id := x_location_id; –<
p_party_site_rec.identifying_address_flag := ‘Y’;
p_party_site_rec.created_by_module := ‘ISTORE’;

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);

– If the Party Site record has been successfully created, Create the Acct Site

p_cust_acct_site_rec.cust_account_id := p_ship_to_cust_acct_id; –<
p_cust_acct_site_rec.party_site_id := x_party_site_id; –<
p_cust_acct_site_rec.language := ‘US’;
p_cust_acct_site_rec.created_by_module := ‘ISTORE’;

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);

– If the Party Site record has been successfully created, Ship To info

p_cust_site_use_rec.cust_acct_site_id := x_cust_acct_site_id; –<
p_cust_site_use_rec.site_use_code := ‘SHIP_TO’;
p_cust_site_use_rec.created_by_module := ‘ISTORE’;
p_cust_site_use_rec.primary_flag := p_primary_flag;

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);

Additionally, for the same address one can create the Bill To Address, by passing ‘BILL_TO’ as the site_use_code to the above API.

Request for support by sending an email to support@ibizsoftinc.com

No comments:

Post a Comment