Wednesday, 22 November 2023

HCM : ELEMENT ENTRY REPORT

 SELECT source_id.source_system_owner,

       source_id.source_system_id,
       eentry.element_entry_id,
       eentry.person_id,
       To_char(eentry.effective_start_date, 'yyyy/mm/dd') effective_start_date,
       To_char(eentry.effective_end_date, 'yyyy/mm/dd')   effective_end_date,
       eentry.element_type_id,
       (SELECT meaning
        FROM   fnd_lookup_values
        WHERE  lookup_type = 'PAY_ENTRY_TYPE'
               AND lookup_code = eentry.entry_type
               AND LANGUAGE = Userenv('LANG'))            entry_type,
       eentry.creator_type,
       eentry.reason,
       eentry.multiple_entry_count,
       etype.element_name,
       eclass.classification_name,
       (SELECT meaning
        FROM   fnd_lookup_values
        WHERE  lookup_type = 'PAY_PROCESSING_TYPE'
               AND lookup_code = etypeF.processing_type
               AND LANGUAGE = Userenv('LANG'))            processing_type,
       asgmt.assignment_number
FROM   pay_element_entries_f eentry,
       pay_entry_usages eent_usag,
       pay_rel_groups_dn rel_group,
       per_all_assignments_f asgmt,
       pay_element_types_tl etype,
       pay_element_types_f etypeF,
       pay_ele_classifications_tl eclass,
       hrc_integration_key_map source_id
WHERE  1 = 1
       AND SYSDATE BETWEEN eentry.effective_start_date AND
                           eentry.effective_end_date
       AND SYSDATE BETWEEN Nvl(eent_usag.date_from, SYSDATE - 1) AND
                           Nvl(eent_usag.date_to, SYSDATE + 1)
       AND SYSDATE BETWEEN Nvl(rel_group.start_date, SYSDATE - 1) AND Nvl(
                           rel_group.end_date, SYSDATE + 1)
       AND SYSDATE BETWEEN asgmt.effective_start_date(+) AND
                           asgmt.effective_end_date(+)
       AND SYSDATE BETWEEN etypeF.effective_start_date AND
                           etypeF.effective_end_date
       AND etype.LANGUAGE = Userenv('LANG')
       AND eclass.LANGUAGE = Userenv('LANG')
       AND eentry.element_entry_id = eent_usag.element_entry_id
       AND eent_usag.payroll_assignment_id = rel_group.relationship_group_id
       AND rel_group.assignment_id = asgmt.assignment_id (+)
       AND etype.element_type_id = eentry.element_type_id
       AND etypeF.element_type_id = eentry.element_type_id
       AND eclass.classification_id = etypeF.classification_id
       AND source_id.surrogate_id = eentry.element_entry_id
       AND source_id.object_name = 'ElementEntry'
       AND etypeF.processing_type = 'N'
--  AND asgmt.assignment_number='  86508'
--  AND asgmt.assignment_number='  86508'

No comments: