SAP K_OBJECT_DELETE Function Module for Deleting the Object-Number-Dependent Tables for a CO Object
K_OBJECT_DELETE is a standard k object delete SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Deleting the Object-Number-Dependent Tables for a CO Object 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 object delete FM, simply by entering the name K_OBJECT_DELETE into the relevant SAP transaction such as SE37 or SE38.
Function Group: KADL
Program Name: SAPLKADL
Main Program: SAPLKADL
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update: 1

Function K_OBJECT_DELETE 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_OBJECT_DELETE'"Deleting the Object-Number-Dependent Tables for a CO Object.
EXPORTING
* MASTER_DATA = ' ' "Flag 'Also delete tables with similar master data'
* NO_COMMIT = ' ' "Flag 'No COMMIT WORK'
* OBJNR = ' ' "Object number
* OBART = ' ' "Object type for the object number(s) to be deleted
* BLOCKING_SIZE = '30' "
TABLES
* T_OBJNR = "Table with object numbers
* T_STAT = "Transfer of statistics data to archiving
EXCEPTIONS
MISSING_INPUT = 1 OBJNR_WITH_WRONG_OBART = 2
IMPORTING Parameters details for K_OBJECT_DELETE
MASTER_DATA - Flag 'Also delete tables with similar master data'
Data type: BOOLE-BOOLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_COMMIT - Flag 'No COMMIT WORK'
Data type: BOOLE-BOOLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
OBJNR - Object number
Data type: ONR00-OBJNRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
OBART - Object type for the object number(s) to be deleted
Data type: IONRA-OBARTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
BLOCKING_SIZE -
Data type: ARCH_USR-ARCH_COMITDefault: '30'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for K_OBJECT_DELETE
T_OBJNR - Table with object numbers
Data type: IONRBOptional: Yes
Call by Reference: No ( called with pass by value option)
T_STAT - Transfer of statistics data to archiving
Data type: ARCH_STATOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
MISSING_INPUT - No object number(s) specified
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OBJNR_WITH_WRONG_OBART - Object number has incorrect object type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for K_OBJECT_DELETE 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_objnr | TYPE STANDARD TABLE OF IONRB, " | |||
| lv_master_data | TYPE BOOLE-BOOLE, " SPACE | |||
| lv_missing_input | TYPE BOOLE, " | |||
| lt_t_stat | TYPE STANDARD TABLE OF ARCH_STAT, " | |||
| lv_no_commit | TYPE BOOLE-BOOLE, " SPACE | |||
| lv_objnr_with_wrong_obart | TYPE BOOLE, " | |||
| lv_objnr | TYPE ONR00-OBJNR, " SPACE | |||
| lv_obart | TYPE IONRA-OBART, " SPACE | |||
| lv_blocking_size | TYPE ARCH_USR-ARCH_COMIT. " '30' |
|   CALL FUNCTION 'K_OBJECT_DELETE' "Deleting the Object-Number-Dependent Tables for a CO Object |
| EXPORTING | ||
| MASTER_DATA | = lv_master_data | |
| NO_COMMIT | = lv_no_commit | |
| OBJNR | = lv_objnr | |
| OBART | = lv_obart | |
| BLOCKING_SIZE | = lv_blocking_size | |
| TABLES | ||
| T_OBJNR | = lt_t_objnr | |
| T_STAT | = lt_t_stat | |
| EXCEPTIONS | ||
| MISSING_INPUT = 1 | ||
| OBJNR_WITH_WRONG_OBART = 2 | ||
| . " K_OBJECT_DELETE | ||
ABAP code using 7.40 inline data declarations to call FM K_OBJECT_DELETE
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 BOOLE FROM BOOLE INTO @DATA(ld_master_data). | ||||
| DATA(ld_master_data) | = ' '. | |||
| "SELECT single BOOLE FROM BOOLE INTO @DATA(ld_no_commit). | ||||
| DATA(ld_no_commit) | = ' '. | |||
| "SELECT single OBJNR FROM ONR00 INTO @DATA(ld_objnr). | ||||
| DATA(ld_objnr) | = ' '. | |||
| "SELECT single OBART FROM IONRA INTO @DATA(ld_obart). | ||||
| DATA(ld_obart) | = ' '. | |||
| "SELECT single ARCH_COMIT FROM ARCH_USR INTO @DATA(ld_blocking_size). | ||||
| DATA(ld_blocking_size) | = '30'. | |||
Search for further information about these or an SAP related objects