SAP CLMA_DELETE_CLASS_WITH_OBJECTS Function Module for Delete Class with Objects Assigned
CLMA_DELETE_CLASS_WITH_OBJECTS is a standard clma delete class with objects 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 Class with Objects Assigned 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 clma delete class with objects FM, simply by entering the name CLMA_DELETE_CLASS_WITH_OBJECTS into the relevant SAP transaction such as SE37 or SE38.
Function Group: CLMA
Program Name: SAPLCLMA
Main Program: SAPLCLMA
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CLMA_DELETE_CLASS_WITH_OBJECTS 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 'CLMA_DELETE_CLASS_WITH_OBJECTS'"Delete Class with Objects Assigned.
EXPORTING
CLASSNAME = "Class Name
CLASSTYPE = "Class Type
* CHANGE_NUMBER = ' ' "Change Number
* KEY_DATE = SY-DATUM "
EXCEPTIONS
CLASS_NOT_EXIST = 1 CN_OBJ_LOCK = 10 CN_DATE_IN_PAST = 11 CN_ERROR_CLASSIF = 12 CN_NO_CHANGE_SERVICE = 13 NO_VALID_SIGN = 2 CHANGE_NUMBER_MISSING = 3 CHANGE_NUMBER_NOT_ALLOWED = 4 NO_AUTHORITY_MAINTAIN = 5 CN_ERROR_NUMBER = 6 CN_ERROR_CLASS = 7 CN_ERROR_CREATE = 8 CN_DATE_RESTRICTION = 9
IMPORTING Parameters details for CLMA_DELETE_CLASS_WITH_OBJECTS
CLASSNAME - Class Name
Data type: KLAH-CLASSOptional: No
Call by Reference: No ( called with pass by value option)
CLASSTYPE - Class Type
Data type: KLAH-KLARTOptional: No
Call by Reference: No ( called with pass by value option)
CHANGE_NUMBER - Change Number
Data type: KSML-AENNRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
KEY_DATE -
Data type: KSML-DATUVDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
CLASS_NOT_EXIST - Class Not Found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CN_OBJ_LOCK - Change number: processing class with change number locked
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CN_DATE_IN_PAST - Change date is in the past
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CN_ERROR_CLASSIF - Change Number: Not Active for Classification
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CN_NO_CHANGE_SERVICE - Class Type Does not Support ECH for Classification
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_VALID_SIGN - Class Number Contains Invalid Characters
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CHANGE_NUMBER_MISSING - Change Number Missing
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CHANGE_NUMBER_NOT_ALLOWED - Already Changed on Date with Different Change Number
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_AUTHORITY_MAINTAIN - No Change Authorization for Class
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CN_ERROR_NUMBER - Change Number Not Found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CN_ERROR_CLASS - Change Number Not Active for Class
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CN_ERROR_CREATE - Change Number Not Active for Class
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CN_DATE_RESTRICTION - Change Number: Date in Reserved Range
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CLMA_DELETE_CLASS_WITH_OBJECTS 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_classname | TYPE KLAH-CLASS, " | |||
| lv_class_not_exist | TYPE KLAH, " | |||
| lv_cn_obj_lock | TYPE KLAH, " | |||
| lv_cn_date_in_past | TYPE KLAH, " | |||
| lv_cn_error_classif | TYPE KLAH, " | |||
| lv_cn_no_change_service | TYPE KLAH, " | |||
| lv_classtype | TYPE KLAH-KLART, " | |||
| lv_no_valid_sign | TYPE KLAH, " | |||
| lv_change_number | TYPE KSML-AENNR, " SPACE | |||
| lv_change_number_missing | TYPE KSML, " | |||
| lv_key_date | TYPE KSML-DATUV, " SY-DATUM | |||
| lv_change_number_not_allowed | TYPE KSML, " | |||
| lv_no_authority_maintain | TYPE KSML, " | |||
| lv_cn_error_number | TYPE KSML, " | |||
| lv_cn_error_class | TYPE KSML, " | |||
| lv_cn_error_create | TYPE KSML, " | |||
| lv_cn_date_restriction | TYPE KSML. " |
|   CALL FUNCTION 'CLMA_DELETE_CLASS_WITH_OBJECTS' "Delete Class with Objects Assigned |
| EXPORTING | ||
| CLASSNAME | = lv_classname | |
| CLASSTYPE | = lv_classtype | |
| CHANGE_NUMBER | = lv_change_number | |
| KEY_DATE | = lv_key_date | |
| EXCEPTIONS | ||
| CLASS_NOT_EXIST = 1 | ||
| CN_OBJ_LOCK = 10 | ||
| CN_DATE_IN_PAST = 11 | ||
| CN_ERROR_CLASSIF = 12 | ||
| CN_NO_CHANGE_SERVICE = 13 | ||
| NO_VALID_SIGN = 2 | ||
| CHANGE_NUMBER_MISSING = 3 | ||
| CHANGE_NUMBER_NOT_ALLOWED = 4 | ||
| NO_AUTHORITY_MAINTAIN = 5 | ||
| CN_ERROR_NUMBER = 6 | ||
| CN_ERROR_CLASS = 7 | ||
| CN_ERROR_CREATE = 8 | ||
| CN_DATE_RESTRICTION = 9 | ||
| . " CLMA_DELETE_CLASS_WITH_OBJECTS | ||
ABAP code using 7.40 inline data declarations to call FM CLMA_DELETE_CLASS_WITH_OBJECTS
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 CLASS FROM KLAH INTO @DATA(ld_classname). | ||||
| "SELECT single KLART FROM KLAH INTO @DATA(ld_classtype). | ||||
| "SELECT single AENNR FROM KSML INTO @DATA(ld_change_number). | ||||
| DATA(ld_change_number) | = ' '. | |||
| "SELECT single DATUV FROM KSML INTO @DATA(ld_key_date). | ||||
| DATA(ld_key_date) | = SY-DATUM. | |||
Search for further information about these or an SAP related objects