SAP K_COST_OBJECTS_CREATE Function Module for









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

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



Function K_COST_OBJECTS_CREATE 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_COST_OBJECTS_CREATE'"
EXPORTING
* I_SCREEN = ' ' "
* I_MSG_SEND = '0' "
I_KTRAT = "
* I_WITH_PROFILE = ' ' "

IMPORTING
E_COMMIT = "
E_EXIT_BY_USER = "
E_CKPHS = "

TABLES
* T_OBJECT_ENTRY = "
* T_FIELD_CAT = "

EXCEPTIONS
INPUT_ERROR = 1 NOT_FOUND = 2 NO_AUTHORITY = 3
.



IMPORTING Parameters details for K_COST_OBJECTS_CREATE

I_SCREEN -

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

I_MSG_SEND -

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

I_KTRAT -

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

I_WITH_PROFILE -

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

EXPORTING Parameters details for K_COST_OBJECTS_CREATE

E_COMMIT -

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

E_EXIT_BY_USER -

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

E_CKPHS -

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

TABLES Parameters details for K_COST_OBJECTS_CREATE

T_OBJECT_ENTRY -

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

T_FIELD_CAT -

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

EXCEPTIONS details

INPUT_ERROR - Incomplete Call Parameter

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

NOT_FOUND -

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)

Copy and paste ABAP code example for K_COST_OBJECTS_CREATE 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_commit  TYPE C, "   
lv_i_screen  TYPE C, "   SPACE
lv_input_error  TYPE C, "   
lt_t_object_entry  TYPE STANDARD TABLE OF KKP0_T_COSTOBJ_ENTRY, "   
lv_not_found  TYPE KKP0_T_COSTOBJ_ENTRY, "   
lv_i_msg_send  TYPE C, "   '0'
lt_t_field_cat  TYPE STANDARD TABLE OF KKP0_T_FNAME, "   
lv_e_exit_by_user  TYPE C, "   
lv_e_ckphs  TYPE CKPHS, "   
lv_i_ktrat  TYPE CKPHS-KTRAT, "   
lv_no_authority  TYPE CKPHS, "   
lv_i_with_profile  TYPE C. "   SPACE

  CALL FUNCTION 'K_COST_OBJECTS_CREATE'  "
    EXPORTING
         I_SCREEN = lv_i_screen
         I_MSG_SEND = lv_i_msg_send
         I_KTRAT = lv_i_ktrat
         I_WITH_PROFILE = lv_i_with_profile
    IMPORTING
         E_COMMIT = lv_e_commit
         E_EXIT_BY_USER = lv_e_exit_by_user
         E_CKPHS = lv_e_ckphs
    TABLES
         T_OBJECT_ENTRY = lt_t_object_entry
         T_FIELD_CAT = lt_t_field_cat
    EXCEPTIONS
        INPUT_ERROR = 1
        NOT_FOUND = 2
        NO_AUTHORITY = 3
. " K_COST_OBJECTS_CREATE




ABAP code using 7.40 inline data declarations to call FM K_COST_OBJECTS_CREATE

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.

 
DATA(ld_i_screen) = ' '.
 
 
 
 
DATA(ld_i_msg_send) = '0'.
 
 
 
 
"SELECT single KTRAT FROM CKPHS INTO @DATA(ld_i_ktrat).
 
 
DATA(ld_i_with_profile) = ' '.
 


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!