SAP Function Modules

CNV_MBT_MSG_ADD_MESSAGE SAP Function module - Create a new system message







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

Associated Function Group: CNV_MBT_MSG
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM CNV_MBT_MSG_ADD_MESSAGE - CNV MBT MSG ADD MESSAGE





CALL FUNCTION 'CNV_MBT_MSG_ADD_MESSAGE' "Create a new system message
  EXPORTING
*   ip_central =                " cnvmbtdest-exec_target  Specifies The Target System the Activity is Executed in
*   ip_control =                " cnvmbtdest-exec_target  Specifies The Target System the Activity is Executed in
*   ip_receiver =               " cnvmbtdest-exec_target  Specifies The Target System the Activity is Executed in
*   ip_sender =                 " cnvmbtdest-exec_target  Specifies The Target System the Activity is Executed in
*   ip_upgrade =                " cnvmbtdest-exec_target  Specifies The Target System the Activity is Executed in
    ip_pack =                   " cnvmbtpack-packid  Package Number to Specify CMIS and TDMS Packages
*   ip_textline1 =              " temsg-emtext  Express message text
*   ip_textline2 =              " temsg-emtext  Express message text
*   ip_textline3 =              " temsg-emtext  Express message text
*   ip_client =                 " cnv_mbt_flag  Client specific system message call
*   ip_server =                 " cnv_mbt_flag  Server specific system message call
*   ip_expiration_date =        " temsg-datdel  Expiration date of system message
*   ip_expiration_time =        " temsg-timdel  Expiration time of system message
*   ip_delete_date =            " temsg-datrem  Deletion date of a system message
*   ip_delete_time =            " temsg-timrem  Deletion time of a system message
  IMPORTING
    ex_message_id =             " temsg-id      Express Message ID
    ex_message_id_saved =       " cnv_mbt_flag  Indicates if the message id is saved or not
  EXCEPTIONS
    EMPTY_MESSAGE = 1           "               No message text available
    SERVER_NOT_AVAILABLE = 2    "
    CLIENT_NOT_AVAILABLE = 3    "
    NOT_AUTHORIZED = 4          "               User not authorized to create a system message
    NO_SYSTEM_SELECTED = 5      "               No system was selected
    NO_PACKID = 6               "               Package number is initial
    NO_DEST_FOR_PACKID = 7      "               There are no destinations for the package number
    NO_DESTINATION = 8          "               No destination found
    OTHER_ERROR = 9             "
    .  "  CNV_MBT_MSG_ADD_MESSAGE

ABAP code example for Function Module CNV_MBT_MSG_ADD_MESSAGE





The ABAP code below is a full code listing to execute function module CNV_MBT_MSG_ADD_MESSAGE 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_ex_message_id  TYPE TEMSG-ID ,
ld_ex_message_id_saved  TYPE CNV_MBT_FLAG .


SELECT single EXEC_TARGET
FROM CNVMBTDEST
INTO @DATA(ld_ip_central).


SELECT single EXEC_TARGET
FROM CNVMBTDEST
INTO @DATA(ld_ip_control).


SELECT single EXEC_TARGET
FROM CNVMBTDEST
INTO @DATA(ld_ip_receiver).


SELECT single EXEC_TARGET
FROM CNVMBTDEST
INTO @DATA(ld_ip_sender).


SELECT single EXEC_TARGET
FROM CNVMBTDEST
INTO @DATA(ld_ip_upgrade).


SELECT single PACKID
FROM CNVMBTPACK
INTO @DATA(ld_ip_pack).


SELECT single EMTEXT
FROM TEMSG
INTO @DATA(ld_ip_textline1).


SELECT single EMTEXT
FROM TEMSG
INTO @DATA(ld_ip_textline2).


SELECT single EMTEXT
FROM TEMSG
INTO @DATA(ld_ip_textline3).

DATA(ld_ip_client) = 'Check type of data required'.
DATA(ld_ip_server) = 'Check type of data required'.

SELECT single DATDEL
FROM TEMSG
INTO @DATA(ld_ip_expiration_date).


SELECT single TIMDEL
FROM TEMSG
INTO @DATA(ld_ip_expiration_time).


