Supplier Creation in R12
VENDOR:
l_vendor_rec.segment1 := cv_ven_l.vendor_number;
l_vendor_rec.vendor_name := cv_ven_l.vendor_name;
l_vendor_rec.summary_flag := cv_ven_l.summary_flag;
l_vendor_rec.enabled_flag := cv_ven_l.enabled_flag;
l_vendor_rec.vendor_type_lookup_code := cv_ven_l.vendor_type_lookup_code;
l_vendor_rec.start_date_active := SYSDATE;
l_vendor_rec.customer_num := cv_ven_l.customer_num;
l_vendor_rec.pay_group_lookup_code := cv_ven_l.pay_group_lookup_code;
l_vendor_rec.pay_date_basis_lookup_code := cv_ven_l.pay_date_basis_lookup_code;
l_vendor_rec.invoice_currency_code := cv_ven_l.invoice_currency_code;
l_vendor_rec.terms_id :=cv_ven_l.term_id;
l_vendor_rec.ext_payee_rec.default_pmt_method :=cv_ven_l.payment_method_lookup_code;
l_vendor_rec.invoice_currency_code := cv_ven_l.payment_currency_code;
l_vendor_rec.payment_currency_code := cv_ven_l.payment_currency_code;
l_vendor_rec.invoice_amount_limit := cv_ven_l.invoice_amount_limit;
l_vendor_rec.state_reportable_flag :=trim( cv_ven_l.state_reportable_flag);
l_vendor_rec.attribute1 := cv_ven_l.attribute1;
l_vendor_rec.end_date_active := cv_ven_l.end_date_active;
l_vendor_rec.allow_substitute_receipts_flag := cv_ven_l.allow_substitute_receipts_flag;
l_vendor_rec.allow_unordered_receipts_flag := cv_ven_l.allow_unordered_receipts_flag;
l_vendor_rec.employee_id :=cv_ven_l.employee_id;
fnd_msg_pub.initialize;
ap_vendor_pub_pkg.create_vendor (p_api_version => 1.0,
p_init_msg_list => 'F',
p_commit => 'F',
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_vendor_rec => l_vendor_rec,
x_vendor_id => l_vendor_id,
x_party_id => l_party_id
);
VENDOR-SITE:
l_vendor_rec_site.vendor_id := cv_ven_site_l.vendor_id;
l_vendor_rec_site.vendor_site_code := cv_ven_site_l.vendor_site_code;
fnd_file.put_line (fnd_file.log, 'Vendor Site Code is: '||cv_ven_site_l.vendor_site_code);
l_vendor_rec_site.vendor_site_code_alt := cv_ven_site_l.vendor_site_code_alt;
l_vendor_rec_site.org_id := cv_ven_site_l.organization_id;
l_vendor_rec_site.purchasing_site_flag := cv_ven_site_l.purchasing_site_flag;
l_vendor_rec_site.rfq_only_site_flag := cv_ven_site_l.rfq_only_site_flag;
l_vendor_rec_site.pay_site_flag := cv_ven_site_l.pay_site_flag;
l_vendor_rec_site.primary_pay_site_flag := cv_ven_site_l.primary_pay_site_flag;
l_vendor_rec_site.address_line1 := cv_ven_site_l.address_line1;
fnd_file.put_line (fnd_file.log, 'Address Line1 is: '||cv_ven_site_l.address_line1);
l_vendor_rec_site.address_line2 := cv_ven_site_l.address_line2;
l_vendor_rec_site.address_line3 := cv_ven_site_l.address_line3;
l_vendor_rec_site.address_line4 := cv_ven_site_l.address_line4;
l_vendor_rec_site.city := cv_ven_site_l.city;
l_vendor_rec_site.state := cv_ven_site_l.state;
l_vendor_rec_site.zip := cv_ven_site_l.zip;
l_vendor_rec_site.country := cv_ven_site_l.country;
l_vendor_rec_site.county := cv_ven_site_l.county;
l_vendor_rec_site.phone := cv_ven_site_l.phone;
l_vendor_rec_site.ext_payee_rec.default_pmt_method := cv_ven_site_l.payment_method_lookup_code;
l_vendor_rec_site.invoice_currency_code := cv_ven_site_l.invoice_currency_code;
l_vendor_rec_site.invoice_currency_code := cv_ven_site_l.payment_currency_code;
l_vendor_rec_site.terms_date_basis := cv_ven_site_l.terms_date_basis;
l_vendor_rec_site.email_address := cv_ven_site_l.email_address;
l_vendor_rec_site.supplier_notif_method := cv_ven_site_l.supplier_notif_method;
l_vendor_rec_site.address_style := cv_ven_site_l.address_style;
l_vendor_rec_site.remittance_email:= cv_ven_site_l.remittance_email;
l_vendor_rec_site.invoice_amount_limit := cv_ven_site_l.invoice_amount_limit;
l_vendor_rec_site.payment_currency_code := cv_ven_site_l.payment_currency_code;
l_vendor_rec_site.pay_group_lookup_code := cv_ven_site_l.pay_group_lookup_code;
l_vendor_rec_site.terms_id := cv_ven_site_l.term_id;
l_vendor_rec_site.pay_date_basis_lookup_code := cv_ven_site_l.pay_date_basis_lookup_code;
l_vendor_rec_site.fax := cv_ven_site_l.fax;
l_vendor_rec_site.area_code := cv_ven_site_l.area_code;
l_vendor_rec_site.prepay_code_combination_id := cv_ven_site_l.prepay_code_combination_id;
l_vendor_rec_site.accts_pay_code_combination_id := cv_ven_site_l.accts_pay_code_combination_id;
fnd_msg_pub.initialize;
ap_vendor_pub_pkg.create_vendor_site (p_api_version => 1.0,
p_init_msg_list => 'F',
p_commit => 'F',
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_vendor_site_rec => l_vendor_rec_site,
x_vendor_site_id => l_vendor_site_id,
x_party_site_id => l_party_site_id,
x_location_id => l_location_id
);
VENDOR-CONTACTS:
l_vendor_contact_rec.vendor_id := cv_site_con_l.vendor_id;
l_vendor_contact_rec.vendor_site_id := cv_site_con_l.vendor_site_id;
l_vendor_contact_rec.vendor_site_code := cv_site_con_l.vendor_site_code;
l_vendor_contact_rec.org_id := cv_site_con_l.org_id;
l_vendor_contact_rec.org_party_site_id := cv_site_con_l.party_site_id;
l_vendor_contact_rec.person_title := cv_site_con_l.title;
l_vendor_contact_rec.person_first_name := cv_site_con_l.first_name;
l_vendor_contact_rec.person_middle_name := cv_site_con_l.middle_name;
l_vendor_contact_rec.person_last_name := cv_site_con_l.last_name;
l_vendor_contact_rec.prefix := cv_site_con_l.prefix;
l_vendor_contact_rec.area_code := cv_site_con_l.area_code;
l_vendor_contact_rec.phone := cv_site_con_l.phone;
l_vendor_contact_rec.contact_name_phonetic := cv_site_con_l.contact_name_alt;
l_vendor_contact_rec.person_first_name_phonetic := cv_site_con_l.first_name_alt;
l_vendor_contact_rec.person_last_name_phonetic := cv_site_con_l.last_name_alt;
l_vendor_contact_rec.email_address := cv_site_con_l.email_address;
l_vendor_contact_rec.url := cv_site_con_l.url;
l_vendor_contact_rec.fax_area_code := cv_site_con_l.fax_area_code;
l_vendor_contact_rec.fax_phone := cv_site_con_l.fax;
fnd_msg_pub.initialize;
ap_vendor_pub_pkg.create_vendor_contact (p_api_version => 1.0,
p_init_msg_list => 'F',
p_commit => 'F',
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_vendor_contact_rec => l_vendor_contact_rec,
x_vendor_contact_id => l_vendor_contact_id,
x_per_party_id => l_per_party_id,
x_rel_party_id => l_rel_party_id,
x_rel_id => l_rel_id,
x_org_contact_id => l_org_contact_id,
x_party_site_id => l_party_site_id
);
else we can use below One.
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);
p_vendor_contact_rec apps.ap_vendor_pub_pkg.r_vendor_contact_rec_type;
x_vendor_contact_id NUMBER;
x_per_party_id NUMBER;
x_rel_party_id NUMBER;
x_rel_id NUMBER;
x_org_contact_id NUMBER;
x_party_site_id NUMBER;
v_msg_index_out NUMBER;
BEGIN
p_api_version := 1.0;
p_init_msg_list := 'T';
p_commit := 'T';
p_validation_level := FND_API.G_VALID_LEVEL_FULL;
x_return_status := NULL;
x_msg_count := NULL;
x_msg_data := NULL;
p_vendor_contact_rec.vendor_contact_id := po_vendor_contacts_s.NEXTVAL;
P_VENDOR_CONTACT_REC.vendor_site_id :=1580;
P_VENDOR_CONTACT_REC.PERSON_FIRST_NAME := 'M';
P_VENDOR_CONTACT_REC.PERSON_LAST_NAME := 'MANOHAR';
P_VENDOR_CONTACT_REC.PHONE := '9840395136';
P_VENDOR_CONTACT_REC.EMAIL_ADDRESS := 'manohar@gmail.com';
P_VENDOR_CONTACT_REC.URL := 'www.google.com';
P_VENDOR_CONTACT_REC.org_id := 87;
p_vendor_contact_rec.party_site_id := 14653;
p_vendor_contact_rec.org_party_site_id := 14653;
p_vendor_contact_rec.VENDOR_ID := 1228;
x_vendor_contact_id := NULL;
x_per_party_id := NULL;
x_rel_party_id :=NULL;
x_rel_id := NULL;
x_org_contact_id := NULL;
x_party_site_id := NULL;
apps.ap_vendor_pub_pkg.create_vendor_contact (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_contact_rec => p_vendor_contact_rec,
x_vendor_contact_id => x_vendor_contact_id,
x_per_party_id => x_per_party_id,
x_rel_party_id => x_rel_party_id,
x_rel_id => x_rel_id,
x_org_contact_id => x_org_contact_id,
x_party_site_id => x_party_site_id
);
DBMS_OUTPUT.put_line ('X_RETURN_STATUS = ' || x_return_status);
DBMS_OUTPUT.put_line ('X_MSG_COUNT = ' || TO_CHAR (x_msg_count));
DBMS_OUTPUT.put_line ('X_MSG_DATA = ' || x_msg_data);
DBMS_OUTPUT.put_line ('X_VENDOR_CONTACT_ID = ' || TO_CHAR (x_vendor_contact_id));
DBMS_OUTPUT.put_line ('X_PER_PARTY_ID = ' || TO_CHAR (x_per_party_id));
DBMS_OUTPUT.put_line ('X_REL_PARTY_ID = ' || TO_CHAR (x_rel_party_id));
DBMS_OUTPUT.put_line ('X_REL_ID = ' || TO_CHAR (x_rel_id));
DBMS_OUTPUT.put_line ('X_ORG_CONTACT_ID = ' || TO_CHAR (x_org_contact_id));
DBMS_OUTPUT.put_line ('X_PARTY_SITE_ID = ' || TO_CHAR (x_party_site_id));
DBMS_OUTPUT.put_line ('');
COMMIT;
END;
No comments:
Post a Comment