SAP GMKU_DELETE_ED Function Module for Delete Entry Documents
GMKU_DELETE_ED is a standard gmku delete ed SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Delete Entry Documents 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 gmku delete ed FM, simply by entering the name GMKU_DELETE_ED into the relevant SAP transaction such as SE37 or SE38.
Function Group: GMBDGT_RECON_TOOLS
Program Name: SAPLGMBDGT_RECON_TOOLS
Main Program: SAPLGMBDGT_RECON_TOOLS
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function GMKU_DELETE_ED 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 'GMKU_DELETE_ED'"Delete Entry Documents.
EXPORTING
I_COMP_CODE = "Company Code
I_VERSION = "Budget version
I_REF_MSG = "Application log with context
* I_FLG_LOCK_DOCS = 'X' "If set, the function module locks the data to be deleted
I_T_DOCID = "GM Budgeting --> Entry Document Key
* I_JUST_LDGR = ' ' "Delete just ledger records
* I_SIMULATE = ' ' "Just count the ED and lines to be deleted
IMPORTING
E_ERROR = "Error occured
E_NB_ED_DELETED = "Number of Entry Documents Deleted
E_NB_LINES_DELETED = "Number of lines Deleted
E_NB_TOTALS_DELETED = "Number of entries deleted in totals table
EXCEPTIONS
NOT_FOUND = 1 WRONG_INPUT = 2
IMPORTING Parameters details for GMKU_DELETE_ED
I_COMP_CODE - Company Code
Data type: BUKRSOptional: No
Call by Reference: Yes
I_VERSION - Budget version
Data type: GM_BDGT_VERSIONOptional: No
Call by Reference: Yes
I_REF_MSG - Application log with context
Data type: CL_BUBAS_APPL_LOG_CTXOptional: No
Call by Reference: Yes
I_FLG_LOCK_DOCS - If set, the function module locks the data to be deleted
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: Yes
I_T_DOCID - GM Budgeting --> Entry Document Key
Data type: GMBDGT_ED_T_KEYOptional: No
Call by Reference: Yes
I_JUST_LDGR - Delete just ledger records
Data type: XFELDDefault: ' '
Optional: Yes
Call by Reference: Yes
I_SIMULATE - Just count the ED and lines to be deleted
Data type: XFELDDefault: ' '
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for GMKU_DELETE_ED
E_ERROR - Error occured
Data type: XFELDOptional: No
Call by Reference: Yes
E_NB_ED_DELETED - Number of Entry Documents Deleted
Data type: IOptional: No
Call by Reference: Yes
E_NB_LINES_DELETED - Number of lines Deleted
Data type: IOptional: No
Call by Reference: Yes
E_NB_TOTALS_DELETED - Number of entries deleted in totals table
Data type: IOptional: No
Call by Reference: Yes
EXCEPTIONS details
NOT_FOUND - No ED founds
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_INPUT - Errors in the importing parameters
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for GMKU_DELETE_ED 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_error | TYPE XFELD, " | |||
| lv_not_found | TYPE XFELD, " | |||
| lv_i_comp_code | TYPE BUKRS, " | |||
| lv_i_version | TYPE GM_BDGT_VERSION, " | |||
| lv_wrong_input | TYPE GM_BDGT_VERSION, " | |||
| lv_e_nb_ed_deleted | TYPE I, " | |||
| lv_i_ref_msg | TYPE CL_BUBAS_APPL_LOG_CTX, " | |||
| lv_e_nb_lines_deleted | TYPE I, " | |||
| lv_i_flg_lock_docs | TYPE XFELD, " 'X' | |||
| lv_e_nb_totals_deleted | TYPE I, " | |||
| lv_i_t_docid | TYPE GMBDGT_ED_T_KEY, " | |||
| lv_i_just_ldgr | TYPE XFELD, " ' ' | |||
| lv_i_simulate | TYPE XFELD. " ' ' |
|   CALL FUNCTION 'GMKU_DELETE_ED' "Delete Entry Documents |
| EXPORTING | ||
| I_COMP_CODE | = lv_i_comp_code | |
| I_VERSION | = lv_i_version | |
| I_REF_MSG | = lv_i_ref_msg | |
| I_FLG_LOCK_DOCS | = lv_i_flg_lock_docs | |
| I_T_DOCID | = lv_i_t_docid | |
| I_JUST_LDGR | = lv_i_just_ldgr | |
| I_SIMULATE | = lv_i_simulate | |
| IMPORTING | ||
| E_ERROR | = lv_e_error | |
| E_NB_ED_DELETED | = lv_e_nb_ed_deleted | |
| E_NB_LINES_DELETED | = lv_e_nb_lines_deleted | |
| E_NB_TOTALS_DELETED | = lv_e_nb_totals_deleted | |
| EXCEPTIONS | ||
| NOT_FOUND = 1 | ||
| WRONG_INPUT = 2 | ||
| . " GMKU_DELETE_ED | ||
ABAP code using 7.40 inline data declarations to call FM GMKU_DELETE_ED
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_flg_lock_docs) | = 'X'. | |||
| DATA(ld_i_just_ldgr) | = ' '. | |||
| DATA(ld_i_simulate) | = ' '. | |||
Search for further information about these or an SAP related objects