SAP KBPS_GET_PERIODS Function Module for Determination periods and period blocks budget / planning
KBPS_GET_PERIODS is a standard kbps get periods SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Determination periods and period blocks budget / planning 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 kbps get periods FM, simply by entering the name KBPS_GET_PERIODS into the relevant SAP transaction such as SE37 or SE38.
Function Group: KBPS
Program Name: SAPLKBPS
Main Program: SAPLKBPS
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function KBPS_GET_PERIODS 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 'KBPS_GET_PERIODS'"Determination periods and period blocks budget / planning.
EXPORTING
FIKRS = "Financial management area
* FIKRS_CA_PERIV = ' ' "Period version in FM01-CA_PERIV
* FIKRS_PERIV = ' ' "Period version in FM01-PERIV
KOKRS = "Controlling area
* GJAHR = "Fiscal Year
IMPORTING
PERBL = "Number of period blocks
PERIO = "Number of periods
EXCEPTIONS
NO_PARAMETERS = 1
IMPORTING Parameters details for KBPS_GET_PERIODS
FIKRS - Financial management area
Data type: FM01-FIKRSOptional: No
Call by Reference: No ( called with pass by value option)
FIKRS_CA_PERIV - Period version in FM01-CA_PERIV
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FIKRS_PERIV - Period version in FM01-PERIV
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
KOKRS - Controlling area
Data type: TKA01-KOKRSOptional: No
Call by Reference: No ( called with pass by value option)
GJAHR - Fiscal Year
Data type: T009Y-GJAHROptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for KBPS_GET_PERIODS
PERBL - Number of period blocks
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
PERIO - Number of periods
Data type: T009-ANZBPOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_PARAMETERS - Do Not Pass Any Parameters
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for KBPS_GET_PERIODS 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_fikrs | TYPE FM01-FIKRS, " | |||
| lv_perbl | TYPE FM01, " | |||
| lv_no_parameters | TYPE FM01, " | |||
| lv_perio | TYPE T009-ANZBP, " | |||
| lv_fikrs_ca_periv | TYPE T009, " SPACE | |||
| lv_fikrs_periv | TYPE T009, " SPACE | |||
| lv_kokrs | TYPE TKA01-KOKRS, " | |||
| lv_gjahr | TYPE T009Y-GJAHR. " |
|   CALL FUNCTION 'KBPS_GET_PERIODS' "Determination periods and period blocks budget / planning |
| EXPORTING | ||
| FIKRS | = lv_fikrs | |
| FIKRS_CA_PERIV | = lv_fikrs_ca_periv | |
| FIKRS_PERIV | = lv_fikrs_periv | |
| KOKRS | = lv_kokrs | |
| GJAHR | = lv_gjahr | |
| IMPORTING | ||
| PERBL | = lv_perbl | |
| PERIO | = lv_perio | |
| EXCEPTIONS | ||
| NO_PARAMETERS = 1 | ||
| . " KBPS_GET_PERIODS | ||
ABAP code using 7.40 inline data declarations to call FM KBPS_GET_PERIODS
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 FIKRS FROM FM01 INTO @DATA(ld_fikrs). | ||||
| "SELECT single ANZBP FROM T009 INTO @DATA(ld_perio). | ||||
| DATA(ld_fikrs_ca_periv) | = ' '. | |||
| DATA(ld_fikrs_periv) | = ' '. | |||
| "SELECT single KOKRS FROM TKA01 INTO @DATA(ld_kokrs). | ||||
| "SELECT single GJAHR FROM T009Y INTO @DATA(ld_gjahr). | ||||
Search for further information about these or an SAP related objects