Delete Payroll Element Entry – pay_element_entry_api

By | December 15, 2014

Background of Payroll Element Entry API


In Oracle HRMS, elements are created in a persons’ assignments to make them eligible to be processed in a payroll run. Sometimes we need to create/ delete the element. This can be done by Application or by use of API. Here is the API to Create / Delete the element.

Delete Payroll Element Entry

DECLARE

CURSOR c1 IS
Select object_version_number, element_entry_id,effective_start_date
from pay_element_entries_f
where 1=1
and assignment_id in (339)
and effective_start_date > ’31-DEC-2015′;

l_effective_start_date DATE := NULL;
l_effective_end_date DATE := NULL;
l_element_entry_id NUMBER := 560124;
l_Obj_Version_id Number:=2;
l_delete_warning BOOLEAN;
l_err_msg VARCHAR2 (500) := NULL;

BEGIN

FOR i IN c1 LOOP

BEGIN

pay_element_entry_api.delete_element_entry (

p_validate => FALSE,
p_datetrack_delete_mode => ‘DELETE’, — ZAP to Purge from Database
p_effective_date => i.effective_start_date,
p_element_entry_id => i.element_entry_id,
p_object_version_number => i.object_version_number,
p_effective_start_date => l_effective_start_date,
p_effective_end_date => l_effective_end_date,
p_delete_warning => l_delete_warning
);

DBMS_OUTPUT.put_line (‘Element has been deleted: ‘);

EXCEPTION WHEN OTHERS THEN
l_err_msg := SQLERRM;
DBMS_OUTPUT.put_line (‘Main 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;

Related:

OLM API
Oracle Interview Questions