Wednesday, February 23, 2022

Script to Find All Sundays Date for a given Date Within that Year

DECLARE
   l_date       DATE := '&P_ENTER_ANY_DATE';
   l_first_sunday   DATE;
   l_last_sunday    DATE;
BEGIN
   --Find 1st Sunday
   l_first_sunday := NEXT_DAY (TRUNC (l_date, 'YYYY') - 1, 'SUN');
   --Find last Sunday
   l_last_sunday := NEXT_DAY (ADD_MONTHS (TRUNC (l_date, 'YYYY') - 1, 12), 'SUN') - 7;

   WHILE l_first_sunday <= l_last_sunday
   LOOP
      DBMS_OUTPUT.PUT_LINE ( l_first_sunday);
      l_first_sunday := l_first_sunday + 7;
   END LOOP;
END;

Thursday, February 17, 2022

Unapplied and Unresolved Receipts Register report completing with Error

 "Unapplied and Unresolved Receipts" report is the replacement for "Unapplied Receipt Register". When tried to run "Unapplied and Unresolved Receipts" report for the first time, its completed with below error.

Its not a BIDI char set

Its not a BIDI language

Error executing cursor. ORA-06502: PL/SQL: numeric or value error: NULL index table key value 

ORA-06512: at "APPS.FA_RX_PUBLISH", line 2205 

ORA-06512: at line 1

Unable to execute cursor


To resolve this issue Oracle Provided data fix as mentioned in Note "Unapplied and Unresolved Receipts Register Cannot Be Submitted (Doc ID 866105.1)"

Please make sure that you will do testing in test instance.

As per Oracle the error occurs because the concurrent_program_id is null for the reports having report_ids 492 and 493.


1. Please run the following sql

select report_id, application_id, concurrent_program_id,
last_update_date,concurrent_program_name
from fa_rx_reports
where report_id in (492,493);

2. If the query results concurrent_program_id as NULL then please run the following update statement:

Update fa_rx_reports farr
set concurrent_program_id =
(Select concurrent_program_id
From fnd_concurrent_programs
Where application_id = farr.application_id
And concurrent_program_name = farr.concurrent_program_name);

3. Then run the report.

Tuesday, February 15, 2022

"Unapplied Receipt Register" report completing with Error in Oracle Apps R12

While running "Unapplied Receipts Register" completing with below error in Oracle APPS R12.

REP-0004: Warning: Unable to open user preference file.

MSG-00100: BeforeReport_Procs.Set_Sort_Order

MSG-00200: Total forAGENCY: 

REP-1401: 'report_subtitleformula': Fatal PL/SQL error occurred.

ORA-06502: PL/SQL: numeric or value error

ORA-06512: at "APPS.AR_MO_GLOBAL_CACHE", line 55

ORA-06512: at "APPS.ARP_STANDARD", line 3021


REP-0069: Internal error

REP-57054: In-process job terminated:Terminated with error: m

REP-1401: MSG-00100: BeforeReport_Procs.Set_Sort_Order

MSG-00200: Total forAGENCY: 

REP-1401: 'report_subtitleformula': Fatal PL/SQL error occurred.

ORA-06502: PL/SQL: numeric or value error

ORA-06512: at "APPS.AR_MO_GLOBAL_CACHE", line 55

ORA-06512: at "APPS.ARP_STANDARD", line 3021


Solution: As mentionbed in Oracle Note Document ID 418261.1 "Unapplied Receipt Register" is Obsoleted in R12. 

Below are the comments from Oracle Note.

"In Release 12, the Unapplied Receipt Register has been made Obsoleted. 


The Unapplied and Unresolved Receipts Register is a new RXI report which gives you the ability to change the columns on the report as needed with the Report eXchange Designer responsibility."

Query To Fetch AP Invoice Details From SO Number(Doc ID 2949013.1)

SELECT dh.source_order_number       ,df.source_line_number as so_line_number   ,df.fulfill_line_number    ,ddr.doc_user_key as po_number...