PROCEDURE FUJ_CRT_ELEMENT_ENTRY
(
L_ASSIGNMENT_ID NUMBER,
L_PAYROLL_ID NUMBER,
L_EFF_DATE DATE,
L_AMOUNT NUMBER,
L_ELEMENT_NAME VARCHAR2,
L_INPUT_NAME VARCHAR2
) AS
--L_ASSIGNMENT_ID NUMBER := 45570;
--L_PAYROLL_ID NUMBER := 60;
--L_ELEMENT_NAME VARCHAR2(200) := 'XX123 Allowance';
--L_INPUT_NAME VARCHAR2(200) := 'Override Amount';
--L_EFF_DATE DATE := TO_DATE('20-DEC-2022');
--L_AMOUNT NUMBER := 200;
--local variables
l_input_value_id NUMBER;
l_link_id NUMBER;
l_effective_end_date DATE := NULL;
l_effective_start_date DATE := NULL;
l_object_version_number NUMBER := NULL;
l_element_entry_id NUMBER := NULL;
l_create_warning BOOLEAN;
lc_dt_ud_mode VARCHAR2(100) := NULL;
L_OVN NUMBER;
L_ELEMENT_EXISTS VARCHAR2(200);
V_ERROR_MSG varchar2(2000);
begin
SELECT XXI.input_value_id, element_link_id,
INTO l_input_value_id, l_link_id
FROM
PAY_INPUT_VALUES_F XXI,
PAY_ELEMENT_TYPES_F XXT,
PAY_ELEMENT_LINKS_F XXL
WHERE XXT.ELEMENT_TYPE_ID = XXI.ELEMENT_TYPE_ID
AND XXT.ELEMENT_TYPE_ID = XXL.ELEMENT_TYPE_ID
AND XXL.PAYROLL_ID = L_PAYROLL_ID
AND XXT.ELEMENT_NAME = L_ELEMENT_NAME--in ('XX123 Allowance')
and XXI.NAME = L_INPUT_NAME
AND ROWNUM =1
;
pay_element_entry_api.create_element_entry (
p_validate => FALSE,
p_effective_date => L_EFF_DATE,
p_business_group_id => 81,
p_assignment_id => L_ASSIGNMENT_ID,
p_element_link_id => l_link_id,
p_entry_type => 'E',
p_input_value_id1 => l_input_value_id
,p_entry_value1 => L_AMOUNT,
p_effective_start_date => l_effective_start_date,
p_effective_end_date => l_effective_end_date,
p_element_entry_id => l_element_entry_id,
p_object_version_number => l_object_version_number,
p_create_warning => l_create_warning
);
commit;
EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
V_ERROR_MSG := sqlerrm;
END;
No comments:
Post a Comment