SAP CLCM_CLASS_CHANGE Function Module for Change class (in background, without screens)









CLCM_CLASS_CHANGE is a standard clcm class change SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Change class (in background, without screens) 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 clcm class change FM, simply by entering the name CLCM_CLASS_CHANGE into the relevant SAP transaction such as SE37 or SE38.

Function Group: CLCM
Program Name: SAPLCLCM
Main Program: SAPLCLCM
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CLCM_CLASS_CHANGE 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 'CLCM_CLASS_CHANGE'"Change class (in background, without screens)
EXPORTING
CLASSNAME = "Class Name / Class Number
CLASSTYPE = "Class Type
* CHANGE_NUMBER = "Change Number
* KLBASIC = "Basic data for class
* KLDOCUMENT = "Document key
* KLADDITIONAL = "Additional data for class
* KLNORMDATA = "Standards data
* KEY_DATE = SY-DATUM "Valid-From Date

IMPORTING
ERROR = "Error that is not an exception

TABLES
* TFEATURES = "Characteristics
* TCATCH = "Keywords Table (All Languages)
* TKLAT = "Table of descriptions for long texts
* THEADER = "Long texts: header (for SAPTEXT)
* TLINES = "Long texts: lines (for SAPTEXT)
* TCABN_O = "Characteristics: overwritten data
* TCAWN_O = "Characteristic values: overwritten
* TCAWNT_O = "Value descriptions: overwritten

EXCEPTIONS
NO_RETAIL_CLASS = 1
.



IMPORTING Parameters details for CLCM_CLASS_CHANGE

CLASSNAME - Class Name / Class Number

Data type: KLAH-CLASS
Optional: No
Call by Reference: No ( called with pass by value option)

CLASSTYPE - Class Type

Data type: KLAH-KLART
Optional: No
Call by Reference: No ( called with pass by value option)

CHANGE_NUMBER - Change Number

Data type: KSML-AENNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

KLBASIC - Basic data for class

Data type: KLBASD
Optional: Yes
Call by Reference: No ( called with pass by value option)

KLDOCUMENT - Document key

Data type: KLDOKM
Optional: Yes
Call by Reference: No ( called with pass by value option)

KLADDITIONAL - Additional data for class

Data type: KLZUSD
Optional: Yes
Call by Reference: No ( called with pass by value option)

KLNORMDATA - Standards data

Data type: KLNORM
Optional: Yes
Call by Reference: No ( called with pass by value option)

KEY_DATE - Valid-From Date

Data type: SY-DATUM
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for CLCM_CLASS_CHANGE

ERROR - Error that is not an exception

Data type: SY-BINPT
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for CLCM_CLASS_CHANGE

TFEATURES - Characteristics

Data type: CLMERK
Optional: Yes
Call by Reference: No ( called with pass by value option)

TCATCH - Keywords Table (All Languages)

Data type: SCHLAG
Optional: Yes
Call by Reference: No ( called with pass by value option)

TKLAT - Table of descriptions for long texts

Data type: KLKLAT
Optional: Yes
Call by Reference: No ( called with pass by value option)

THEADER - Long texts: header (for SAPTEXT)

Data type: THEAD
Optional: Yes
Call by Reference: No ( called with pass by value option)

TLINES - Long texts: lines (for SAPTEXT)

Data type: TLINE
Optional: Yes
Call by Reference: No ( called with pass by value option)

TCABN_O - Characteristics: overwritten data

Data type: CLA_CH_CHG
Optional: Yes
Call by Reference: No ( called with pass by value option)

TCAWN_O - Characteristic values: overwritten

Data type: CLA_CH_VAL
Optional: Yes
Call by Reference: No ( called with pass by value option)

TCAWNT_O - Value descriptions: overwritten

Data type: CLA_CH_VDS
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

NO_RETAIL_CLASS - SAP Retail Object Cannot Be Maintained

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for CLCM_CLASS_CHANGE 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_error  TYPE SY-BINPT, "   
lv_classname  TYPE KLAH-CLASS, "   
lt_tfeatures  TYPE STANDARD TABLE OF CLMERK, "   
lv_no_retail_class  TYPE CLMERK, "   
lt_tcatch  TYPE STANDARD TABLE OF SCHLAG, "   
lv_classtype  TYPE KLAH-KLART, "   
lt_tklat  TYPE STANDARD TABLE OF KLKLAT, "   
lv_change_number  TYPE KSML-AENNR, "   
lv_klbasic  TYPE KLBASD, "   
lt_theader  TYPE STANDARD TABLE OF THEAD, "   
lt_tlines  TYPE STANDARD TABLE OF TLINE, "   
lv_kldocument  TYPE KLDOKM, "   
lt_tcabn_o  TYPE STANDARD TABLE OF CLA_CH_CHG, "   
lv_kladditional  TYPE KLZUSD, "   
lt_tcawn_o  TYPE STANDARD TABLE OF CLA_CH_VAL, "   
lv_klnormdata  TYPE KLNORM, "   
lv_key_date  TYPE SY-DATUM, "   SY-DATUM
lt_tcawnt_o  TYPE STANDARD TABLE OF CLA_CH_VDS. "   

  CALL FUNCTION 'CLCM_CLASS_CHANGE'  "Change class (in background, without screens)
    EXPORTING
         CLASSNAME = lv_classname
         CLASSTYPE = lv_classtype
         CHANGE_NUMBER = lv_change_number
         KLBASIC = lv_klbasic
         KLDOCUMENT = lv_kldocument
         KLADDITIONAL = lv_kladditional
         KLNORMDATA = lv_klnormdata
         KEY_DATE = lv_key_date
    IMPORTING
         ERROR = lv_error
    TABLES
         TFEATURES = lt_tfeatures
         TCATCH = lt_tcatch
         TKLAT = lt_tklat
         THEADER = lt_theader
         TLINES = lt_tlines
         TCABN_O = lt_tcabn_o
         TCAWN_O = lt_tcawn_o
         TCAWNT_O = lt_tcawnt_o
    EXCEPTIONS
        NO_RETAIL_CLASS = 1
. " CLCM_CLASS_CHANGE




ABAP code using 7.40 inline data declarations to call FM CLCM_CLASS_CHANGE

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 BINPT FROM SY INTO @DATA(ld_error).
 
"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).
 
 
 
 
 
 
 
 
 
"SELECT single DATUM FROM SY INTO @DATA(ld_key_date).
DATA(ld_key_date) = SY-DATUM.
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!