SAP K_COSTS_INIT Function Module for Initialize Archiving Class K_COSTS
K_COSTS_INIT is a standard k costs init SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Initialize Archiving Class K_COSTS processing and below is the pattern details for this FM, 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 costs init FM, simply by entering the name K_COSTS_INIT into the relevant SAP transaction such as SE37 or SE38.
Function Group: KAAR
Program Name: SAPLKAAR
Main Program:
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:
Function K_COSTS_INIT 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_COSTS_INIT'"Initialize Archiving Class K_COSTS.
EXPORTING
* I_OBJ_DELETE_FLAG = 'X' "
* I_ITEMS_ONLY = "
* I_ALL_LEDGERS = 'X' "Are all the ledgers in T_LEDNR?
TABLES
* T_LEDNR = "Ledger to be archived (default '00')
* RA_GJAHR = "
* RA_WRTTP = "Select via value type
* RA_VERSN = "
* RA_PERIO = "
IMPORTING Parameters details for K_COSTS_INIT
I_OBJ_DELETE_FLAG -
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_ITEMS_ONLY -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
I_ALL_LEDGERS - Are all the ledgers in T_LEDNR?
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for K_COSTS_INIT
T_LEDNR - Ledger to be archived (default '00')
Data type: KARC_T_LEDNROptional: Yes
Call by Reference: No ( called with pass by value option)
RA_GJAHR -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
RA_WRTTP - Select via value type
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
RA_VERSN -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
RA_PERIO -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for K_COSTS_INIT 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: | ||||
lt_t_lednr | TYPE STANDARD TABLE OF KARC_T_LEDNR, " | |||
lv_i_obj_delete_flag | TYPE C, " 'X' | |||
lt_ra_gjahr | TYPE STANDARD TABLE OF C, " | |||
lv_i_items_only | TYPE C, " | |||
lt_ra_wrttp | TYPE STANDARD TABLE OF C, " | |||
lv_i_all_ledgers | TYPE C, " 'X' | |||
lt_ra_versn | TYPE STANDARD TABLE OF C, " | |||
lt_ra_perio | TYPE STANDARD TABLE OF C. " |
  CALL FUNCTION 'K_COSTS_INIT' "Initialize Archiving Class K_COSTS |
EXPORTING | ||
I_OBJ_DELETE_FLAG | = lv_i_obj_delete_flag | |
I_ITEMS_ONLY | = lv_i_items_only | |
I_ALL_LEDGERS | = lv_i_all_ledgers | |
TABLES | ||
T_LEDNR | = lt_t_lednr | |
RA_GJAHR | = lt_ra_gjahr | |
RA_WRTTP | = lt_ra_wrttp | |
RA_VERSN | = lt_ra_versn | |
RA_PERIO | = lt_ra_perio | |
. " K_COSTS_INIT |
ABAP code using 7.40 inline data declarations to call FM K_COSTS_INIT
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_obj_delete_flag) | = 'X'. | |||
DATA(ld_i_all_ledgers) | = 'X'. | |||
Search for further information about these or an SAP related objects