SAP Function Modules

CM_F_INITIALIZE SAP Function module







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

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


Pattern for FM CM_F_INITIALIZE - CM F INITIALIZE





CALL FUNCTION 'CM_F_INITIALIZE' "
* EXPORTING
*   abort_msgty = 'A'           " cmimsg-msgty  MSGTY with which termination of the transaction occurred
*   aplid = SPACE               " tcmf6-aplid   Application ID for access to control parameter
*   msg_on_screen = SPACE       " c             Indicator whether messages are output on screen
*   object_id = SPACE           " tcmf5-object_id  ID of object for which the errors are logged
*   ocs_activ = SPACE           " c             Indicator whether message control should be active
*   refresh_old_log = 'X'       " c             Delete old log in internal memory
*   smsg_initialize = SPACE     " c             Also initialize CO error mgmt (gr. SMSG)
*   no_other_initialize = SPACE  " c            Only a leading application can initialize
*   no_display_on_abort = SPACE  " c
  IMPORTING
    initialize_not_allowed =    "               Other appl. attempts to init. and NO_OTH.. = 'X'
    smsg_identification =       " sy-uzeit
  EXCEPTIONS
    MESSAGE_TYPE_NOT_VALID = 1  "               Message type unknown
    UNKNOWN_APLID = 2           "               Unknown application ID
    UNKNOWN_OBJECT_ID = 3       "               Unknown object
    .  "  CM_F_INITIALIZE

ABAP code example for Function Module CM_F_INITIALIZE





The ABAP code below is a full code listing to execute function module CM_F_INITIALIZE 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_initialize_not_allowed  TYPE STRING ,
ld_smsg_identification  TYPE SY-UZEIT .


DATA(ld_abort_msgty) = some text here

SELECT single APLID
FROM TCMF6
INTO @DATA(ld_aplid).

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

SELECT single OBJECT_ID
FROM TCMF5
INTO @DATA(ld_object_id).

DATA(ld_ocs_activ) = 'Check type of data required'.
DATA(ld_refresh_old_log) = 'Check type of data required'.
DATA(ld_smsg_initialize) = 'Check type of data required'.
DATA(ld_no_other_initialize) = 'Check type of data required'.
DATA(ld_no_display_on_abort) = 'Check type of data required'. . CALL FUNCTION 'CM_F_INITIALIZE' * EXPORTING * abort_msgty = ld_abort_msgty * aplid = ld_aplid * msg_on_screen = ld_msg_on_screen * object_id = ld_object_id * ocs_activ = ld_ocs_activ * refresh_old_log = ld_refresh_old_log * smsg_initialize = ld_smsg_initialize * no_other_initialize = ld_no_other_initialize * no_display_on_abort = ld_no_display_on_abort IMPORTING initialize_not_allowed = ld_initialize_not_allowed smsg_identification = ld_smsg_identification EXCEPTIONS MESSAGE_TYPE_NOT_VALID = 1 UNKNOWN_APLID = 2 UNKNOWN_OBJECT_ID = 3 . " CM_F_INITIALIZE
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 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_initialize_not_allowed  TYPE STRING ,
ld_abort_msgty  TYPE CMIMSG-MSGTY ,
ld_smsg_identification  TYPE SY-UZEIT ,
ld_aplid  TYPE TCMF6-APLID ,
ld_msg_on_screen  TYPE C ,
ld_object_id  TYPE TCMF5-OBJECT_ID ,
ld_ocs_activ  TYPE C ,
ld_refresh_old_log  TYPE C ,
ld_smsg_initialize  TYPE C ,
ld_no_other_initialize  TYPE C ,
ld_no_display_on_abort  TYPE C .


ld_abort_msgty = some text here

SELECT single APLID
FROM TCMF6
INTO ld_aplid.

ld_msg_on_screen = 'Check type of data required'.

SELECT single OBJECT_ID
FROM TCMF5
INTO ld_object_id.

ld_ocs_activ = 'Check type of data required'.
ld_refresh_old_log = 'Check type of data required'.
ld_smsg_initialize = 'Check type of data required'.
ld_no_other_initialize = 'Check type of data required'.
ld_no_display_on_abort = 'Check type of data required'.

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