• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Techgoeasy

Techgoeasy

Learn Oracle, PHP, HTML,CSS,Perl,UNIX shell scripts

  • Home
  • Oracle
    • Oracle database
    • Oracle Ebusiness Suite
    • Oracle weblogic
    • Oracle Performance Tuning
    • Oracle Hyperion
    • Oracle Cloud Tutorials
  • SQL
  • interview questions
  • Linux
  • PHP and HTML
  • Downloads
  • General
Home » Oracle » Oracle Ebuisness Suite » How to submit a concurrent program from the backend

How to submit a concurrent program from the backend

September 18, 2022 by techgoeasy Leave a Comment

Concurrent Programs can be submitted from the backend ie. database using fnd_request.submit_request.We will check in this post the various code on How to submit a concurrent program from the backend

Here is the Snippet of the API

FUNCTION fnd_request.submit_request 
(
application      IN             VARCHAR2 DEFAULT NULL,
program          IN             VARCHAR2 DEFAULT NULL,
description      IN             VARCHAR2 DEFAULT NULL,
start_time       IN             VARCHAR2 DEFAULT NULL,
sub_request      IN              BOOLEAN DEFAULT FALSE 
argument1,
argument2,
…,
argument99,
argument100)
RETURN NUMBER;

We need to initialize the FND Session using fnd_global.apps_initialize before calling this API

Here
Application is the Application Short Name
Program is the Concurrent Program Name
Description is the Description of the Program
Start_time is the time to start the concurrent request
sub_request is Set to TRUE if the request is submitted from another request and should be treated as a sub-request.
argument1..argument100 is Arguments for the concurrent request; up to 100 arguments are permitted

Let’s check an example now

DECLARE

l_user_name VARCHAR2(240) := 'SYSADMIN';
l_resp_name VARCHAR2(240) := 'System Administrator';

l_user_id       NUMBER;
l_resp_id       NUMBER;
l_resp_appl_id  NUMBER;

l_request_id NUMBER;

BEGIN
-- Apps Initialization
   SELECT    user_id
    INTO l_user_id
   FROM fnd_user
   WHERE user_name =l_user_name;

   SELECT  b.RESPONSIBILITY_ID,b.APPLICATION_ID 
    FROM fnd_responsibility_tl tl, fnd_responsibility b
    WHERE tl.responsibility_name = l_resp_name
      AND LANGUAGE=UserEnv('LANG')
      AND tl.RESPONSIBILITY_ID=b.RESPONSIBILITY_ID;

  fnd_global.apps_initialize
    ( user_id => l_user_id
     ,resp_id => l_resp_id
     ,resp_appl_id => l_resp_appl_id
    );
--
l_request_id := FND_request.submit_request
              (application => 'XXTEST',  -- Custom Application Short Name
               program     => 'TESTPROG',   -- Concurrent Short Name
               description =>  NULL,
               start_time  =>  sysdate,
               sub_request =>  FALSE,
                argument1  =>  null, 
                           );

 COMMIT;
 
   IF l_request_id = 0 THEN
      DBMS_OUTPUT.put_line('Request not submitted: '|| fnd_message.get);
   ELSE
      DBMS_OUTPUT.put_line('Request submitted successfully. Request id: ' || l_request_id);
   END IF;
 
EXCEPTION
   WHEN OTHERS THEN
     DBMS_OUTPUT.put_line('Exception: ' || SQLERRM);   
END;
/

Here we have submitted to start the concurrent Program immediately by specifying the sysdate. If you want to specify the date, you can use it in the below manner

DECLARE

l_user_name VARCHAR2(240) := 'SYSADMIN';
l_resp_name VARCHAR2(240) := 'System Administrator';

l_user_id       NUMBER;
l_resp_id       NUMBER;
l_resp_appl_id  NUMBER;

l_request_id NUMBER;

