SAP PM_CL_FIND_MAINCLASS Function Module for NOTRANSL: PM: liefert zu einem Objekt die Hauptklasse
PM_CL_FIND_MAINCLASS is a standard pm cl find mainclass SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: PM: liefert zu einem Objekt die Hauptklasse 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 pm cl find mainclass FM, simply by entering the name PM_CL_FIND_MAINCLASS into the relevant SAP transaction such as SE37 or SE38.
Function Group: IHCL
Program Name: SAPLIHCL
Main Program: SAPLIHCL
Appliation area: I
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function PM_CL_FIND_MAINCLASS 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 'PM_CL_FIND_MAINCLASS'"NOTRANSL: PM: liefert zu einem Objekt die Hauptklasse.
EXPORTING
I_OBJECT = "Object
I_OBTAB = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* I_DATE_OF_CHANGE = SY-DATUM "DE-EN-LANG-SWITCH-NO-TRANSLATION
* I_ACTIVITY = 'A' "Activity Category in Transaction (Cr/Ch/D)
IMPORTING
E_CLASS = "DE-EN-LANG-SWITCH-NO-TRANSLATION
E_CLASSTYPE = "Class Type
E_CLASSTEXT = "
E_UNIQUE_MAINCLASS = "DE-EN-LANG-SWITCH-NO-TRANSLATION
E_NUMBER_OF_ALLOCATIONS = "DE-EN-LANG-SWITCH-NO-TRANSLATION
EXCEPTIONS
ERROR_IN_CLASSIFICATION = 1
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLIHCL_001 IHCL Customer Include: Default Values for Classes and Characteristics
IMPORTING Parameters details for PM_CL_FIND_MAINCLASS
I_OBJECT - Object
Data type: KSSK-OBJEKOptional: No
Call by Reference: No ( called with pass by value option)
I_OBTAB - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type: TCLT-OBTABOptional: No
Call by Reference: No ( called with pass by value option)
I_DATE_OF_CHANGE - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type: RMCLF-DATUV1Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_ACTIVITY - Activity Category in Transaction (Cr/Ch/D)
Data type: T370-AKTYPDefault: 'A'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for PM_CL_FIND_MAINCLASS
E_CLASS - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type: KLAH-CLASSOptional: No
Call by Reference: No ( called with pass by value option)
E_CLASSTYPE - Class Type
Data type: KLAH-KLARTOptional: No
Call by Reference: No ( called with pass by value option)
E_CLASSTEXT -
Data type: API_KSSK-KLTXTOptional: No
Call by Reference: No ( called with pass by value option)
E_UNIQUE_MAINCLASS - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type: EQKT-KZLTXOptional: No
Call by Reference: No ( called with pass by value option)
E_NUMBER_OF_ALLOCATIONS - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ERROR_IN_CLASSIFICATION - Other errors
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for PM_CL_FIND_MAINCLASS 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_class | TYPE KLAH-CLASS, " | |||
| lv_i_object | TYPE KSSK-OBJEK, " | |||
| lv_error_in_classification | TYPE KSSK, " | |||
| lv_i_obtab | TYPE TCLT-OBTAB, " | |||
| lv_e_classtype | TYPE KLAH-KLART, " | |||
| lv_e_classtext | TYPE API_KSSK-KLTXT, " | |||
| lv_i_date_of_change | TYPE RMCLF-DATUV1, " SY-DATUM | |||
| lv_i_activity | TYPE T370-AKTYP, " 'A' | |||
| lv_e_unique_mainclass | TYPE EQKT-KZLTX, " | |||
| lv_e_number_of_allocations | TYPE SY-TABIX. " |
|   CALL FUNCTION 'PM_CL_FIND_MAINCLASS' "NOTRANSL: PM: liefert zu einem Objekt die Hauptklasse |
| EXPORTING | ||
| I_OBJECT | = lv_i_object | |
| I_OBTAB | = lv_i_obtab | |
| I_DATE_OF_CHANGE | = lv_i_date_of_change | |
| I_ACTIVITY | = lv_i_activity | |
| IMPORTING | ||
| E_CLASS | = lv_e_class | |
| E_CLASSTYPE | = lv_e_classtype | |
| E_CLASSTEXT | = lv_e_classtext | |
| E_UNIQUE_MAINCLASS | = lv_e_unique_mainclass | |
| E_NUMBER_OF_ALLOCATIONS | = lv_e_number_of_allocations | |
| EXCEPTIONS | ||
| ERROR_IN_CLASSIFICATION = 1 | ||
| . " PM_CL_FIND_MAINCLASS | ||
ABAP code using 7.40 inline data declarations to call FM PM_CL_FIND_MAINCLASS
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_e_class). | ||||
| "SELECT single OBJEK FROM KSSK INTO @DATA(ld_i_object). | ||||
| "SELECT single OBTAB FROM TCLT INTO @DATA(ld_i_obtab). | ||||
| "SELECT single KLART FROM KLAH INTO @DATA(ld_e_classtype). | ||||
| "SELECT single KLTXT FROM API_KSSK INTO @DATA(ld_e_classtext). | ||||
| "SELECT single DATUV1 FROM RMCLF INTO @DATA(ld_i_date_of_change). | ||||
| DATA(ld_i_date_of_change) | = SY-DATUM. | |||
| "SELECT single AKTYP FROM T370 INTO @DATA(ld_i_activity). | ||||
| DATA(ld_i_activity) | = 'A'. | |||
| "SELECT single KZLTX FROM EQKT INTO @DATA(ld_e_unique_mainclass). | ||||
| "SELECT single TABIX FROM SY INTO @DATA(ld_e_number_of_allocations). | ||||
Search for further information about these or an SAP related objects