Monday, 16 December 2013

Find Accounting Period Status

------------------------------------------------------------------------------------------------
--AUTHOR: LOKANADHAM
------------------------------------------------------------------------------------------------
SELECT   gs.period_name, gs.period_num period_number,
         gs.period_year fiscal_year,
         TO_CHAR (gs.start_date, 'DD-MON-YYYY') start_date,
         TO_CHAR (gs.end_date, 'DD-MON-YYYY') end_date, fa.application_name,
         DECODE (gs.closing_status,
                 'C', 'Closed',
                 'O', 'Open',
                 'F', 'Future',
                 'W', 'Closed Pending',
                 'N', 'Never Opened',
                 'P', 'Permanently Closed'
                ) "PERIOD_STATUS",
         fu.user_name || '  *** ' || 'Full Name:'
         || fu.description who_updated,
         TO_CHAR (gs.last_update_date, 'DD-MON-YYYY HH24:MM:SS') updated_on,
         fu.email_address, gs.last_updated_by
    FROM gl.gl_period_statuses gs, apps.fnd_application_tl fa, fnd_user fu
   WHERE fa.application_id = gs.application_id
     AND gs.set_of_books_id = '2021'
     AND gs.last_updated_by = fu.user_id
     AND gs.period_name = UPPER (:period)
GROUP BY period_name,
         application_name,
         gs.closing_status,
         gs.last_updated_by,
         gs.last_update_date,
         gs.last_update_login,
         gs.period_name,
         gs.closing_status,
         gs.period_num,
         gs.period_year,
         gs.start_date,
         gs.end_date,
         fu.user_name,
         fu.description,
         fu.email_address

ORDER BY gs.period_name, fa.application_name

Output: