SAP LVC_VARIANT_SAVE_LOAD Function Module for
LVC_VARIANT_SAVE_LOAD is a standard lvc variant save load 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 lvc variant save load FM, simply by entering the name LVC_VARIANT_SAVE_LOAD into the relevant SAP transaction such as SE37 or SE38.
Function Group: SLVC_DIALOG
Program Name: SAPLSLVC_DIALOG
Main Program: SAPLSLVC_DIALOG
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function LVC_VARIANT_SAVE_LOAD 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 'LVC_VARIANT_SAVE_LOAD'".
EXPORTING
* I_TITLE = "Dialog box title
* I_DEFAULT = 'X' "
* I_NO_REPTEXT_OPTIMIZE = 'X' "
* I_DIALOG = 'X' "
* IR_TO_CL_ALV_BDS = "
* IR_TO_CL_ALV_VARIANT = "
* I_BYPASSING_BUFFER = "Ignore All Buffers?
* I_BUFFER_ACTIVE = "Activate Buffer A?
* I_FCAT_COMPLETE = "
* I_SCREEN_START_COLUMN = 0 "Coordinates for list in dialog box
* I_SCREEN_START_LINE = 0 "Coordinates for list in dialog box
* I_SCREEN_END_COLUMN = 0 "Coordinates for list in dialog box
* I_SCREEN_END_LINE = 0 "Coordinates for list in dialog box
* I_SAVE_LOAD = 'L' "
* I_TOOL = 'LT' "
* I_TABNAME = '1' "
* I_USER_SPECIFIC = ' ' "
IMPORTING
ES_SELFIELD = "Selection info for simple selection
E_BDS_SAVE = "
E_GRAPHICS_SAVE = "
E_EXIT = "'X' = Cancel by user
CHANGING
CS_VARIANT = "Layout (External Use)
* CS_LAYOUT = "Field Catalog for List Viewer Control
* CT_FIELDCAT = "Field Catalog for List Viewer Control
* CT_DEFAULT_FIELDCAT = "Field Catalog for List Viewer Control
* CT_SORT = "ALV control: Table of Sort Criteria
* CT_FILTER = "ALV Control: Table of Filter Conditions
* CT_GROUPLEVELS_FILTER = "ALV Control: Group Level Index
* C_SUMLEVEL = "Summation level
TABLES
* IT_DATA = "
EXCEPTIONS
NOT_FOUND = 1 WRONG_INPUT = 2 FC_NOT_COMPLETE = 3
IMPORTING Parameters details for LVC_VARIANT_SAVE_LOAD
I_TITLE - Dialog box title
Data type: SY-TITLEOptional: Yes
Call by Reference: No ( called with pass by value option)
I_DEFAULT -
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_NO_REPTEXT_OPTIMIZE -
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_DIALOG -
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IR_TO_CL_ALV_BDS -
Data type: CL_ALV_BDSOptional: Yes
Call by Reference: Yes
IR_TO_CL_ALV_VARIANT -
Data type: CL_ALV_VARIANTOptional: Yes
Call by Reference: Yes
I_BYPASSING_BUFFER - Ignore All Buffers?
Data type: CHAR01Optional: Yes
Call by Reference: No ( called with pass by value option)
I_BUFFER_ACTIVE - Activate Buffer A?
Data type: CHAR01Optional: Yes
Call by Reference: No ( called with pass by value option)
I_FCAT_COMPLETE -
Data type: ABAP_BOOLOptional: Yes
Call by Reference: Yes
I_SCREEN_START_COLUMN - Coordinates for list in dialog box
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
I_SCREEN_START_LINE - Coordinates for list in dialog box
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
I_SCREEN_END_COLUMN - Coordinates for list in dialog box
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
I_SCREEN_END_LINE - Coordinates for list in dialog box
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
I_SAVE_LOAD -
Data type: CDefault: 'L'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_TOOL -
Data type: LTDX-RELIDDefault: 'LT'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_TABNAME -
Data type: KKBLO_TABNAMEDefault: '1'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_USER_SPECIFIC -
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for LVC_VARIANT_SAVE_LOAD
ES_SELFIELD - Selection info for simple selection
Data type: SLIS_SELFIELDOptional: No
Call by Reference: No ( called with pass by value option)
E_BDS_SAVE -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
E_GRAPHICS_SAVE -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
E_EXIT - 'X' = Cancel by user
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for LVC_VARIANT_SAVE_LOAD
CS_VARIANT - Layout (External Use)
Data type: DISVARIANTOptional: No
Call by Reference: Yes
CS_LAYOUT - Field Catalog for List Viewer Control
Data type: LVC_S_LAYOOptional: Yes
Call by Reference: Yes
CT_FIELDCAT - Field Catalog for List Viewer Control
Data type: LVC_T_FCATOptional: Yes
Call by Reference: Yes
CT_DEFAULT_FIELDCAT - Field Catalog for List Viewer Control
Data type: LVC_T_FCATOptional: Yes
Call by Reference: Yes
CT_SORT - ALV control: Table of Sort Criteria
Data type: LVC_T_SORTOptional: Yes
Call by Reference: Yes
CT_FILTER - ALV Control: Table of Filter Conditions
Data type: LVC_T_FILTOptional: Yes
Call by Reference: Yes
CT_GROUPLEVELS_FILTER - ALV Control: Group Level Index
Data type: LVC_T_GRPLOptional: Yes
Call by Reference: Yes
C_SUMLEVEL - Summation level
Data type: IOptional: Yes
Call by Reference: Yes
TABLES Parameters details for LVC_VARIANT_SAVE_LOAD
IT_DATA -
Data type:Optional: Yes
Call by Reference: Yes
EXCEPTIONS details
NOT_FOUND -
Data type:Optional: No
Call by Reference: Yes
WRONG_INPUT -
Data type:Optional: No
Call by Reference: Yes
FC_NOT_COMPLETE -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for LVC_VARIANT_SAVE_LOAD 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: | ||||
| lt_it_data | TYPE STANDARD TABLE OF STRING, " | |||
| lv_i_title | TYPE SY-TITLE, " | |||
| lv_not_found | TYPE SY, " | |||
| lv_cs_variant | TYPE DISVARIANT, " | |||
| lv_es_selfield | TYPE SLIS_SELFIELD, " | |||
| lv_i_default | TYPE C, " 'X' | |||
| lv_i_no_reptext_optimize | TYPE C, " 'X' | |||
| lv_i_dialog | TYPE C, " 'X' | |||
| lv_ir_to_cl_alv_bds | TYPE CL_ALV_BDS, " | |||
| lv_ir_to_cl_alv_variant | TYPE CL_ALV_VARIANT, " | |||
| lv_i_bypassing_buffer | TYPE CHAR01, " | |||
| lv_i_buffer_active | TYPE CHAR01, " | |||
| lv_i_fcat_complete | TYPE ABAP_BOOL, " | |||
| lv_cs_layout | TYPE LVC_S_LAYO, " | |||
| lv_e_bds_save | TYPE C, " | |||
| lv_wrong_input | TYPE C, " | |||
| lv_i_screen_start_column | TYPE I, " 0 | |||
| lv_ct_fieldcat | TYPE LVC_T_FCAT, " | |||
| lv_e_graphics_save | TYPE C, " | |||
| lv_fc_not_complete | TYPE C, " | |||
| lv_i_screen_start_line | TYPE I, " 0 | |||
| lv_e_exit | TYPE C, " | |||
| lv_ct_default_fieldcat | TYPE LVC_T_FCAT, " | |||
| lv_i_screen_end_column | TYPE I, " 0 | |||
| lv_ct_sort | TYPE LVC_T_SORT, " | |||
| lv_i_screen_end_line | TYPE I, " 0 | |||
| lv_ct_filter | TYPE LVC_T_FILT, " | |||
| lv_i_save_load | TYPE C, " 'L' | |||
| lv_i_tool | TYPE LTDX-RELID, " 'LT' | |||
| lv_ct_grouplevels_filter | TYPE LVC_T_GRPL, " | |||
| lv_i_tabname | TYPE KKBLO_TABNAME, " '1' | |||
| lv_c_sumlevel | TYPE I, " | |||
| lv_i_user_specific | TYPE C. " SPACE |
|   CALL FUNCTION 'LVC_VARIANT_SAVE_LOAD' " |
| EXPORTING | ||
| I_TITLE | = lv_i_title | |
| I_DEFAULT | = lv_i_default | |
| I_NO_REPTEXT_OPTIMIZE | = lv_i_no_reptext_optimize | |
| I_DIALOG | = lv_i_dialog | |
| IR_TO_CL_ALV_BDS | = lv_ir_to_cl_alv_bds | |
| IR_TO_CL_ALV_VARIANT | = lv_ir_to_cl_alv_variant | |
| I_BYPASSING_BUFFER | = lv_i_bypassing_buffer | |
| I_BUFFER_ACTIVE | = lv_i_buffer_active | |
| I_FCAT_COMPLETE | = lv_i_fcat_complete | |
| I_SCREEN_START_COLUMN | = lv_i_screen_start_column | |
| I_SCREEN_START_LINE | = lv_i_screen_start_line | |
| I_SCREEN_END_COLUMN | = lv_i_screen_end_column | |
| I_SCREEN_END_LINE | = lv_i_screen_end_line | |
| I_SAVE_LOAD | = lv_i_save_load | |
| I_TOOL | = lv_i_tool | |
| I_TABNAME | = lv_i_tabname | |
| I_USER_SPECIFIC | = lv_i_user_specific | |
| IMPORTING | ||
| ES_SELFIELD | = lv_es_selfield | |
| E_BDS_SAVE | = lv_e_bds_save | |
| E_GRAPHICS_SAVE | = lv_e_graphics_save | |
| E_EXIT | = lv_e_exit | |
| CHANGING | ||
| CS_VARIANT | = lv_cs_variant | |
| CS_LAYOUT | = lv_cs_layout | |
| CT_FIELDCAT | = lv_ct_fieldcat | |
| CT_DEFAULT_FIELDCAT | = lv_ct_default_fieldcat | |
| CT_SORT | = lv_ct_sort | |
| CT_FILTER | = lv_ct_filter | |
| CT_GROUPLEVELS_FILTER | = lv_ct_grouplevels_filter | |
| C_SUMLEVEL | = lv_c_sumlevel | |
| TABLES | ||
| IT_DATA | = lt_it_data | |
| EXCEPTIONS | ||
| NOT_FOUND = 1 | ||
| WRONG_INPUT = 2 | ||
| FC_NOT_COMPLETE = 3 | ||
| . " LVC_VARIANT_SAVE_LOAD | ||
ABAP code using 7.40 inline data declarations to call FM LVC_VARIANT_SAVE_LOAD
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 TITLE FROM SY INTO @DATA(ld_i_title). | ||||
| DATA(ld_i_default) | = 'X'. | |||
| DATA(ld_i_no_reptext_optimize) | = 'X'. | |||
| DATA(ld_i_dialog) | = 'X'. | |||
| DATA(ld_i_save_load) | = 'L'. | |||
| "SELECT single RELID FROM LTDX INTO @DATA(ld_i_tool). | ||||
| DATA(ld_i_tool) | = 'LT'. | |||
| DATA(ld_i_tabname) | = '1'. | |||
| DATA(ld_i_user_specific) | = ' '. | |||
Search for further information about these or an SAP related objects