/*PLSQL Script using API to update vendor name in ap_suppliers*/
Initialization steps BEFORE MODIFY supplier TABLES:
SELECT user_id
FROM fnd_user
WHERE user_name=<'Username which is used to run script'>;
SELECT responsibility_id,
application_id
FROM fnd_responsibility_tl
WHERE responsibility_name = '<resp name>';
API:
DECLARElc_return_status VARCHAR2(2000);
ln_msg_count NUMBER;
ll_msg_data LONG;
ln_vendor_id NUMBER;
ln_vendor_site_id NUMBER;
ln_message_int NUMBER;
ln_party_id NUMBER;
lrec_vendor_rec ap_vendor_pub_pkg.r_vendor_rec_type;
BEGIN
fnd_global.Apps_initialize(<USER_ID>, <RESP_ID>, 201);
ln_vendor_id := <VENDOR_ID>;
lrec_vendor_rec.vendor_name := '<New_Vendor_Name>';
ap_vendor_pub_pkg.Update_vendor_public
x_return_status => lc_return_status,
x_msg_data => ll_msg_data,
p_vendor_id => ln_vendor_id);
IF ( lc_return_status <> 'S' ) THEN
IF ln_msg_count >= 1 THEN
FOR v_index IN 1..ln_msg_count LOOP
fnd_msg_pub.Get (p_msg_index => v_index, p_encoded => 'F',
p_data => ll_msg_data
, p_msg_index_out => ln_message_int);
ll_msg_data := 'UPDATE_VENDOR '
||Substr(ll_msg_data, 1, 3900);
dbms_output.Put_line('Ll_Msg_Data - '
||ll_msg_data);
END LOOP;
END IF;
END IF;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
dbms_output.Put_line('SQLERRM - '
||SQLERRM);
END;