Skip to main content

I am trying to run cust_age_analysis_rpi.Cust_Detail_Age_Analysis in pl/sql to generate the archive data for it, and then I am going to pull it into an SSRS report. I had done this years ago at another customer and this code worked, but not sure what I am doing wrong now. Getting this error.

“end;
Error report -
ORA-20111: Archive.FND_RECORD_NOT_EXIST: The Archive does not exist.
ORA-06512: at "IFSAPP.ERROR_SYS", line 140
ORA-06512: at "IFSAPP.ERROR_SYS", line 366
ORA-06512: at "IFSAPP.ARCHIVE_API", line 845
ORA-06512: at "IFSAPP.ARCHIVE_API", line 849
ORA-06512: at "IFSAPP.ARCHIVE_API", line 235
ORA-06512: at "IFSAPP.ARCHIVE_API", line 240
ORA-06512: at "IFSAPP.ARCHIVE_VARIABLE_API", line 1285
ORA-06512: at "IFSAPP.ARCHIVE_VARIABLE_API", line 1294
ORA-06512: at "IFSAPP.ARCHIVE_VARIABLE_API", line 1327
ORA-06512: at "IFSAPP.ARCHIVE_VARIABLE_API", line 1331
ORA-06512: at "IFSAPP.ARCHIVE_VARIABLE_API", line 1745
ORA-06512: at "IFSAPP.ARCHIVE_VARIABLE_API", line 1751
ORA-06512: at "IFSAPP.CUST_AGE_ANALYSIS_RPI", line 990
ORA-06512: at line 51

See code below

declare  
  --user_id_ varchar(100) := ;
        report_attr_ varchar2(32000);
        parameter_attr_ varchar2(32000);
        result_key_  NUMBER              := ifsapp.report_sys_seq.nextval;
        from_customer_ VARCHAR2(20)       := null;
        to_customer_ VARCHAR2(20)        := null;
        from_cust_group_ VARCHAR2(20)    := null;
        to_cust_group_ VARCHAR2(20)      := null;
        company_ varchar(100) := 'Company';
        analysis_date_  DATE := trunc(sysdate);
        first_interval_ NUMBER      := 30;
        second_interval_ NUMBER    := 30;
        third_interval_ NUMBER     := 30;
        --report_date_ DATE        := analysis_date_;
        --party_to_use_ VARCHAR2(100)       := Party_Type_API.Decode( 'CUSTOMER' );
        --report_title_ VARCHAR2(20)       := 'Detail';
        ledger_status_type_ VARCHAR2(50) := 'All';
        --ledger_status_ VARCHAR2(50)      := NVL(Ledger_Status_Type_API.Encode(ledger_status_type_), 'ALL');
        adv_inv_type_ VARCHAR2(200)       := 'Include';
        --adv_inv_type_db_ VARCHAR2(5)    := Advance_Invoice_Pay_Type_API.Encode(adv_inv_type_);
        excl_open_pay_docs_ VARCHAR2(20) := 'No';
        exclude_adv_pay_ VARCHAR2(5)    :='No';
        exclude_pay_on_acc_ VARCHAR2(5) := 'No';
        sort_order_ VARCHAR2(20)        := 'Customer ID';
        --sort_order_          := NVL(sort_order_,'CUSTID');
begin
        ifsapp.client_SYS.Clear_Attr(report_attr_);
        ifsapp.client_SYS.Clear_Attr(parameter_attr_);

        ifsapp.Client_SYS.Add_To_Attr('RESULT_KEY',result_key_, report_attr_);
        ifsapp.Client_SYS.Add_To_Attr('COMPANY',company_, parameter_attr_);
        ifsapp.Client_SYS.Add_To_Attr('FROM_CUSTOMER',from_customer_, parameter_attr_);
        ifsapp.Client_SYS.Add_To_Attr('TO_CUSTOMER',to_customer_, parameter_attr_);
        ifsapp.Client_SYS.Add_To_Attr('FROM_GROUP',from_cust_group_, parameter_attr_);
        ifsapp.Client_SYS.Add_To_Attr('TO_GROUP',to_cust_group_, parameter_attr_);
        ifsapp.Client_SYS.Add_To_Attr('ANALYSIS_DATE',analysis_date_, parameter_attr_);
        ifsapp.Client_SYS.Add_To_Attr('FIRST_INTERVAL',first_interval_, parameter_attr_);
        ifsapp.Client_SYS.Add_To_Attr('SECOND_INTERVAL',second_interval_, parameter_attr_);
        ifsapp.Client_SYS.Add_To_Attr('THIRD_INTERVAL',third_interval_, parameter_attr_);
        --Client_SYS.Add_To_Attr('REPORT_TITLE',report_title_, parameter_attr_);
        ifsapp.Client_SYS.Add_To_Attr('LEDGER_STATUS',ledger_status_type_, parameter_attr_);
        ifsapp.Client_SYS.Add_To_Attr('ADV_INV',adv_inv_type_, parameter_attr_);
        ifsapp.Client_SYS.Add_To_Attr('EXCLUDE_OPEN_PAY_DOCS',excl_open_pay_docs_, parameter_attr_);
        ifsapp.Client_SYS.Add_To_Attr('EXCLUDE_ADV_PAY',exclude_adv_pay_, parameter_attr_);
        ifsapp.Client_SYS.Add_To_Attr('EXCLUDE_PAY_ON_ACC',exclude_pay_on_acc_, parameter_attr_);
        ifsapp.Client_SYS.Add_To_Attr('GROUPING',sort_order_, parameter_attr_);

        --DBMS_OUTPUT.PUT_LINE(report_attr_);
        --DBMS_OUTPUT.PUT_LINE(parameter_attr_);
        ifsapp.cust_age_analysis_rpi.Cust_Detail_Age_Analysis(report_attr_, parameter_attr_);
        ifsapp.archive_distribution_api.connect_instance(result_key_, 'IFSAPP', (sysdate +365));
end;

Be the first to reply!

Reply