SAP Function Modules

CLUF_USAGE_FEATURES_IN_CLASSES SAP Function module







CLUF_USAGE_FEATURES_IN_CLASSES is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name CLUF_USAGE_FEATURES_IN_CLASSES into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: CLUF
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM CLUF_USAGE_FEATURES_IN_CLASSES - CLUF USAGE FEATURES IN CLASSES





CALL FUNCTION 'CLUF_USAGE_FEATURES_IN_CLASSES' "
* EXPORTING
*   all_types = SPACE           "               Search via all class types
*   class_type = SPACE          " klah-klart    Class type
*   feature = SPACE             " cabn-atnam
*   feature = SPACE             " cabn-atnam
*   feature = SPACE             " cabn-atnam    Characteristic
*   language = SY-LANGU         " sy-langu      Language
*   process_mode = SPACE        " rmcls-modus   Mode: DARK, FULL, SHOW, MERK
*   key_date = SY-DATUM         " sy-datum
*   f_only_classes_with_attachment = SPACE  " rmcls-xflag
*   flg_effectivity = SPACE     " tcla-effe_act
*   alv_tree = 'X'              " flag
  IMPORTING
    cclass =                    " klah-class
    cclass =                    " klah-class
    cclass =                    " klah-class    selected/found class
    class_type =                " klah-klart    Class type
    class_typetext =            " rmcls-artxt   Class type description
    clbez =                     " rmcls-klbez
    clbez =                     " rmcls-klbez
    clbez =                     " rmcls-klbez   Class identification (on transacti
* TABLES
*   classes =                   "
*   classes =                   "
*   classes =                   "               Table with found classes (on trans
  EXCEPTIONS
    CLASSTYPE_NOT_EXISTENT = 1  "               Class type does not exist
    FEATURE_NOT_FOUND = 2       "               Characteristic not found
    INPUT_WRONG = 3             "               Entry cannot be interpreted
    NO_CLASS_FOUND = 4          "               No class found
    UNSPECIFIC_ERROR = 5        "               Non-specific error
    .  "  CLUF_USAGE_FEATURES_IN_CLASSES

ABAP code example for Function Module CLUF_USAGE_FEATURES_IN_CLASSES





The ABAP code below is a full code listing to execute function module CLUF_USAGE_FEATURES_IN_CLASSES including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_cclass  TYPE KLAH-CLASS ,
ld_cclass  TYPE KLAH-CLASS ,
ld_cclass  TYPE KLAH-CLASS ,
ld_class_type  TYPE KLAH-KLART ,
ld_class_typetext  TYPE RMCLS-ARTXT ,
ld_clbez  TYPE RMCLS-KLBEZ ,
ld_clbez  TYPE RMCLS-KLBEZ ,
ld_clbez  TYPE RMCLS-KLBEZ ,
it_classes  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_classes  LIKE LINE OF it_classes ,
it_classes  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_classes  LIKE LINE OF it_classes ,
it_classes  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_classes  LIKE LINE OF it_classes .

DATA(ld_all_types) = 'some text here'.

SELECT single KLART
FROM KLAH
INTO @DATA(ld_class_type).


SELECT single ATNAM
FROM CABN
INTO @DATA(ld_feature).


SELECT single ATNAM
FROM CABN
INTO @DATA(ld_feature).


SELECT single ATNAM
FROM CABN
INTO @DATA(ld_feature).

DATA(ld_language) = 'Check type of data required'.

DATA(ld_process_mode) = some text here
DATA(ld_key_date) = '20210129'.

DATA(ld_f_only_classes_with_attachment) = some text here

SELECT single EFFE_ACT
FROM TCLA
INTO @DATA(ld_flg_effectivity).

DATA(ld_alv_tree) = '20210129'.

"populate fields of struture and append to itab
append wa_classes to it_classes.

"populate fields of struture and append to itab
append wa_classes to it_classes.

"populate fields of struture and append to itab
append wa_classes to it_classes. . CALL FUNCTION 'CLUF_USAGE_FEATURES_IN_CLASSES' * EXPORTING * all_types = ld_all_types * class_type = ld_class_type * feature = ld_feature * feature = ld_feature * feature = ld_feature * language = ld_language * process_mode = ld_process_mode * key_date = ld_key_date * f_only_classes_with_attachment = ld_f_only_classes_with_attachment * flg_effectivity = ld_flg_effectivity * alv_tree = ld_alv_tree IMPORTING cclass = ld_cclass cclass = ld_cclass cclass = ld_cclass class_type = ld_class_type class_typetext = ld_class_typetext clbez = ld_clbez clbez = ld_clbez clbez = ld_clbez * TABLES * classes = it_classes * classes = it_classes * classes = it_classes EXCEPTIONS CLASSTYPE_NOT_EXISTENT = 1 FEATURE_NOT_FOUND = 2 INPUT_WRONG = 3 NO_CLASS_FOUND = 4 UNSPECIFIC_ERROR = 5 . " CLUF_USAGE_FEATURES_IN_CLASSES
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_cclass  TYPE KLAH-CLASS ,
ld_cclass  TYPE KLAH-CLASS ,
ld_cclass  TYPE KLAH-CLASS ,
ld_all_types  TYPE STRING ,
it_classes  TYPE STANDARD TABLE OF STRING ,
wa_classes  LIKE LINE OF it_classes,
it_classes  TYPE STANDARD TABLE OF STRING ,
wa_classes  LIKE LINE OF it_classes,
it_classes  TYPE STANDARD TABLE OF STRING ,
wa_classes  LIKE LINE OF it_classes,
ld_class_type  TYPE KLAH-KLART ,
ld_class_type  TYPE KLAH-KLART ,
ld_class_typetext  TYPE RMCLS-ARTXT ,
ld_feature  TYPE CABN-ATNAM ,
ld_feature  TYPE CABN-ATNAM ,
ld_feature  TYPE CABN-ATNAM ,
ld_language  TYPE SY-LANGU ,
ld_clbez  TYPE RMCLS-KLBEZ ,
ld_clbez  TYPE RMCLS-KLBEZ ,
ld_clbez  TYPE RMCLS-KLBEZ ,
ld_process_mode  TYPE RMCLS-MODUS ,
ld_key_date  TYPE SY-DATUM ,
ld_f_only_classes_with_attachment  TYPE RMCLS-XFLAG ,
ld_flg_effectivity  TYPE TCLA-EFFE_ACT ,
ld_alv_tree  TYPE FLAG .

ld_all_types = 'some text here'.

"populate fields of struture and append to itab
append wa_classes to it_classes.

"populate fields of struture and append to itab
append wa_classes to it_classes.

"populate fields of struture and append to itab
append wa_classes to it_classes.

SELECT single KLART
FROM KLAH
INTO ld_class_type.


SELECT single ATNAM
FROM CABN
INTO ld_feature.


SELECT single ATNAM
FROM CABN
INTO ld_feature.


SELECT single ATNAM
FROM CABN
INTO ld_feature.

ld_language = 'Check type of data required'.

ld_process_mode = some text here
ld_key_date = '20210129'.

ld_f_only_classes_with_attachment = some text here

SELECT single EFFE_ACT
FROM TCLA
INTO ld_flg_effectivity.

ld_alv_tree = '20210129'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name CLUF_USAGE_FEATURES_IN_CLASSES or its description.