Friday, December 3, 2010

PA Detail Query

Your Ad Here



SELECT DISTINCT
hou.NAME org,
hou.organization_id org_id,
ppc.class_category CATEGORY,
ppc.class_code code,
ppa.project_id,
NULL expenditure_type,
ppa.segment1 proj_num,
ppa.NAME proj_name,
ppa.project_type project_type,
pcd.pa_date,
pcd.pa_period_name,
pet.expenditure_category expenditure_category,
(SELECT xx.description
FROM fnd_flex_values_vl xx
WHERE xx.flex_value_set_id = a.flex_value_set_id
AND a.parent_flex_value = xx.flex_value
AND xx.summary_flag = 'Y'
AND flex_value <> 'T')
account_type,
FROM apps.pa_projects_all ppa,
apps.pa_tasks ppt,
apps.hr_all_organization_units hou,
apps.pa_project_classes ppc,
apps.pa_cost_distribution_lines_all pcd,
apps.pa_expenditures_all e,
apps.pa_expenditure_items_all pei,
apps.pa_expenditure_types pet,
fnd_flex_value_children_v a,
fnd_id_flex_segments j
WHERE ppa.carrying_out_organization_id = hou.organization_id
AND ppa.project_id = ppt.project_id
AND ppa.project_id = pei.project_id
AND pei.task_id = ppt.task_id
AND e.expenditure_id = pei.expenditure_id
AND ppa.project_id = ppc.project_id
AND pei.expenditure_item_id = pcd.expenditure_item_id
AND pet.expenditure_type = pei.expenditure_type
AND a.flex_value_set_id = j.flex_value_set_id
AND UPPER (j.segment_name) = 'ACCOUNT'
AND j.id_flex_code = 'GLLE'
AND ppt.attribute1 = a.flex_value
Your Ad Here

0 comments:

Post a Comment