SAP SPC_GET_VAR_TABLE Function Module for command to read the variant table
SPC_GET_VAR_TABLE is a standard spc get var table SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for command to read the variant table 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 spc get var table FM, simply by entering the name SPC_GET_VAR_TABLE into the relevant SAP transaction such as SE37 or SE38.
Function Group: SPC_DEPRECATED
Program Name: SAPLSPC_DEPRECATED
Main Program: SAPLSPC_DEPRECATED
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled JAVA Module
Update:

Function SPC_GET_VAR_TABLE 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 'SPC_GET_VAR_TABLE'"command to read the variant table.
EXPORTING
IV_DOCUMENT_ID = "Pricing Document GUID
IV_ITEM_ID = "ipc item id
* IV_TAB_NAME = "variant table name
* IT_NAME_CSTICS = "table for characteristic names
* IV_FILTER_NAME = "String
* IV_FILTER_VALUE = "String
* IV_FILTER_DEFAULT = "String
IMPORTING
EV_TAB_NAME = "String
ET_CSTICS_NAMES = "table for characteristic names
ET_CSTICS_VALUES = "table for characteristic values
IMPORTING Parameters details for SPC_GET_VAR_TABLE
IV_DOCUMENT_ID - Pricing Document GUID
Data type: PRCT_PRIDOC_GUIDOptional: No
Call by Reference: No ( called with pass by value option)
IV_ITEM_ID - ipc item id
Data type: PRCT_PRIDOC_GUIDOptional: No
Call by Reference: No ( called with pass by value option)
IV_TAB_NAME - variant table name
Data type: SYSTRINGOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_NAME_CSTICS - table for characteristic names
Data type: COMT_CSTIC_NAMES_TABOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_FILTER_NAME - String
Data type: SYSTRINGOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_FILTER_VALUE - String
Data type: SYSTRINGOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_FILTER_DEFAULT - String
Data type: SYSTRINGOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SPC_GET_VAR_TABLE
EV_TAB_NAME - String
Data type: SYSTRINGOptional: No
Call by Reference: No ( called with pass by value option)
ET_CSTICS_NAMES - table for characteristic names
Data type: COMT_CSTIC_NAMES_TABOptional: No
Call by Reference: No ( called with pass by value option)
ET_CSTICS_VALUES - table for characteristic values
Data type: COMT_CSTIC_VALUES_TABOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SPC_GET_VAR_TABLE 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_ev_tab_name | TYPE SYSTRING, " | |||
| lv_iv_document_id | TYPE PRCT_PRIDOC_GUID, " | |||
| lv_iv_item_id | TYPE PRCT_PRIDOC_GUID, " | |||
| lv_et_cstics_names | TYPE COMT_CSTIC_NAMES_TAB, " | |||
| lv_iv_tab_name | TYPE SYSTRING, " | |||
| lv_et_cstics_values | TYPE COMT_CSTIC_VALUES_TAB, " | |||
| lv_it_name_cstics | TYPE COMT_CSTIC_NAMES_TAB, " | |||
| lv_iv_filter_name | TYPE SYSTRING, " | |||
| lv_iv_filter_value | TYPE SYSTRING, " | |||
| lv_iv_filter_default | TYPE SYSTRING. " |
|   CALL FUNCTION 'SPC_GET_VAR_TABLE' "command to read the variant table |
| EXPORTING | ||
| IV_DOCUMENT_ID | = lv_iv_document_id | |
| IV_ITEM_ID | = lv_iv_item_id | |
| IV_TAB_NAME | = lv_iv_tab_name | |
| IT_NAME_CSTICS | = lv_it_name_cstics | |
| IV_FILTER_NAME | = lv_iv_filter_name | |
| IV_FILTER_VALUE | = lv_iv_filter_value | |
| IV_FILTER_DEFAULT | = lv_iv_filter_default | |
| IMPORTING | ||
| EV_TAB_NAME | = lv_ev_tab_name | |
| ET_CSTICS_NAMES | = lv_et_cstics_names | |
| ET_CSTICS_VALUES | = lv_et_cstics_values | |
| . " SPC_GET_VAR_TABLE | ||
ABAP code using 7.40 inline data declarations to call FM SPC_GET_VAR_TABLE
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.Search for further information about these or an SAP related objects