SAP K_KKB_ITEMIZATION Function Module for Line Item Report for Costing









K_KKB_ITEMIZATION is a standard k kkb itemization SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Line Item Report for Costing processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for k kkb itemization FM, simply by entering the name K_KKB_ITEMIZATION into the relevant SAP transaction such as SE37 or SE38.

Function Group: KKBI
Program Name: SAPLKKBI
Main Program: SAPLKKBI
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function K_KKB_ITEMIZATION pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'K_KKB_ITEMIZATION'"Line Item Report for Costing
EXPORTING
* I_PSPNR = "
* I_KALNR_BA = "
* I_KLVAR = "Costing variant
* I_KDPOS = "Item
* I_KOKRS = "Controlling area
* I_EXTNR = "Base Planning Object
* I_MATNR = "Material
* I_WERKS = "Plant
* I_EXPLOSION = "Explode BOM?
* I_KHS1 = "
* I_AUFLO = "Expansion Level
* I_KDAUF = "Sales order
* I_SICHT = '01' "Cost view
* I_MATON = "Material Items Only
* I_CURR_FORCED = "Currency forced ('K','O')
* I_BZ_LOSGR = "Reference value of BOM explosion
* I_KEKO = "
* I_NO_TREE = "
* I_PRINT = "
* I_RESS_EINZ = "
* I_PKOST = "Primary cost element
* I_KOSTL = "
* I_KSTRG = "Cost object
* I_NO_DEF_VARIANT = "
* I_DINKEL_FORCED = "
* I_NETWORK = "
* I_NETWORK_VORNR = "
* I_NETWORK_COMP = "
* I_NETWORK_PRONR = "
* I_NETWORK_VSNMR = "
* I_KALNR = "
* I_VARIA = "
* I_LZEILE = "
* I_TVERS = "Costing version
* I_PFAD = "
* I_LEISTUNG = "
* I_NO_OUTPUT = "
* I_CONTAINER = "
* I_CLASSIC_FORCED = "Interface with Report Writer selection screen
* I_OBA_ITEM = "Character Field for IDocs (Length: Three Characters)
* I_GRID_TITLE = "ALV Control: Title Line Text
* I_CONVERT_TO_KOSMNG = "Character Field of Length 1
* I_ERZKA_GIVEN = "Character Field of Length 1
* I_ERZKA = "Cost Estimate Created with Product Costing
* I_GJAHR = "Fiscal year
* I_USE_LAST_VARIANT = "Character Field of Length 1
* I_BZ_MEINH = "
* I_PRONR = "WBS element
* I_AUFNR = "Order
* I_VERSN = "Version
* I_KADKY = "Costing date

IMPORTING
E_HEAD = "

TABLES
* T_SA_TABIN = "BOM
* T_KIS1 = "Itemization
* T_XHEADER = "
* T_KISK_OBJ = "
* T_OUT_ITEMS = "

EXCEPTIONS
INPUT_INCOMPLETE = 1 INPUT_NOT_UNIQUE = 2 NO_CALCULATION_FOUND = 3 NO_ITEMS_FOUND = 4 WRONG_INPUT = 5 USER_ABEND = 6
.



IMPORTING Parameters details for K_KKB_ITEMIZATION

I_PSPNR -

Data type: CKI64A-PSPNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_KALNR_BA -

Data type: KEKO-KALNR_BA
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_KLVAR - Costing variant

Data type: KEKO-KLVAR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_KDPOS - Item

Data type: KKBU-KDPOS
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_KOKRS - Controlling area

Data type: KKBU-KOKRS
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_EXTNR - Base Planning Object

Data type: KKBU-EXTNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_MATNR - Material

Data type: KEKO-MATNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_WERKS - Plant

Data type: KKBU-WERKS
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_EXPLOSION - Explode BOM?

Data type: TKKB1-OBJ
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_KHS1 -

Data type: KHS1
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_AUFLO - Expansion Level

Data type:
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_KDAUF - Sales order

Data type: KKBU-KDAUF
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_SICHT - Cost view

