How to Check FI period opended/closed use SAP ABAP

Sometimes, We need to check whether the FI period of Tcode FO-2/FB01. After debuging, We find a stand FM to check this, below is the subroutine. You can config the period in tcode OB52/OB52B. Hope it is helpful for you.   Try to check whether company code AM01 on September 2024 opened/closed. PERFORM FRM_CHECK_OPEN USING ‘AM01’