Saturday, December 08, 2012

Query to find concurrent request status


The following query finds the concurrent process status and its related information (such as, completion phase, responsibility used, which user submitted the program, etc.).

In the following example, I used "Autoinvoice Import Program" as Concurrent Program Name. You will need to run the query by changing the program name as per your requirement. You can also uncomment the "FCR.REQUEST_ID" condition (at the bottom of the query) for a specific Request ID.

-------------------------------------------------------------------------------
-- Query to find concurrent request status related information
-------------------------------------------------------------------------------
SELECT fu.user_name                        "User ID",
       fr.responsibility_name              "Responsibility Used",
       fcr.request_id                      "Request Id",
       fcp.user_concurrent_program_name    "Concurrent Program Name",
       fl_ph.meaning                       "Phase",
       fl_st.meaning                       "Status",
       fcr.request_date                    "Request Date",
       fcr.requested_start_date            "Request Start Date",
       fcr.parent_request_id               "Parent Request Id"
  FROM FND_USER                    fu,
       FND_RESPONSIBILITY_VL       fr,
       FND_CONCURRENT_REQUESTS     fcr,
       FND_CONCURRENT_PROGRAMS_VL  fcp,
       FND_LOOKUP_VALUES           fl_ph,
       FND_LOOKUP_VALUES           fl_st
 WHERE 1=1
   --
   AND fl_ph.lookup_code = fcr.phase_code
   AND fl_ph.lookup_type = 'CP_PHASE_CODE'
   AND fl_ph.enabled_flag = 'Y'
   AND fl_ph.view_application_id = 283
   --
   AND fl_st.lookup_code = fcr.status_code
   AND fl_st.lookup_type = 'CP_STATUS_CODE'
   AND fl_st.enabled_flag = 'Y'
   AND fl_st.view_application_id = 283
   -- 
   AND fu.user_id = fcr.requested_by
   AND fcr.concurrent_program_id = fcp.concurrent_program_id
   AND fcr.responsibility_id = fr.responsibility_id
   --
   AND fcp.user_concurrent_program_name = 
       'Payables Open Interface Import'  -- <change it>
   AND TRUNC(fcr.request_date) >= TRUNC(SYSDATE-7)  -- <change it>
 ORDER BY fu.user_name, fcr.request_date DESC;



No comments: