Search Results


Tuesday, November 04, 2008

Call Concurrent Program from OA Framework

How to Call a Concurrent Program from OA framework


OA Framework provides the ConcurrentRequest class to call the concurrent program from the page. The submitRequest() method in the ConcurrentRequest class takes 6 parameters and returns request id of the submitted concurrent request:

public int submitRequest(
String ProgramApplication ,
String ProgramName ,
String ProgramDescription ,
String StartTime,
boolean SubRequest,
Vector Parameters ) throws RequestSubmissionException


ProgramApplication -Application Short name of application under which the program is registered.
ProgramName - Concurrent Program Name for which the request has to be submitted
ProgramDescription - Concurrent Program Description
StartTime - Time at which the request has to start running.
SubRequest - Set to TRUE if the request is submitted from another running request and has to be treated as a sub request.
Parameters - Parameters of the concurrent Request


Here is the example for calling a concurrent program from a OA framework page.


import oracle.apps.fnd.cp.request.ConcurrentRequest;
import oracle.apps.fnd.framework.server.OADBTransaction;

public int submitCPRequest(Number headerId) {

try {


OADBTransaction tx = (OADBTransaction)getDBTransaction();
java.sql.Connection pConncection = tx.getJdbcConnection();
ConcurrentRequest cr = new ConcurrentRequest(pConncection);

String applnName = "PO"; //Application that contains the concurrent program
String cpName = "POXXXX"; //Concurrent program name
String cpDesc = "Concurrent Program Description"; // concurrent Program description

// Pass the Arguments using vector
// Here i have added my parameter headerId to the vector and passed the vector to the concurrent program

Vector cpArgs = new Vector();
cpArgs.addElement(headerId.stringValue());


// Calling the Concurrent Program

int requestId = cr.submitRequest(applnName, cpName, cpDesc, null, false, cpArgs);
tx.commit();

return requestId;

} catch (RequestSubmissionException e) {
OAException oe = new OAException(e.getMessage());
oe.setApplicationModule(this);
throw oe;

}
}



How to monitor the submitted concurrent request OA Framework


The Request Monitoring user interface provides the ability to search for a current user's requests. It allows the user to specify criteria to search for a request based on a specific request ID, requests for a specific program or a range of scheduled requests. Using the search results list, a user can select a request to see the details of that request or view its output file. From the Details page for a request, a user can place a hold on a pending request, cancel a pending request or view the request's log file.



You can call the Request Monitoring page by calling following URL
OA.jsp?akRegionCode=FNDCPREQUESTVIEWREGION&akRegionApplicationId=0



Article By:

Prasanna Jayaraman


Please post your Ideas and Comments

15 comments :

Anonymous said...

Does this example work?

I tried adding this into one of the existing jsp and it throws error (server 500).

Any help?

Thanks
Deven

suresh said...

Hi prasanna,
Your post are great. Now I have an issue of viewing Concurrent Program output and log file from an OAF link basing on concurrent request ID.

Please help me in this regard,

Thanks,
Suresh

Anonymous said...

Good post and this enter helped me alot in my college assignement. Say thank you you on your information.

Anonymous said...

Brim over I acquiesce in but I dream the post should have more info then it has.

Parag Narkhede said...

Hi, my requirement is.. At the click of submit button on OAF page, I dont want to submit concurrent program. I want to open SRS form in apps which will ask me for concurrent program name and parameter. I will provide the params and will submit the program from there. How to achieve this?

Unknown said...

Hi Prasanna,

I have a requiremen, Need to submit a concurrent program by clicking a submit button,

I tried your code in AMImpl.java
Im getting the following errors can you please help me to resolve those?

Error(279,10): class RequestSubmissionException not found in class xxafp.oracle.apps.qp.pricelistrebate.server.PricelistrebateAMImpl

Error(280,1): class OAException not found in class xxafp.oracle.apps.qp.pricelistrebate.server.PricelistrebateAMImpl


Error(280,22): class OAException not found in class xxafp.oracle.apps.qp.pricelistrebate.server.PricelistrebateAMImpl

Error(268,1): class Vector not found in class xxafp.oracle.apps.qp.pricelistrebate.server.PricelistrebateAMImpl

Error(268,21): class Vector not found in class xxafp.oracle.apps.qp.pricelistrebate.server.PricelistrebateAMImpl

Thanks,
Mahesh

Pras said...

Import the following pkg

import oracle.apps.fnd.framework.OAException;

--Prasanna

Unknown said...

Hi Prasanna,
Still getting the following errors.
sorry to bother you but Please let me know your gmail, so that i can send my acutal code of AMImpl.

Error(280,10): class RequestSubmissionException not found in class xxafp.oracle.apps.qp.pricelistrebate.server.PricelistrebateAMImpl

Error(269,1): class Vector not found in class xxafp.oracle.apps.qp.pricelistrebate.server.PricelistrebateAMImpl

Error(269,21): class Vector not found in class xxafp.oracle.apps.qp.pricelistrebate.server.PricelistrebateAMImpl

Pras said...

import java.util.Vector;

replace RequestSubmissionException
with (Exception e) and proceed.

--Prasanna

Unknown said...

Hi Prasanna,
Thanks for your help.

I Have written the following code in Controller.

if(pageContext.getParameter("Print")!=null)
{
am.submitCPRequest();
}

I'm getting the following error.

Error(106,9): method submitCPRequest not found in class xxafp.oracle.apps.qp.pricelistrebate.server.PricelistrebateAMImpl

Can you please let me know how to resolve this?
even though i have imported xxafp.oracle.apps.qp.pricelistrebate.server.PricelistrebateAMImpl;

Thanks,
Mahesh

mahakk01 said...

This post gives you procedure to call concurrent program from OA framework. I tried the given steps but failed to perform them successfully. I'll try again. I hope this time it work fine. This is one of the best blog that I follow. Thanks for the post.
sap erp system

Unknown said...

I have error on row
OADBTransaction tx = (OADBTransaction)getDBTransaction();

Error: method getDBTransaction() not found in class

Aarthi Puthran said...

Hi,

Great article. However, can you please guide me on how to open the log file and output file directly from the custom OAF page for a given request id?

Regards,
Aarthi

Unknown said...

can you please describe me where to use this particular code ...actually i am new in oaf.

Pras said...

You could use it in the controller where you handle the actions for button submits etc..