SAP BKK_CLOSING_CHECK Function Module for BCA: Consistency Check on Data for Account Time Periods
BKK_CLOSING_CHECK is a standard bkk closing check SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for BCA: Consistency Check on Data for Account Time Periods processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for bkk closing check FM, simply by entering the name BKK_CLOSING_CHECK into the relevant SAP transaction such as SE37 or SE38.
Function Group: FBM5
Program Name: SAPLFBM5
Main Program: SAPLFBM5
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function BKK_CLOSING_CHECK pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'BKK_CLOSING_CHECK'"BCA: Consistency Check on Data for Account Time Periods.
EXPORTING
* I_BKKRS = "
* I_CALENDAR1 = "Public Holiday Calendar ID 1
* I_CALENDAR2 = "Public Holiday Calendar ID 2
* I_ACNUM_EXT = "Account number for current account
I_CLOS_TYP = "Balancing Type
I_PERIOD = "Period Length
I_PER_UNIT = "Period Unit
I_KEY_DATE = "Key Date
* I_REFDATE = SY-DATUM "Reference Date (See Long Text)
* I_XCHECKPAST = "See Long Text
* I_MH2_STEPL = "Line Index (See Long Text)
IMPORTING
E_FLG_CHECK_PAST = "Data element for domain BOOLE: TRUE (='X') and FALSE (=' ')
CHANGING
C_NEXT_DATE = "Next Due Date
EXCEPTIONS
MISSING_INPUT = 1 NEXT_DATE_IN_PAST = 2 INVALID_KEYDATE_PER_UNIT = 3 KEY_DATE_MISSING = 4 INVALID_CLOS_TYPE = 5 INVALID_PERIOD_UNIT = 6
IMPORTING Parameters details for BKK_CLOSING_CHECK
I_BKKRS -
Data type: TBKK01-BKKRSOptional: Yes
Call by Reference: No ( called with pass by value option)
I_CALENDAR1 - Public Holiday Calendar ID 1
Data type: IBKK42-CAL_ID1Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CALENDAR2 - Public Holiday Calendar ID 2
Data type: IBKK42-CAL_ID2Optional: Yes
Call by Reference: No ( called with pass by value option)
I_ACNUM_EXT - Account number for current account
Data type: BKK_ACEXTOptional: Yes
Call by Reference: Yes
I_CLOS_TYP - Balancing Type
Data type: IBKKM7-CLOS_TYPOptional: No
Call by Reference: No ( called with pass by value option)
I_PERIOD - Period Length
Data type: IBKKM7-PERIODOptional: No
Call by Reference: No ( called with pass by value option)
I_PER_UNIT - Period Unit
Data type: IBKKM7-PER_UNITOptional: No
Call by Reference: No ( called with pass by value option)
I_KEY_DATE - Key Date
Data type: IBKKM7-KEY_DATEOptional: No
Call by Reference: No ( called with pass by value option)
I_REFDATE - Reference Date (See Long Text)
Data type: IBKKM4-NEXT_DATEDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_XCHECKPAST - See Long Text
Data type: BOOLE-BOOLEOptional: Yes
Call by Reference: No ( called with pass by value option)
I_MH2_STEPL - Line Index (See Long Text)
Data type: SY-STEPLOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BKK_CLOSING_CHECK
E_FLG_CHECK_PAST - Data element for domain BOOLE: TRUE (='X') and FALSE (=' ')
Data type: BOOLE-BOOLEOptional: No
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for BKK_CLOSING_CHECK
C_NEXT_DATE - Next Due Date
Data type: IBKKM4-NEXT_DATEOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
MISSING_INPUT - Data Incomplete
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NEXT_DATE_IN_PAST - Next Balancing Date in Past
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_KEYDATE_PER_UNIT - Invalid Period Unit for Key Date Specification
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
KEY_DATE_MISSING - Key Date Missing
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_CLOS_TYPE - Invalid Balancing Type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_PERIOD_UNIT - Invalid Period Unit for Balancing Type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BKK_CLOSING_CHECK Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_i_bkkrs | TYPE TBKK01-BKKRS, " | |||
| lv_c_next_date | TYPE IBKKM4-NEXT_DATE, " | |||
| lv_missing_input | TYPE IBKKM4, " | |||
| lv_e_flg_check_past | TYPE BOOLE-BOOLE, " | |||
| lv_i_calendar1 | TYPE IBKK42-CAL_ID1, " | |||
| lv_i_calendar2 | TYPE IBKK42-CAL_ID2, " | |||
| lv_i_acnum_ext | TYPE BKK_ACEXT, " | |||
| lv_next_date_in_past | TYPE BKK_ACEXT, " | |||
| lv_i_clos_typ | TYPE IBKKM7-CLOS_TYP, " | |||
| lv_invalid_keydate_per_unit | TYPE IBKKM7, " | |||
| lv_i_period | TYPE IBKKM7-PERIOD, " | |||
| lv_key_date_missing | TYPE IBKKM7, " | |||
| lv_i_per_unit | TYPE IBKKM7-PER_UNIT, " | |||
| lv_invalid_clos_type | TYPE IBKKM7, " | |||
| lv_i_key_date | TYPE IBKKM7-KEY_DATE, " | |||
| lv_invalid_period_unit | TYPE IBKKM7, " | |||
| lv_i_refdate | TYPE IBKKM4-NEXT_DATE, " SY-DATUM | |||
| lv_i_xcheckpast | TYPE BOOLE-BOOLE, " | |||
| lv_i_mh2_stepl | TYPE SY-STEPL. " |
|   CALL FUNCTION 'BKK_CLOSING_CHECK' "BCA: Consistency Check on Data for Account Time Periods |
| EXPORTING | ||
| I_BKKRS | = lv_i_bkkrs | |
| I_CALENDAR1 | = lv_i_calendar1 | |
| I_CALENDAR2 | = lv_i_calendar2 | |
| I_ACNUM_EXT | = lv_i_acnum_ext | |
| I_CLOS_TYP | = lv_i_clos_typ | |
| I_PERIOD | = lv_i_period | |
| I_PER_UNIT | = lv_i_per_unit | |
| I_KEY_DATE | = lv_i_key_date | |
| I_REFDATE | = lv_i_refdate | |
| I_XCHECKPAST | = lv_i_xcheckpast | |
| I_MH2_STEPL | = lv_i_mh2_stepl | |
| IMPORTING | ||
| E_FLG_CHECK_PAST | = lv_e_flg_check_past | |
| CHANGING | ||
| C_NEXT_DATE | = lv_c_next_date | |
| EXCEPTIONS | ||
| MISSING_INPUT = 1 | ||
| NEXT_DATE_IN_PAST = 2 | ||
| INVALID_KEYDATE_PER_UNIT = 3 | ||
| KEY_DATE_MISSING = 4 | ||
| INVALID_CLOS_TYPE = 5 | ||
| INVALID_PERIOD_UNIT = 6 | ||
| . " BKK_CLOSING_CHECK | ||
ABAP code using 7.40 inline data declarations to call FM BKK_CLOSING_CHECK
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single BKKRS FROM TBKK01 INTO @DATA(ld_i_bkkrs). | ||||
| "SELECT single NEXT_DATE FROM IBKKM4 INTO @DATA(ld_c_next_date). | ||||
| "SELECT single BOOLE FROM BOOLE INTO @DATA(ld_e_flg_check_past). | ||||
| "SELECT single CAL_ID1 FROM IBKK42 INTO @DATA(ld_i_calendar1). | ||||
| "SELECT single CAL_ID2 FROM IBKK42 INTO @DATA(ld_i_calendar2). | ||||
| "SELECT single CLOS_TYP FROM IBKKM7 INTO @DATA(ld_i_clos_typ). | ||||
| "SELECT single PERIOD FROM IBKKM7 INTO @DATA(ld_i_period). | ||||
| "SELECT single PER_UNIT FROM IBKKM7 INTO @DATA(ld_i_per_unit). | ||||
| "SELECT single KEY_DATE FROM IBKKM7 INTO @DATA(ld_i_key_date). | ||||
| "SELECT single NEXT_DATE FROM IBKKM4 INTO @DATA(ld_i_refdate). | ||||
| DATA(ld_i_refdate) | = SY-DATUM. | |||
| "SELECT single BOOLE FROM BOOLE INTO @DATA(ld_i_xcheckpast). | ||||
| "SELECT single STEPL FROM SY INTO @DATA(ld_i_mh2_stepl). | ||||
Search for further information about these or an SAP related objects