Note: This API will not work if the Element has been Assigned to
Employees
DECLARE
l_effective_date DATE
:= NULL;
l_business_group_id NUMBER := 81;
l_element_type_id NUMBER := NULL;
l_input_value_name VARCHAR2 (100) := 'Future12';
l_uom VARCHAR2 (10) := 'N'; -- Number
l_element_name VARCHAR2 (100) := 'N';
l_input_value_id NUMBER;
l_object_version_number NUMBER;
l_effective_start_date DATE;
l_effective_end_date DATE;
l_default_val_warning BOOLEAN;
l_min_max_warning BOOLEAN;
l_pay_basis_warning BOOLEAN;
l_formula_warning BOOLEAN;
l_assignment_id_warning BOOLEAN;
l_formula_message VARCHAR2 (500) := NULL;
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 =
'Element Name';
pay_input_value_api.create_input_value
(
p_validate => FALSE,
p_effective_date => l_effective_date,
p_element_type_id => l_element_type_id,
p_name => l_input_value_name,
p_uom => l_uom,
p_input_value_id => l_input_value_id,
p_object_version_number => l_object_version_number,
p_effective_start_date => l_effective_start_date,
p_effective_end_date => l_effective_end_date,
p_default_val_warning => l_default_val_warning,
p_min_max_warning => l_min_max_warning,
p_pay_basis_warning => l_pay_basis_warning,
p_formula_warning => l_formula_warning,
p_assignment_id_warning => l_assignment_id_warning,
p_formula_message => l_formula_message);
DBMS_OUTPUT.put_line
(
l_input_value_name
||
' has been Added to the Element
'
||
l_element_name);
EXCEPTION
WHEN
OTHERS
THEN
DBMS_OUTPUT.put_line
('Exception: '
|| SQLERRM);
END;
No comments:
Post a Comment