SAP Function Modules

CNV_MBT_MSG_READ_MESSAGE SAP Function module - Get a system message







CNV_MBT_MSG_READ_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_READ_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_READ_MESSAGE - CNV MBT MSG READ MESSAGE





CALL FUNCTION 'CNV_MBT_MSG_READ_MESSAGE' "Get a system message
  EXPORTING
    ip_pack =                   " cnvmbtpack-packid  Package number
*   ip_message_id =             " temsg-id      System message identification number
    ip_pname =                  " char40        Parameter name in table cnvmbtparams
*   ip_valnum =                 " cnv_mbt_disting_entries  Continues number
* TABLES
*   t_messages =                " temsg         Result set of messages depending on import parameters
  EXCEPTIONS
    PACKID_INITIAL = 1          "               Import parameter packid has no value
    MESSAGE_ID_NOT_FOUND = 2    "               Could not found the message id (check parameter)
    PARAMETER_NAME_INITIAL = 3  "               Parameter name has no entry
    NO_MESSAGE_ID = 4           "               Could not found a message id
    COULD_NOT_READ_MESSAGES = 5  "              Could not found messages
    NO_EXEC_TARGET = 6          "               Could not determine the execution target
    NO_RFC_DESTINATION = 7      "               Could not determine the rfc destination
    COULD_NOT_READ_PARAMETERS = 8  "            Error while reading parameters
    WRONG_MESSAGE_ID = 9        "               Message id from import parameter did not match with message id read from table
    UNKNOWN_PARAMETER_NAME = 10  "              The import parameter name is unknown
    INVALID_MESSAGE_ID = 11     "               The message id could not be writtten therefor we assume that the msg is expired
    .  "  CNV_MBT_MSG_READ_MESSAGE

ABAP code example for Function Module CNV_MBT_MSG_READ_MESSAGE





The ABAP code below is a full code listing to execute function module CNV_MBT_MSG_READ_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:
it_t_messages  TYPE STANDARD TABLE OF TEMSG,"TABLES PARAM
wa_t_messages  LIKE LINE OF it_t_messages .


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


SELECT single ID
FROM TEMSG
INTO @DATA(ld_ip_message_id).

DATA(ld_ip_pname) = 'Check type of data required'.
DATA(ld_ip_valnum) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_messages to it_t_messages. . CALL FUNCTION 'CNV_MBT_MSG_READ_MESSAGE' EXPORTING ip_pack = ld_ip_pack * ip_message_id = ld_ip_message_id ip_pname = ld_ip_pname * ip_valnum = ld_ip_valnum * TABLES * t_messages = it_t_messages EXCEPTIONS PACKID_INITIAL = 1 MESSAGE_ID_NOT_FOUND = 2 PARAMETER_NAME_INITIAL = 3 NO_MESSAGE_ID = 4 COULD_NOT_READ_MESSAGES = 5 NO_EXEC_TARGET = 6 NO_RFC_DESTINATION = 7 COULD_NOT_READ_PARAMETERS = 8 WRONG_MESSAGE_ID = 9 UNKNOWN_PARAMETER_NAME = 10 INVALID_MESSAGE_ID = 11 . " CNV_MBT_MSG_READ_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 ELSEIF SY-SUBRC EQ 10. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 11. "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_ip_pack  TYPE CNVMBTPACK-PACKID ,
it_t_messages  TYPE STANDARD TABLE OF TEMSG ,
wa_t_messages  LIKE LINE OF it_t_messages,
ld_ip_message_id  TYPE TEMSG-ID ,
ld_ip_pname  TYPE CHAR40 ,
ld_ip_valnum  TYPE CNV_MBT_DISTING_ENTRIES .


SELECT single PACKID
FROM CNVMBTPACK
INTO ld_ip_pack.


"populate fields of struture and append to itab
append wa_t_messages to it_t_messages.

SELECT single ID
FROM TEMSG
INTO ld_ip_message_id.

ld_ip_pname = 'Check type of data required'.
ld_ip_valnum = '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 CNV_MBT_MSG_READ_MESSAGE or its description.