SAP K_KKB_UNIT_COSTING_REPORT_CALL Function Module for









K_KKB_UNIT_COSTING_REPORT_CALL is a standard k kkb unit costing report call SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 unit costing report call FM, simply by entering the name K_KKB_UNIT_COSTING_REPORT_CALL into the relevant SAP transaction such as SE37 or SE38.

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



Function K_KKB_UNIT_COSTING_REPORT_CALL 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_UNIT_COSTING_REPORT_CALL'"
EXPORTING
* AUFNR = ' ' "Order
KOKRS = "Controlling area
* KOSTL = ' ' "Cost center
* KSTRG = ' ' "Cost object
* LEINH = ' ' "Lot Size Unit
* LOSGR = ' ' "Lot size
* MATNR = ' ' "Material
* PERIO1 = ' ' "Period from
* PERIO2 = ' ' "Period to
* PKOST = ' ' "Primary cost element
* PRONR = ' ' "Project
* BATCH = ' ' "Background processing yes/no
* RGJNR = ' ' "Report group
* VERSION = ' ' "Version
* VERSN = ' ' "Costing Version
* WERKS = ' ' "Plant
* KDAUF = ' ' "Sales order
* KDPOS = ' ' "Sales order item
* SICHT = '01' "
* I_KALNR_BA = 0 "
* CHOICE_J = ' ' "Report selection yes/no
* CALLING_TYP = '%' "
* CALLING_ANW = ' ' "Calling Application
* EXTNR = ' ' "Base Planning Object
* GJAHR = ' ' "Fiscal year
* KADKY = ' ' "Costing date
* KLVAR = ' ' "Costing Variant

IMPORTING
EXIT = "Termination Message

EXCEPTIONS
INTERNAL_ERROR = 1 NOT_GENERATED = 2 NO_AUTHORITY = 3 NO_JOB = 4 WRONG_INPUT = 5
.



IMPORTING Parameters details for K_KKB_UNIT_COSTING_REPORT_CALL

AUFNR - Order

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

KOKRS - Controlling area

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

KOSTL - Cost center

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

KSTRG - Cost object

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

LEINH - Lot Size Unit

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

LOSGR - Lot size

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

MATNR - Material

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

PERIO1 - Period from

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

PERIO2 - Period to

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

PKOST - Primary cost element

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

PRONR - Project

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

BATCH - Background processing yes/no

Data type: SY-BATCH
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

RGJNR - Report group

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

VERSION - Version

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

VERSN - Costing Version

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

WERKS - Plant

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

KDAUF - Sales order

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

KDPOS - Sales order item

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

SICHT -

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

I_KALNR_BA -

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

CHOICE_J - Report selection yes/no

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

CALLING_TYP -

Data type: TKKB1-TYP
Default: '%'
Optional: Yes
Call by Reference: No ( called with pass by value option)

CALLING_ANW - Calling Application

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

EXTNR - Base Planning Object

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

GJAHR - Fiscal year

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

KADKY - Costing date

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

KLVAR - Costing Variant

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

EXPORTING Parameters details for K_KKB_UNIT_COSTING_REPORT_CALL

EXIT - Termination Message

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

EXCEPTIONS details

INTERNAL_ERROR - Internal Error

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

NOT_GENERATED - Report group is not current

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

NO_AUTHORITY - No authorization

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

NO_JOB - No report group

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

WRONG_INPUT - Incorrect entry

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

Copy and paste ABAP code example for K_KKB_UNIT_COSTING_REPORT_CALL 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_exit  TYPE STRING, "   
lv_aufnr  TYPE KKBU-AUFNR, "   SPACE
lv_internal_error  TYPE KKBU, "   
lv_kokrs  TYPE KKBU-KOKRS, "   
lv_kostl  TYPE KKBU-KOSTL, "   SPACE
lv_kstrg  TYPE KKBU-KSTRG, "   SPACE
lv_leinh  TYPE KKBU-LEINH, "   SPACE
lv_losgr  TYPE KKBU-LOSGR, "   SPACE
lv_matnr  TYPE KEKO-MATNR, "   SPACE
lv_perio1  TYPE KKBU-PERBL, "   SPACE
lv_perio2  TYPE KKBU-PERBL, "   SPACE
lv_pkost  TYPE KKBU-PKOST, "   SPACE
lv_pronr  TYPE KKBU-PRONR, "   SPACE
lv_batch  TYPE SY-BATCH, "   SPACE
lv_not_generated  TYPE SY, "   
lv_rgjnr  TYPE TKKB1-BGR, "   SPACE
lv_version  TYPE KKBU-VERSN, "   SPACE
lv_versn  TYPE KKBU-TVERS, "   SPACE
lv_werks  TYPE KKBU-WERKS, "   SPACE
lv_kdauf  TYPE KKBU-KDAUF, "   SPACE
lv_kdpos  TYPE KKBU-KDPOS, "   SPACE
lv_sicht  TYPE KKBU-SICHT, "   '01'
lv_i_kalnr_ba  TYPE KKBU-KALNR_BA, "   0
lv_choice_j  TYPE TKKB1-ANW, "   SPACE
lv_no_authority  TYPE TKKB1, "   
lv_no_job  TYPE TKKB1, "   
lv_calling_typ  TYPE TKKB1-TYP, "   '%'
lv_calling_anw  TYPE TKKB1-ANW, "   SPACE
lv_wrong_input  TYPE TKKB1, "   
lv_extnr  TYPE KKBU-EXTNR, "   SPACE
lv_gjahr  TYPE KKBU-GJAHR, "   SPACE
lv_kadky  TYPE KKBU-KADKY, "   SPACE
lv_klvar  TYPE KKBU-KLVAR. "   SPACE

  CALL FUNCTION 'K_KKB_UNIT_COSTING_REPORT_CALL'  "
    EXPORTING
         AUFNR = lv_aufnr
         KOKRS = lv_kokrs
         KOSTL = lv_kostl
         KSTRG = lv_kstrg
         LEINH = lv_leinh
         LOSGR = lv_losgr
         MATNR = lv_matnr
         PERIO1 = lv_perio1
         PERIO2 = lv_perio2
         PKOST = lv_pkost
         PRONR = lv_pronr
         BATCH = lv_batch
         RGJNR = lv_rgjnr
         VERSION = lv_version
         VERSN = lv_versn
         WERKS = lv_werks
         KDAUF = lv_kdauf
         KDPOS = lv_kdpos
         SICHT = lv_sicht
         I_KALNR_BA = lv_i_kalnr_ba
         CHOICE_J = lv_choice_j
         CALLING_TYP = lv_calling_typ
         CALLING_ANW = lv_calling_anw
         EXTNR = lv_extnr
         GJAHR = lv_gjahr
         KADKY = lv_kadky
         KLVAR = lv_klvar
    IMPORTING
         EXIT = lv_exit
    EXCEPTIONS
        INTERNAL_ERROR = 1
        NOT_GENERATED = 2
        NO_AUTHORITY = 3
        NO_JOB = 4
        WRONG_INPUT = 5