Data type: KKBU-SICHT
Default: '01'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_MATON - Material Items Only

Data type: TKKB1-OBJ
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_CURR_FORCED - Currency forced ('K','O')

Data type: TKKB1-OBJ
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_BZ_LOSGR - Reference value of BOM explosion

Data type: CKI64A-KOSMNG
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_KEKO -

Data type: KEKO
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_NO_TREE -

Data type: TKKB1-FEH
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_PRINT -

Data type: TKKB1-FEH
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_RESS_EINZ -

Data type: TKKB1-FEH
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_PKOST - Primary cost element

Data type: KKBU-PKOST
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_KOSTL -

Data type: KKBU-KOSTL
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_KSTRG - Cost object

Data type: KKBU-KSTRG
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_NO_DEF_VARIANT -

Data type: TKKB1-FEH
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_DINKEL_FORCED -

Data type: TKKB1-FEH
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_NETWORK -

Data type: CAUFV-AUFNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_NETWORK_VORNR -

Data type: KKBU-VORNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_NETWORK_COMP -

Data type: KEKO-MATNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_NETWORK_PRONR -

Data type: PRPS-PSPNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_NETWORK_VSNMR -

Data type: VSKOPF-VSNMR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_KALNR -

Data type: KEKO-KALNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_VARIA -

Data type: DISVARIANT-VARIANT
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_LZEILE -

Data type:
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_TVERS - Costing version

Data type: KEKO-TVERS
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_PFAD -

Data type:
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_LEISTUNG -

Data type: ESLL-KTEXT1
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_NO_OUTPUT -

Data type: TKKB1-FEH
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_CONTAINER -

Data type: CL_GUI_CONTAINER
Optional: Yes
Call by Reference: Yes

I_CLASSIC_FORCED - Interface with Report Writer selection screen

Data type: XFELD
Optional: Yes
Call by Reference: Yes

I_OBA_ITEM - Character Field for IDocs (Length: Three Characters)

Data type: CHAR03
Optional: Yes
Call by Reference: Yes

I_GRID_TITLE - ALV Control: Title Line Text

Data type: LVC_TITLE
Optional: Yes
Call by Reference: Yes

I_CONVERT_TO_KOSMNG - Character Field of Length 1

Data type: CHAR01
Optional: Yes
Call by Reference: Yes

I_ERZKA_GIVEN - Character Field of Length 1

Data type: CHAR01
Optional: Yes
Call by Reference: Yes

I_ERZKA - Cost Estimate Created with Product Costing

Data type: KEKO-ERZKA
Optional: Yes
Call by Reference: Yes

I_GJAHR - Fiscal year

Data type: KKBU-GJAHR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_USE_LAST_VARIANT - Character Field of Length 1

Data type: CHAR01
Optional: Yes
Call by Reference: Yes

I_BZ_MEINH -

Data type: MEINH
Optional: Yes
Call by Reference: Yes

I_PRONR - WBS element

Data type: KKBU-PRONR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_AUFNR - Order

Data type: KKBU-AUFNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_VERSN - Version

Data type: KKBU-VERSN
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_KADKY - Costing date

Data type: KEKO-KADKY
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for K_KKB_ITEMIZATION

E_HEAD -

Data type: KKB04_HEAD
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for K_KKB_ITEMIZATION

T_SA_TABIN - BOM

Data type: CK_STRUKTURTAB
Optional: Yes
Call by Reference: No ( called with pass by value option)

T_KIS1 - Itemization

Data type: KIS1
Optional: Yes
Call by Reference: No ( called with pass by value option)

T_XHEADER -

Data type: KKBLO_T_LISTHEADER
Optional: Yes
Call by Reference: No ( called with pass by value option)

T_KISK_OBJ -

Data type: KKB03_CITEM
Optional: Yes
Call by Reference: No ( called with pass by value option)

T_OUT_ITEMS -

Data type: KKB04_T_ITEMS
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

