Sie sind auf Seite 1von 3

How to Get Approval Group assigned to specific Job and Position in Oracle

Purchasing

During Support on one of my client site I was facing error For some of managers
system is not following Approval limits and bypassing the approval groups
Client ERP Coordinator was claiming that he setup approval group and Approval
assignment correctly but system is not following defined approval groups 
There were around 35 Approval Groups and assigned to more than 100 Responsibilities
mean it was very hectic to query each and every position and see what limit is
assigned and for what .
Thanks Metalink where I found below queries to find approval groups and limits on
basis of user.
Parameters for the Queries
:MYORGID (Operating Unit Id)
:P_USER_Name (Name of User Defined in Application (Fnd_user)
:P_empoyee_id (Employee Id populated in fnd_user table)
:p_func_name (
You can select function name by using following query)
SELECT UNIQUE pcf.control_function_name
FROM po_control_functions pcf
)

Query 1
Shows the Approval Group / Assignment rule details for specified approvers based on
their JOB in HR
SELECT fndu.user_name, papf.full_name, paaf.person_id, pcr.control_group_id,
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_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 = :myorgid
AND ppca.control_function_id = pcf.control_function_id

http://oracleebusinesssuite.wordpress.com

Page 1

AND
AND
AND
AND
AND
AND

UPPER (pcf.control_function_name) = upper(:p_func_name)


ppca.job_id = paaf.job_id
paaf.effective_end_date >= SYSDATE
papf.effective_end_date >= SYSDATE
paaf.person_id = papf.person_id
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 (:p_user_name)
OR employee_id IN (:p_empoyee_id)
)
GROUP BY person_id)
AND paaf.person_id = fndu.employee_id
AND ( fndu.user_name IN
(:p_user_name)
OR fndu.employee_id IN
(:p_empoyee_id)
)
ORDER BY pcr.control_group_id, pcr.control_rule_id, fndu.user_name

Query 2
Shows the Approval Group / Assignment rule details for specified approvers based on
their POSITION in HR
SELECT fndu.user_name, papf.full_name, paaf.person_id, pcr.control_group_id,
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_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 = :myorgid
AND ppca.control_function_id = pcf.control_function_id
AND UPPER (pcf.control_function_name) = UPPER (:p_func_name)
AND ppca.position_id = paaf.position_id
AND paaf.effective_end_date >= SYSDATE
AND papf.effective_end_date >= SYSDATE

http://oracleebusinesssuite.wordpress.com

Page 2

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 (:p_user_name)
OR employee_id IN (:p_empoyee_id)
)
GROUP BY person_id)
AND paaf.person_id = fndu.employee_id
AND ( fndu.user_name IN
(:p_user_name)
OR fndu.employee_id IN
(:p_empoyee_id)
)
ORDER BY pcr.control_group_id, pcr.control_rule_id, fndu.user_name

Reference:How to Query Approval Group and Approval Assignment Details for iProcurement and
Purchasing Users
Metalink ID: 382899.1

http://oracleebusinesssuite.wordpress.com

Page 3

Das könnte Ihnen auch gefallen