SAP Function Modules

VBWS_VALUE_CHECK SAP Function module







VBWS_VALUE_CHECK is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name VBWS_VALUE_CHECK into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: MWSO
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM VBWS_VALUE_CHECK - VBWS VALUE CHECK





CALL FUNCTION 'VBWS_VALUE_CHECK' "
  EXPORTING
    i_value =                   " f
*   i_matnr =                   " mara-matnr
*   i_atinn =                   " marm-atinn
*   i_msehi =                   " marm-msehi
*   i_meinh =                   " marm-meinh
*   i_meins =                   " mara1-meins
*   i_atwrt =                   " conf_out-atwrt
*   i_check_unit_exist =        " mws_char-xused
*   i_check_use_of_uom = 'X'    " mws_char-xused
  IMPORTING
    o_zaehler =                 " marm-umrez
    o_nenner =                  " marm-umren
    o_conv_not_logical =        " c
  EXCEPTIONS
    VALUE_NOT_VALID = 1         "
    IMPROPER_INPUT_PARAMETERS = 2  "
    NO_UNIT = 3                 "
    MATERIAL_NOT_FOUND = 4      "
    CONVERSION_NOT_FOUND = 5    "
    INPUT_LE_ZERO = 6           "
    MSEHI_NOT_DEFINED = 7       "
    MEINH_NOT_DEFINED = 8       "
    CONVERSION_NOT_ALLOWED = 9  "
    .  "  VBWS_VALUE_CHECK

ABAP code example for Function Module VBWS_VALUE_CHECK





The ABAP code below is a full code listing to execute function module VBWS_VALUE_CHECK including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_o_zaehler  TYPE MARM-UMREZ ,
ld_o_nenner  TYPE MARM-UMREN ,
ld_o_conv_not_logical  TYPE C .

DATA(ld_i_value) = 'Check type of data required'.

SELECT single MATNR
FROM MARA
INTO @DATA(ld_i_matnr).


SELECT single ATINN
FROM MARM
INTO @DATA(ld_i_atinn).


SELECT single MSEHI
FROM MARM
INTO @DATA(ld_i_msehi).


SELECT single MEINH
FROM MARM
INTO @DATA(ld_i_meinh).


SELECT single MEINS
FROM MARA1
INTO @DATA(ld_i_meins).


DATA(ld_i_atwrt) = some text here

DATA(ld_i_check_unit_exist) = some text here

DATA(ld_i_check_use_of_uom) = some text here . CALL FUNCTION 'VBWS_VALUE_CHECK' EXPORTING i_value = ld_i_value * i_matnr = ld_i_matnr * i_atinn = ld_i_atinn * i_msehi = ld_i_msehi * i_meinh = ld_i_meinh * i_meins = ld_i_meins * i_atwrt = ld_i_atwrt * i_check_unit_exist = ld_i_check_unit_exist * i_check_use_of_uom = ld_i_check_use_of_uom IMPORTING o_zaehler = ld_o_zaehler o_nenner = ld_o_nenner o_conv_not_logical = ld_o_conv_not_logical EXCEPTIONS VALUE_NOT_VALID = 1 IMPROPER_INPUT_PARAMETERS = 2 NO_UNIT = 3 MATERIAL_NOT_FOUND = 4 CONVERSION_NOT_FOUND = 5 INPUT_LE_ZERO = 6 MSEHI_NOT_DEFINED = 7 MEINH_NOT_DEFINED = 8 CONVERSION_NOT_ALLOWED = 9 . " VBWS_VALUE_CHECK
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_o_zaehler  TYPE MARM-UMREZ ,
ld_i_value  TYPE F ,
ld_o_nenner  TYPE MARM-UMREN ,
ld_i_matnr  TYPE MARA-MATNR ,
ld_o_conv_not_logical  TYPE C ,
ld_i_atinn  TYPE MARM-ATINN ,
ld_i_msehi  TYPE MARM-MSEHI ,
ld_i_meinh  TYPE MARM-MEINH ,
ld_i_meins  TYPE MARA1-MEINS ,
ld_i_atwrt  TYPE CONF_OUT-ATWRT ,
ld_i_check_unit_exist  TYPE MWS_CHAR-XUSED ,
ld_i_check_use_of_uom  TYPE MWS_CHAR-XUSED .

ld_i_value = 'Check type of data required'.

SELECT single MATNR
FROM MARA
INTO ld_i_matnr.


SELECT single ATINN
FROM MARM
INTO ld_i_atinn.


SELECT single MSEHI
FROM MARM
INTO ld_i_msehi.


SELECT single MEINH
FROM MARM
INTO ld_i_meinh.


SELECT single MEINS
FROM MARA1
INTO ld_i_meins.


ld_i_atwrt = some text here

ld_i_check_unit_exist = some text here

ld_i_check_use_of_uom = some text here

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name VBWS_VALUE_CHECK or its description.