You are on page 1of 5

Creating Customer Address in TCA - Step by Step

To create an address for Customer using APIs [so that you can invoice them], is a multi-step task as outlined in brief below. Addresses in Oracle TCA are stored in table named HZ_LOCATIONS. To create Locations, Oracle TCA provides an API named hz_location_v2pub.create_location This API returns Location_id once a physical address has been created. The location_id can then be used to create Party Site. To create party site, use hz_party_site_v2pub.create_party_site. When calling this API, we can pass "Party Site name" alongside the location_id to which this site is attached.. This API then returns Party_site_id. This Party_site_id can further be passed to another API hz_party_site_v2pub. create_party_site_use, which is where we specify Site Usage like Correspondance/Bilable etc. Next thing is to make a Customer Site, so that you can start billing to the customer. Lets say you already know the customer Account Id[assuming it already exists ] and the Party Site id(as created above). Now to create the Customer Site, use the API call as below. declare px_customer_acount_site_record hz_cust_account_site_v2pub.cust_acct_site_rec_type; begin px_customer_acount_site_record.cust_account_id := 90000;--lets assume px_customer_acount_site_record.party_site_id := 4323342;--the party site created above px_customer_acount_site_record.LANGUAGE := 'US'; px_customer_acount_site_record.created_by_module := 'XX_SIEBEL'; px_customer_acount_site_record.orig_system_reference := v_sibel_custom_site_num || 'CALLCENTRE'; hz_cust_account_site_v2pub.create_cust_acct_site (FND_API.G_TRUE, px_customer_acount_site_record, n_cust_acct_site_id, --returned v_return_status, --To indicagte success n_msg_count, -v_msg_data); end ; The last step would be to create Customer Site Usage by calling API hz_cust_account_site_v2pub.create_cust_site_use

AP Supplier API
R12 Supplier API

AP_PO_VENDOR_APIS_PKG (appvapib.pls) has been replaced in R12 by AP_VENDOR_PUB_PKG(appvndrb.pls). Both processes perform essentially the same function. The suppliers forms were replaced with OA Framework HTML style pages in R12. Oracle kept in R12 Forms for some aspects, but Suppliers screen was changed. In R12 you now have new tables AP_SUPPLIERS_ALL & AP_SUPPLIER_SITES_ALL. The old form (in 11.5) was working against PO_VENDORS & PO_VENDOR_SITES_ALL. In R12 those tables became views, and the new OA Framework is working against AP_SUPPLIERS_ALL &

AP_SUPPLIER_SITES_ALL. That is why you can't use Suppliers old form in R12, and why it will not be supported AP_VENDOR_PUB_PKG is not intended to be used an API for the creation/maintenance of Suppliers. Using the procedures directly in custom SQL is not supported. There is an existing set of Concurrent programs "Supplier Open Interface Import", "Supplier Sites Open Interface Import", and "Supplier Site Contacts Open Interface Import". These concurrent programs use the Supplier Interface tables (AP_SUPPLIERS_INT, AP_SUPPLIER_SITES_INT, and AP_SUP_SITE_CONTACTS_INT) to create suppliers using the procedures in AP_VENDOR_PUB_PKG. They are the only means we will support for the import of Suppliers. ------------------------------AP_SUP_SITE_CONTACT_INT interface used in 11i for loading supplier contact. Currently in R12 contacts can not be loaded using the interface table. ap_vendor_pub_pkg.create_vendor_contact API is used in R12 and the program has to be registered as a concurrent program. ### Sample R12 Code BEGIN v_party_usg_assignment_id := NULL; v_relationship_id := NULL; v_directional_flag := NULL; v_rel_rowid := NULL; fnd_file.put_line (fnd_file.LOG, 'Vendor code :' || rec.vendor_name || ' Vendor site code :' || rec.vendor_site_code || ' Person Last Name : ' || rec.person_last_name ); l_vendor_contact.vendor_id := rec.vendor_id; l_vendor_contact.vendor_site_id := rec.vendor_site_id; l_vendor_contact.org_id := rec.org_id; l_vendor_contact.person_first_name := rec.person_first_name; l_vendor_contact.person_middle_name := rec.person_middle_name; l_vendor_contact.person_last_name := rec.person_last_name; l_vendor_contact.phone := rec.phone; l_vendor_contact.email_address := rec.email_address; p_init_msg_list := fnd_api.g_true; p_commit := fnd_api.g_false; x_return_status := NULL; x_msg_count := NULL; x_msg_data := NULL; IF rec.process_flag = 'I' THEN fnd_file.put_line (fnd_file.LOG, 'Creating contacts....'); ap_vendor_pub_pkg.create_vendor_contact

(p_api_version => p_api_version, p_init_msg_list => p_init_msg_list, p_commit => p_commit, x_return_status => x_return_status, x_msg_count => x_msg_count, x_msg_data => x_msg_data, p_vendor_contact_rec => l_vendor_contact, x_vendor_contact_id => l_vendor_contact.vendor_contact_id, x_per_party_id => l_vendor_contact.per_party_id, x_rel_party_id => l_vendor_contact.relationship_id, x_rel_id => l_vendor_contact.rel_party_id, x_org_contact_id => l_vendor_contact.org_contact_id, x_party_site_id => l_vendor_contact.party_site_id ); error_handling (rec.r_id, x_return_status, x_msg_count, x_msg_data); fnd_file.put_line (fnd_file.LOG, '*************'); END IF; END; ------------------------------11i Supplier API ap_po_vendors_apis_pkg.insert_new_vendor (p_vendor_name => v_vendor.vendor_name, p_vendor_type_lookup_code => l_lookup_code, p_taxpayer_id => NULL, p_tax_registration_id => NULL, p_women_owned_flag => NULL, p_small_business_flag => NULL, p_minority_group_lookup_code => NULL, p_supplier_number => v_vendor.vendor_no, x_vendor_id, x_status, x_exception_msg); ap_po_vendors_apis_pkg.insert_new_vendor_site (p_vendor_site_code => v_vendor_site.vendor_site_code, p_vendor_id => l_vendor_id, p_org_id => l_org_id, p_address_line1 => v_vendor_site.address_line1, p_address_line2 => v_vendor_site.address_line2, p_address_line3 => v_vendor_site.address_line3, p_address_line4 => v_vendor_site.address_line4, p_city => v_vendor_site.city, p_state => v_vendor_site.state, p_zip => v_vendor_site.zip, p_province => NULL, p_county => v_vendor_site.county, p_country => v_vendor_site.country,

p_area_code => v_vendor_site.area_code, p_phone => v_vendor_site.phone, p_fax_area_code => v_vendor_site.fax_area_code, p_fax => v_vendor_site.fax, p_email_address => NULL, p_purchasing_site_flag => v_vendor_site.purchasing_site_flag, p_pay_site_flag => NULL, p_rfq_only_site_flag => NULL, x_vendor_site_id, x_status, x_exception_msg); ap_po_vendors_apis_pkg.insert_new_vendor_contact (p_vendor_site_id => l_vendor_site_id, p_first_name => v_vendor_site_contact.FIRST_NAME, p_last_name => v_vendor_site_contact.LAST_NAME, p_middle_name => v_vendor_site_contact.MIDDLE_NAME, p_prefix => v_vendor_site_contact.PREFIX, p_title => v_vendor_site_contact.TITLE, p_mail_stop => v_vendor_site_contact.MAIL_STOP, p_area_code => v_vendor_site_contact.CONTACT_AREA_CODE, p_phone => v_vendor_site_contact.CONTACT_PHONE, p_alt_area_code => NULL, p_alt_phone => NULL, p_fax_area_code => NULL, p_fax => NULL, p_email_address => NULL, p_url => NULL, x_vendor_contact_id, x_status, x_exception_msg); Credit goes to the below website(s) : http://www.oracleerp4u.com/2010/07/r11i-vendor-load-thru-api.html

Posted by Girish E at 8:12 PM No comments: Email ThisBlogThis!Share to TwitterShare to Facebook Labels: AP, API, R12 Articles Monday, February 18, 2013

Important TCA API's

You might also like