Thursday, September 26, 2019
Monday, September 16, 2019
Use of the API FND_PROFILE
It is used to perform various actions related to profile values through PL/SQL. Some of the important ones are listed below:
SELECT fnd_profile.value('PROFILEOPTION')
,fnd_profile.value('MFG_ORGANIZATION_ID')
,fnd_profile.value('ORG_ID')
,fnd_profile.value('LOGIN_ID')
,fnd_profile.value('USER_ID')
,fnd_profile.value('USERNAME')
,fnd_profile.value('CONCURRENT_REQUEST_ID')
,fnd_profile.value('GL_SET_OF_BKS_ID')
,fnd_profile.value('SO_ORGANIZATION_ID')
,fnd_profile.value('APPL_SHRT_NAME')
,fnd_profile.value('RESP_NAME')
,fnd_profile.value('RESP_ID')
FROM DUAL;
Also you can use following query:
SELECT *
FROM fnd_profile_options_vl po,
fnd_profile_option_values pov,
fnd_user usr,
fnd_application app,
fnd_responsibility rsp,
fnd_nodes svr,
hr_operating_units org
WHERE 1 = 1
AND pov.application_id = po.application_id
AND pov.profile_option_id = po.profile_option_id
AND usr.user_id(+) = pov.level_value
AND rsp.application_id(+) = pov.level_value_application_id
AND rsp.responsibility_id(+) = pov.level_value
AND app.application_id(+) = pov.level_value
AND svr.node_id(+) = pov.level_value
AND org.organization_id(+) = pov.level_value;
SELECT fnd_profile.value('PROFILEOPTION')
,fnd_profile.value('MFG_ORGANIZATION_ID')
,fnd_profile.value('ORG_ID')
,fnd_profile.value('LOGIN_ID')
,fnd_profile.value('USER_ID')
,fnd_profile.value('USERNAME')
,fnd_profile.value('CONCURRENT_REQUEST_ID')
,fnd_profile.value('GL_SET_OF_BKS_ID')
,fnd_profile.value('SO_ORGANIZATION_ID')
,fnd_profile.value('APPL_SHRT_NAME')
,fnd_profile.value('RESP_NAME')
,fnd_profile.value('RESP_ID')
FROM DUAL;
Also you can use following query:
SELECT *
FROM fnd_profile_options_vl po,
fnd_profile_option_values pov,
fnd_user usr,
fnd_application app,
fnd_responsibility rsp,
fnd_nodes svr,
hr_operating_units org
WHERE 1 = 1
AND pov.application_id = po.application_id
AND pov.profile_option_id = po.profile_option_id
AND usr.user_id(+) = pov.level_value
AND rsp.application_id(+) = pov.level_value_application_id
AND rsp.responsibility_id(+) = pov.level_value
AND app.application_id(+) = pov.level_value
AND svr.node_id(+) = pov.level_value
AND org.organization_id(+) = pov.level_value;
Thursday, September 12, 2019
How to identify the Activity ID for a Oracle Workflow Activity
SELECT WI.ITEM_TYPE
,WI.ITEM_KEY
,WI.BEGIN_DATE
,WPA.INSTANCE_ID ACTIVITY_ID
,WPA.ACTIVITY_NAME ACTIVITY_NAME
,WPA.PROCESS_NAME
FROM APPS.WF_ITEMS WI
,APPS.WF_ITEM_ACTIVITY_STATUSES WIAS
,APPS.WF_PROCESS_ACTIVITIES WPA
WHERE WI.ITEM_TYPE = WIAS.ITEM_TYPE
AND WIAS.ITEM_TYPE = WPA.PROCESS_ITEM_TYPE
AND WI.ITEM_KEY = WIAS.ITEM_KEY
AND WIAS.PROCESS_ACTIVITY = WPA.INSTANCE_ID
AND WPA.ACTIVITY_NAME = UPPER('&Activity_Name')
AND WI.ITEM_TYPE = UPPER('&Workflow_Item_Type')
AND WIAS.ITEM_KEY = UPPER('&Workflow_Item_Key')
,WI.ITEM_KEY
,WI.BEGIN_DATE
,WPA.INSTANCE_ID ACTIVITY_ID
,WPA.ACTIVITY_NAME ACTIVITY_NAME
,WPA.PROCESS_NAME
FROM APPS.WF_ITEMS WI
,APPS.WF_ITEM_ACTIVITY_STATUSES WIAS
,APPS.WF_PROCESS_ACTIVITIES WPA
WHERE WI.ITEM_TYPE = WIAS.ITEM_TYPE
AND WIAS.ITEM_TYPE = WPA.PROCESS_ITEM_TYPE
AND WI.ITEM_KEY = WIAS.ITEM_KEY
AND WIAS.PROCESS_ACTIVITY = WPA.INSTANCE_ID
AND WPA.ACTIVITY_NAME = UPPER('&Activity_Name')
AND WI.ITEM_TYPE = UPPER('&Workflow_Item_Type')
AND WIAS.ITEM_KEY = UPPER('&Workflow_Item_Key')
Wednesday, September 11, 2019
Query to find the Position Attached to Username in Oracle Apps
SELECT pos.name position_name, pa.position_id,fnd.user_name
FROM PER_ALL_ASSIGNMENTS_F pa, per_positions pos,per_jobs job, fnd_user fnd
WHERE pa.POSITION_ID = pos.POSITION_ID
and pa.job_ID = job.job_id
and sysdate between pa.EFFECTIVE_START_DATE
and pa.EFFECTIVE_END_DATE
and pa.primary_flag = 'Y'
and pa.assignment_type = 'E'
and pa.person_id = fnd.employee_id
and pa.PERSON_ID = (select employee_id
from fnd_user
where user_name = '&user_name')
FROM PER_ALL_ASSIGNMENTS_F pa, per_positions pos,per_jobs job, fnd_user fnd
WHERE pa.POSITION_ID = pos.POSITION_ID
and pa.job_ID = job.job_id
and sysdate between pa.EFFECTIVE_START_DATE
and pa.EFFECTIVE_END_DATE
and pa.primary_flag = 'Y'
and pa.assignment_type = 'E'
and pa.person_id = fnd.employee_id
and pa.PERSON_ID = (select employee_id
from fnd_user
where user_name = '&user_name')
Purchase Requisition Action History in Oracle Apps
select poah.sequence_num seq#, poah.action_date, poah.action_code,
poah.employee_id emp_id, fnd.user_name, substr (poah.object_type_code,1,3) type, poah.object_sub_type_code sub_type,
poah.object_revision_num rev, pohead.org_id, poah.note
from po_action_history poah, fnd_user fnd, po_requisition_headers_all pohead
where poah.object_id = pohead.requisition_header_id
and pohead.segment1 = '&REQ_NUMBER'
and substr(poah.object_type_code,1,3) = 'REQ'
and pohead.org_id = '&ORG_ID'
and poah.employee_id = fnd.employee_id
and fnd.session_number != 0
order by 9,2,1
poah.employee_id emp_id, fnd.user_name, substr (poah.object_type_code,1,3) type, poah.object_sub_type_code sub_type,
poah.object_revision_num rev, pohead.org_id, poah.note
from po_action_history poah, fnd_user fnd, po_requisition_headers_all pohead
where poah.object_id = pohead.requisition_header_id
and pohead.segment1 = '&REQ_NUMBER'
and substr(poah.object_type_code,1,3) = 'REQ'
and pohead.org_id = '&ORG_ID'
and poah.employee_id = fnd.employee_id
and fnd.session_number != 0
order by 9,2,1