SAP Function Modules

CTMV_CREATE_FEATURE SAP Function module







CTMV_CREATE_FEATURE 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 CTMV_CREATE_FEATURE into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM CTMV_CREATE_FEATURE - CTMV CREATE FEATURE





CALL FUNCTION 'CTMV_CREATE_FEATURE' "
  EXPORTING
*   feature_name = SPACE        " cabnt-atbez   Characteristic name
    feature_neutral_name =      " cabn-atnam    Language-independent name of characteristic
    format =                    " cabn-atfor    Data format
*   group = SPACE               " cabn-atkla    Characteristics group
*   internal_unit_of_measure = SPACE  " cabn-msehi  Internal unit of measure
*   language = SY-LANGU         " cabnt-spras   Language
*   number_of_positions = 0     " cabn-anzst    Number of characters
*   places_after_decimal_sign = 0  " cabn-anzdz  Number of decimal places
*   required_entry = SPACE      " cabn-aterf    Necessary entry (required field)
*   title1 = SPACE              " cabnt-atue1   Heading 1
*   title2 = SPACE              " cabnt-atue2   Heading 2
*   key_date = SY-DATUM         " sy-datum      Date
*   change_number = SPACE       " cabn-aennr    Change number
  IMPORTING
    feature_id =                " cabn-atinn    Internal characteristic number
  EXCEPTIONS
    CANCEL_BY_USER = 1          "               User cancelled characteristics maintenance
    INVALID_NAME = 2            "               Characteristic name already assigned
    KEY_LOCKED = 3              "               Data base block set
    INVALID_GROUP = 4           "               Characteristics group not found
    INVALID_LANGUAGE = 5        "               Invalid language indicator
    INVALID_ECN = 6             "               Change Number Does Not Exist
    .  "  CTMV_CREATE_FEATURE

ABAP code example for Function Module CTMV_CREATE_FEATURE





The ABAP code below is a full code listing to execute function module CTMV_CREATE_FEATURE 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_feature_id  TYPE CABN-ATINN .


SELECT single ATBEZ
FROM CABNT
INTO @DATA(ld_feature_name).


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


SELECT single ATFOR
FROM CABN
INTO @DATA(ld_format).


SELECT single ATKLA
FROM CABN
INTO @DATA(ld_group).


SELECT single MSEHI
FROM CABN
INTO @DATA(ld_internal_unit_of_measure).


SELECT single SPRAS
FROM CABNT
INTO @DATA(ld_language).


SELECT single ANZST
FROM CABN
INTO @DATA(ld_number_of_positions).


SELECT single ANZDZ
FROM CABN
INTO @DATA(ld_places_after_decimal_sign).


SELECT single ATERF
FROM CABN
INTO @DATA(ld_required_entry).


SELECT single ATUE1
FROM CABNT
INTO @DATA(ld_title1).


SELECT single ATUE2
FROM CABNT
INTO @DATA(ld_title2).

DATA(ld_key_date) = '20210129'.

SELECT single AENNR
FROM CABN
INTO @DATA(ld_change_number).
. CALL FUNCTION 'CTMV_CREATE_FEATURE' EXPORTING * feature_name = ld_feature_name feature_neutral_name = ld_feature_neutral_name format = ld_format * group = ld_group * internal_unit_of_measure = ld_internal_unit_of_measure * language = ld_language * number_of_positions = ld_number_of_positions * places_after_decimal_sign = ld_places_after_decimal_sign * required_entry = ld_required_entry * title1 = ld_title1 * title2 = ld_title2 * key_date = ld_key_date * change_number = ld_change_number IMPORTING feature_id = ld_feature_id EXCEPTIONS CANCEL_BY_USER = 1 INVALID_NAME = 2 KEY_LOCKED = 3 INVALID_GROUP = 4 INVALID_LANGUAGE = 5 INVALID_ECN = 6 . " CTMV_CREATE_FEATURE
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 ELSEIF SY-SUBRC EQ 6. "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_feature_id  TYPE CABN-ATINN ,
ld_feature_name  TYPE CABNT-ATBEZ ,
ld_feature_neutral_name  TYPE CABN-ATNAM ,
ld_format  TYPE CABN-ATFOR ,
ld_group  TYPE CABN-ATKLA ,
ld_internal_unit_of_measure  TYPE CABN-MSEHI ,
ld_language  TYPE CABNT-SPRAS ,
ld_number_of_positions  TYPE CABN-ANZST ,
ld_places_after_decimal_sign  TYPE CABN-ANZDZ ,
ld_required_entry  TYPE CABN-ATERF ,
ld_title1  TYPE CABNT-ATUE1 ,
ld_title2  TYPE CABNT-ATUE2 ,
ld_key_date  TYPE SY-DATUM ,
ld_change_number  TYPE CABN-AENNR .


SELECT single ATBEZ
FROM CABNT
INTO ld_feature_name.


SELECT single ATNAM
FROM CABN
INTO ld_feature_neutral_name.


SELECT single ATFOR
FROM CABN
INTO ld_format.


SELECT single ATKLA
FROM CABN
INTO ld_group.


SELECT single MSEHI
FROM CABN
INTO ld_internal_unit_of_measure.


SELECT single SPRAS
FROM CABNT
INTO ld_language.


SELECT single ANZST
FROM CABN
INTO ld_number_of_positions.


SELECT single ANZDZ
FROM CABN
INTO ld_places_after_decimal_sign.


SELECT single ATERF
FROM CABN
INTO ld_required_entry.


SELECT single ATUE1
FROM CABNT
INTO ld_title1.


SELECT single ATUE2
FROM CABNT
INTO ld_title2.

ld_key_date = '20210129'.

SELECT single AENNR
FROM CABN
INTO ld_change_number.

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 CTMV_CREATE_FEATURE or its description.