Saturday 3 June 2017

Oracle Apps: PA_TASKS Hierarchy Query to get all the tasks in Project /Template in the correct order

The below query can be used to get the PA Tasks in a hierarchical order which belongs to a Project/Template which is defined in the Project Accounting Module.

Thanks to Sajeer Omar.

Replace the below hardcoded values before executing :
Project/Template ID

 select x.project_id  
       ,x.task_id  
       ,(lpad(' ',(wbs_level-1)*5,' ')||x.task_number) task_number  
       ,x.parent_task_id  
       ,x.top_task_id  
       ,x.wbs_level  
       ,sys_connect_by_path(x.task_id, '/')  
 from  pa_tasks x  
 where x.project_id = 1 -- Project/Template ID  
 connect by prior x.task_id = x.parent_task_id  
 start with x.parent_task_id is null  
 order by sys_connect_by_path(x.task_id, '/');  


Feel free to point out if anything is missing/wrong in this blog.

No comments:

Post a Comment