HRMS

API to Create External Bank Branch

/* Formatted on 2017/04/12 15:59 (Formatter Plus v4.8.8) */
DECLARE
p_api_version NUMBER := 1.0;
p_init_msg_list VARCHAR2 (1) := ‘F’;
v_bank_id NUMBER := 530705;
x_return_status VARCHAR2 (2000);
x_msg_count NUMBER (5);
x_msg_data VARCHAR2 (2000);
x_branch_id NUMBER;
p_count NUMBER;
x_response iby_fndcpt_common_pub.result_rec_type;
p_ext_bank_branch_rec iby_ext_bankacct_pub.extbankbranch_rec_type;
BEGIN
DBMS_OUTPUT.put_line (‘BEFORE BANK BRANCH API’);
p_ext_bank_branch_rec.bch_object_version_number := 1.0;
p_ext_bank_branch_rec.branch_name := ‘TEST BANK BRANCH’;
p_ext_bank_branch_rec.branch_type := ‘ABA’;
p_ext_bank_branch_rec.bank_party_id := v_bank_id;
iby_ext_bankacct_pub.create_ext_bank_branch
( — —————————–
— Input data elements
— —————————–
p_api_version => p_api_version,
p_init_msg_list => p_init_msg_list,
p_ext_bank_branch_rec => p_ext_bank_branch_rec,
— ——————————–
— Output data elements
— ——————————–
x_branch_id => x_branch_id,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
x_response => x_response
);
DBMS_OUTPUT.put_line (‘x_branch_id = ‘ || x_branch_id);

IF (x_msg_count = 1)
THEN
DBMS_OUTPUT.put_line (‘x_msg_data ‘ || x_msg_data);
ELSIF (x_msg_count > 1)
THEN
LOOP
p_count := p_count + 1;
x_msg_data := fnd_msg_pub.get (fnd_msg_pub.g_next, fnd_api.g_false);

IF (x_msg_data IS NULL)
THEN
EXIT;
END IF;

DBMS_OUTPUT.put_line (‘Message’ || p_count || ‘ —‘ || x_msg_data);
END LOOP;
END IF;

COMMIT;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
DBMS_OUTPUT.put_line (SQLERRM);
END;

API to Create Bank

/* Formatted on 2017/04/12 15:59 (Formatter Plus v4.8.8) */
DECLARE
lc_output VARCHAR2 (3000);
lc_msg_dummy VARCHAR2 (3000);
lc_return_status VARCHAR2 (3000);
lc_msg_data VARCHAR2 (3000);
ln_bank_id NUMBER;
ln_msg_count NUMBER;
lr_extbank_rec apps.iby_ext_bankacct_pub.extbank_rec_type;
lr_response_rec apps.iby_fndcpt_common_pub.result_rec_type;
BEGIN
lc_return_status := ”;
ln_msg_count := ”;
lc_msg_data := ”;
lr_extbank_rec.bank_name := ‘Test Supp Bank’;
lr_extbank_rec.bank_number := ‘TSB0000001’;
lr_extbank_rec.country_code := ‘IN’;
apps.fnd_msg_pub.delete_msg (NULL);
apps.fnd_msg_pub.initialize ();
iby_ext_bankacct_pub.create_ext_bank ( — ——————————
— Input data elements
— ——————————
p_api_version => 1.0,
p_init_msg_list => fnd_api.g_true,
p_ext_bank_rec => lr_extbank_rec,
— ——————————–
— Output data elements
— ——————————–
x_bank_id => ln_bank_id,
x_return_status => lc_return_status,
x_msg_count => ln_msg_count,
x_msg_data => lc_msg_data,
x_response => lr_response_rec
);
lc_output := ‘ ‘;

IF (lc_return_status ‘S’)
THEN
FOR i IN 1 .. ln_msg_count
LOOP
apps.fnd_msg_pub.get (i,
apps.fnd_api.g_false,
lc_msg_data,
lc_msg_dummy
);
lc_output :=
lc_output
|| (TO_CHAR (i) || ‘: ‘ || SUBSTR (lc_msg_data, 1, 250));
END LOOP;

apps.fnd_file.put_line (apps.fnd_file.output,
‘Error Occured while Creating Bank: ‘
);
END IF;

COMMIT;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
DBMS_OUTPUT.put_line (SQLERRM);
END;

API to Create Supplier Site

/* Formatted on 2017/04/12 15:54 (Formatter Plus v4.8.8) */
DECLARE
l_vendor_site_rec ap_vendor_pub_pkg.r_vendor_site_rec_type;
lc_return_status VARCHAR2 (10);
ln_msg_count NUMBER;
lc_msg_data VARCHAR2 (4000);
ln_vendor_site_id NUMBER;
ln_party_site_id NUMBER;
ln_location_id NUMBER;
BEGIN
— —————
— Required
— —————
l_vendor_site_rec.vendor_id := 40000;
l_vendor_site_rec.vendor_site_code := ‘Supplier_Site’;
l_vendor_site_rec.address_line1 := ’05 IFFCO Chowk’;
l_vendor_site_rec.city := ‘Gurgaon’;
l_vendor_site_rec.country := ‘IND’;
l_vendor_site_rec.org_id := 182;
— ————–
— Optional
— ————–
l_vendor_site_rec.purchasing_site_flag := ‘N’;
l_vendor_site_rec.pay_site_flag := ‘N’;
l_vendor_site_rec.rfq_only_site_flag := ‘N’;
pos_vendor_pub_pkg.create_vendor_site
(
— ——————————
— Input data elements
— ——————————
p_vendor_site_rec => l_vendor_site_rec,
— ———————————
— Output data elements
— ———————————
x_return_status => lc_return_status,
x_msg_count => ln_msg_count,
x_msg_data => lc_msg_data,
x_vendor_site_id => ln_vendor_site_id,
x_party_site_id => ln_party_site_id,
x_location_id => ln_location_id
);
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
DBMS_OUTPUT.put_line (SQLERRM);
END;

Create Employee Contact

/* Formatted on 2017/04/12 15:35 (Formatter Plus v4.8.8) */
DECLARE
ln_contact_rel_id per_contact_relationships.contact_relationship_id%TYPE;
ln_ctr_object_ver_num per_contact_relationships.object_version_number%TYPE;
ln_contact_person per_all_people_f.person_id%TYPE;
ln_object_version_number per_contact_relationships.object_version_number%TYPE;
ld_per_effective_start_date DATE;
ld_per_effective_end_date DATE;
lc_full_name per_all_people_f.full_name%TYPE;
ln_per_comment_id per_all_people_f.comment_id%TYPE;
lb_name_comb_warning BOOLEAN;
lb_orig_hire_warning BOOLEAN;
BEGIN
— Create Employee Contact
— ————————————-
hr_contact_rel_api.create_contact
( — Input data elements
— —————————–
p_start_date => sysdate,
p_business_group_id => fnd_profile.VALUE
(‘PER_BUSINESS_GROUP_ID’),
p_person_id => XX, — Number field
p_contact_type => ‘M’,
p_date_start => TO_DATE (’12-Apr-2017′),
p_last_name => ‘XYZ’,
p_first_name => ‘XX’,
p_personal_flag => ‘Y’,
— Output data elements
— ——————————–
p_contact_relationship_id => ln_contact_rel_id,
p_ctr_object_version_number => ln_ctr_object_ver_num,
p_per_person_id => ln_contact_person,
p_per_object_version_number => ln_object_version_number,
p_per_effective_start_date => ld_per_effective_start_date,
p_per_effective_end_date => ld_per_effective_end_date,
p_full_name => lc_full_name,
p_per_comment_id => ln_per_comment_id,
p_name_combination_warning => lb_name_comb_warning,
p_orig_hire_warning => lb_orig_hire_warning
);
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
DBMS_OUTPUT.put_line (SQLERRM);
END;

Create Employee from Backend API

— Create Employee
— ————————-

/* Formatted on 2017/04/12 15:31 (Formatter Plus v4.8.8) */
DECLARE
lc_employee_number per_all_people_f.employee_number%TYPE
:= ‘XX_01’;
ln_person_id per_all_people_f.person_id%TYPE;
ln_assignment_id per_all_assignments_f.assignment_id%TYPE;
ln_object_ver_number per_all_assignments_f.object_version_number%TYPE;
ln_asg_ovn NUMBER;
ld_per_effective_start_date per_all_people_f.effective_start_date%TYPE;
ld_per_effective_end_date per_all_people_f.effective_end_date%TYPE;
lc_full_name per_all_people_f.full_name%TYPE;
ln_per_comment_id per_all_people_f.comment_id%TYPE;
ln_assignment_sequence per_all_assignments_f.assignment_sequence%TYPE;
lc_assignment_number per_all_assignments_f.assignment_number%TYPE;
lb_name_combination_warning BOOLEAN;
lb_assign_payroll_warning BOOLEAN;
lb_orig_hire_warning BOOLEAN;
BEGIN
hr_employee_api.create_employee
( — Input data elements
— ——————————
p_hire_date => sysdate,
p_business_group_id => fnd_profile.value_specific
(‘PER_BUSINESS_GROUP_ID’),
p_last_name => ‘TEST’,
p_first_name => ‘XX’,
p_middle_names => NULL,
p_sex => ‘M’,
p_national_identifier => ‘183-09-6723′,
p_date_of_birth => TO_DATE (’28-NOV-1989’),
p_known_as => ‘SAJAL’,
— Output data elements
— ——————————–
p_employee_number => lc_employee_number,
p_person_id => ln_person_id,
p_assignment_id => ln_assignment_id,
p_per_object_version_number => ln_object_ver_number,
p_asg_object_version_number => ln_asg_ovn,
p_per_effective_start_date => ld_per_effective_start_date,
p_per_effective_end_date => ld_per_effective_end_date,
p_full_name => lc_full_name,
p_per_comment_id => ln_per_comment_id,
p_assignment_sequence => ln_assignment_sequence,
p_assignment_number => lc_assignment_number,
p_name_combination_warning => lb_name_combination_warning,
p_assign_payroll_warning => lb_assign_payroll_warning,
p_orig_hire_warning => lb_orig_hire_warning
);
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
DBMS_OUTPUT.put_line (SQLERRM);
END;