SELECT single DATREM
FROM TEMSG
INTO @DATA(ld_ip_delete_date).


SELECT single TIMREM
FROM TEMSG
INTO @DATA(ld_ip_delete_time).
. CALL FUNCTION 'CNV_MBT_MSG_ADD_MESSAGE' EXPORTING * ip_central = ld_ip_central * ip_control = ld_ip_control * ip_receiver = ld_ip_receiver * ip_sender = ld_ip_sender * ip_upgrade = ld_ip_upgrade ip_pack = ld_ip_pack * ip_textline1 = ld_ip_textline1 * ip_textline2 = ld_ip_textline2 * ip_textline3 = ld_ip_textline3 * ip_client = ld_ip_client * ip_server = ld_ip_server * ip_expiration_date = ld_ip_expiration_date * ip_expiration_time = ld_ip_expiration_time * ip_delete_date = ld_ip_delete_date * ip_delete_time = ld_ip_delete_time IMPORTING ex_message_id = ld_ex_message_id ex_message_id_saved = ld_ex_message_id_saved EXCEPTIONS EMPTY_MESSAGE = 1 SERVER_NOT_AVAILABLE = 2 CLIENT_NOT_AVAILABLE = 3 NOT_AUTHORIZED = 4 NO_SYSTEM_SELECTED = 5 NO_PACKID = 6 NO_DEST_FOR_PACKID = 7 NO_DESTINATION = 8 OTHER_ERROR = 9 . " CNV_MBT_MSG_ADD_MESSAGE
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 ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "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_ex_message_id  TYPE TEMSG-ID ,
ld_ip_central  TYPE CNVMBTDEST-EXEC_TARGET ,
ld_ex_message_id_saved  TYPE CNV_MBT_FLAG ,
ld_ip_control  TYPE CNVMBTDEST-EXEC_TARGET ,
ld_ip_receiver  TYPE CNVMBTDEST-EXEC_TARGET ,
ld_ip_sender  TYPE CNVMBTDEST-EXEC_TARGET ,
ld_ip_upgrade  TYPE CNVMBTDEST-EXEC_TARGET ,
ld_ip_pack  TYPE CNVMBTPACK-PACKID ,
ld_ip_textline1  TYPE TEMSG-EMTEXT ,
ld_ip_textline2  TYPE TEMSG-EMTEXT ,
ld_ip_textline3  TYPE TEMSG-EMTEXT ,
ld_ip_client  TYPE CNV_MBT_FLAG ,
ld_ip_server  TYPE CNV_MBT_FLAG ,
ld_ip_expiration_date  TYPE TEMSG-DATDEL ,
ld_ip_expiration_time  TYPE TEMSG-TIMDEL ,
ld_ip_delete_date  TYPE TEMSG-DATREM ,
ld_ip_delete_time  TYPE TEMSG-TIMREM .


SELECT single EXEC_TARGET
FROM CNVMBTDEST
INTO ld_ip_central.


SELECT single EXEC_TARGET
FROM CNVMBTDEST
INTO ld_ip_control.


SELECT single EXEC_TARGET
FROM CNVMBTDEST
INTO ld_ip_receiver.


SELECT single EXEC_TARGET
FROM CNVMBTDEST
INTO ld_ip_sender.


SELECT single EXEC_TARGET
FROM CNVMBTDEST
INTO ld_ip_upgrade.


SELECT single PACKID
FROM CNVMBTPACK
INTO ld_ip_pack.


SELECT single EMTEXT
FROM TEMSG
INTO ld_ip_textline1.


SELECT single EMTEXT
FROM TEMSG
INTO ld_ip_textline2.


SELECT single EMTEXT
FROM TEMSG
INTO ld_ip_textline3.

ld_ip_client = 'Check type of data required'.
ld_ip_server = 'Check type of data required'.

SELECT single DATDEL
FROM TEMSG
INTO ld_ip_expiration_date.


SELECT single TIMDEL
FROM TEMSG
INTO ld_ip_expiration_time.


SELECT single DATREM
FROM TEMSG
INTO ld_ip_delete_date.


SELECT single TIMREM
FROM TEMSG
INTO ld_ip_delete_time.

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