---Supplier Site update API
DECLARE
p_api_version NUMBER;
p_init_msg_list VARCHAR2 (200);
p_commit VARCHAR2 (200);
p_validation_level NUMBER;
x_return_status VARCHAR2 (200);
x_msg_count NUMBER;
x_msg_data VARCHAR2 (200);
lr_vendor_site_rec apps.ap_vendor_pub_pkg.r_vendor_site_rec_type;
lr_existing_vendor_site_rec ap_supplier_sites_all%ROWTYPE;
p_vendor_site_id NUMBER;
p_calling_prog VARCHAR2 (200);
BEGIN
-- Initialize apps session
--user_id, resp_id, resp_app_id
fnd_global.apps_initialize (0, 7000, 200);
mo_global.init ('SQLAP');
fnd_client_info.set_org_context (261);
-- Assign Basic Values
p_api_version := 1.0;
p_init_msg_list := fnd_api.g_true;
p_commit := fnd_api.g_true;
p_validation_level := fnd_api.g_valid_level_full;
p_vendor_site_id := 121039; -- to be end dated
p_calling_prog := 'XXCUSTOM';
BEGIN
SELECT *
INTO lr_existing_vendor_site_rec
FROM ap_supplier_sites_all assa
WHERE assa.vendor_site_id = p_vendor_site_id;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (
'Unable to derive the supplier site information for site id:'
|| p_vendor_site_id);
END;
-- Assign Vendor Site Details
lr_vendor_site_rec.vendor_site_id := lr_existing_vendor_site_rec.vendor_site_id;
lr_vendor_site_rec.last_update_date := SYSDATE;
lr_vendor_site_rec.last_updated_by := 0;
lr_vendor_site_rec.vendor_id := lr_existing_vendor_site_rec.vendor_id;
lr_vendor_site_rec.org_id := lr_existing_vendor_site_rec.org_id;
lr_vendor_site_rec.vendor_site_code := 'Sec. 194(Q)';
--lr_vendor_site_rec.inactive_date := SYSDATE;
AP_VENDOR_PUB_PKG.UPDATE_VENDOR_SITE (
p_api_version => p_api_version,
p_init_msg_list => p_init_msg_list,
p_commit => p_commit,
p_validation_level => p_validation_level,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_vendor_site_rec => lr_vendor_site_rec,
p_vendor_site_id => p_vendor_site_id,
p_calling_prog => p_calling_prog);
DBMS_OUTPUT.put_line ('RETURN_STATUS = ' || x_return_status);
DBMS_OUTPUT.put_line ('MSG_COUNT = ' || x_msg_count);
DBMS_OUTPUT.put_line ('MSG_DATA = ' || x_msg_data);
END;
/