SAP SPC_PRE_CHECK Function Module for NOTRANSL: Vorprüfungen für Selektionsbildeingaben zur Verkaufspreiskalkula
SPC_PRE_CHECK is a standard spc pre 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 NOTRANSL: Vorprüfungen für Selektionsbildeingaben zur Verkaufspreiskalkula 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 pre check FM, simply by entering the name SPC_PRE_CHECK into the relevant SAP transaction such as SE37 or SE38.
Function Group: WVK1
Program Name: SAPLWVK1
Main Program: SAPLWVK1
Appliation area: W
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:
Function SPC_PRE_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 'SPC_PRE_CHECK'"NOTRANSL: Vorprüfungen für Selektionsbildeingaben zur Verkaufspreiskalkula.
EXPORTING
PI_I_SPC = "
* PI_CHECK_EKERV = "
* PI_NO_CHECK_WERKS = "
IMPORTING
PE_I_SPC = "
PE_SEL_MATNR = "
PE_SEL_VKORG = "
PE_SEL_VTWEG = "
PE_SEL_WERKS = "
PE_SEL_PLTYP = "
PE_SEL_FILGR = "
CHANGING
* SO_MATNR = "
* SO_VKORG = "
* SO_VTWEG = "
* SO_WERKS = "
* SO_PLTYP = "
* SO_FILGR = "
TABLES
* PE_T_XT001W = "
* PE_T_XTVKOV = "
* PE_T_XKLAH = "
EXCEPTIONS
ARTICLE_GROUP_NOT_FOUND = 1 NO_PLANTS_SELECTED = 10 VENDOR_NOT_FOUND = 11 VENDOR_SUBRANGE_NOT_FOUND = 12 ANNUAL_SEASON_NOT_VALID = 13 EXIT = 14 DATE_NOT_VALID = 2 EKERV_NOT_VALID = 3 NO_KLART_FOUND = 4 LIGRU_NOT_VALID = 5 LIVAR_NOT_VALID = 6 LTSNR_WITHOUT_LIFNR = 7 NO_COMPANIES_SELECTED = 8 NO_MATERIALS_SELECTED = 9
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLWVK1_001 Extend Communication Structure KOMK for Pricing
EXIT_SAPLWVK1_002 Extend Communication Structure KOMP for Pricing
EXIT_SAPLWVK1_003 Customer-Specific Check of a Pricing Item
IMPORTING Parameters details for SPC_PRE_CHECK
PI_I_SPC -
Data type: PISPCOptional: No
Call by Reference: No ( called with pass by value option)
PI_CHECK_EKERV -
Data type: SY-MARKYOptional: Yes
Call by Reference: No ( called with pass by value option)
PI_NO_CHECK_WERKS -
Data type: SY-MARKYOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SPC_PRE_CHECK
PE_I_SPC -
Data type: PISPCOptional: No
Call by Reference: No ( called with pass by value option)
PE_SEL_MATNR -
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
PE_SEL_VKORG -
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
PE_SEL_VTWEG -
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
PE_SEL_WERKS -
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
PE_SEL_PLTYP -
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
PE_SEL_FILGR -
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for SPC_PRE_CHECK
SO_MATNR -
Data type: WVK1_MATNR_RANOptional: Yes
Call by Reference: No ( called with pass by value option)
SO_VKORG -
Data type: WVK1_VKORG_RANOptional: Yes
Call by Reference: No ( called with pass by value option)
SO_VTWEG -
Data type: WVK1_VTWEG_RANOptional: Yes
Call by Reference: No ( called with pass by value option)
SO_WERKS -
Data type: WVK1_WERKS_RANOptional: Yes
Call by Reference: No ( called with pass by value option)
SO_PLTYP -
Data type: WVK1_PLTYP_RANOptional: Yes
Call by Reference: No ( called with pass by value option)
SO_FILGR -
Data type: WVK1_FILGR_RANOptional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for SPC_PRE_CHECK
PE_T_XT001W -
Data type: T001WOptional: Yes
Call by Reference: No ( called with pass by value option)
PE_T_XTVKOV -
Data type: TVKOVOptional: Yes
Call by Reference: No ( called with pass by value option)
PE_T_XKLAH -
Data type: KLAHOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ARTICLE_GROUP_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_PLANTS_SELECTED - No plants able to be selected
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VENDOR_NOT_FOUND - Vendor does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VENDOR_SUBRANGE_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ANNUAL_SEASON_NOT_VALID -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
EXIT - Cancel
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DATE_NOT_VALID - Invalid Date
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
EKERV_NOT_VALID -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_KLART_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LIGRU_NOT_VALID -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LIVAR_NOT_VALID -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LTSNR_WITHOUT_LIFNR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_COMPANIES_SELECTED - No plants able to be selected
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_MATERIALS_SELECTED - No materials could be selected
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SPC_PRE_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_pe_i_spc | TYPE PISPC, " | |||
lv_pi_i_spc | TYPE PISPC, " | |||
lv_so_matnr | TYPE WVK1_MATNR_RAN, " | |||
lt_pe_t_xt001w | TYPE STANDARD TABLE OF T001W, " | |||
lv_article_group_not_found | TYPE T001W, " | |||
lv_no_plants_selected | TYPE T001W, " | |||
lv_vendor_not_found | TYPE T001W, " | |||
lv_vendor_subrange_not_found | TYPE T001W, " | |||
lv_annual_season_not_valid | TYPE T001W, " | |||
lv_exit | TYPE T001W, " | |||
lv_so_vkorg | TYPE WVK1_VKORG_RAN, " | |||
lt_pe_t_xtvkov | TYPE STANDARD TABLE OF TVKOV, " | |||
lv_pe_sel_matnr | TYPE SY-TABIX, " | |||
lv_date_not_valid | TYPE SY, " | |||
lv_pi_check_ekerv | TYPE SY-MARKY, " | |||
lv_so_vtweg | TYPE WVK1_VTWEG_RAN, " | |||
lt_pe_t_xklah | TYPE STANDARD TABLE OF KLAH, " | |||
lv_pe_sel_vkorg | TYPE SY-TABIX, " | |||
lv_ekerv_not_valid | TYPE SY, " | |||
lv_pi_no_check_werks | TYPE SY-MARKY, " | |||
lv_so_werks | TYPE WVK1_WERKS_RAN, " | |||
lv_pe_sel_vtweg | TYPE SY-TABIX, " | |||
lv_no_klart_found | TYPE SY, " | |||
lv_so_pltyp | TYPE WVK1_PLTYP_RAN, " | |||
lv_pe_sel_werks | TYPE SY-TABIX, " | |||
lv_ligru_not_valid | TYPE SY, " | |||
lv_so_filgr | TYPE WVK1_FILGR_RAN, " | |||
lv_pe_sel_pltyp | TYPE SY-TABIX, " | |||
lv_livar_not_valid | TYPE SY, " | |||
lv_pe_sel_filgr | TYPE SY-TABIX, " | |||
lv_ltsnr_without_lifnr | TYPE SY, " | |||
lv_no_companies_selected | TYPE SY, " | |||
lv_no_materials_selected | TYPE SY. " |
  CALL FUNCTION 'SPC_PRE_CHECK' "NOTRANSL: Vorprüfungen für Selektionsbildeingaben zur Verkaufspreiskalkula |
