Query to finid employee with a Prticular Company CodeBased on their Cost Account (Especially when there is no Default Expense Account Defined under Purchase Order information Tab in Assignment Screen.
SELECT first_name,
last_name
FROM per_all_people_f
WHERE person_id IN (SELECT person_id
FROM per_all_assignments_f
WHERE assignment_id IN (SELECT assignment_id
FROM pay_cost_allocations_f
WHERE cost_allocation_keyflex_id
IN
(SELECT
cost_allocation_keyflex_id
FROM
pay_cost_allocation_keyflex
WHERE
segment2 = '19') -- Here my company segment is 19
AND effective_end_date >
sysdate - 1))
AND effective_end_date > sysdate - 1
PAY_COST_ALLOCATIONS_V View Definition
SELECT PAY.ROWID ROW_ID,
PAY.cost_allocation_id,
PAY.effective_start_date,
PAY.effective_end_date,
PAY.business_group_id,
PAY.cost_allocation_keyflex_id,
PAY.assignment_id,
PAY.proportion,
PAY.request_id,
PAY.program_application_id,
PAY.program_id,
PAY.program_update_date,
PAY.last_update_date,
PAY.last_updated_by,
PAY.last_update_login,
PAY.created_by,
PAY.creation_date,
PCAF.concatenated_segments,
PAY.object_version_number
FROM fnd_sessions FND,
pay_cost_allocation_keyflex PCAF,
pay_cost_allocations_f PAY
WHERE PCAF.cost_allocation_keyflex_id (+) = PAY.cost_allocation_keyflex_id
AND FND.session_id = Userenv('sessionid')
AND FND.effective_date BETWEEN PAY.effective_start_date AND
PAY.effective_end_date
Comments
Post a Comment