SAP Function Modules

K_VARIANCE_VARIANT_GET SAP Function module







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

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


Pattern for FM K_VARIANCE_VARIANT_GET - K VARIANCE VARIANT GET





CALL FUNCTION 'K_VARIANCE_VARIANT_GET' "
  EXPORTING
*   par_awoba = CON_AWOBA-OR    " tkv06-awoba
    par_awvar =                 " tkv06-awvar
*   par_spras = SY-LANGU        " tkv06-spras
  IMPORTING
    par_awrfx =                 " tkv05-awrfx
    par_awrlg =                 " tkv05-awrlg
    par_awrmg =                 " tkv05-awrmg
    par_awrpr =                 " tkv05-awrpr
    par_awrrs =                 " tkv05-awrrs
    par_awrst =                 " tkv05-awrst
    par_awstx =                 " tkv06-awstx
    par_awres =                 " tkv05-awres
    par_awrvp =                 " tkv05-awrvp
    par_awrfs =                 " tkv05-awrfs
    par_awrwk =                 " tkv05-awrwk
    par_awkdf =                 " tkv05-awkdf
    par_awrvm =                 " tkv05-awrvm
    par_awrmp =                 " tkv05-awrmp
    par_awrau =                 " tkv05-awrau
  EXCEPTIONS
    OBJECT_TYPE_INVALID = 1     "
    VARIANT_NOT_FOUND = 2       "
    .  "  K_VARIANCE_VARIANT_GET

ABAP code example for Function Module K_VARIANCE_VARIANT_GET





The ABAP code below is a full code listing to execute function module K_VARIANCE_VARIANT_GET 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_par_awrfx  TYPE TKV05-AWRFX ,
ld_par_awrlg  TYPE TKV05-AWRLG ,
ld_par_awrmg  TYPE TKV05-AWRMG ,
ld_par_awrpr  TYPE TKV05-AWRPR ,
ld_par_awrrs  TYPE TKV05-AWRRS ,
ld_par_awrst  TYPE TKV05-AWRST ,
ld_par_awstx  TYPE TKV06-AWSTX ,
ld_par_awres  TYPE TKV05-AWRES ,
ld_par_awrvp  TYPE TKV05-AWRVP ,
ld_par_awrfs  TYPE TKV05-AWRFS ,
ld_par_awrwk  TYPE TKV05-AWRWK ,
ld_par_awkdf  TYPE TKV05-AWKDF ,
ld_par_awrvm  TYPE TKV05-AWRVM ,
ld_par_awrmp  TYPE TKV05-AWRMP ,
ld_par_awrau  TYPE TKV05-AWRAU .


SELECT single AWOBA
FROM TKV06
INTO @DATA(ld_par_awoba).


SELECT single AWVAR
FROM TKV06
INTO @DATA(ld_par_awvar).


SELECT single SPRAS
FROM TKV06
INTO @DATA(ld_par_spras).
. CALL FUNCTION 'K_VARIANCE_VARIANT_GET' EXPORTING * par_awoba = ld_par_awoba par_awvar = ld_par_awvar * par_spras = ld_par_spras IMPORTING par_awrfx = ld_par_awrfx par_awrlg = ld_par_awrlg par_awrmg = ld_par_awrmg par_awrpr = ld_par_awrpr par_awrrs = ld_par_awrrs par_awrst = ld_par_awrst par_awstx = ld_par_awstx par_awres = ld_par_awres par_awrvp = ld_par_awrvp par_awrfs = ld_par_awrfs par_awrwk = ld_par_awrwk par_awkdf = ld_par_awkdf par_awrvm = ld_par_awrvm par_awrmp = ld_par_awrmp par_awrau = ld_par_awrau EXCEPTIONS OBJECT_TYPE_INVALID = 1 VARIANT_NOT_FOUND = 2 . " K_VARIANCE_VARIANT_GET
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 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_par_awrfx  TYPE TKV05-AWRFX ,
ld_par_awoba  TYPE TKV06-AWOBA ,
ld_par_awrlg  TYPE TKV05-AWRLG ,
ld_par_awvar  TYPE TKV06-AWVAR ,
ld_par_awrmg  TYPE TKV05-AWRMG ,
ld_par_spras  TYPE TKV06-SPRAS ,
ld_par_awrpr  TYPE TKV05-AWRPR ,
ld_par_awrrs  TYPE TKV05-AWRRS ,
ld_par_awrst  TYPE TKV05-AWRST ,
ld_par_awstx  TYPE TKV06-AWSTX ,
ld_par_awres  TYPE TKV05-AWRES ,
ld_par_awrvp  TYPE TKV05-AWRVP ,
ld_par_awrfs  TYPE TKV05-AWRFS ,
ld_par_awrwk  TYPE TKV05-AWRWK ,
ld_par_awkdf  TYPE TKV05-AWKDF ,
ld_par_awrvm  TYPE TKV05-AWRVM ,
ld_par_awrmp  TYPE TKV05-AWRMP ,
ld_par_awrau  TYPE TKV05-AWRAU .


SELECT single AWOBA
FROM TKV06
INTO ld_par_awoba.


SELECT single AWVAR
FROM TKV06
INTO ld_par_awvar.


SELECT single SPRAS
FROM TKV06
INTO ld_par_spras.

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