EXPORTING | ||
PI_I_SPC | = lv_pi_i_spc | |
PI_CHECK_EKERV | = lv_pi_check_ekerv | |
PI_NO_CHECK_WERKS | = lv_pi_no_check_werks | |
IMPORTING | ||
PE_I_SPC | = lv_pe_i_spc | |
PE_SEL_MATNR | = lv_pe_sel_matnr | |
PE_SEL_VKORG | = lv_pe_sel_vkorg | |
PE_SEL_VTWEG | = lv_pe_sel_vtweg | |
PE_SEL_WERKS | = lv_pe_sel_werks | |
PE_SEL_PLTYP | = lv_pe_sel_pltyp | |
PE_SEL_FILGR | = lv_pe_sel_filgr | |
CHANGING | ||
SO_MATNR | = lv_so_matnr | |
SO_VKORG | = lv_so_vkorg | |
SO_VTWEG | = lv_so_vtweg | |
SO_WERKS | = lv_so_werks | |
SO_PLTYP | = lv_so_pltyp | |
SO_FILGR | = lv_so_filgr | |
TABLES | ||
PE_T_XT001W | = lt_pe_t_xt001w | |
PE_T_XTVKOV | = lt_pe_t_xtvkov | |
PE_T_XKLAH | = lt_pe_t_xklah | |
EXCEPTIONS | ||
ARTICLE_GROUP_NOT_FOUND = 1 | ||
NO_PLANTS_SELECTED = 10 | ||
VENDOR_NOT_FOUND = 11 | ||
VENDOR_SUBRANGE_NOT_FOUND = 12 | ||
ANNUAL_SEASON_NOT_VALID = 13 | ||
EXIT = 14 | ||
DATE_NOT_VALID = 2 | ||
EKERV_NOT_VALID = 3 | ||
NO_KLART_FOUND = 4 | ||
LIGRU_NOT_VALID = 5 | ||
LIVAR_NOT_VALID = 6 | ||
LTSNR_WITHOUT_LIFNR = 7 | ||
NO_COMPANIES_SELECTED = 8 | ||
NO_MATERIALS_SELECTED = 9 | ||
. " SPC_PRE_CHECK |
ABAP code using 7.40 inline data declarations to call FM SPC_PRE_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 TABIX FROM SY INTO @DATA(ld_pe_sel_matnr). | ||||
"SELECT single MARKY FROM SY INTO @DATA(ld_pi_check_ekerv). | ||||
"SELECT single TABIX FROM SY INTO @DATA(ld_pe_sel_vkorg). | ||||
"SELECT single MARKY FROM SY INTO @DATA(ld_pi_no_check_werks). | ||||
"SELECT single TABIX FROM SY INTO @DATA(ld_pe_sel_vtweg). | ||||
"SELECT single TABIX FROM SY INTO @DATA(ld_pe_sel_werks). | ||||
"SELECT single TABIX FROM SY INTO @DATA(ld_pe_sel_pltyp). | ||||
"SELECT single TABIX FROM SY INTO @DATA(ld_pe_sel_filgr). | ||||
Search for further information about these or an SAP related objects