Overview: This Script will help you to make process execution to wait for program to be completed and you can implement this script in your PL/SQL package or Procedure in Oracle R12 Application.
IF req_id > 0 THEN LOOP --To make process execution to wait for program to complete l_req_return_status := fnd_concurrent. wait_for_request (request_id => req_id, interval => 5, --interval Number of seconds to wait between checks max_wait => 60, --Maximum number of seconds to wait for the request completion -- out arguments phase => lc_phase, status => lc_status, dev_phase => lc_dev_phase, dev_status => lc_dev_status, MESSAGE => lc_message);EXIT WHEN UPPER (lc_phase) = 'COMPLETED' OR UPPER (lc_status) IN ('CANCELLED', 'ERROR', 'TERMINATED');
END LOOP;
END IF;