DECLARE
CURSOR fetch_det
IS
SELECT paaf.assignment_id
FROM per_people_x per, per_assignments_x paaf
WHERE per.person_id = paaf.person_id
AND per.person_type_id IN (1126, 1127)
AND paaf.assignment_type = 'E'
AND paaf.assignment_status_type_id IN (1, 2)
AND paaf.primary_flag = 'Y';
l_effective_start_date DATE := NULL;
l_effective_end_date DATE := NULL;
l_object_version_number NUMBER := NULL;
l_external_account_id NUMBER := NULL;
l_personal_payment_method_id NUMBER := NULL;
l_comment_id NUMBER := NULL;
l_err_msg VARCHAR2 (500) := NULL;
BEGIN
FOR i IN fetch_det
LOOP
BEGIN
hr_personal_pay_method_api.create_personal_pay_method (
p_validate => FALSE,
p_effective_date => TO_DATE ('01-APR-2013'),
p_assignment_id => i.assignment_id,
p_org_payment_method_id => 84,
p_percentage => 100,
p_priority => 1,
p_territory_code => 'SA',
p_segment1 => 'NCB', -- Employee Bank Name
p_segment4 => '12345678',-- Employee Bank Account Number
p_personal_payment_method_id => l_personal_payment_method_id,
p_external_account_id => l_external_account_id,
p_object_version_number => l_object_version_number,
p_effective_start_date => l_effective_start_date,
p_effective_end_date => l_effective_end_date,
p_comment_id => l_comment_id
);
COMMIT;
DBMS_OUTPUT.put_line('Personal Pay Method has been uploaded: '
|| l_personal_payment_method_id);
EXCEPTION
WHEN OTHERS
THEN
l_err_msg := SQLERRM;
DBMS_OUTPUT.put_line ('Inner Exception: ' || l_err_msg);
END;
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
l_err_msg := SQLERRM;
DBMS_OUTPUT.put_line ('Main Exception: ' || l_err_msg);
END;
No comments:
Post a Comment