Sunday, September 6, 2009

customer api in oracle apps

customer API
(Every API has 3 out Parameters – Return_Status, Msg_Count, Msg_Data)

Algorithm Used in API is:
1We create a record variable of the desired type (Party /Organization)
2Then we Populate the record with information from source.
3Then Call the Procedure to create Party / Organization and pass the record to the procedure as a parameter so that procedure put the information of the record variable in the base table.

1. Set the organization id
Exec dbms_application_info.set_client_info(‘204’);

2. Create a party and an account
a) HZ_CUST_ACCOUNT_V2PUB.CUST_ACCOUNT_REC_TYPE
b) HZ_PARTY_V2PUB.ORGANIZATION_REC_TYPE
c) HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE
HZ_CUST_ACCOUNT_V2PUB.Create_Cust_Account(…)à Cust_Account_ID, Account#, PartyID, Party#.

3. Create a physical location
a) HZ_LOCATION_V2PUB.LOCATION_REC_TYPE

HZ_LOCATION_V2PUB.Create_Location(..) à Location_ID

4. Create a party site using party_id you get from step 2 and location_id from step 3.
a) HZ_PARTY_SITE_V2PUB.PARTY_SITE_REC_TYPE

HZ_PARTY_SITE_V2PUB.Create_Party_Site( Party_ID, Location_ID ) à
Party_Site_ID, Party_Site#

5. Create an account site using account_id you get from step 2 and party_site_id from step 4.
a) HZ_CUST_ACCOUNT_SITE_V2PUB.CUST_ACCT_SITE_REC_TYPE

HZ_CUST_ACCOUNT_SITE_V2PUB.Create_Cust_Acct_Site(Cust_Acct_ID, Party_Site_ID)
àCust_Acct_Site_ID

6. Create an account site use using cust_acct_site_id you get from step 5 ans site_use_code = ‘BILL_TO’.
a) HZ_CUST_ACCOUNT_SITE_V2PUB.CUST_SITE_USE_REC_TYPE
b) HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE

HZ_CUST_ACCOUNT_SITE_V2PUB.Create_Cust_Site_Use(Cust_Acct_Site_ID) à
Site_Use_ID
Interface Table: TCA API.

Base table: HZ_PARTIES HZ_PARTY_SITES HZ_LOCATIONS
HZ_CUST_ACCOUNTS HZ_CUST_SITE_USES_ALL
HZ_CUST_ACCT_SITES_ALL HZ_PARTY_SITE_USES

Validations: Check if legacy values fetched are valid.
Check if customer address site is already created.
Check if customer site use is already created.
Check is customer header is already created.
Check whether the ship_to_site has associated bill_to_site
Check whether associated bill_to_site is created or not.
Profile amounts validation: validate cust_account_id, validate customer status.
Check if the location already exists in HZ_LOCATIONS. If does not exist, create new location.

1 comment: