SAP K_VARIANCES_LIST_WRITE_RESULT Function Module for
K_VARIANCES_LIST_WRITE_RESULT is a standard k variances list write result SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 variances list write result FM, simply by entering the name K_VARIANCES_LIST_WRITE_RESULT into the relevant SAP transaction such as SE37 or SE38.
Function Group: KSS1
Program Name: SAPLKSS1
Main Program: SAPLKSS1
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:
![](https://www.se80.co.uk/training-education/wp-content/uploads/2019/07/normal-function-module.png)
Function K_VARIANCES_LIST_WRITE_RESULT 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_VARIANCES_LIST_WRITE_RESULT'".
EXPORTING
I_USER = "
I_KOKRS = "
* I_OBJ_VAR_ALV = "
* I_LOG_DATA = "
* I_TEST = "
* I_REPORT = "
I_DATA_SAVED = "
I_CUMUL = "
I_ERR_COUNT = "
I_ERR_MAX = "
I_GJAHR1 = "
* I_GJAHR2 = ' ' "
I_PERIO1 = "
* I_PERIO2 = ' ' "
IMPORTING
E_OBJNR_TBX = "
CHANGING
* C_VERSN = "
TABLES
RESULT = "
T_KV20A = "
IMPORTING Parameters details for K_VARIANCES_LIST_WRITE_RESULT
I_USER -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
I_KOKRS -
Data type: TKA00-KOKRSOptional: No
Call by Reference: No ( called with pass by value option)
I_OBJ_VAR_ALV -
Data type: OBJ_VAR_ALV_TABOptional: Yes
Call by Reference: Yes
I_LOG_DATA -
Data type: OBJ_LOG_DATAOptional: Yes
Call by Reference: Yes
I_TEST -
Data type: OBJ_VAR_GLOBAL-TESTOptional: Yes
Call by Reference: Yes
I_REPORT -
Data type: SYREPIDOptional: Yes
Call by Reference: Yes
I_DATA_SAVED -
Data type: SY-INPUTOptional: No
Call by Reference: No ( called with pass by value option)
I_CUMUL -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
I_ERR_COUNT -
Data type: KSS10-ERR_COUNTOptional: No
Call by Reference: No ( called with pass by value option)
I_ERR_MAX -
Data type: KSS10-ERR_MAXOptional: No
Call by Reference: No ( called with pass by value option)
I_GJAHR1 -
Data type: KSS10-GJAHR1Optional: No
Call by Reference: No ( called with pass by value option)
I_GJAHR2 -
Data type: KSS10-GJAHR2Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_PERIO1 -
Data type: KSS10-PERIO1Optional: No
Call by Reference: No ( called with pass by value option)
I_PERIO2 -
Data type: KSS10-PERIO2Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for K_VARIANCES_LIST_WRITE_RESULT
E_OBJNR_TBX -
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for K_VARIANCES_LIST_WRITE_RESULT
C_VERSN -
Data type: KSS10-AWVRSOptional: Yes
Call by Reference: Yes
TABLES Parameters details for K_VARIANCES_LIST_WRITE_RESULT
RESULT -
Data type: KSS03Optional: No
Call by Reference: No ( called with pass by value option)
T_KV20A -
Data type: KV20AOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for K_VARIANCES_LIST_WRITE_RESULT 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_user | TYPE C, " | |||
lt_result | TYPE STANDARD TABLE OF KSS03, " | |||
lv_c_versn | TYPE KSS10-AWVRS, " | |||
lv_e_objnr_tbx | TYPE SY-TABIX, " | |||
lv_i_kokrs | TYPE TKA00-KOKRS, " | |||
lv_i_obj_var_alv | TYPE OBJ_VAR_ALV_TAB, " | |||
lv_i_log_data | TYPE OBJ_LOG_DATA, " | |||
lv_i_test | TYPE OBJ_VAR_GLOBAL-TEST, " | |||
lv_i_report | TYPE SYREPID, " | |||
lt_t_kv20a | TYPE STANDARD TABLE OF KV20A, " | |||
lv_i_data_saved | TYPE SY-INPUT, " | |||
lv_i_cumul | TYPE C, " | |||
lv_i_err_count | TYPE KSS10-ERR_COUNT, " | |||
lv_i_err_max | TYPE KSS10-ERR_MAX, " | |||
lv_i_gjahr1 | TYPE KSS10-GJAHR1, " | |||
lv_i_gjahr2 | TYPE KSS10-GJAHR2, " SPACE | |||
lv_i_perio1 | TYPE KSS10-PERIO1, " | |||
lv_i_perio2 | TYPE KSS10-PERIO2. " SPACE |
  CALL FUNCTION 'K_VARIANCES_LIST_WRITE_RESULT' " |
EXPORTING | ||
I_USER | = lv_i_user | |
I_KOKRS | = lv_i_kokrs | |
I_OBJ_VAR_ALV | = lv_i_obj_var_alv | |
I_LOG_DATA | = lv_i_log_data | |
I_TEST | = lv_i_test | |
I_REPORT | = lv_i_report | |
I_DATA_SAVED | = lv_i_data_saved | |
I_CUMUL | = lv_i_cumul | |
I_ERR_COUNT | = lv_i_err_count | |
I_ERR_MAX | = lv_i_err_max | |
I_GJAHR1 | = lv_i_gjahr1 | |
I_GJAHR2 | = lv_i_gjahr2 | |
I_PERIO1 | = lv_i_perio1 | |
I_PERIO2 | = lv_i_perio2 | |
IMPORTING | ||
E_OBJNR_TBX | = lv_e_objnr_tbx | |
CHANGING | ||
C_VERSN | = lv_c_versn | |
TABLES | ||
RESULT | = lt_result | |
T_KV20A | = lt_t_kv20a | |
. " K_VARIANCES_LIST_WRITE_RESULT |
ABAP code using 7.40 inline data declarations to call FM K_VARIANCES_LIST_WRITE_RESULT
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 AWVRS FROM KSS10 INTO @DATA(ld_c_versn). | ||||
"SELECT single TABIX FROM SY INTO @DATA(ld_e_objnr_tbx). | ||||
"SELECT single KOKRS FROM TKA00 INTO @DATA(ld_i_kokrs). | ||||
"SELECT single TEST FROM OBJ_VAR_GLOBAL INTO @DATA(ld_i_test). | ||||
"SELECT single INPUT FROM SY INTO @DATA(ld_i_data_saved). | ||||
"SELECT single ERR_COUNT FROM KSS10 INTO @DATA(ld_i_err_count). | ||||
"SELECT single ERR_MAX FROM KSS10 INTO @DATA(ld_i_err_max). | ||||
"SELECT single GJAHR1 FROM KSS10 INTO @DATA(ld_i_gjahr1). | ||||
"SELECT single GJAHR2 FROM KSS10 INTO @DATA(ld_i_gjahr2). | ||||
DATA(ld_i_gjahr2) | = ' '. | |||
"SELECT single PERIO1 FROM KSS10 INTO @DATA(ld_i_perio1). | ||||
"SELECT single PERIO2 FROM KSS10 INTO @DATA(ld_i_perio2). | ||||
DATA(ld_i_perio2) | = ' '. | |||
Search for further information about these or an SAP related objects