SAP K_DOCUMENT_UPDATE Function Module for
K_DOCUMENT_UPDATE is a standard k document update 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 document update FM, simply by entering the name K_DOCUMENT_UPDATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: KAUP
Program Name: SAPLKAUP
Main Program:
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update: 1
Function K_DOCUMENT_UPDATE 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_DOCUMENT_UPDATE'".
EXPORTING
* I_TOTALS_UPDATE = 'X' "Flag 'Update totals records'
* I_RCL_UPDATE = 'X' "Flag 'Update cost element ledger'
* I_ITEMS_INSERT = 'X' "Flag 'Update line items'
* I_SAVE_DIRECTLY = ' ' "Flag 'Update data directly (instead of ON COMMIT)'
* I_MAX_PERIOD = '999' "Maximum period for statistical key figures
* I_LATE_COEP_INS = ' ' "
TABLES
* T_COBK = "Tabel COBK
* T_COEJTA = "Table COEJTA
* T_COEP = "Table COEP
* T_COEPB = "Table COEPB
* T_COEPL = "Table COEPL
* T_COEPR = "Table COEPR
* T_COEPT = "Table COEPT
* T_COEJA = "Table COEJA
* T_COEJLA = "Table COEJLA
* T_COEJRA = "Table COEJRA
IMPORTING Parameters details for K_DOCUMENT_UPDATE
I_TOTALS_UPDATE - Flag 'Update totals records'
Data type: SY-BATCHDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_RCL_UPDATE - Flag 'Update cost element ledger'
Data type: SY-BATCHDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_ITEMS_INSERT - Flag 'Update line items'
Data type: SY-BATCHDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_SAVE_DIRECTLY - Flag 'Update data directly (instead of ON COMMIT)'
Data type: SY-BATCHDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MAX_PERIOD - Maximum period for statistical key figures
Data type: COEPR-PERIODefault: '999'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_LATE_COEP_INS -
Data type: SY-BATCHDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for K_DOCUMENT_UPDATE
T_COBK - Tabel COBK
Data type: COBKOptional: Yes
Call by Reference: No ( called with pass by value option)
T_COEJTA - Table COEJTA
Data type: COEJTAOptional: Yes
Call by Reference: No ( called with pass by value option)
T_COEP - Table COEP
Data type: COEPOptional: Yes
Call by Reference: No ( called with pass by value option)
T_COEPB - Table COEPB
Data type: COEPBOptional: Yes
Call by Reference: No ( called with pass by value option)
T_COEPL - Table COEPL
Data type: COEPLOptional: Yes
Call by Reference: No ( called with pass by value option)
T_COEPR - Table COEPR
Data type: COEPROptional: Yes
Call by Reference: No ( called with pass by value option)
T_COEPT - Table COEPT
Data type: COEPTOptional: Yes
Call by Reference: No ( called with pass by value option)
T_COEJA - Table COEJA
Data type: COEJAOptional: Yes
Call by Reference: No ( called with pass by value option)
T_COEJLA - Table COEJLA
Data type: COEJLAOptional: Yes
Call by Reference: No ( called with pass by value option)
T_COEJRA - Table COEJRA
Data type: COEJRAOptional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for K_DOCUMENT_UPDATE 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_cobk | TYPE STANDARD TABLE OF COBK, " | |||
lv_i_totals_update | TYPE SY-BATCH, " 'X' | |||
lt_t_coejta | TYPE STANDARD TABLE OF COEJTA, " | |||
lt_t_coep | TYPE STANDARD TABLE OF COEP, " | |||
lv_i_rcl_update | TYPE SY-BATCH, " 'X' | |||
lt_t_coepb | TYPE STANDARD TABLE OF COEPB, " | |||
lv_i_items_insert | TYPE SY-BATCH, " 'X' | |||
lt_t_coepl | TYPE STANDARD TABLE OF COEPL, " | |||
lv_i_save_directly | TYPE SY-BATCH, " ' ' | |||
lt_t_coepr | TYPE STANDARD TABLE OF COEPR, " | |||
lv_i_max_period | TYPE COEPR-PERIO, " '999' | |||
lt_t_coept | TYPE STANDARD TABLE OF COEPT, " | |||
lv_i_late_coep_ins | TYPE SY-BATCH, " ' ' | |||
lt_t_coeja | TYPE STANDARD TABLE OF COEJA, " | |||
lt_t_coejla | TYPE STANDARD TABLE OF COEJLA, " | |||
lt_t_coejra | TYPE STANDARD TABLE OF COEJRA. " |
  CALL FUNCTION 'K_DOCUMENT_UPDATE' " |
EXPORTING | ||
I_TOTALS_UPDATE | = lv_i_totals_update | |
I_RCL_UPDATE | = lv_i_rcl_update | |
I_ITEMS_INSERT | = lv_i_items_insert | |
I_SAVE_DIRECTLY | = lv_i_save_directly | |
I_MAX_PERIOD | = lv_i_max_period | |
I_LATE_COEP_INS | = lv_i_late_coep_ins | |
TABLES | ||
T_COBK | = lt_t_cobk | |
T_COEJTA | = lt_t_coejta | |
T_COEP | = lt_t_coep | |
T_COEPB | = lt_t_coepb | |
T_COEPL | = lt_t_coepl | |
T_COEPR | = lt_t_coepr | |
T_COEPT | = lt_t_coept | |
T_COEJA | = lt_t_coeja | |
T_COEJLA | = lt_t_coejla | |
T_COEJRA | = lt_t_coejra | |
. " K_DOCUMENT_UPDATE |
ABAP code using 7.40 inline data declarations to call FM K_DOCUMENT_UPDATE
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 BATCH FROM SY INTO @DATA(ld_i_totals_update). | ||||
DATA(ld_i_totals_update) | = 'X'. | |||
"SELECT single BATCH FROM SY INTO @DATA(ld_i_rcl_update). | ||||
DATA(ld_i_rcl_update) | = 'X'. | |||
"SELECT single BATCH FROM SY INTO @DATA(ld_i_items_insert). | ||||
DATA(ld_i_items_insert) | = 'X'. | |||
"SELECT single BATCH FROM SY INTO @DATA(ld_i_save_directly). | ||||
DATA(ld_i_save_directly) | = ' '. | |||
"SELECT single PERIO FROM COEPR INTO @DATA(ld_i_max_period). | ||||
DATA(ld_i_max_period) | = '999'. | |||
"SELECT single BATCH FROM SY INTO @DATA(ld_i_late_coep_ins). | ||||
DATA(ld_i_late_coep_ins) | = ' '. | |||
Search for further information about these or an SAP related objects