SAP K_VERSN_READ Function Module for Read Plan Version + Fiscal Year-Dependent Version Parameters (if necess.)
K_VERSN_READ is a standard k versn read SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Read Plan Version + Fiscal Year-Dependent Version Parameters (if necess.) 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 k versn read FM, simply by entering the name K_VERSN_READ into the relevant SAP transaction such as SE37 or SE38.
Function Group: RKSR
Program Name: SAPLRKSR
Main Program: SAPLRKSR
Appliation area: K
Release date: 13-Aug-1999
Mode(Normal, Remote etc): Normal Function Module
Update:

Function K_VERSN_READ 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 'K_VERSN_READ'"Read Plan Version + Fiscal Year-Dependent Version Parameters (if necess.).
EXPORTING
* I_GJAHR = '0000' "Fiscal Year
I_KOKRS = "Controlling Area
I_VERSN = "Version
* BYPASSING_BUFFER = "
* I_ACTVT = "Activity for Authorization Check
IMPORTING
E_TKA09 = "Master Table Versions
E_TKA07 = "Fiscal-Year Dependent Version Parameters
E_TKT09 = "Text on Version
EXCEPTIONS
NOT_FOUND = 1 NOT_FOUND_GJAHR = 2 NO_AUTHORITY = 3
IMPORTING Parameters details for K_VERSN_READ
I_GJAHR - Fiscal Year
Data type: CCSS-GJAHRDefault: '0000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_KOKRS - Controlling Area
Data type: CCSS-KOKRSOptional: No
Call by Reference: No ( called with pass by value option)
I_VERSN - Version
Data type: CCSS-VERSNOptional: No
Call by Reference: No ( called with pass by value option)
BYPASSING_BUFFER -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
I_ACTVT - Activity for Authorization Check
Data type: TACT-ACTVTOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for K_VERSN_READ
E_TKA09 - Master Table Versions
Data type: TKA09Optional: No
Call by Reference: No ( called with pass by value option)
E_TKA07 - Fiscal-Year Dependent Version Parameters
Data type: TKA07Optional: No
Call by Reference: No ( called with pass by value option)
E_TKT09 - Text on Version
Data type: TKT09Optional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NOT_FOUND - CO Area not Found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_FOUND_GJAHR - Control Parameters not Found for Fiscal Year
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_AUTHORITY - No Authorization for Version
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for K_VERSN_READ 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_e_tka09 | TYPE TKA09, " | |||
| lv_i_gjahr | TYPE CCSS-GJAHR, " '0000' | |||
| lv_not_found | TYPE CCSS, " | |||
| lv_e_tka07 | TYPE TKA07, " | |||
| lv_i_kokrs | TYPE CCSS-KOKRS, " | |||
| lv_not_found_gjahr | TYPE CCSS, " | |||
| lv_e_tkt09 | TYPE TKT09, " | |||
| lv_i_versn | TYPE CCSS-VERSN, " | |||
| lv_no_authority | TYPE CCSS, " | |||
| lv_bypassing_buffer | TYPE CCSS, " | |||
| lv_i_actvt | TYPE TACT-ACTVT. " |
|   CALL FUNCTION 'K_VERSN_READ' "Read Plan Version + Fiscal Year-Dependent Version Parameters (if necess.) |
| EXPORTING | ||
| I_GJAHR | = lv_i_gjahr | |
| I_KOKRS | = lv_i_kokrs | |
| I_VERSN | = lv_i_versn | |
| BYPASSING_BUFFER | = lv_bypassing_buffer | |
| I_ACTVT | = lv_i_actvt | |
| IMPORTING | ||
| E_TKA09 | = lv_e_tka09 | |
| E_TKA07 | = lv_e_tka07 | |
| E_TKT09 | = lv_e_tkt09 | |
| EXCEPTIONS | ||
| NOT_FOUND = 1 | ||
| NOT_FOUND_GJAHR = 2 | ||
| NO_AUTHORITY = 3 | ||
| . " K_VERSN_READ | ||
ABAP code using 7.40 inline data declarations to call FM K_VERSN_READ
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 GJAHR FROM CCSS INTO @DATA(ld_i_gjahr). | ||||
| DATA(ld_i_gjahr) | = '0000'. | |||
| "SELECT single KOKRS FROM CCSS INTO @DATA(ld_i_kokrs). | ||||
| "SELECT single VERSN FROM CCSS INTO @DATA(ld_i_versn). | ||||
| "SELECT single ACTVT FROM TACT INTO @DATA(ld_i_actvt). | ||||
Search for further information about these or an SAP related objects