SAP G_PERIOD_ALLOWED_CHECK Function Module for Check open posting periods
G_PERIOD_ALLOWED_CHECK is a standard g period allowed 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 Check open posting 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 g period allowed check FM, simply by entering the name G_PERIOD_ALLOWED_CHECK into the relevant SAP transaction such as SE37 or SE38.
Function Group: GUPD
Program Name: SAPLGUPD
Main Program: SAPLGUPD
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function G_PERIOD_ALLOWED_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 'G_PERIOD_ALLOWED_CHECK'"Check open posting periods.
EXPORTING
* ACCOUNT_TYPE = 'G' "Account type
* COMPANY = ' ' "Company
* GLOBAL_COMPANY = ' ' "
PERIOD = "Posting period
* PERIV_COMPANY = ' ' "
* PERIV_LEDGER = ' ' "
RECORD_TYPE = "Record type
* TO_ACCOUNT = ' ' "To account
YEAR = "Fiscal year
EXCEPTIONS
PERIOD_NOT_ALLOWED = 1 NOT_AUTHORIZED = 2
IMPORTING Parameters details for G_PERIOD_ALLOWED_CHECK
ACCOUNT_TYPE - Account type
Data type: T001B-MKOARDefault: 'G'
Optional: Yes
Call by Reference: No ( called with pass by value option)
COMPANY - Company
Data type: T001B-BUKRSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
GLOBAL_COMPANY -
Data type: T880-RCOMPDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PERIOD - Posting period
Data type: T001B-FRPE1Optional: No
Call by Reference: No ( called with pass by value option)
PERIV_COMPANY -
Data type: T001-PERIVDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PERIV_LEDGER -
Data type: T882-PERIVDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
RECORD_TYPE - Record type
Data type: T001B-RRCTYOptional: No
Call by Reference: No ( called with pass by value option)
TO_ACCOUNT - To account
Data type: T001B-BKONTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
YEAR - Fiscal year
Data type: T001B-FRYE1Optional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
PERIOD_NOT_ALLOWED - Posting period is not allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_AUTHORIZED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for G_PERIOD_ALLOWED_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_account_type | TYPE T001B-MKOAR, " 'G' | |||
| lv_period_not_allowed | TYPE T001B, " | |||
| lv_company | TYPE T001B-BUKRS, " SPACE | |||
| lv_not_authorized | TYPE T001B, " | |||
| lv_global_company | TYPE T880-RCOMP, " SPACE | |||
| lv_period | TYPE T001B-FRPE1, " | |||
| lv_periv_company | TYPE T001-PERIV, " SPACE | |||
| lv_periv_ledger | TYPE T882-PERIV, " SPACE | |||
| lv_record_type | TYPE T001B-RRCTY, " | |||
| lv_to_account | TYPE T001B-BKONT, " SPACE | |||
| lv_year | TYPE T001B-FRYE1. " |
|   CALL FUNCTION 'G_PERIOD_ALLOWED_CHECK' "Check open posting periods |
| EXPORTING | ||
| ACCOUNT_TYPE | = lv_account_type | |
| COMPANY | = lv_company | |
| GLOBAL_COMPANY | = lv_global_company | |
| PERIOD | = lv_period | |
| PERIV_COMPANY | = lv_periv_company | |
| PERIV_LEDGER | = lv_periv_ledger | |
| RECORD_TYPE | = lv_record_type | |
| TO_ACCOUNT | = lv_to_account | |
| YEAR | = lv_year | |
| EXCEPTIONS | ||
| PERIOD_NOT_ALLOWED = 1 | ||
| NOT_AUTHORIZED = 2 | ||
| . " G_PERIOD_ALLOWED_CHECK | ||
ABAP code using 7.40 inline data declarations to call FM G_PERIOD_ALLOWED_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 MKOAR FROM T001B INTO @DATA(ld_account_type). | ||||
| DATA(ld_account_type) | = 'G'. | |||
| "SELECT single BUKRS FROM T001B INTO @DATA(ld_company). | ||||
| DATA(ld_company) | = ' '. | |||
| "SELECT single RCOMP FROM T880 INTO @DATA(ld_global_company). | ||||
| DATA(ld_global_company) | = ' '. | |||
| "SELECT single FRPE1 FROM T001B INTO @DATA(ld_period). | ||||
| "SELECT single PERIV FROM T001 INTO @DATA(ld_periv_company). | ||||
| DATA(ld_periv_company) | = ' '. | |||
| "SELECT single PERIV FROM T882 INTO @DATA(ld_periv_ledger). | ||||
| DATA(ld_periv_ledger) | = ' '. | |||
| "SELECT single RRCTY FROM T001B INTO @DATA(ld_record_type). | ||||
| "SELECT single BKONT FROM T001B INTO @DATA(ld_to_account). | ||||
| DATA(ld_to_account) | = ' '. | |||
| "SELECT single FRYE1 FROM T001B INTO @DATA(ld_year). | ||||
Search for further information about these or an SAP related objects