0% found this document useful (0 votes)
22 views3 pages

Oracle PL/SQL Element Entry Creation

The document outlines a PL/SQL block that defines a cursor for retrieving pay input values based on a specified element name. It includes variable declarations, a savepoint, and a call to an API for creating an element entry with various parameters. The code also handles exceptions and includes a rollback mechanism in case of errors.

Uploaded by

Raghava Reddy
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views3 pages

Oracle PL/SQL Element Entry Creation

The document outlines a PL/SQL block that defines a cursor for retrieving pay input values based on a specified element name. It includes variable declarations, a savepoint, and a call to an API for creating an element entry with various parameters. The code also handles exceptions and includes a rollback mechanism in case of errors.

Uploaded by

Raghava Reddy
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

declare

--
cursor cur_input_name (p_ele_name varchar2)
is
select piv.display_sequence
,[Link]
,piv.element_type_id
from pay_element_types_f_tl petl
,pay_element_types_f pet
,pay_input_values_f piv
where petl.element_name = p_ele_name
and [Link] = 'US'
and pet.element_type_id = petl.element_type_id
and piv.element_type_id = pet.element_type_id
order by piv.display_sequence;
--
ln_element_link_id pay_element_links_f.element_link_id%type;
v_effective_start_date date;
v_effective_end_date date;
v_element_entry_id pay_element_entries_f.element_entry_id%type;
v_object_version_number pay_element_entries_f.object_version_number%type;
v_create_warning boolean;
ln_screen_entry_value pay_element_entry_values_f.screen_entry_value
%type;
ln_element_type_id pay_element_types_f.element_type_id%type;
ln_input_value_id1 pay_input_values_f.input_value_id%type;
ln_input_value_id2 pay_input_values_f.input_value_id%type;
ln_input_value_id pay_input_values_f.input_value_id%type;

ln_element_type_id pay_element_types_f.element_type_id%type;
--
ln_assignment_id NUMBER := 63;
p_cost_concat_segments_out VARCHAR2 (250);
ln_cost_allocation_keyflex_id number;
lc_element_name pay_element_types_f.element_name%type :=
'Conference Daily Allowance';
--
BEGIN
--
--
savepoint sv_create_element;
--

-- Get Element Link Id


-- ------------------------------

ln_element_link_id := hr_entry_api.get_link
(p_assignment_id => 63,
p_element_type_id => 321,
p_session_date => TRUNC(SYSDATE)
);

dbms_output.put_line( ' API: Element Link Id: ' || ln_element_link_id );


pay_element_entry_api.create_element_entry(p_validate => false,
p_effective_date =>
TO_DATE('01-OCT-2023','DD-MON-YYYY'),
p_business_group_id
=> fnd_profile.value('PER_BUSINESS_GROUP_ID'),
p_assignment_id =>
63,
p_element_link_id =>
224,
p_entry_type => 'E',
p_input_value_id1
=>510, --Amonut
p_input_value_id2 =>
511, --Purpose
p_input_value_id3 =>
512, --Purpose
p_input_value_id4 =>
513, --Remarks

p_entry_value1 =>
200,--p_segment4,
p_entry_value2 =>
'TEST',
p_entry_value3 =>
'TEST',
p_entry_value4 => 4,

-- p_cost_allocation_keyflex_id => ln_cost_allocation_keyflex_id,

-- p_cost_segment5 => '0010',


-- p_cost_segment6
=> '0102',
--
p_cost_concat_segments_out => p_cost_concat_segments_out,

p_effective_start_date => v_effective_start_date,


p_effective_end_date
=> v_effective_end_date,
p_element_entry_id =>
v_element_entry_id,

p_object_version_number => v_object_version_number,


p_create_warning =>
v_create_warning

);

dbms_output.put_line( ' API: pay_element_entry_api.create_element_entry


successfull - Element Entry Id: ' || v_element_entry_id );

--rollback;
commit;

exception
when others then
dbms_output.put_line('Error: '||sqlerrm);
rollback to sv_create_element;
end;
/

You might also like