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’   2024 ‘009’   CHANGING LV_FLAG_OPEN.

 

*&———————————————————————*
*& Form FRM_CHECK_OPEN
*&———————————————————————*
*& When Opened, CV_OPEN equal to ‘X’.
*&———————————————————————*
FORM FRM_CHECK_OPEN USING    UV_BUKRS
UV_YEAR
UV_MONTH
CHANGING CV_OPEN.
DATA LV_MONTH TYPE  T001BFRPE1.
CLEAR CV_OPEN.

CHECK UV_BUKRS IN S_CODE[].

LV_MONTH UV_MONTH.

DATA LV_RET TYPE T001BFRPE1.
CALL FUNCTION ‘FI_PERIOD_CHECK’
EXPORTING
I_BUKRS          UV_BUKRS
*     I_OPVAR          = ‘ ‘
I_GJAHR          UV_YEAR
I_KOART          ‘+’
I_KONTO          ‘+’
I_MONAT          LV_MONTH
*     I_SPERI          =
*     I_RLDNR          =
I_GLVOR          ‘RFBU’
*     I_LDGRP          =
*     I_CBTTYPE        =
I_CLOSINGSTEP    ‘000’
IMPORTING
E_OPER           LV_RET
EXCEPTIONS
ERROR_PERIOD     1
ERROR_PERIOD_ACC 2
INVALID_INPUT    3
OTHERS           4.
IF SYSUBRC 0.
CV_OPEN ‘X’.
ENDIF.

ENDFORM.

 

About me:

This post is come from www.hot583.com, you can share/use it with the post  original link for free.

But pay attention of any  risk yourself.

微信原文《The End》

今日热点在看SAP HOT583