0% found this document useful (0 votes)
74 views1 page

Period Status

This SQL query joins data from three tables to retrieve information about accounting periods for different applications and sets of books. It selects the name of the set of books, product code, period name, start and end dates, and status. The status is decoded as open, never opened, future enterable or closed. It filters for two application IDs, joins on the set of books ID, and limits the results to periods with an adjustment flag of 'N' and between two dates.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views1 page

Period Status

This SQL query joins data from three tables to retrieve information about accounting periods for different applications and sets of books. It selects the name of the set of books, product code, period name, start and end dates, and status. The status is decoded as open, never opened, future enterable or closed. It filters for two application IDs, joins on the set of books ID, and limits the results to periods with an adjustment flag of 'N' and between two dates.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

SELECT sob.

name "Set of Books" ,


fnd.product_code "Product Code" ,
ps.PERIOD_NAME "Period Name" ,
ps.START_DATE "Period Start Date" ,
ps.END_DATE "Period End Date" ,
DECODE(ps.closing_status, 'O','O - Open' ,
'N','N - Never Opened' ,
'F','F - Future Enterable' ,
'C','C - Closed' ,'Unknown') "Period Status"
FROM gl_period_statuses ps ,
GL_SETS_OF_BOOKS sob ,
FND_APPLICATION_VL fnd
WHERE ps.application_id IN (200,222) -- GL & PO
AND sob.SET_OF_BOOKS_ID = ps.SET_OF_BOOKS_ID
AND fnd.application_id = ps.application_id
AND ps.adjustment_period_flag = 'N'
AND ('31-MAR-2020' -- Comment line if a a date other than SYSDATE is being tested.
--AND ('01-DEC-2014' -- Uncomment line if a date other than SYSDATE is being
tested.
BETWEEN TRUNC(ps.start_date) AND TRUNC (ps.end_date))
ORDER BY ps.SET_OF_BOOKS_ID,
fnd.product_code,
ps.start_date;

select fa.application_name,gl.name
ledger_name,gps.period_name,closing_status,period_year,gps.start_date
period_start_date,gps.end_date period_end_date
from gl_period_statuses gps,gl_ledgers gl,fnd_application_tl fa
where gps.application_id in (101,200,222)
and gps.set_of_books_id = gl.ledger_id
and LEDGER_CATEGORY_CODE = 'PRIMARY'
and PERIOD_YEAR = 2021
and gps.application_id = fa.application_id
and fa.language = 'US'
and CLOSING_STATUS = 'O'
order by 1,2,3

You might also like