SAP Function Modules

K_KKB_CALCULATION_EXPLOSION SAP Function module







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

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


Pattern for FM K_KKB_CALCULATION_EXPLOSION - K KKB CALCULATION EXPLOSION





CALL FUNCTION 'K_KKB_CALCULATION_EXPLOSION' "
* EXPORTING
*   i_kalnr =                   " keko-kalnr
*   i_klvar =                   " keko-klvar
*   i_tvers =                   " keko-tvers
*   i_matnr =                   " keko-matnr
*   i_werks =                   " keko-werks
*   i_kdauf =                   " keko-vbeln
*   i_kadky =                   " keko-kadky
*   i_kdpos =                   " keko-posnr
*   i_kokrs =                   " keko-kokrs
*   i_auflo =                   "
*   i_erzka = '*'               " keko-erzka
*   i_losgr =                   " keko-losgr
*   i_dupli = SPACE             " tkkb1-feh
* TABLES
*   tab_keko =                  " keko
  EXCEPTIONS
    NO_DATA_FOUND = 1           "
    NO_CALCULATION = 2          "
    WRONG_INPUT = 3             "
    INTERNAL_ERROR = 4          "
    .  "  K_KKB_CALCULATION_EXPLOSION

ABAP code example for Function Module K_KKB_CALCULATION_EXPLOSION





The ABAP code below is a full code listing to execute function module K_KKB_CALCULATION_EXPLOSION 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:
it_tab_keko  TYPE STANDARD TABLE OF KEKO,"TABLES PARAM
wa_tab_keko  LIKE LINE OF it_tab_keko .


SELECT single KALNR
FROM KEKO
INTO @DATA(ld_i_kalnr).


SELECT single KLVAR
FROM KEKO
INTO @DATA(ld_i_klvar).


SELECT single TVERS
FROM KEKO
INTO @DATA(ld_i_tvers).


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


SELECT single WERKS
FROM KEKO
INTO @DATA(ld_i_werks).


SELECT single VBELN
FROM KEKO
INTO @DATA(ld_i_kdauf).


SELECT single KADKY
FROM KEKO
INTO @DATA(ld_i_kadky).


SELECT single POSNR
FROM KEKO
INTO @DATA(ld_i_kdpos).


SELECT single KOKRS
FROM KEKO
INTO @DATA(ld_i_kokrs).

DATA(ld_i_auflo) = 'some text here'.

SELECT single ERZKA
FROM KEKO
INTO @DATA(ld_i_erzka).


SELECT single LOSGR
FROM KEKO
INTO @DATA(ld_i_losgr).


SELECT single FEH
FROM TKKB1
INTO @DATA(ld_i_dupli).


"populate fields of struture and append to itab
append wa_tab_keko to it_tab_keko. . CALL FUNCTION 'K_KKB_CALCULATION_EXPLOSION' * EXPORTING * i_kalnr = ld_i_kalnr * i_klvar = ld_i_klvar * i_tvers = ld_i_tvers * i_matnr = ld_i_matnr * i_werks = ld_i_werks * i_kdauf = ld_i_kdauf * i_kadky = ld_i_kadky * i_kdpos = ld_i_kdpos * i_kokrs = ld_i_kokrs * i_auflo = ld_i_auflo * i_erzka = ld_i_erzka * i_losgr = ld_i_losgr * i_dupli = ld_i_dupli * TABLES * tab_keko = it_tab_keko EXCEPTIONS NO_DATA_FOUND = 1 NO_CALCULATION = 2 WRONG_INPUT = 3 INTERNAL_ERROR = 4 . " K_KKB_CALCULATION_EXPLOSION
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_i_kalnr  TYPE KEKO-KALNR ,
it_tab_keko  TYPE STANDARD TABLE OF KEKO ,
wa_tab_keko  LIKE LINE OF it_tab_keko,
ld_i_klvar  TYPE KEKO-KLVAR ,
ld_i_tvers  TYPE KEKO-TVERS ,
ld_i_matnr  TYPE KEKO-MATNR ,
ld_i_werks  TYPE KEKO-WERKS ,
ld_i_kdauf  TYPE KEKO-VBELN ,
ld_i_kadky  TYPE KEKO-KADKY ,
ld_i_kdpos  TYPE KEKO-POSNR ,
ld_i_kokrs  TYPE KEKO-KOKRS ,
ld_i_auflo  TYPE STRING ,
ld_i_erzka  TYPE KEKO-ERZKA ,
ld_i_losgr  TYPE KEKO-LOSGR ,
ld_i_dupli  TYPE TKKB1-FEH .


SELECT single KALNR
FROM KEKO
INTO ld_i_kalnr.


"populate fields of struture and append to itab
append wa_tab_keko to it_tab_keko.

SELECT single KLVAR
FROM KEKO
INTO ld_i_klvar.


SELECT single TVERS
FROM KEKO
INTO ld_i_tvers.


SELECT single MATNR
FROM KEKO
INTO ld_i_matnr.


SELECT single WERKS
FROM KEKO
INTO ld_i_werks.


SELECT single VBELN
FROM KEKO
INTO ld_i_kdauf.


SELECT single KADKY
FROM KEKO
INTO ld_i_kadky.


SELECT single POSNR
FROM KEKO
INTO ld_i_kdpos.


SELECT single KOKRS
FROM KEKO
INTO ld_i_kokrs.

ld_i_auflo = 'some text here'.

SELECT single ERZKA
FROM KEKO
INTO ld_i_erzka.


SELECT single LOSGR
FROM KEKO
INTO ld_i_losgr.


SELECT single FEH
FROM TKKB1
INTO ld_i_dupli.

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