BEGIN
-- Apps Initialization
   SELECT    user_id
    INTO l_user_id
   FROM fnd_user
   WHERE user_name =l_user_name;

   SELECT  b.RESPONSIBILITY_ID,b.APPLICATION_ID 
    FROM fnd_responsibility_tl tl, fnd_responsibility b
    WHERE tl.responsibility_name = l_resp_name
      AND LANGUAGE=UserEnv('LANG')
      AND tl.RESPONSIBILITY_ID=b.RESPONSIBILITY_ID;

  fnd_global.apps_initialize
    ( user_id => l_user_id
     ,resp_id => l_resp_id
     ,resp_appl_id => l_resp_appl_id
    );
--
l_request_id := FND_request.submit_request
                       (application => 'FND',  -- Application Object Library
                        program     => 'TESTPROG',   -- Workflow Background Process
                        description =>  NULL,
                        start_time  =>  to_char('11-JAN-2022 18::24:23','DD-MON-YYYY HH24:MI:SS'),
                        sub_request =>  FALSE,
                        argument1  =>  null, -- Item Type
                           );

 COMMIT;
 
   IF l_request_id = 0 THEN
      DBMS_OUTPUT.put_line('Request not submitted: '|| fnd_message.get);
   ELSE
      DBMS_OUTPUT.put_line('Request submitted successfully. Request id: ' || l_request_id);
   END IF;
 
EXCEPTION
   WHEN OTHERS THEN
     DBMS_OUTPUT.put_line('Exception: ' || SQLERRM);   
END;
/

Now if you want to submit a recurring Concurrent request, then you have to use the API fnd_request.set_repeat_options before submitting the concurrent program

Here is the sample code

DECLARE

v_request_id NUMBER;
v_status BOOLEAN;

BEGIN
–Initialize the session with appropriate values
fnd_global.apps_initialize (user_id=>0
,resp_id=>20420
,resp_appl_id=>1);

--Set the Repeat Options

v_status := fnd_request.set_repeat_options ( repeat_interval => 1
, repeat_unit => 'DAYS'
, repeat_type => 'START');
--Submit the Request

v_request_id := FND_request.submit_request
(application => 'XXTEST',
program =>     'XXFBG', 
description => NULL,
start_time => '2022/01/17 09:40:00',
sub_request => FALSE,
argument1 => 'AD'
);
COMMIT;

IF v_request_id = 0 THEN
DBMS_OUTPUT.put_line(‘Request not submitted: ‘|| fnd_message.get);
ELSE
DBMS_OUTPUT.put_line(‘Request submitted successfully. Request id: ‘ || v_request_id);
END IF;

EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line(‘Exception: ‘ || SQLERRM);
END;
/

I hope you find this information on How to submit a concurrent program from backend useful. Please do provide feedback

Related Articles 

Oracle Concurrent Manager: How an E-Business Suite Concurrent Manager Process Works, Oracle Concurrent Manager, What is internal monitor, What are the service manager and troubleshooting
Concurrent Request Phase and status: All information about Concurrent Request Phase and Status. The meaning is derived for each combination.
Core files in Oracle Concurrent manager: This page contains a description of the core file for oracle concurrent manager. Core file can be used to debug various issues in CM
Priority for concurrent Program: This post has a detailed description of changing Priority for Concurrent Program or user or request to solve user critical report running issues
Concurrent Manager Interview questions: Check out 24 Concurrent Manager Interview questions to help you in the EBS interview. This consists of all sorts of questions on the standard manager, service manager
Parallel Concurrent Processing: What is PCP, How to setup it up, how to define an internal monitor
ORA-01427:Check out this for the solution on ORA-01427: single-row subquery returns more than one-row error , how to resolve it when it happens with Concurrent Manager

Filed Under: Oracle, Oracle Ebuisness Suite

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar



Subscribe to our mailing list

Enter your email address to subscribe to this blog and receive notifications of new posts by email

Recent Posts

  • How to generate sql monitor report in Oracle
  • How to find the long running (longops session) in Oracle
  • How to find concurrent request id from Sid or spid
  • how to check recycle bin in oracle: Purge, enable/disable
  • how to check fra size in oracle: Location, usage, change size

Copyright © 2023 : TechGoEasy

  • Hire me
  • Privacy Policy
  • Contact Us
  • New? Start Here
  • About Us