Creating Suppliers
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);
x_vendor_id NUMBER;
x_party_id NUMBER;
p_vendor_rec ap_vendor_pub_pkg.r_vendor_rec_type;
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_rec.vendor_type_lookup_code := 'VENDOR';
p_vendor_rec.vendor_name := 'Business Solutions';
p_vendor_rec.women_owned_flag := 'N';
p_vendor_rec.small_business_flag := 'Y';
-- p_vendor_rec.segment1 := '001';--insert non duplicate number
SELECT next_auto_supplier_num
INTO p_vendor_rec.segment1
FROM ap_product_setup;
ap_vendor_pub_pkg.create_vendor (p_api_version,
p_init_msg_list,
p_commit,
p_validation_level,
x_return_status,
x_msg_count,
x_msg_data,
p_vendor_rec,
x_vendor_id,
x_party_id
);
DBMS_OUTPUT.put_line ('RETURN STATUS :' || x_return_status);
DBMS_OUTPUT.put_line ('MESSAGE COUNT :' || TO_CHAR (x_msg_count));
DBMS_OUTPUT.put_line ('MESSAGE :' || x_msg_data);
DBMS_OUTPUT.put_line ('VENDOR ID :' || TO_CHAR (x_vendor_id));
DBMS_OUTPUT.put_line ('PARTY ID :' || TO_CHAR (x_party_id));
COMMIT;
IF x_return_status = 'S'
THEN
COMMIT;
ELSE
ROLLBACK;
END IF;
IF x_msg_count > 0
THEN
FOR v_index IN 1 .. x_msg_count
LOOP
fnd_msg_pub.get (p_msg_index => v_index,
p_encoded => 'F',
p_data => x_msg_data,
p_msg_index_out => v_msg_index_out
);
x_msg_data := SUBSTR (x_msg_data, 1, 200);
DBMS_OUTPUT.put_line ('x_msg_data :' || x_msg_data);
END LOOP;
END IF;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('SQL ERROR :' || SQLERRM);
END;
/
/*************************************************************************
RETURN STATUS :S
MESSAGE COUNT :0
MESSAGE :
VENDOR ID :2386867
PARTY ID :6953375
PL/SQL procedure successfully completed.
**************************************************************************/
Creating Sites
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);
x_vendor_site_id NUMBER;
x_party_site_id NUMBER;
x_location_id NUMBER;
p_vendor_site_rec ap_vendor_pub_pkg.r_vendor_site_rec_type;
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_site_rec.vendor_id := 2386867;
p_vendor_site_rec.vendor_site_code := 'BUSINESS SOLUTIONS SITE';
p_vendor_site_rec.area_code := '';
p_vendor_site_rec.phone := '';
p_vendor_site_rec.fax_area_code := '';
p_vendor_site_rec.fax := '';
p_vendor_site_rec.address_line1 := '235 111 Avenue';
p_vendor_site_rec.address_line2 := '';
p_vendor_site_rec.address_line3 := '';
p_vendor_site_rec.city := 'Bellevue';
p_vendor_site_rec.state := 'WA';
p_vendor_site_rec.county := 'KING';
p_vendor_site_rec.country := 'US';
p_vendor_site_rec.org_name := '111 US BU';
p_vendor_site_rec.org_id := 101;
x_vendor_site_id := NULL;
x_party_site_id := NULL;
x_location_id := NULL;
ap_vendor_pub_pkg.create_vendor_site (p_api_version,
p_init_msg_list,
p_commit,
p_validation_level,
x_return_status,
x_msg_count,
x_msg_data,
p_vendor_site_rec,
x_vendor_site_id,
x_party_site_id,
x_location_id
);
DBMS_OUTPUT.put_line ('RETURN STATUS :' || x_return_status);
DBMS_OUTPUT.put_line ('MESSAGE COUNT :' || TO_CHAR (x_msg_count));
DBMS_OUTPUT.put_line ('MESSAGE :' || x_msg_data);
DBMS_OUTPUT.put_line ('VENDOR SITE ID :' || TO_CHAR (x_vendor_site_id));
DBMS_OUTPUT.put_line ('PARTY SITE ID :' || TO_CHAR (x_party_site_id));
DBMS_OUTPUT.put_line ('LOCATION ID :' || TO_CHAR (x_location_id));
COMMIT;
IF x_return_status = 'S'
THEN
COMMIT;
ELSE
ROLLBACK;
END IF;
IF x_msg_count > 0
THEN
FOR v_index IN 1 .. x_msg_count
LOOP
fnd_msg_pub.get (p_msg_index => v_index,
p_encoded => 'F',
p_data => x_msg_data,
p_msg_index_out => v_msg_index_out
);
x_msg_data := SUBSTR (x_msg_data, 1, 200);
DBMS_OUTPUT.put_line ('x_msg_data :' || x_msg_data);
END LOOP;
END IF;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('SQL ERROR :' || SQLERRM);
END;
/*************************************************************************
RETURN STATUS :S
MESSAGE COUNT :0
MESSAGE :
VENDOR SITE ID :7171
PARTY SITE ID :234632
LOCATION ID :26635
PL/SQL procedure successfully completed.
**************************************************************************/
Creating Contacts
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 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 :=
ap_sup_site_contact_int_s.NEXTVAL;
p_vendor_contact_rec.person_first_name := 'PETER';
p_vendor_contact_rec.person_middle_name := '';
p_vendor_contact_rec.person_last_name := 'ALLEN';
p_vendor_contact_rec.phone := '9948012318';
p_vendor_contact_rec.email_address := 'APETER@zaire.com';
p_vendor_contact_rec.url := 'http://abn.com';
p_vendor_contact_rec.org_id := 204;
p_vendor_contact_rec.party_site_id := 234632;
p_vendor_contact_rec.org_party_site_id := 234632;
p_vendor_contact_rec.vendor_id := 49170;
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;
fnd_msg_pub.initialize;
ap_vendor_pub_pkg.create_vendor_contact (p_api_version,
p_init_msg_list,
p_commit,
p_validation_level,
x_return_status,
x_msg_count,
x_msg_data,
p_vendor_contact_rec,
x_vendor_contact_id,
x_per_party_id,
x_rel_party_id,
x_rel_id,
x_org_contact_id,
x_party_site_id
);
DBMS_OUTPUT.put_line ( 'AP_SUP_SITE_CONTACT_INT_S.NEXTVAL :'
|| ap_sup_site_contact_int_s.NEXTVAL
);
DBMS_OUTPUT.put_line ('RETURN STATUS :' || x_return_status);
DBMS_OUTPUT.put_line ('MESSAGE COUNT :' || TO_CHAR (x_msg_count));
DBMS_OUTPUT.put_line ('MESSAGE :' || x_msg_data);
DBMS_OUTPUT.put_line ('VENDOR contact ID :' || x_vendor_contact_id);
DBMS_OUTPUT.put_line ('per_party_id :' || x_per_party_id);
DBMS_OUTPUT.put_line ('rel_party_id :' || x_rel_party_id);
DBMS_OUTPUT.put_line ('rel_id :' || x_rel_id);
DBMS_OUTPUT.put_line ('org_contact_id :' || x_org_contact_id);
DBMS_OUTPUT.put_line ('party_site_id :' || x_party_site_id);
COMMIT;
IF x_return_status = 'S'
THEN
COMMIT;
ELSE
ROLLBACK;
END IF;
IF x_msg_count > 0
THEN
FOR v_index IN 1 .. x_msg_count
LOOP
fnd_msg_pub.get (p_msg_index => v_index,
p_encoded => 'F',
p_data => x_msg_data,
p_msg_index_out => v_msg_index_out
);
x_msg_data := SUBSTR (x_msg_data, 1, 200);
DBMS_OUTPUT.put_line ('x_msg_data :' || x_msg_data);
END LOOP;
END IF;
END;
/
/*************************************************************************
AP_SUP_SITE_CONTACT_INT_S.NEXTVAL :16002
RETURN STATUS :S
MESSAGE COUNT :0
MESSAGE :
VENDOR contact ID :25949
per_party_id :416682
rel_party_id :416683
rel_id :381368
org_contact_id :169423
party_site_id :234632
PL/SQL procedure successfully completed.
**************************************************************************/
No comments:
Post a Comment