INPUT_INCOMPLETE - Entry incomplete

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INPUT_NOT_UNIQUE - Entry not unique

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_CALCULATION_FOUND - No cost estimate found

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_ITEMS_FOUND - No itemization found

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

WRONG_INPUT - Wrong entry: Object does not exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

USER_ABEND - Cancelation by user

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for K_KKB_ITEMIZATION Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.

DATA:
lv_e_head  TYPE KKB04_HEAD, "   
lv_i_pspnr  TYPE CKI64A-PSPNR, "   
lt_t_sa_tabin  TYPE STANDARD TABLE OF CK_STRUKTURTAB, "   
lv_input_incomplete  TYPE CK_STRUKTURTAB, "   
lv_i_kalnr_ba  TYPE KEKO-KALNR_BA, "   
lv_i_klvar  TYPE KEKO-KLVAR, "   
lv_i_kdpos  TYPE KKBU-KDPOS, "   
lv_i_kokrs  TYPE KKBU-KOKRS, "   
lv_i_extnr  TYPE KKBU-EXTNR, "   
lv_i_matnr  TYPE KEKO-MATNR, "   
lv_i_werks  TYPE KKBU-WERKS, "   
lv_i_explosion  TYPE TKKB1-OBJ, "   
lv_i_khs1  TYPE KHS1, "   
lv_i_auflo  TYPE KHS1, "   
lt_t_kis1  TYPE STANDARD TABLE OF KIS1, "   
lv_i_kdauf  TYPE KKBU-KDAUF, "   
lv_input_not_unique  TYPE KKBU, "   
lv_i_sicht  TYPE KKBU-SICHT, "   '01'
lv_i_maton  TYPE TKKB1-OBJ, "   
lv_i_curr_forced  TYPE TKKB1-OBJ, "   
lv_i_bz_losgr  TYPE CKI64A-KOSMNG, "   
lv_i_keko  TYPE KEKO, "   
lv_i_no_tree  TYPE TKKB1-FEH, "   
lv_i_print  TYPE TKKB1-FEH, "   
lv_i_ress_einz  TYPE TKKB1-FEH, "   
lv_i_pkost  TYPE KKBU-PKOST, "   
lv_i_kostl  TYPE KKBU-KOSTL, "   
lv_i_kstrg  TYPE KKBU-KSTRG, "   
lt_t_xheader  TYPE STANDARD TABLE OF KKBLO_T_LISTHEADER, "   
lv_no_calculation_found  TYPE KKBLO_T_LISTHEADER, "   
lv_i_no_def_variant  TYPE TKKB1-FEH, "   
lv_i_dinkel_forced  TYPE TKKB1-FEH, "   
lv_i_network  TYPE CAUFV-AUFNR, "   
lv_i_network_vornr  TYPE KKBU-VORNR, "   
lv_i_network_comp  TYPE KEKO-MATNR, "   
lv_i_network_pronr  TYPE PRPS-PSPNR, "   
lv_i_network_vsnmr  TYPE VSKOPF-VSNMR, "   
lv_i_kalnr  TYPE KEKO-KALNR, "   
lv_i_varia  TYPE DISVARIANT-VARIANT, "   
lv_i_lzeile  TYPE DISVARIANT, "   
lv_i_tvers  TYPE KEKO-TVERS, "   
lt_t_kisk_obj  TYPE STANDARD TABLE OF KKB03_CITEM, "   
lv_no_items_found  TYPE KKB03_CITEM, "   
lv_i_pfad  TYPE KKB03_CITEM, "   
lv_i_leistung  TYPE ESLL-KTEXT1, "   
lv_i_no_output  TYPE TKKB1-FEH, "   
lv_i_container  TYPE CL_GUI_CONTAINER, "   
lv_i_classic_forced  TYPE XFELD, "   
lv_i_oba_item  TYPE CHAR03, "   
lv_i_grid_title  TYPE LVC_TITLE, "   
lv_i_convert_to_kosmng  TYPE CHAR01, "   
lv_i_erzka_given  TYPE CHAR01, "   
lv_i_erzka  TYPE KEKO-ERZKA, "   
lv_i_gjahr  TYPE KKBU-GJAHR, "   
lt_t_out_items  TYPE STANDARD TABLE OF KKB04_T_ITEMS, "   
lv_wrong_input  TYPE KKB04_T_ITEMS, "   
lv_i_use_last_variant  TYPE CHAR01, "   
lv_i_bz_meinh  TYPE MEINH, "   
lv_i_pronr  TYPE KKBU-PRONR, "   
lv_user_abend  TYPE KKBU, "   
lv_i_aufnr  TYPE KKBU-AUFNR, "   
lv_i_versn  TYPE KKBU-VERSN, "   
lv_i_kadky  TYPE KEKO-KADKY. "   

  CALL FUNCTION 'K_KKB_ITEMIZATION'  "Line Item Report for Costing
    EXPORTING
         I_PSPNR = lv_i_pspnr
         I_KALNR_BA = lv_i_kalnr_ba
         I_KLVAR = lv_i_klvar
         I_KDPOS = lv_i_kdpos
         I_KOKRS = lv_i_kokrs
         I_EXTNR = lv_i_extnr
         I_MATNR = lv_i_matnr
         I_WERKS = lv_i_werks
         I_EXPLOSION = lv_i_explosion
         I_KHS1 = lv_i_khs1
         I_AUFLO = lv_i_auflo
         I_KDAUF = lv_i_kdauf
         I_SICHT = lv_i_sicht
         I_MATON = lv_i_maton
         I_CURR_FORCED = lv_i_curr_forced
         I_BZ_LOSGR = lv_i_bz_losgr
         I_KEKO = lv_i_keko
         I_NO_TREE = lv_i_no_tree
         I_PRINT = lv_i_print
         I_RESS_EINZ = lv_i_ress_einz
         I_PKOST = lv_i_pkost
         I_KOSTL = lv_i_kostl
         I_KSTRG = lv_i_kstrg
         I_NO_DEF_VARIANT = lv_i_no_def_variant
         I_DINKEL_FORCED = lv_i_dinkel_forced
         I_NETWORK = lv_i_network
         I_NETWORK_VORNR = lv_i_network_vornr
         I_NETWORK_COMP = lv_i_network_comp
         I_NETWORK_PRONR = lv_i_network_pronr
         I_NETWORK_VSNMR = lv_i_network_vsnmr
         I_KALNR = lv_i_kalnr
         I_VARIA = lv_i_varia
         I_LZEILE = lv_i_lzeile
         I_TVERS = lv_i_tvers
         I_PFAD = lv_i_pfad
         I_LEISTUNG = lv_i_leistung
         I_NO_OUTPUT = lv_i_no_output
         I_CONTAINER = lv_i_container
         I_CLASSIC_FORCED = lv_i_classic_forced
         I_OBA_ITEM = lv_i_oba_item
         I_GRID_TITLE = lv_i_grid_title
         I_CONVERT_TO_KOSMNG = lv_i_convert_to_kosmng
         I_ERZKA_GIVEN = lv_i_erzka_given
         I_ERZKA = lv_i_erzka
         I_GJAHR = lv_i_gjahr
         I_USE_LAST_VARIANT = lv_i_use_last_variant
         I_BZ_MEINH = lv_i_bz_meinh
         I_PRONR = lv_i_pronr
         I_AUFNR = lv_i_aufnr
         I_VERSN = lv_i_versn
         I_KADKY = lv_i_kadky
    IMPORTING
         E_HEAD = lv_e_head
    TABLES
         T_SA_TABIN = lt_t_sa_tabin
         T_KIS1 = lt_t_kis1
         T_XHEADER = lt_t_xheader
         T_KISK_OBJ = lt_t_kisk_obj
         T_OUT_ITEMS = lt_t_out_items
    EXCEPTIONS
        INPUT_INCOMPLETE = 1
        INPUT_NOT_UNIQUE = 2
        NO_CALCULATION_FOUND = 3
        NO_ITEMS_FOUND = 4
        WRONG_INPUT = 5
        USER_ABEND = 6
