Tuesday, August 20, 2019

Submit concurrent request from back end (Solved)


Submit concurrent request (Solved)

Or

How to submit concurrent request in Oracle from backend or frontend?


There are two parts of this question:


1.     
          Submit concurrent request from backend.

and
2.   
          Submit concurrent request from Oracle form.

If we talk about its first part which is

Submit concurrent request from backend
Or
Submit concurrent request from pl/sql


I assume you know how to submit any request from front end if you don’t know you should read second part first otherwise keep reading.



We have to login into the oracle applications, navigate to respective responsibility and finally submit the concurrent program for its execution. (As illustrated in second part)


But challenge arise when we have to submit a concurrent program from an integrated development environment like Toad and SQL Developer.

Here comes the solution.


Firstly we need to initialize the apps environment to submit a concurrent request from back-end.


We will use the built-in function (APPS_INITIALIZE ) to initialize the apps environment and the syntax is:


APPS.FND_GLOBAL.APPS_INITIALIZE(user_id,
                                                                    responsibility_id,
                                                                    application_responsibility_id
                                                                    );

Now challenge comes from where we can have all these IDs?

We can extract these values from backend by using following tables
 or
we can extract the values from the Oracle Application menu  i.e.

 Help > Diagnostic > Examine >
Select  “$PROFILES$” in “Block Field” and select required field in “Field” and you can have your required value in “Value” section. As illustrated below:

submit concurrent request in Oracle from backend or frontend?
submit concurrent request in Oracle from backend or frontend?




Submit concurrent request from Toad

submit concurrent request in Oracle from backend or frontend?

These can be queried from following tables:


SELECT user_id
  FROM fnd_user
WHERE user_name like 'ALI'     --(or write your username here instead of ALI)


SELECT responsibility_id, application_id
  FROM  fnd_responsibility_tl
WHERE responsibility_name like 'System Administration'          --(replace ‘System Administration’ --with your target responsibility)

SELECT application_short_name
  FROM  fnd_application
WHERE application_id = (write application id here which you extracted from above )



Now, after initializing the apps environment, execute the API,

APPS.FND_REQUEST.SUBMIT_REQUEST();

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);    ---- this function will return number

application: application short name in which your concurrent program is registered

as illustrated below



unable to submit concurrent program from backend
unable to submit concurrent program from backend








submit concurrent program from backend
submit concurrent program from backend


Run Concurrent Request from back-end
Run Concurrent Request from back-end

SELECT application_short_name
 FROM fnd_application
WHERE application_id = 0----(write application id here which you extracted from above )

Input arguments:

Program: Concurrent Program Short name

Description: It is optional. If you want to add any particular description you can use this.

start_time:  time at which the program should start executing (optional)

sub_request:  ‘TRUE’, if the program is being submitted from any other program otherwise ‘False’

argument1, argument2, ...argument99, argument100 
Parameters for the concurrent program in sequence if any required



Example:


Declare
v_req_id number;

begin              

APPS.FND_GLOBAL.APPS_INITIALIZE(1,       --user_id,
                                                                       20,     --responsibility_id,
    1)       --application_responsibility_id

dbms_output.put_line('Initialized ' || v_req_id);  ----better to add this at every step while working

v_req_id:= APPS.FND_REQUEST.SUBMIT_REQUEST(
                                'FND', ----  application short name IN varchar2 default NULL
                                'FNDSCURS', ----CONCURRENT program NAME IN varchar2 default NULL,
                                 Null,               ----description    IN varchar2 default NULL,
                                 sysdate,           ----start_time     IN varchar2 default NULL,
                                 FALSE);          ----sub_request    IN boolean default FALSE

dbms_output.put_line('Request Submitted and Request Id is: ' || v_req_id);                                      

Commit;                                     

dbms_output.put_line('Commit Executed.');

if v_req_id >0 then

dbms_output.put_line('Request submitted Successfully and Request ID is: ' || v_req_id);

else

dbms_output.put_line('Request submission Failed. ' || v_req_id ||' and sqlerrm:  ' || sqlerrm);

end if;

exception when others then
dbms_output.put_line('Error while submitting Concurrent Request');

end;

/


After writing it (let us try in Toad) first start the DBMS output and then select the whole script and press “F9”. And then again press “Refresh” button in DMS output and check what messages are shown there.

as shwon below:

Run Concurrent Request from  Toad
Run Concurrent Request from  Toad
left most round button is to start debuging after that select your code and hit "F9" button and then refresh and messages will be shown.


at the end of first part of this question let me describe other possible form of this question, so that maximum people can reach to the solution (I will really appreciate your patience if it bothers you)  

unable to submit concurrent program from backend
submit concurrent program through backend
submit a concurrent request from backend
how to submit concurrent request from backend
submit concurrent program from backend in r12
submit concurrent program from backend in oracle apps
pl/sql script to submit a concurrent request from backend
submitting the concurrent request from backend
submit concurrent request from oracle form
oracle submit concurrent request from pl sql
how to submit concurrent request from oracle forms
submit concurrent request  from pl/sql



If we talk about its second part which is

Submit concurrent request from Oracle form.




Solution: 

You need to login in Oracle Application and then switch to respective responsibility.
Rest of procedure I am illustrating beneath for your ease because you know

“A picture speaks louder than words”


RUN Oracle concurrent request from back end
RUN Oracle concurrent request from back end

RUN Oracle concurrent request from back end
RUN Oracle concurrent request from back end
RUN Oracle concurrent request from back end
RUN Oracle concurrent request from back end



RUN Oracle concurrent request from back end
RUN Oracle concurrent request from back end

RUN Oracle concurrent request from back end
RUN Oracle concurrent request from back end

RUN Oracle concurrent request from back end
RUN Oracle concurrent request from back end

RUN Oracle concurrent request from back end
RUN Oracle concurrent request from back end

This request does not have any parameter to define so press "OK". 



RUN Oracle concurrent request from back end
RUN Oracle concurrent request from back end

RUN Oracle concurrent request from back end
RUN Oracle concurrent request from back end

RUN Oracle concurrent request from back end
RUN Oracle concurrent request from back end

finally to view the output press "View Output" button.



At the end let me describe other possible form of this question, so that maximum people can reach to the solution (I will really appreciate your patience if it bothers you)  


How to submit concurrent request from Oracle Form
How to submit concurrent request from frontend
Cannot submit concurrent request from Oracle Form
Unable to submit concurrent request from Oracle Form


reference: when I was first time trying to run concurrent request from back end I followed following website: