Calling Cuncorent Program from OAF Page.
In Application Module Create a custom method as below:
import below statements:
import java.util.Vector;
import oracle.apps.fnd.cp.request.ConcurrentRequest;
import oracle.apps.fnd.cp.request.RequestSubmissionException;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.apps.fnd.framework.server.OADBTransaction;
import oracle.apps.fnd.framework.server.OAViewObjectImpl;
import oracle.jbo.Row;
// method to submit the cp
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 = "POXCONST"; //Concurrent program name
String cpDesc = "Contract Status Report"; // 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.toString());
// 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;
}
}
// end method to submit cp
//Calling above method
public int submitConcurrent Program(){
int reqid=submitCPRequest(1);
System.out.println("reqid"+reqid);
return reqid;
}
In Application Module Create a custom method as below:
import below statements:
import java.util.Vector;
import oracle.apps.fnd.cp.request.ConcurrentRequest;
import oracle.apps.fnd.cp.request.RequestSubmissionException;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.apps.fnd.framework.server.OADBTransaction;
import oracle.apps.fnd.framework.server.OAViewObjectImpl;
import oracle.jbo.Row;
// method to submit the cp
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 = "POXCONST"; //Concurrent program name
String cpDesc = "Contract Status Report"; // 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.toString());
// 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;
}
}
// end method to submit cp
//Calling above method
public int submitConcurrent Program(){
int reqid=submitCPRequest(1);
System.out.println("reqid"+reqid);
return reqid;
}
Raju garu meru keka andi...
ReplyDeleteendhuku kranthi ala annav?
ReplyDelete