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 (101, 201) -- 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 (:p_date BETWEEN TRUNC (ps.start_date) AND TRUNC (ps.end_date))
ORDER BY ps.set_of_books_id, fnd.product_code, ps.start_date;
No comments:
Post a Comment