SAP K_UNITCOSTING_READ Function Module for









K_UNITCOSTING_READ is a standard k unitcosting read 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 unitcosting read FM, simply by entering the name K_UNITCOSTING_READ into the relevant SAP transaction such as SE37 or SE38.

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



Function K_UNITCOSTING_READ 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_UNITCOSTING_READ'"
EXPORTING
FEL_BWVAR = "Valuation variant
FEL_BZOBJ = "Reference object
FEL_KADKY = "Costing date (key)
FEL_KALKA = "Calculation category
FEL_KALNR = "Costing number(product costing/unit costing)
FEL_KKZMA = "Costing indicator entered manually
FEL_LEDNR = "
FEL_SPRAS = "Language
FEL_TVERS = "Costing version

IMPORTING
FEL_KHS1 = "internal structure CKHS + CKHT

TABLES
* FEL_TAB_CKIT = "internal table foreign language texts
* FEL_TAB_KIS1 = "internal table items with text

EXCEPTIONS
FEL_NOT_FOUND = 1
.



IMPORTING Parameters details for K_UNITCOSTING_READ

FEL_BWVAR - Valuation variant

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

FEL_BZOBJ - Reference object

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

FEL_KADKY - Costing date (key)

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

FEL_KALKA - Calculation category

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

FEL_KALNR - Costing number(product costing/unit costing)

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

FEL_KKZMA - Costing indicator entered manually

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

FEL_LEDNR -

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

FEL_SPRAS - Language

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

FEL_TVERS - Costing version

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

EXPORTING Parameters details for K_UNITCOSTING_READ

FEL_KHS1 - internal structure CKHS + CKHT

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

TABLES Parameters details for K_UNITCOSTING_READ

FEL_TAB_CKIT - internal table foreign language texts

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

FEL_TAB_KIS1 - internal table items with text

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

EXCEPTIONS details

FEL_NOT_FOUND - Unit costing header not found

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

Copy and paste ABAP code example for K_UNITCOSTING_READ 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_fel_khs1  TYPE KHS1, "   
lv_fel_bwvar  TYPE CKHS-BWVAR, "   
lt_fel_tab_ckit  TYPE STANDARD TABLE OF CKIT, "   
lv_fel_not_found  TYPE CKIT, "   
lv_fel_bzobj  TYPE CKHS-BZOBJ, "   
lt_fel_tab_kis1  TYPE STANDARD TABLE OF KIS1, "   
lv_fel_kadky  TYPE CKHS-KADKY, "   
lv_fel_kalka  TYPE CKHS-KALKA, "   
lv_fel_kalnr  TYPE CKHS-KALNR, "   
lv_fel_kkzma  TYPE CKHS-KKZMA, "   
lv_fel_lednr  TYPE CKHS-LEDNR, "   
lv_fel_spras  TYPE CKHT-SPRAS, "   
lv_fel_tvers  TYPE CKHS-TVERS. "   

  CALL FUNCTION 'K_UNITCOSTING_READ'  "
    EXPORTING
         FEL_BWVAR = lv_fel_bwvar
         FEL_BZOBJ = lv_fel_bzobj
         FEL_KADKY = lv_fel_kadky
         FEL_KALKA = lv_fel_kalka
         FEL_KALNR = lv_fel_kalnr
         FEL_KKZMA = lv_fel_kkzma
         FEL_LEDNR = lv_fel_lednr
         FEL_SPRAS = lv_fel_spras
         FEL_TVERS = lv_fel_tvers
    IMPORTING
         FEL_KHS1 = lv_fel_khs1
    TABLES
         FEL_TAB_CKIT = lt_fel_tab_ckit
         FEL_TAB_KIS1 = lt_fel_tab_kis1
    EXCEPTIONS
        FEL_NOT_FOUND = 1
. " K_UNITCOSTING_READ




ABAP code using 7.40 inline data declarations to call FM K_UNITCOSTING_READ

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 BWVAR FROM CKHS INTO @DATA(ld_fel_bwvar).
 
 
 
"SELECT single BZOBJ FROM CKHS INTO @DATA(ld_fel_bzobj).
 
 
"SELECT single KADKY FROM CKHS INTO @DATA(ld_fel_kadky).
 
"SELECT single KALKA FROM CKHS INTO @DATA(ld_fel_kalka).
 
"SELECT single KALNR FROM CKHS INTO @DATA(ld_fel_kalnr).
 
"SELECT single KKZMA FROM CKHS INTO @DATA(ld_fel_kkzma).
 
"SELECT single LEDNR FROM CKHS INTO @DATA(ld_fel_lednr).
 
"SELECT single SPRAS FROM CKHT INTO @DATA(ld_fel_spras).
 
"SELECT single TVERS FROM CKHS INTO @DATA(ld_fel_tvers).
 


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!