In this illustration we would try and delete an existing element entry using oracle's seeded API
Pay Period: May 22nd – Jun 04th
2017
Element to be deleted: EA037 Public Holiday
Element details:
Get Element entry id by navigating to -
Help > diagnostic > Examine
Search for ELEMENT_ENTRY_ID
If you don’t have access to Help > Diagnostics >
Examine option (due to profile option settings), you can use an sql query to
find the required details
select peef.element_entry_id
, petf.element_name
, petf.reporting_name
, peef.effective_start_date
, peef.effective_end_date
, peef.assignment_id
, peef.object_version_number
from
PAY_ELEMENT_ENTRIES_F peef
, pay_element_links_f pelf
, pay_element_types_f petf
where 1=1
and peef.element_link_id =
pelf.element_link_id
and pelf.element_type_id =
petf.element_type_id
and peef.assignment_id = (select
paaf.assignment_id
from
per_all_assignments_f paaf
where
paaf.assignment_number like 60075166) -- assg number in this example
and petf.element_name = 'EA037 Public
Holiday'
order by
element_entry_id desc
We get the element_entry_id = 479143354
Below is one of the ways we can test the delete
element entry seeded functionality by using the code i.e. using the standard API for deleting element entry and running it as an anonymous block
DECLARE
l_obj_version
NUMBER := 1; -- from the query
l_effective_start_date DATE;
l_effective_end_date DATE;
l_delete_warning BOOLEAN := NULL;
BEGIN
pay_element_entry_api.delete_element_entry
(
p_validate => false ,
p_datetrack_delete_mode => 'ZAP', -- to completely delete the entry from
database
p_effective_date => TO_DATE ('04-JUN-2017'),
p_element_entry_id => 479143354, -- from the
query
p_object_version_number => l_obj_version,
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 entry successfully deleted');
EXCEPTION
WHEN
OTHERS
THEN
DBMS_OUTPUT.put_line(SQLERRM);
DBMS_OUTPUT.put_line(' ... ');
DBMS_OUTPUT.put_line(fnd_message.get);
DBMS_OUTPUT.put_line(' ... ');
DBMS_OUTPUT.put_line ('Element Exception: '|| SQLERRM);
END;
Note: Before executing the code, ensure
that DBMS Output is enabled (View > DBMS Output)
Commit (Session > Commit)
Now navigate back to Oracle EBS,
the element entry will be deleted. In case if the API goes into any exception
or error. The DBMS OUTPUT window will display the error
No comments:
Post a Comment