Home » Applications » Oracle Fusion Apps & E-Business Suite » Concurrent request failing in pl/sql (11.5.10.2)
Concurrent request failing in pl/sql [message #321524] Tue, 20 May 2008 10:26 Go to next message
techno
Messages: 44
Registered: October 2003
Member
I have submitted the conc. request by calling the function fnd_request.submit_request in pl/sql. It is returning 0 as request Id, Since it is failing to submit request. I have initialized environment thru FND_GLOBAL.APPS_INITIALIZE prior to this.

All the parameters I am passing correctly. I am able to submit the same request thru SRS.

What is causing this error? I found the same result for all the conc. requests that I made thru pl/sql?

Thanks
-Techno
Re: Concurrent request failing in pl/sql [message #321558 is a reply to message #321524] Tue, 20 May 2008 13:38 Go to previous message
Steve Corey
Messages: 336
Registered: February 2005
Location: RI
Senior Member
After issuing the submission, you have to commit in order to get a returned value. Here is an example that I use to submit the seeded concurrent request REQIMPORT from PL/SQL:

BEGIN
	 	 	
	 -- Set System Options/Parameters to allow for successful concurrent request 
	 --  submission of the Requisition Import 	  
	 l_mode := APPS.FND_SUBMIT.SET_MODE(TRUE);

     l_req_id := 0; 
	 
	 l_return_code := APPS.FND_REQUEST.SET_OPTIONS( 'N', 'N');
	 	 	 
	 l_return_code := APPS.FND_REQUEST.SET_REPEAT_OPTIONS( '', '', '', '', '');
	 		
	 l_return_code := APPS.FND_REQUEST.SET_PRINT_OPTIONS( '', '', '', TRUE , '');
	 	 
	 l_req_id := APPS.FND_REQUEST.SUBMIT_REQUEST('PO','REQIMPORT',NULL,NULL,FALSE,
                                            	 'PO',NULL,'ALL',NULL,'Y','N',CHR(0),
	 '', '', '', '', '', '', '', '', '', '',
	 '', '', '', '', '', '', '', '', '', '',
	 '', '', '', '', '', '', '', '', '', '',
	 '', '', '', '', '', '', '', '', '', '',
         '', '', '', '', '', '', '', '', '', '',
	 '', '', '', '', '', '', '', '', '', '',
	 '', '', '', '', '', '', '', '', '', '',
	 '', '', '', '', '', '', '', '', '', '',
	 '', '', '', '', '', '', '', '' );
							
	 COMMIT;


The empty values are for arguments that I am not passing to the submit request function. I believe these can be left out, but the documentation suggests that you should provide all 100 arguments in the call.

Once you have committed, you can then analyze the value of l_req_id to determine how to continue processing. The following is a continuation of the above code:

IF l_req_id > 0 THEN	
     	 
	 	l_conc_status := APPS.FND_CONCURRENT.WAIT_FOR_REQUEST
                          	(request_id => l_req_id
                     	  	,interval   => 5            -- Sleep 5 seconds between checks.
                     	  	,max_wait   => 0            -- Wait indefinately.
                     	  	,phase      => l_phase
                     	  	,status     => l_status
                     	  	,dev_phase  => l_dev_phase
                     	  	,dev_status => l_dev_status
                     	  	,message    => l_message
                            );

	  	-- Test development status to determine how to proceed
    	IF l_dev_status = 'NORMAL' THEN

      	    -- Set return code to "NORMAL":
       	   	retcode := 0;

    	ELSIF l_dev_status = 'WARNING' THEN

	        -- Store message and set return code to "WARNING":
	      	errbuf := errbuf||'Request ID: '||l_req_id||' IMPORT_REQ_AND_AUTOCREATE_PO completed with WARNING status.';
	      	errbuf := errbuf||CHR(10);
	      	errbuf := errbuf||'Completion message from XXRI_PO_FY_EXPORT_PKG: ';
	      	errbuf := errbuf||l_message;
			errbuf := errbuf||CHR(10);
	      	retcode := 1 ;
	
	    ELSIF l_dev_status IN ('ERROR','CANCELLED','TERMINATED') THEN
	
	        -- Store message and set return code to "ERROR":
	      	errbuf := errbuf||'Request ID: '||l_req_id||' IMPORT_REQ_AND_AUTOCREATE_PO completed with '||l_dev_status||' status.';
	      	errbuf := errbuf||CHR(10);
	      	errbuf := errbuf||'Completion message from XXRI_PO_FY_EXPORT_PKG: ';
	      	errbuf := errbuf||l_message;
			errbuf := errbuf||CHR(10);
	      	retcode := 2;
			 
	    ELSE -- completed with unrecognized status:
	
	        -- Store message and set return code to "ERROR":
	      	errbuf := errbuf||'Request ID: '||l_req_id||' IMPORT_REQ_AND_AUTOCREATE_PO completed with unrecognized status: '||l_dev_status;
	      	errbuf := errbuf||CHR(10);
	      	errbuf := errbuf||'Completion message from XXRI_PO_FY_EXPORT_PKG: ';
	      	errbuf := errbuf||l_message;
			errbuf := errbuf||CHR(10);
	      	retcode := 2;

     	END IF;
		   
     ELSE
		
	    RAISE submission_error; 
		   
     END IF;


I left out the declaration section, but I'm sure you can set yours appropriately.

Hope that helps,
Steve
Previous Topic: Not able to retrive the data form view.
Next Topic: Calculating Tax error AP invoice
Goto Forum:
  


Current Time: Mon Dec 05 07:05:31 CST 2016

Total time taken to generate the page: 0.11405 seconds