原文地址  供应商导入的API补充(详解EBS接口开发之供应商导入)

--供应商
--创建
AP_VENDOR_PUB_PKG.Create_Vendor
( p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_vendor_rec IN r_vendor_rec_type,
x_vendor_id OUT NOCOPY AP_SUPPLIERS.VENDOR_ID%TYPE,
x_party_id OUT NOCOPY HZ_PARTIES.PARTY_ID%TYPE
);
--更新
AP_VENDOR_PUB_PKG.Update_Vendor
( p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_vendor_rec IN r_vendor_rec_type,
p_vendor_id IN NUMBER
);
--亲们,提供个R12失效供应商的程序供参考:
DECLARE
--
lv_return_status VARCHAR2(1);
lv_msg_count NUMBER;
lv_msg_data VARCHAR2(2000);
--
lv_vendor_id ap_suppliers.vendor_id%TYPE;
lv_vendor_rec AP_VENDOR_PUB_PKG.r_vendor_rec_type;
L_USER_ID NUMBER := 0;
L_RESP_ID NUMBER := 50192;
L_RESP_APPL_ID NUMBER := 20003;
--
cursor c_vendorid is
select vendor_id from TMP_DISABLE_VENDOR where STATUS='N'; BEGIN
--
EXECUTE IMMEDIATE 'ALTER session SET nls_language = ''American'''; fnd_global.apps_initialize(L_USER_ID, L_RESP_ID, L_RESP_APPL_ID);
mo_global.init('S');
--
for cc in c_vendorid loop
lv_vendor_id := cc.vendor_id;
lv_vendor_rec.END_DATE_ACTIVE :=SYSDATE; --如果要取消失效时间,请设置为:FND_API.G_MISS_DATE;
--
AP_VENDOR_PUB_PKG.Update_Vendor(p_api_version => 1.0
,p_init_msg_list => fnd_api.g_true
,p_commit => fnd_api.g_false
,p_validation_level => fnd_api.g_valid_level_full
,x_return_status => lv_return_status
,x_msg_count => lv_msg_count
,x_msg_data => lv_msg_data
,p_vendor_rec => lv_vendor_rec
,p_vendor_id => lv_vendor_id);
-- -- dbms_output.put_line(lv_return_status || '-' || lv_msg_count || '-' || lv_msg_data);
--
UPDATE TMP_DISABLE_VENDOR
SET STATUS ='Y'
WHERE vendor_id = lv_vendor_id;
end loop;
COMMIT;
END;
--验证
AP_VENDOR_PUB_PKG.Validate_Vendor
( p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_vendor_rec IN OUT NOCOPY r_vendor_rec_type,
p_mode IN VARCHAR2,
p_calling_prog IN VARCHAR2,
x_party_valid OUT NOCOPY VARCHAR2,
x_payee_valid OUT NOCOPY VARCHAR2,
p_vendor_id IN NUMBER
);
--供应商地点
--创建
AP_VENDOR_PUB_PKG.Create_Vendor_Site
( p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_vendor_site_rec IN r_vendor_site_rec_type,
x_vendor_site_id OUT NOCOPY NUMBER,
x_party_site_id OUT NOCOPY NUMBER,
x_location_id OUT NOCOPY NUMBER
);
--更新
AP_VENDOR_PUB_PKG.Update_Vendor_Site
( p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_vendor_site_rec IN r_vendor_site_rec_type,
p_vendor_site_id IN NUMBER,
p_calling_prog IN VARCHAR2 DEFAULT 'NOT ISETUP'
);
--验证
AP_VENDOR_PUB_PKG.Validate_Vendor_Site
( p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_vendor_site_rec IN OUT NOCOPY r_vendor_site_rec_type,
p_mode IN VARCHAR2,
p_calling_prog IN VARCHAR2,
x_party_site_valid OUT NOCOPY VARCHAR2,
x_location_valid OUT NOCOPY VARCHAR2,
x_payee_valid OUT NOCOPY VARCHAR2,
p_vendor_site_id IN NUMBER
);
--供应商联系人
--创建
AP_VENDOR_PUB_PKG.Create_Vendor_Contact
( p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_vendor_contact_rec IN r_vendor_contact_rec_type,
x_vendor_contact_id OUT NOCOPY NUMBER,
x_per_party_id OUT NOCOPY NUMBER,
x_rel_party_id OUT NOCOPY NUMBER,
x_rel_id OUT NOCOPY NUMBER,
x_org_contact_id OUT NOCOPY NUMBER,
x_party_site_id OUT NOCOPY NUMBER
);
--更新
AP_VENDOR_PUB_PKG.Update_Vendor_Contact
( p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE ,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
p_vendor_contact_rec IN r_vendor_contact_rec_type,
x_return_status OUT NOCOPY VARCHAR2 ,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2
);
--验证
AP_VENDOR_PUB_PKG.Validate_Vendor_Contact
( p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_vendor_contact_rec IN OUT NOCOPY r_vendor_contact_rec_type,
x_rel_party_valid OUT NOCOPY VARCHAR2,
x_per_party_valid OUT NOCOPY VARCHAR2,
x_rel_valid OUT NOCOPY VARCHAR2,
x_org_party_id OUT NOCOPY NUMBER,
x_org_contact_valid OUT NOCOPY VARCHAR2,
x_location_id OUT NOCOPY NUMBER,
x_party_site_valid OUT NOCOPY VARCHAR2
);
--导入供应商
--供应商
AP_VENDOR_PUB_PKG.Import_Vendors
( p_api_version IN NUMBER,
p_source IN VARCHAR2 DEFAULT 'IMPORT',
p_what_to_import IN VARCHAR2 DEFAULT NULL,
p_commit_size IN NUMBER DEFAULT 1000,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2
);
--地点
AP_VENDOR_PUB_PKG.Import_Vendor_Sites
( p_api_version IN NUMBER,
p_source IN VARCHAR2 DEFAULT 'IMPORT',
p_what_to_import IN VARCHAR2 DEFAULT NULL,
p_commit_size IN NUMBER DEFAULT 1000,
p_org_id IN NUMBER DEFAULT NULL, --bug13801271
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2
);
--联系人
AP_VENDOR_PUB_PKG.Import_Vendor_Contacts
( p_api_version IN NUMBER,
p_source IN VARCHAR2 DEFAULT 'IMPORT',
p_what_to_import IN VARCHAR2 DEFAULT NULL,
p_commit_size IN NUMBER DEFAULT 1000,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2
);
05-02 10:47