. " K_KKB_UNIT_COSTING_REPORT_CALL




ABAP code using 7.40 inline data declarations to call FM K_KKB_UNIT_COSTING_REPORT_CALL

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 AUFNR FROM KKBU INTO @DATA(ld_aufnr).
DATA(ld_aufnr) = ' '.
 
 
"SELECT single KOKRS FROM KKBU INTO @DATA(ld_kokrs).
 
"SELECT single KOSTL FROM KKBU INTO @DATA(ld_kostl).
DATA(ld_kostl) = ' '.
 
"SELECT single KSTRG FROM KKBU INTO @DATA(ld_kstrg).
DATA(ld_kstrg) = ' '.
 
"SELECT single LEINH FROM KKBU INTO @DATA(ld_leinh).
DATA(ld_leinh) = ' '.
 
"SELECT single LOSGR FROM KKBU INTO @DATA(ld_losgr).
DATA(ld_losgr) = ' '.
 
"SELECT single MATNR FROM KEKO INTO @DATA(ld_matnr).
DATA(ld_matnr) = ' '.
 
"SELECT single PERBL FROM KKBU INTO @DATA(ld_perio1).
DATA(ld_perio1) = ' '.
 
"SELECT single PERBL FROM KKBU INTO @DATA(ld_perio2).
DATA(ld_perio2) = ' '.
 
"SELECT single PKOST FROM KKBU INTO @DATA(ld_pkost).
DATA(ld_pkost) = ' '.
 
"SELECT single PRONR FROM KKBU INTO @DATA(ld_pronr).
DATA(ld_pronr) = ' '.
 
"SELECT single BATCH FROM SY INTO @DATA(ld_batch).
DATA(ld_batch) = ' '.
 
 
"SELECT single BGR FROM TKKB1 INTO @DATA(ld_rgjnr).
DATA(ld_rgjnr) = ' '.
 
"SELECT single VERSN FROM KKBU INTO @DATA(ld_version).
DATA(ld_version) = ' '.
 
"SELECT single TVERS FROM KKBU INTO @DATA(ld_versn).
DATA(ld_versn) = ' '.
 
"SELECT single WERKS FROM KKBU INTO @DATA(ld_werks).
DATA(ld_werks) = ' '.
 
"SELECT single KDAUF FROM KKBU INTO @DATA(ld_kdauf).
DATA(ld_kdauf) = ' '.
 
"SELECT single KDPOS FROM KKBU INTO @DATA(ld_kdpos).
DATA(ld_kdpos) = ' '.
 
"SELECT single SICHT FROM KKBU INTO @DATA(ld_sicht).
DATA(ld_sicht) = '01'.
 
"SELECT single KALNR_BA FROM KKBU INTO @DATA(ld_i_kalnr_ba).
 
"SELECT single ANW FROM TKKB1 INTO @DATA(ld_choice_j).
DATA(ld_choice_j) = ' '.
 
 
 
"SELECT single TYP FROM TKKB1 INTO @DATA(ld_calling_typ).
DATA(ld_calling_typ) = '%'.
 
"SELECT single ANW FROM TKKB1 INTO @DATA(ld_calling_anw).
DATA(ld_calling_anw) = ' '.
 
 
"SELECT single EXTNR FROM KKBU INTO @DATA(ld_extnr).
DATA(ld_extnr) = ' '.
 
"SELECT single GJAHR FROM KKBU INTO @DATA(ld_gjahr).
DATA(ld_gjahr) = ' '.
 
"SELECT single KADKY FROM KKBU INTO @DATA(ld_kadky).
DATA(ld_kadky) = ' '.
 
"SELECT single KLVAR FROM KKBU INTO @DATA(ld_klvar).
DATA(ld_klvar) = ' '.
 


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!