DECLARE
l_element_name VARCHAR2 (100) := 'Element Name';
l_effective_date DATE := NULL;
l_business_group_id NUMBER := 10665;
l_element_type_id NUMBER := NULL;
l_input_value_name VARCHAR2 (100) := Input Value Name';
l_uom VARCHAR2 (10) := 'N'; -- Number
l_return_value NUMBER := 0;
BEGIN
SELECT element_type_id, effective_start_date, element_name
INTO l_element_type_id, l_effective_date, l_element_name
FROM pay_element_types_f petf
WHERE
TRUNC (SYSDATE) BETWEEN petf.effective_start_date
AND petf.effective_end_date
AND petf.business_group_id = l_business_group_id
AND petf.element_name = l_element_name;
l_return_value :=
pay_db_pay_setup.create_input_value (
p_element_name => l_element_name,
p_name =>
l_input_value_name,
p_uom_code => l_uom,
p_display_sequence =>
5, -- Get the Max
Display No + 1
p_business_group_name => 'Business Group Name',
p_effective_start_date => l_effective_date);
COMMIT;
DBMS_OUTPUT.put_line (
l_input_value_name
|| ' has been Added to the
Element '
|| l_element_name);
hr_input_values.create_link_input_value
('INSERT_INPUT_VALUE',
NULL,
-- Element Link ID
l_return_value, -- Input Value ID
l_input_value_name,
'N',
-- Costable Type
l_effective_date, -- Effective Start
Date
'31-DEC-4712', -- Effective End Date
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
l_input_value_name,
l_element_type_id);
COMMIT;
DBMS_OUTPUT.put_line (
'Element Link Input
Value Created for ' || l_element_type_id);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('Exception: ' || SQLERRM);
END;
No comments:
Post a Comment