The requirement is to update/attach a new Bill To Location to existing supplier sites. The below script can be used to update the Bill To Location for the existing supplier sites and this script can be explored to update any fields that are available on the supplier sites record.

 

/*******************************************************************************/
— Author : Yuvaraj Paranthaman
— Scope : Private

— To update Bill To Location ID for supplier sites


— 11790 UK – Livingston-Nettlehill
— 11791 UK – Livingston Whitelaw House
/*******************************************************************************/
DECLARE
l_return_status VARCHAR2(25) := NULL;
l_msg_count NUMBER := NULL;
l_msg_data VARCHAR2(2000) := NULL;
l_vendor_site_id VARCHAR2(25) := NULL;
l_vendor_site_rec ap_vendor_pub_pkg.r_vendor_site_rec_type;
CURSOR c1 IS
SELECT
*
FROM
apps.ap_supplier_sites_all
WHERE
bill_to_location_id = 11791
AND
vendor_site_id = 330806;

BEGIN
/* Intialize block */
BEGIN
fnd_global.apps_initialize(
user_id => 23994,
resp_id => 50541,
resp_appl_id => 200,
security_group_id => 0,
server_id =>-1
);
END;

— Assigning the new bill to location to supplier sites

l_vendor_site_rec.bill_to_location_id := 11790; — Bill To location newly created that is to be updated

/* You can assign the values that are available in the record type ap_vendor_pub_pkg.r_vendor_site_rec_type */

FOR i IN c1 LOOP
apps.ap_vendor_pub_pkg.update_vendor_site(
p_api_version => 1.0,
p_init_msg_list => fnd_api.g_false,
p_commit => fnd_api.g_false,
p_validation_level => fnd_api.g_valid_level_full,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_vendor_site_rec => l_vendor_site_rec,
p_vendor_site_id => i.vendor_site_id
–,
— p_calling_prog IN VARCHAR2 DEFAULT ‘NOT ISETUP’
);
END LOOP;

END;

Recent Posts

Start typing and press Enter to search