. " K_KKB_ITEMIZATION




ABAP code using 7.40 inline data declarations to call FM K_KKB_ITEMIZATION

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
"SELECT single PSPNR FROM CKI64A INTO @DATA(ld_i_pspnr).
 
 
 
"SELECT single KALNR_BA FROM KEKO INTO @DATA(ld_i_kalnr_ba).
 
"SELECT single KLVAR FROM KEKO INTO @DATA(ld_i_klvar).
 
"SELECT single KDPOS FROM KKBU INTO @DATA(ld_i_kdpos).
 
"SELECT single KOKRS FROM KKBU INTO @DATA(ld_i_kokrs).
 
"SELECT single EXTNR FROM KKBU INTO @DATA(ld_i_extnr).
 
"SELECT single MATNR FROM KEKO INTO @DATA(ld_i_matnr).
 
"SELECT single WERKS FROM KKBU INTO @DATA(ld_i_werks).
 
"SELECT single OBJ FROM TKKB1 INTO @DATA(ld_i_explosion).
 
 
 
 
"SELECT single KDAUF FROM KKBU INTO @DATA(ld_i_kdauf).
 
 
"SELECT single SICHT FROM KKBU INTO @DATA(ld_i_sicht).
DATA(ld_i_sicht) = '01'.
 
