Oracle Supplier API API AP_VENDOR_PUB_PKG.UPDATE_VENDOR Not going to updates Supplier name.
Use HZ_PARTY_V2PUB.update_organization to update Supplier name/Customer name
l_organization_rec hz_party_v2pub.organization_rec_type;
x_profile_id NUMBER;
l_party_id NUMBER;
l_object_version_number HZ_PARTIES.OBJECT_VERSION_NUMBER%TYPE;
l_vendor_number AP_SUPPLIERS.SEGMENT1%TYPE;
l_msg_count NUMBER :=NULL;
l_msg_data VARCHAR2(4000);
l_return_status VARCHAR2(5);
BEGIN
SELECT aps.party_id,hzp.object_version_number,aps.segment1
INTO l_party_id,l_object_version_number,l_vendor_number
FROM AP_SUPPLIERS aps,
HZ_PARTIES hzp
WHERE vendor_id =p_vendorid
AND aps.party_id = hzp.party_id;
EXCEPTION WHEN OTHERS
THEN
fnd_file.put_line(fnd_file.log,'Error While Getting object_version_number from HZ_PARTIES for the Supplier no :'||p_supp_no);
END;
l_organization_rec.party_rec.party_id := l_party_id;
l_organization_rec.organization_name := TO_CHAR(SYSDATE,'DDMMRRRR')||l_vendor_number;
l_msg_count :=NULL;
l_msg_data :=NULL;
l_return_status :=NULL;
-- API top Update Vendor Name
--
BEGIN
HZ_PARTY_V2PUB.update_organization ( p_init_msg_list => FND_API.G_FALSE
,p_organization_rec=>l_organization_rec
,p_party_object_version_number => l_object_version_number
,x_profile_id => x_profile_id
,x_return_status=>l_return_status
,x_msg_count=>l_msg_count
,x_msg_data=>l_msg_data
);
EXCEPTION WHEN OTHERS
THEN
fnd_file.put_line(fnd_file.log,'Error While Calling HZ_PARTY_V2PUB.update_organization API for Supplier No'||p_supp_no||'-'||sqlerrm);
END;
No comments:
Post a Comment