Saturday, 10 October 2020

How to call concurrent program from pl/sql package

How to call concurrent program from pl/sql package

Hi friends, we are going to discuss about , how to call concurrent program from pl/sql package. We will share the detail pl/sql code to call concurrent program in oracle apps from backend. Oracle apps has provided the standard API to concurrent program from plsql. We don't need to submit or call the concurrent program from application itself. Using this standard api , we do call the concurrent programs from oracle database using the pl/sql.  This type of scenario mostly comes in terms of oracle apps interfaces, where we need to call the standard import programs from oracle database to process in the oracle interface records. Here in this post , We will share more detail about How to call concurrent program from pl/sql package.
How to call concurrent program from pl/sql package
How to call concurrent program from pl/sql package

Standard API to call concurrent program from pl/sql package

1. fnd_request.submit_request

3 Important Points to call concurrent program from pl/sql package

Here below ,  We will share some of the important points , we need to consider before using the standard API.

1. Application Name under which the Concurrent Program registered .
2.Concurrent Program short code name which we want to call from pl/sql.
3.Needs to know the Concurrent Program Parameters , which we also needs to pass while calling the concurrent program from pl/sql package


Complete pl/sql Package to call the Concurrent Program from Oracle Data Base.

Here below , we are sharing the detail plsql code which helps to submit the concurrent program from DB.


DECLARE
v_resp_id NUMBER;
v_appl_id    NUMBER;
v_usr_id            NUMBER;
v_con_req_id            NUMBER;
BEGIN

SELECT user_id INTO v_usr_id  
   FROM fnd_user WHERE user_name = 'xx_running_user';
   
  SELECT DISTINCT fr.responsibility_id,
    frx.application_id
     INTO v_resp_id,
    v_appl_id
     FROM apps.fnd_responsibility frx,
    apps.fnd_responsibility_tl fr
    WHERE fr.responsibility_id = frx.responsibility_id
  AND LOWER (fr.responsibility_name) LIKE LOWER('XXTest Resp');
 
  
  apps.fnd_global.apps_initialize (v_usr_id ,v_resp_id,v_appl_id);

  
  -- Here below ,  we are calling the concurrent request from Oracle DB--
  
  
  v_con_req_id := fnd_request.submit_request ( 
                            application   ='XXGL', 
                            program       ='XXTEST_CON_PROG, 
                            description   ='XXTest Concurrent Program', 
                            start_time    =sysdate, 
                            sub_request   =FALSE,
    argument1     ='84','TEST' -- 2 PARAMETERS OF THIS CONCURRENT PROGRAM--
  );
 
 
  COMMIT;
  IF v_con_req_id = 0
  THEN
     dbms_output.put_line ('Concurrent Program failed to Call from plsql');
  ELSE
     dbms_output.put_line('Concurrent Program Sucessfully Call from plsql');
  END IF;
  
EXCEPTION
WHEN OTHERS THEN
  dbms_output.put_line('Error In Concurrent Program Call Main Procedure 2 '||TO_CHAR(SQLCODE)||'-'||sqlerrm);
END;


How to call concurrent program from pl/sql package
How to call concurrent program from pl/sql package


0 comments:

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *