SAP Function Modules

K_KKB_ITEMIZATION_GET SAP Function module







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

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


Pattern for FM K_KKB_ITEMIZATION_GET - K KKB ITEMIZATION GET





CALL FUNCTION 'K_KKB_ITEMIZATION_GET' "
  EXPORTING
    i_sicht =                   " kkbu-sicht
*   i_matnr =                   " keko-matnr
*   i_werks =                   " keko-werks
*   i_kadky =                   " keko-kadky
*   i_klvar =                   " keko-klvar
*   i_tvers =                   " keko-tvers
*   i_bz_losgr =                " cki64a-kosmng
*   i_kalnr_ba =                " keko-kalnr_ba
*   i_kdpos =                   " kkbu-kdpos
*   i_kdauf =                   " kkbu-kdauf
*   i_kokrs =                   " kkbu-kokrs
*   i_kalnr =                   " keko-kalnr
  IMPORTING
    e_header =                  " kkb04_head
* TABLES
*   t_e_items =                 " kkb04_t_items
  EXCEPTIONS
    INPUT_INCOMPLETE = 1        "
    INPUT_NOT_UNIQUE = 2        "
    NO_CALCULATION_FOUND = 3    "
    NO_ITEMS_FOUND = 4          "
    WRONG_INPUT = 5             "
    .  "  K_KKB_ITEMIZATION_GET

ABAP code example for Function Module K_KKB_ITEMIZATION_GET





The ABAP code below is a full code listing to execute function module K_KKB_ITEMIZATION_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_e_header  TYPE KKB04_HEAD ,
it_t_e_items  TYPE STANDARD TABLE OF KKB04_T_ITEMS,"TABLES PARAM
wa_t_e_items  LIKE LINE OF it_t_e_items .


DATA(ld_i_sicht) = Check type of data required

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


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


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


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


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


DATA(ld_i_bz_losgr) = Check type of data required

SELECT single KALNR_BA
FROM KEKO
INTO @DATA(ld_i_kalnr_ba).


DATA(ld_i_kdpos) = Check type of data required

DATA(ld_i_kdauf) = some text here

DATA(ld_i_kokrs) = some text here

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


"populate fields of struture and append to itab
append wa_t_e_items to it_t_e_items. . CALL FUNCTION 'K_KKB_ITEMIZATION_GET' EXPORTING i_sicht = ld_i_sicht * i_matnr = ld_i_matnr * i_werks = ld_i_werks * i_kadky = ld_i_kadky * i_klvar = ld_i_klvar * i_tvers = ld_i_tvers * i_bz_losgr = ld_i_bz_losgr * i_kalnr_ba = ld_i_kalnr_ba * i_kdpos = ld_i_kdpos * i_kdauf = ld_i_kdauf * i_kokrs = ld_i_kokrs * i_kalnr = ld_i_kalnr IMPORTING e_header = ld_e_header * TABLES * t_e_items = it_t_e_items EXCEPTIONS INPUT_INCOMPLETE = 1 INPUT_NOT_UNIQUE = 2 NO_CALCULATION_FOUND = 3 NO_ITEMS_FOUND = 4 WRONG_INPUT = 5 . " K_KKB_ITEMIZATION_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 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 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_e_header  TYPE KKB04_HEAD ,
ld_i_sicht  TYPE KKBU-SICHT ,
it_t_e_items  TYPE STANDARD TABLE OF KKB04_T_ITEMS ,
wa_t_e_items  LIKE LINE OF it_t_e_items,
ld_i_matnr  TYPE KEKO-MATNR ,
ld_i_werks  TYPE KEKO-WERKS ,
ld_i_kadky  TYPE KEKO-KADKY ,
ld_i_klvar  TYPE KEKO-KLVAR ,
ld_i_tvers  TYPE KEKO-TVERS ,
ld_i_bz_losgr  TYPE CKI64A-KOSMNG ,
ld_i_kalnr_ba  TYPE KEKO-KALNR_BA ,
ld_i_kdpos  TYPE KKBU-KDPOS ,
ld_i_kdauf  TYPE KKBU-KDAUF ,
ld_i_kokrs  TYPE KKBU-KOKRS ,
ld_i_kalnr  TYPE KEKO-KALNR .


ld_i_sicht = Check type of data required

"populate fields of struture and append to itab
append wa_t_e_items to it_t_e_items.

SELECT single MATNR
FROM KEKO
INTO ld_i_matnr.


SELECT single WERKS
FROM KEKO
INTO ld_i_werks.


SELECT single KADKY
FROM KEKO
INTO ld_i_kadky.


SELECT single KLVAR
FROM KEKO
INTO ld_i_klvar.


SELECT single TVERS
FROM KEKO
INTO ld_i_tvers.


ld_i_bz_losgr = Check type of data required

SELECT single KALNR_BA
FROM KEKO
INTO ld_i_kalnr_ba.


ld_i_kdpos = Check type of data required

ld_i_kdauf = some text here

ld_i_kokrs = some text here

SELECT single KALNR
FROM KEKO
INTO ld_i_kalnr.

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