SAP READ_COSTELEMENT Function Module for









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

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



Function READ_COSTELEMENT 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 'READ_COSTELEMENT'"
EXPORTING
DATAB = "Lower Interval Limit
DATBI = "Upper Range Limit
* ICSKA = ' ' "
* ICSKU = ' ' "
KOKRS = "
KSTAR = "cost element to be selected
* NO_BUFFER = ' ' "

IMPORTING
KOTYP = "
TXT_FLAG = "Texts in system language are not c

TABLES
SEL_INT = "Selected cost element ranges

EXCEPTIONS
CSKB_NOT_COMPLETE = 1 CSKB_NOT_FOUND = 2
.



IMPORTING Parameters details for READ_COSTELEMENT

DATAB - Lower Interval Limit

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

DATBI - Upper Range Limit

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

ICSKA -

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

ICSKU -

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

KOKRS -

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

KSTAR - cost element to be selected

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

NO_BUFFER -

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

EXPORTING Parameters details for READ_COSTELEMENT

KOTYP -

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

TXT_FLAG - Texts in system language are not c

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

TABLES Parameters details for READ_COSTELEMENT

SEL_INT - Selected cost element ranges

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

EXCEPTIONS details

CSKB_NOT_COMPLETE -

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

CSKB_NOT_FOUND -

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

Copy and paste ABAP code example for READ_COSTELEMENT 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_datab  TYPE CSKB-DATAB, "   
lv_kotyp  TYPE CSKB-KATYP, "   
lt_sel_int  TYPE STANDARD TABLE OF CSKB, "   
lv_cskb_not_complete  TYPE CSKB, "   
lv_datbi  TYPE CSKB-DATBI, "   
lv_txt_flag  TYPE CSKB, "   
lv_cskb_not_found  TYPE CSKB, "   
lv_icska  TYPE CSKA, "   SPACE
lv_icsku  TYPE CSKU, "   SPACE
lv_kokrs  TYPE CSKB-KOKRS, "   
lv_kstar  TYPE CSKB-KSTAR, "   
lv_no_buffer  TYPE CSKB. "   SPACE

  CALL FUNCTION 'READ_COSTELEMENT'  "
    EXPORTING
         DATAB = lv_datab
         DATBI = lv_datbi
         ICSKA = lv_icska
         ICSKU = lv_icsku
         KOKRS = lv_kokrs
         KSTAR = lv_kstar
         NO_BUFFER = lv_no_buffer
    IMPORTING
         KOTYP = lv_kotyp
         TXT_FLAG = lv_txt_flag
    TABLES
         SEL_INT = lt_sel_int
    EXCEPTIONS
        CSKB_NOT_COMPLETE = 1
        CSKB_NOT_FOUND = 2
. " READ_COSTELEMENT




ABAP code using 7.40 inline data declarations to call FM READ_COSTELEMENT

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 DATAB FROM CSKB INTO @DATA(ld_datab).
 
"SELECT single KATYP FROM CSKB INTO @DATA(ld_kotyp).
 
 
 
"SELECT single DATBI FROM CSKB INTO @DATA(ld_datbi).
 
 
 
DATA(ld_icska) = ' '.
 
DATA(ld_icsku) = ' '.
 
"SELECT single KOKRS FROM CSKB INTO @DATA(ld_kokrs).
 
"SELECT single KSTAR FROM CSKB INTO @DATA(ld_kstar).
 
DATA(ld_no_buffer) = ' '.
 


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!