User Approval Group Query
User Approval Group Query
user_name,
papf.full_name,
paaf.person_id,
pcr.control_group_id,
pcg.control_group_name,
pcr.control_rule_id,
pcr.last_update_date,
pcr.rule_type_code,
pcr.object_code,
pcr.amount_limit,
pcr.segment1_low low1,
pcr.segment2_low low2,
pcr.segment3_low low3,
pcr.segment4_low low4,
pcr.segment5_low low5,
pcr.segment6_low low6,
pcr.segment7_low low7,
pcr.segment8_low low8,
pcr.segment1_high high1,
pcr.segment2_high high2,
pcr.segment3_high high3,
pcr.segment4_high high4,
pcr.segment5_high high5,
pcr.segment6_high high6,
pcr.segment7_high high7,
pcr.segment8_high high8
FROM po_control_rules pcr,
PO_CONTROL_GROUPS_ALL pcg,
po_position_controls_all ppca,
po_control_functions pcf,
per_all_assignments_f paaf,
per_all_people_f papf,
fnd_user fndu
WHERE pcr.control_group_id = ppca.control_group_id
AND ppca.org_id = 82
AND ppca.control_function_id = pcf.control_function_id
AND pcr.control_group_id = pcg.control_group_id
AND ppca.control_group_id = pcg.control_group_id
AND pcf.control_function_name = 'Approve Purchase Requisitions' ---- THIS
MAKES THE QUERY FOR PURCHASE REQUISITION APPROVALS
AND ppca.job_id = paaf.job_id --- THIS MAKES THE QUERY FOR JOB BASED
APPROVALS
AND paaf.effective_end_date >= SYSDATE
AND papf.effective_end_date >= SYSDATE
AND paaf.person_id = papf.person_id
AND CONCAT (CONCAT (paaf.person_id, '-'),
NVL (paaf.object_version_number, 0)
) IN
(SELECT CONCAT (CONCAT (person_id, '-'),
NVL (MAX (object_version_number), 0)
)
FROM per_all_assignments_f
WHERE person_id IN
(SELECT employee_id
FROM fnd_user
WHERE user_name IN ('KENOS') ---- SPECIFY THE USER
NAMES OR THE EMPLOYEE IDs
OR employee_id IN (398) ---- SPECIFY THE USER
NAMES OR THE EMPLOYEE IDs
)
GROUP BY person_id)
AND paaf.person_id = fndu.employee_id
AND (fndu.user_name IN ('KENOS') ---- SPECIFY THE USER NAMES OR THE EMPLOYEE
IDs
OR fndu.employee_id IN (398) ---- SPECIFY THE USER NAMES OR THE EMPLOYEE
IDs
)
ORDER BY pcr.control_group_id, pcr.control_rule_id, fndu.user_name
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
select * from
hr_employees
where
full_name like '%Ken%';
select * from
po_requisition_headers_all
where
segment1 in
('116713','116714');
select * from
po_requisition_lines_all
where
requisition_header_id=7102364;
--7102365
select * from
po_req_distributions_all
where
requisition_line_id=7176567;--1721112
select * from
hr_employees
where
employee_id=398; --134
select * from
fnd_user
where
employee_id=398;
select * from
per_all_assignments_f
where
person_id=398;
select * from
per_jobs
where
job_id=86;--ENG REQ
select * from
PO_POSITION_CONTROLS;
select * from
PO_CONTROL_RULES
where
control_rule_id in
(35,
36,
9098,
13100);
select * from
PO_CONTROL_GROUPS_ALL
where
control_group_id=12;
select * from
po_position_controls_all
where
control_group_id=12;
select * from
gl_code_combinations
where
code_combination_id=1721112;