Delete/End Date Element Entry – HRMS APIs


Below is the script for Deleting Element Entry in HRMS

declare

ld_effective_start_date      date;
ld_effective_end_date       date;
lb_delete_warning             boolean;
ln_element_entry_id          number;
ln_object_version_number number;
ln_assin_id                          number;

lc_element_name       pay_element_types_f.element_name%type := ‘Clothing For Official Mission’;
— lc_emp_num             varchar2(6) := ‘005746’;

cursor c is   select pee.element_entry_id
,pee.object_version_number
,paf.assignment_id
from per_all_people_f        per
,per_all_assignments_f   paf
,pay_element_entries_f   pee
,pay_element_types_f_tl  petl
,pay_element_types_f     pet
where 1=1– per.employee_number = lc_emp_num
and trunc(sysdate) between per.effective_start_date and per.effective_end_date
and paf.person_id       = per.person_id
and trunc(sysdate) between paf.effective_start_date and paf.effective_end_date
and pee.assignment_id   = paf.assignment_id
and pee.element_type_id = pet.element_type_id
and trunc(sysdate) between pee.effective_start_date and pee.effective_end_date
and petl.element_name   = lc_element_name
and petl.language       = ‘US’
and pet.element_type_id = petl.element_type_id;

begin

/* Date Track modes
DELETE             >> end date element entry
DELETE_NEXT_CHANGE >> delete next changes
FUTURE_CHANGE      >> delete future changes
ZAP                >> completely remove element entry from the database
*/
for i in c loop

dbms_output.put_line(‘Values are element_entry_id’||i.element_entry_id||’ assignment_id ‘||i.assignment_id);
pay_element_entry_api.delete_element_entry
(p_validate                     => false
,p_datetrack_delete_mode        => ‘DELETE’
,p_effective_date               => trunc(sysdate-17)
,p_element_entry_id             => i.element_entry_id
,p_object_version_number        => i.object_version_number
,p_effective_start_date         => ld_effective_start_date
,p_effective_end_date           => ld_effective_end_date
,p_delete_warning               => lb_delete_warning
) ;
commit;

end loop;
exception
when others then
dbms_output.put_line(‘Error: ‘||sqlerrm);
rollback;
end;

Advertisements

About pacesettergraam

A good and realistic person

Posted on January 17, 2017, in Oracle, oracle apps and tagged , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: