SAP K_COKL_READ Function Module for
K_COKL_READ is a standard k cokl 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 cokl read FM, simply by entering the name K_COKL_READ into the relevant SAP transaction such as SE37 or SE38.
Function Group: KCOA
Program Name: SAPLKCOA
Main Program: SAPLKCOA
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function K_COKL_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_COKL_READ'".
EXPORTING
COKL_READ = "Transfered COKL Record for Testing
* S_ENQUEUE_IF_NEW = 'X' "Indicator for Enqueue Setting
* TEST_READ = ' ' "Indicator for Complete COKL_READ
IMPORTING
VKSTA = "Cost Element Characteristics
FOUND = "Indicator Found
TARKZ = "
LATYP = "
LATYPI = "
TARKZ_I = "
READ_COKL = "
EXCEPTIONS
NOT_FOUND = 1
IMPORTING Parameters details for K_COKL_READ
COKL_READ - Transfered COKL Record for Testing
Data type: COKLOptional: No
Call by Reference: No ( called with pass by value option)
S_ENQUEUE_IF_NEW - Indicator for Enqueue Setting
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TEST_READ - Indicator for Complete COKL_READ
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for K_COKL_READ
VKSTA - Cost Element Characteristics
Data type: COKL-VKSTAOptional: No
Call by Reference: No ( called with pass by value option)
FOUND - Indicator Found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TARKZ -
Data type: COKL-TARKZOptional: No
Call by Reference: No ( called with pass by value option)
LATYP -
Data type: COKL-LATYPOptional: No
Call by Reference: No ( called with pass by value option)
LATYPI -
Data type: COKL-LATYPIOptional: No
Call by Reference: No ( called with pass by value option)
TARKZ_I -
Data type: COKL-TARKZ_IOptional: No
Call by Reference: No ( called with pass by value option)
READ_COKL -
Data type: COKLOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NOT_FOUND - Record Not Found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for K_COKL_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_vksta | TYPE COKL-VKSTA, " | |||
| lv_cokl_read | TYPE COKL, " | |||
| lv_not_found | TYPE COKL, " | |||
| lv_found | TYPE COKL, " | |||
| lv_s_enqueue_if_new | TYPE COKL, " 'X' | |||
| lv_tarkz | TYPE COKL-TARKZ, " | |||
| lv_test_read | TYPE COKL, " ' ' | |||
| lv_latyp | TYPE COKL-LATYP, " | |||
| lv_latypi | TYPE COKL-LATYPI, " | |||
| lv_tarkz_i | TYPE COKL-TARKZ_I, " | |||
| lv_read_cokl | TYPE COKL. " |
|   CALL FUNCTION 'K_COKL_READ' " |
| EXPORTING | ||
| COKL_READ | = lv_cokl_read | |
| S_ENQUEUE_IF_NEW | = lv_s_enqueue_if_new | |
| TEST_READ | = lv_test_read | |
| IMPORTING | ||
| VKSTA | = lv_vksta | |
| FOUND | = lv_found | |
| TARKZ | = lv_tarkz | |
| LATYP | = lv_latyp | |
| LATYPI | = lv_latypi | |
| TARKZ_I | = lv_tarkz_i | |
| READ_COKL | = lv_read_cokl | |
| EXCEPTIONS | ||
| NOT_FOUND = 1 | ||
| . " K_COKL_READ | ||
ABAP code using 7.40 inline data declarations to call FM K_COKL_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 VKSTA FROM COKL INTO @DATA(ld_vksta). | ||||
| DATA(ld_s_enqueue_if_new) | = 'X'. | |||
| "SELECT single TARKZ FROM COKL INTO @DATA(ld_tarkz). | ||||
| DATA(ld_test_read) | = ' '. | |||
| "SELECT single LATYP FROM COKL INTO @DATA(ld_latyp). | ||||
| "SELECT single LATYPI FROM COKL INTO @DATA(ld_latypi). | ||||
| "SELECT single TARKZ_I FROM COKL INTO @DATA(ld_tarkz_i). | ||||
Search for further information about these or an SAP related objects