Home » Developer & Programmer » Reports & Discoverer » REP-1419:'Afterreport': PL/SQL program aborted
REP-1419:'Afterreport': PL/SQL program aborted [message #470642] Tue, 10 August 2010 06:42 Go to next message
stalin4d
Messages: 226
Registered: May 2010
Location: Chennai, Tamil Nadu, Indi...
Senior Member
Dear,

I have given the below code for a report, report runs good, but after closing report window i m receiving the error code:

Quote:
REP-1419: 'afterreport': PL/SQL program aborted.


function AfterReport return boolean is
cnt number;
begin	    	      
 	  	select count(*) into cnt 
	  	from opcl
	  	where fiscal_yr_cd = :P_Fiscal_Yr
	  	and Period_no = :P_Period;
	  	
	  	if cnt > 0 then
	    raise SRW.PROGRAM_ABORT;  	
	  else	  	   
  	insert into opcl (fiscal_yr_cd,Period_no,Col1,Col2,Col3,Col4,Col5,Col6)
  	 Values          (:P_Fiscal_yr,:P_Period,nvl(:total_credit,0), nvl(:total_cess_cf,0),
  	                  nvl(:total_sec_cess_cf,0), nvl(:cf_tot_serv_tax1,0), nvl(:cf_tot_serv_tax2,0),
  	                  nvl(:cf_tot_serv_tax3,0));
    commit;  	                
    end if;     
    
  return (TRUE);
end;


can you help to resolve this?

Thanks in Advance.

Stalin Ephraim...

Re: REP-1419:'Afterreport': PL/SQL program aborted [message #470653 is a reply to message #470642] Tue, 10 August 2010 06:51 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Stalin,
You need to check what is the count resulting.
If that is more than 1, "raise SRW.PROGRAM_ABORT;" raising the error.
But, I wonder why the code is like that.
If you run the report first time, the same year and period are getting inserted.
Second time, surely it errs because this time you will have two rows.

By
Vamsi
Re: REP-1419:'Afterreport': PL/SQL program aborted [message #470667 is a reply to message #470653] Tue, 10 August 2010 07:10 Go to previous messageGo to next message
stalin4d
Messages: 226
Registered: May 2010
Location: Chennai, Tamil Nadu, Indi...
Senior Member
Actually if Count > 0 then, again it should not insert the data into the table, else it should insert data for the next month.

eg:

period_no: 01 = April
02 = May
03 = Jun
04 = Jul goes on Upto 12 Months.

if i selecting first time for month of july, the record should be inserted into that table OPCL, if i again view the report tomorrow it should not be duplicated.

Actually we know this after report will insert everytime when we run the report. once i have run the report it should not duplicate the data for the same month again.

so i gave the SRW.PROGRAM_ABORT, this will terminate the process if there is count more than 1 for that month if zero then the record must be inserted.

i hope u understand clearly.




Re: REP-1419:'Afterreport': PL/SQL program aborted [message #470672 is a reply to message #470667] Tue, 10 August 2010 07:26 Go to previous message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Quote:
SRW.PROGRAM_ABORT
Description: This exception stops the report execution and raises the following error.
message: REP-1419: PL/SQL program aborted.
SRW.PROGRAM_ABORT stops report execution when you raise it.
If you want come out from the procedure/function, why can't you just use RETURN?

By
Vamsi
Previous Topic: calling a dml from report
Next Topic: PDF export
Goto Forum:
  


Current Time: Thu Mar 28 18:02:49 CDT 2024