SAP CX_F_MESSAGE Function Module for Collect/output message for a message code









CX_F_MESSAGE is a standard cx f message SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Collect/output message for a message code processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for cx f message FM, simply by entering the name CX_F_MESSAGE into the relevant SAP transaction such as SE37 or SE38.

Function Group: CXFE
Program Name: SAPLCXFE
Main Program:
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CX_F_MESSAGE pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'CX_F_MESSAGE'"Collect/output message for a message code
EXPORTING
* I_MSG_CODE = 0 "Message code from ICXCON00
* I_INDEX = 0 "
* I_FLG_MESSAGE = 'X' "Flag: collect or display message
* I_MSG_ON_SCREEN = ' ' "Flag: display message on screen
* I_MSG_IN_GRAPHIC = ' ' "Flag: display message in graphic
* I_ARBGB = 'C7' "Message type (S,I,W,E,A)
* I_MSGTY = ' ' "Message type (S,I,W,E,A)
* I_MSGNR = ' ' "Message no. from T100
* I_MSGV1 = ' ' "Message parameter 1
* I_MSGV2 = ' ' "Message parameter 2
* I_MSGV3 = ' ' "Message parameter 3
* I_MSGV4 = ' ' "Message parameter 4
* I_POS = ' ' "

EXCEPTIONS
MESSAGE_ON_SCREEN = 1
.



IMPORTING Parameters details for CX_F_MESSAGE

I_MSG_CODE - Message code from ICXCON00

Data type: SY-SUBRC
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_INDEX -

Data type: SY-TABIX
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_FLG_MESSAGE - Flag: collect or display message

Data type:
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_MSG_ON_SCREEN - Flag: display message on screen

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_MSG_IN_GRAPHIC - Flag: display message in graphic

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_ARBGB - Message type (S,I,W,E,A)

Data type: CMIMSG-ARBGB
Default: 'C7'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_MSGTY - Message type (S,I,W,E,A)

Data type: CMIMSG-MSGTY
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_MSGNR - Message no. from T100

Data type: CMIMSG-MSGNR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_MSGV1 - Message parameter 1

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_MSGV2 - Message parameter 2

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_MSGV3 - Message parameter 3

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_MSGV4 - Message parameter 4

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_POS -

Data type: RCLST-OBJECT
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

MESSAGE_ON_SCREEN -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for CX_F_MESSAGE Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.

DATA:
lv_i_msg_code  TYPE SY-SUBRC, "   0
lv_message_on_screen  TYPE SY, "   
lv_i_index  TYPE SY-TABIX, "   0
lv_i_flg_message  TYPE SY, "   'X'
lv_i_msg_on_screen  TYPE SY, "   SPACE
lv_i_msg_in_graphic  TYPE SY, "   SPACE
lv_i_arbgb  TYPE CMIMSG-ARBGB, "   'C7'
lv_i_msgty  TYPE CMIMSG-MSGTY, "   SPACE
lv_i_msgnr  TYPE CMIMSG-MSGNR, "   SPACE
lv_i_msgv1  TYPE CMIMSG, "   SPACE
lv_i_msgv2  TYPE CMIMSG, "   SPACE
lv_i_msgv3  TYPE CMIMSG, "   SPACE
lv_i_msgv4  TYPE CMIMSG, "   SPACE
lv_i_pos  TYPE RCLST-OBJECT. "   SPACE

  CALL FUNCTION 'CX_F_MESSAGE'  "Collect/output message for a message code
    EXPORTING
         I_MSG_CODE = lv_i_msg_code
         I_INDEX = lv_i_index
         I_FLG_MESSAGE = lv_i_flg_message
         I_MSG_ON_SCREEN = lv_i_msg_on_screen
         I_MSG_IN_GRAPHIC = lv_i_msg_in_graphic
         I_ARBGB = lv_i_arbgb
         I_MSGTY = lv_i_msgty
         I_MSGNR = lv_i_msgnr
         I_MSGV1 = lv_i_msgv1
         I_MSGV2 = lv_i_msgv2
         I_MSGV3 = lv_i_msgv3
         I_MSGV4 = lv_i_msgv4
         I_POS = lv_i_pos
    EXCEPTIONS
        MESSAGE_ON_SCREEN = 1
. " CX_F_MESSAGE




ABAP code using 7.40 inline data declarations to call FM CX_F_MESSAGE

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single SUBRC FROM SY INTO @DATA(ld_i_msg_code).
 
 
"SELECT single TABIX FROM SY INTO @DATA(ld_i_index).
 
DATA(ld_i_flg_message) = 'X'.
 
DATA(ld_i_msg_on_screen) = ' '.
 
DATA(ld_i_msg_in_graphic) = ' '.
 
"SELECT single ARBGB FROM CMIMSG INTO @DATA(ld_i_arbgb).
DATA(ld_i_arbgb) = 'C7'.
 
"SELECT single MSGTY FROM CMIMSG INTO @DATA(ld_i_msgty).
DATA(ld_i_msgty) = ' '.
 
"SELECT single MSGNR FROM CMIMSG INTO @DATA(ld_i_msgnr).
DATA(ld_i_msgnr) = ' '.
 
DATA(ld_i_msgv1) = ' '.
 
DATA(ld_i_msgv2) = ' '.
 
DATA(ld_i_msgv3) = ' '.
 
DATA(ld_i_msgv4) = ' '.
 
"SELECT single OBJECT FROM RCLST INTO @DATA(ld_i_pos).
DATA(ld_i_pos) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!