Professional Documents
Culture Documents
Objectives
Following this session, you will understand:
The Trading Community Architecture
(TCA) Customer Data Model
Customer Account Creation Flow
How To Use TCA Application
Programming Interfaces (APIs)
The Customers User Interface
Agenda
What is an Application Programming Interface (API)?
Overview of Trading Community Architecture (TCA) PL/SQL APIs
Advantages
API Components
API Features
Customer Entities
API Coding Steps & Sample Code
Customer Account Creation Flow with Steps & Demo
Interface
Allows update of columns to NULL, also not possible through
Customer Interface
Extensive debugging capability for troubleshooting
Extensive error handling capability
Robust validation
API Components
API Category
Create Customer Account API
Update Customer Account API
API Components
PROCEDURE create_cust_account (
p_init_msg_list IN VARCHAR2:= FND_API.G_FALSE,
p_cust_account_rec IN CUST_ACCOUNT_REC_TYPE,
p_person_rec IN HZ_PARTY_V2PUB.PERSON_REC_TYPE,
p_customer_profile_rec IN
HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE,
p_create_profile_amt IN VARCHAR2:= FND_API.G_TRUE,
x_cust_account_id OUT NUMBER,
x_account_number OUT VARCHAR2,
x_party_id OUT NUMBER,
x_party_number OUT VARCHAR2,
x_profile_id OUT NUMBER,
x_return_status OUT VARCHAR2,
x_msg_count OUT NUMBER,
x_msg_data OUT VARCHAR2 )
11
API Features
Exception handling and results messages
Overall status success, failure or unexpected error
Messages describing the operations performed or errors encountered by
the API
Output values that the program making the call to the API might need to
API Features
Standard Parameters
IN or IN/OUT Parameters
x_return_status
OUT VARCHAR2
FND_API.G_RET_STS_SUCCESS - Success
FND_API.G_RET_STS_ERROR Validation error
FND_API.G_RET_STS_UNEXP_ERROR - Unexpected error
x_msg_count
OUT NUMBER
x_msg_data
OUT VARCHAR2
13
API Features
Nested Record Types
For example, Create_Person API uses the person_rec_type record type.
primary keys
Missing Attributes
Create APIs missing attributes are defaulted as NULL
Update APIs missing attributes retain the existing database value
14
API Features
Null Attributes
Customer Entities
Party Layer APIs
Entity
API
Tables
Party
Organization
HZ_PARTY_V2PUB.create_organization
HZ_PARTIES
HZ_ORGANIZATION_PROFILES
Party - Person
HZ_PARTY_V2PUB.create_person
HZ_PARTIES
HZ_PERSON_PROFILES
Location
HZ_LOCATION_V2PUB.create_location
HZ_LOCATIONS
HZ_LOCATIONS_PROFILES
Party Site
HZ_PARTY_SITE_V2PUB.create_party_site
HZ_PARTY_SITES
HZ_PARTY_SITE_V2PUB.create_party_site_use
HZ_PARTY_SITE_USES
HZ_PARTY_CONTACT_V2PUB.create_org_contact
HZ_ORG_CONTACTS
HZ_RELATIONSHIPS (Subject:Contact
person Object:Organization/Person)
HZ_PARTIES
(party_type=PARTY_RELATIONSHIP)
Party Contact
(Organization
Contact)
16
Customer Entities
Party Layer APIs
17
Entity
API
Tables
Contact Role
HZ_PARTY_CONTACT_V2PUB.create_org_contact_role
HZ_ORG_CONTACT_ROLES
Contact
Point
HZ_CONTACT_POINT_V2PUB.create_contact_point
HZ_CONTACT_POINT_V2PUB.create_phone_contact_point
HZ_CONTACT_POINT_V2PUB.create_email_contact_point
HZ_CONTACT_POINT_V2PUB.create_web_contact_point
HZ_CONTACT_POINT_V2PUB.create_telex_contact_point
HZ_CONTACT_POINT_V2PUB.create_edi_contact_point
HZ_CONTACT_POINT_V2PUB.create_eft_contact_point
HZ_CONTACT_POINTS
Owner_table_name=HZ_PARTIES and
owner_table_id=party_id
Or
Owner_table_name=HZ_PARTY_SITE
S and owner_table_id=party_site_id
Customer Entities
Account Layer APIs
Entity
18
API
Tables
Customer Account
HZ_CUST_ACCOUNT_V2PUB.create_cust_account
HZ_CUST_ACCOUNTS
HZ_PARTIES
HZ_CUSTOMER_PROFILES
HZ_CUST_PROFILE_AMTS
Account Site
HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_acct_site
HZ_CUST_ACCT_SITES_ALL
HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_site_use
HZ_CUST_SITE_USES_ALL
HZ_CUSTOMER_PROFILES
HZ_CUST_PROFILE_AMTS
Account
Relationship
HZ_CUST_ACCOUNT_V2PUB. create_cust_acct_relate
HZ_CUST_ACCT_RELATE_ALL
Customer Entities
Account Layer APIs
Entity
API
Tables
HZ_CUSTOMER_PROFILE_V2PUB.create_customer_profile
HZ_CUSTOMER_PROFILES
HZ_CUST_PROFILE_AMTS
HZ_CUSTOMER_PROFILE_V2PUB.create_cust_profile_amt
HZ_CUST_PROFILE_AMTS
HZ_CUST_ACCOUNT_ROLE_V2PUB.create_cust_account_
role
HZ_CUST_ACCOUNT_ROLES
HZ_CUST_ACCOUNT_ROLE_V2PUB.create_role_responsi
bility
HZ_ROLE_RESPONSIBILITY
19
user_id in number,
resp_id in number,
resp_appl_id in number,
security_group_id in number default 0);
11i : fnd_client_info.set_org_context(&org_id);
R12: MO_GLOBAL.set_policy_context('S', &org_id);
20
procedure
21
22
DECLARE
p_init_msg_list VARCHAR2(1) := FND_API.G_TRUE;
x_return_status VARCHAR2(2000);
x_msg_count
NUMBER;
x_msg_data
VARCHAR2(2000);
p_person_rec
HZ_PARTY_V2PUB.PERSON_REC_TYPE;
x_party_id
NUMBER;
x_party_number VARCHAR2(2000);
x_profile_id
NUMBER;
BEGIN
p_person_rec.person_first_name := 'Stella';
p_person_rec.person_last_name := 'Sia';
p_person_rec.created_by_module := 'TCA_V2_API';
HZ_PARTY_V2PUB.create_person (
p_init_msg_list,
p_person_rec,
x_party_id,
x_party_number,
x_profile_id,
x_return_status,
x_msg_count,
x_msg_data);
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);
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;
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);
EXCEPTION
when others then dbms_output.put_line(sqlerrm(sqlcode));
END;
23
24
25
26
Demo
TCA APIs for Customer
Account Data
27
Customer
Account
Party Site
Point
Organization
Address
Account Site
Organization Party
Organization Profile
28
Account
Site Use
29
Person
Location
Organization
Contact
Organization
Contact Address
Organization
Contact Point
Account Role
Account Role
Responsibility
Road
30
31
Robinson Road
10. Contact Point: Stella Sia-Singapore Airlines Phone 65-
7771212
11. Customer Account Role: Singapore Airlines Office - Stella Sia-
32
34
35
CUST_ACCT_
PROFILE_AMT_ID
CURRENCY_CODE
241143
241144
241145
241146
241147
241148
36
CUST_ACCOUNT_
PROFILE_ID
CUST_ACCOUNT_ID SITE_USE_ID
244818
244818
244818
244818
244818
244818
252705
252705
252705
252705
252705
252705
CAD
EUR
GBP
RUR
SEK
USD
37
38
Customer Account
Click
39
40
41
42
43
Step 2 Location
Create Location (HZ_LOCATION_V2PUB.create_location)
x_location_id: 28964
select location_id,address1,city,postal_code
from hz_locations
where location_id = 28964;
LOCATION_ID
28964
44
ADDRESS1
1 Robinson Road
CITY
Singapore
POSTAL_CODE
601010
45
46
ORG_ID
204
47
location_id=28964
3. Organization Address: Singapore Airlines 1 Robinson Road
party_site_id=357430
4. Customer Account Site: Singapore Airlines Office 1 Robinson
Road
cust_acct_site_id=13903
48
49
50
PARTY_SITE_ID
357430 BILL_TO
SITE_USE_TYPE
Y
51
52
245819
245819
245819
245819
245819
245819
252705
252705
252705
252705
252705
252705
16390
16390
16390
16390
16390
16390
CAD
EUR
GBP
RUR
SEK
USD
54
55
56
Step 6 - Person
Create Person
(HZ_PARTY_V2PUB.create_person)
X_party_id := 490974;
Select party_id, party_type, party_name from hz_parties
Where party_id = 490974;
57
59
61
Organization Contact
HZ_PARTY_CONTACT_V2PUB.create_org_contact
62
Organization Contact
HZ_PARTY_CONTACT_V2PUB.create_org_contact
party_id=490974
org_contact_id=186069
64
65
CITY
Singapore
POSTAL_CODE
601020
66
67
location_id=28985
9. Organization Contact Address: Stella Sia-Singapore Airlines
68
PHONE
HZ_PARTIES
490975
65 6777-1212
70
71
7771212 contact_point_id=350447
72
73
Click
74
75
76
77
78
79
responsibility_id=34406
cust_account_id=252705
Organization Party: Singapore Airlines party_id=488974
Organization Profile organization_profile_id=415422
Account Profile and Profile Amounts
cust_account_profile_id=244818
2. Location: 1 Robinson Road, Singapore 601010 location_id=28964
party_site_id=357430
4. Customer Account Site: Singapore Airlines Office 1 Robinson Road
cust_acct_site_id=13903
80
81
6.
7.
8.
contact_point_id=350447
11. Customer Account Role: Singapore Airlines Office - Stella Sia-
cust_account_role_id=81851
82
responsibility_id=34406
83
85
86
Summary
What we covered today
How to use the TCA APIs to create
Customer Account Data
Customer Account creation flow
How data is captured in the TCA
data model
How this data appears in the Customers
user interface
87
88
89
Receivables Community:
https://communities.oracle.com/portal/se
rver.pt/community/receivables/233
Stay Connected
Oracle E-Business Suite Support Social Media Channels
Twitter: @Oracle_EBS
Facebook: OracleEBusinessSuiteSupport
Blog: http://blogs.oracle.com/EBS
https://communities.oracle.com/portal/server.pt/community/oracle
_e-business_suite/228
90
1.
2.
91
92
93
your peers are using Oracle technologies and services to better meet their needs.
Exchange Knowledge
Resolve Issues
Gain Expertise
94
1.
2.
3.
Learn More
Available References and Resources to Get Proactive
95
96
THANK YOU
97
98