"SELECT single OBJ FROM TKKB1 INTO @DATA(ld_i_maton).
 
"SELECT single OBJ FROM TKKB1 INTO @DATA(ld_i_curr_forced).
 
"SELECT single KOSMNG FROM CKI64A INTO @DATA(ld_i_bz_losgr).
 
 
"SELECT single FEH FROM TKKB1 INTO @DATA(ld_i_no_tree).
 
"SELECT single FEH FROM TKKB1 INTO @DATA(ld_i_print).
 
"SELECT single FEH FROM TKKB1 INTO @DATA(ld_i_ress_einz).
 
"SELECT single PKOST FROM KKBU INTO @DATA(ld_i_pkost).
 
"SELECT single KOSTL FROM KKBU INTO @DATA(ld_i_kostl).
 
"SELECT single KSTRG FROM KKBU INTO @DATA(ld_i_kstrg).
 
 
 
"SELECT single FEH FROM TKKB1 INTO @DATA(ld_i_no_def_variant).
 
"SELECT single FEH FROM TKKB1 INTO @DATA(ld_i_dinkel_forced).
 
"SELECT single AUFNR FROM CAUFV INTO @DATA(ld_i_network).
 
"SELECT single VORNR FROM KKBU INTO @DATA(ld_i_network_vornr).
 
"SELECT single MATNR FROM KEKO INTO @DATA(ld_i_network_comp).
 
"SELECT single PSPNR FROM PRPS INTO @DATA(ld_i_network_pronr).
 
"SELECT single VSNMR FROM VSKOPF INTO @DATA(ld_i_network_vsnmr).
 
"SELECT single KALNR FROM KEKO INTO @DATA(ld_i_kalnr).
 
"SELECT single VARIANT FROM DISVARIANT INTO @DATA(ld_i_varia).
 
 
"SELECT single TVERS FROM KEKO INTO @DATA(ld_i_tvers).
 
 
 
 
"SELECT single KTEXT1 FROM ESLL INTO @DATA(ld_i_leistung).
 
"SELECT single FEH FROM TKKB1 INTO @DATA(ld_i_no_output).
 
 
 
 
 
 
 
"SELECT single ERZKA FROM KEKO INTO @DATA(ld_i_erzka).
 
"SELECT single GJAHR FROM KKBU INTO @DATA(ld_i_gjahr).
 
 
 
 
 
"SELECT single PRONR FROM KKBU INTO @DATA(ld_i_pronr).
 
 
"SELECT single AUFNR FROM KKBU INTO @DATA(ld_i_aufnr).
 
"SELECT single VERSN FROM KKBU INTO @DATA(ld_i_versn).
 
"SELECT single KADKY FROM KEKO INTO @DATA(ld_i_kadky).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!