SAP Function Modules

KCMV_COMPUTE SAP Function module







KCMV_COMPUTE 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 KCMV_COMPUTE into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM KCMV_COMPUTE - KCMV COMPUTE





CALL FUNCTION 'KCMV_COMPUTE' "
  EXPORTING
    op =                        " i
*   mat1_in =                   " kcmv_mat
*   mat1_r =                    " i
*   mat2_in =                   " kcmv_mat
*   mat2_r =                    " i
*   vec1_in =                   " kcmv_vec
*   vec2_in =                   " kcmv_vec
* CHANGING
*   skal_out =                  " f
*   mat3_out =                  " kcmv_mat
*   vec3_out =                  " kcmv_vec
  EXCEPTIONS
    WRONG_OPERATION = 1         "
    WRONG_OPERATOR = 2          "
    WRONG_DIMENSIONS = 3        "
    DUPLICATE_KEY = 4           "
    .  "  KCMV_COMPUTE

ABAP code example for Function Module KCMV_COMPUTE





The ABAP code below is a full code listing to execute function module KCMV_COMPUTE 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_skal_out) = 'Check type of data required'.
DATA(ld_mat3_out) = 'Check type of data required'.
DATA(ld_vec3_out) = 'Check type of data required'.
DATA(ld_op) = 'Check type of data required'.
DATA(ld_mat1_in) = 'Check type of data required'.
DATA(ld_mat1_r) = 'Check type of data required'.
DATA(ld_mat2_in) = 'Check type of data required'.
DATA(ld_mat2_r) = 'Check type of data required'.
DATA(ld_vec1_in) = 'Check type of data required'.
DATA(ld_vec2_in) = 'Check type of data required'. . CALL FUNCTION 'KCMV_COMPUTE' EXPORTING op = ld_op * mat1_in = ld_mat1_in * mat1_r = ld_mat1_r * mat2_in = ld_mat2_in * mat2_r = ld_mat2_r * vec1_in = ld_vec1_in * vec2_in = ld_vec2_in * CHANGING * skal_out = ld_skal_out * mat3_out = ld_mat3_out * vec3_out = ld_vec3_out EXCEPTIONS WRONG_OPERATION = 1 WRONG_OPERATOR = 2 WRONG_DIMENSIONS = 3 DUPLICATE_KEY = 4 . " KCMV_COMPUTE
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 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_skal_out  TYPE F ,
ld_op  TYPE I ,
ld_mat3_out  TYPE KCMV_MAT ,
ld_mat1_in  TYPE KCMV_MAT ,
ld_vec3_out  TYPE KCMV_VEC ,
ld_mat1_r  TYPE I ,
ld_mat2_in  TYPE KCMV_MAT ,
ld_mat2_r  TYPE I ,
ld_vec1_in  TYPE KCMV_VEC ,
ld_vec2_in  TYPE KCMV_VEC .

ld_skal_out = 'Check type of data required'.
ld_op = 'Check type of data required'.
ld_mat3_out = 'Check type of data required'.
ld_mat1_in = 'Check type of data required'.
ld_vec3_out = 'Check type of data required'.
ld_mat1_r = 'Check type of data required'.
ld_mat2_in = 'Check type of data required'.
ld_mat2_r = 'Check type of data required'.
ld_vec1_in = 'Check type of data required'.
ld_vec2_in = 'Check type of data required'.

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 KCMV_COMPUTE or its description.