SAP RPY_MESSAGE_COMPOSE Function Module for Format a message









RPY_MESSAGE_COMPOSE is a standard rpy message compose SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Format a message 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 rpy message compose FM, simply by entering the name RPY_MESSAGE_COMPOSE into the relevant SAP transaction such as SE37 or SE38.

Function Group: SIGE
Program Name: SAPLSIGE
Main Program: SAPLSIGE
Appliation area: S
Release date: 25-Mar-1997
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function RPY_MESSAGE_COMPOSE 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 'RPY_MESSAGE_COMPOSE'"Format a message
EXPORTING
* LANGUAGE = SY-LANGU "Language key
MESSAGE_ID = "Message Class
MESSAGE_NUMBER = "Message Number
* MESSAGE_VAR1 = ' ' "Variable 1
* MESSAGE_VAR2 = ' ' "Variable 2
* MESSAGE_VAR3 = ' ' "Variable 3
* MESSAGE_VAR4 = ' ' "Variable 4

IMPORTING
MESSAGE_TEXT = "Message Text

TABLES
* LONGTEXT = "

EXCEPTIONS
MESSAGE_NOT_FOUND = 1
.



IMPORTING Parameters details for RPY_MESSAGE_COMPOSE

LANGUAGE - Language key

Data type: T100-SPRSL
Default: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)

MESSAGE_ID - Message Class

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

MESSAGE_NUMBER - Message Number

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

MESSAGE_VAR1 - Variable 1

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

MESSAGE_VAR2 - Variable 2

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

MESSAGE_VAR3 - Variable 3

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

MESSAGE_VAR4 - Variable 4

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

EXPORTING Parameters details for RPY_MESSAGE_COMPOSE

MESSAGE_TEXT - Message Text

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

TABLES Parameters details for RPY_MESSAGE_COMPOSE

LONGTEXT -

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

EXCEPTIONS details

MESSAGE_NOT_FOUND -

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

Copy and paste ABAP code example for RPY_MESSAGE_COMPOSE 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_language  TYPE T100-SPRSL, "   SY-LANGU
lt_longtext  TYPE STANDARD TABLE OF TLINE, "   
lv_message_text  TYPE SY-LISEL, "   
lv_message_not_found  TYPE SY, "   
lv_message_id  TYPE SY-MSGID, "   
lv_message_number  TYPE SY-MSGNO, "   
lv_message_var1  TYPE SY-MSGV1, "   SPACE
lv_message_var2  TYPE SY-MSGV2, "   SPACE
lv_message_var3  TYPE SY-MSGV3, "   SPACE
lv_message_var4  TYPE SY-MSGV4. "   SPACE

  CALL FUNCTION 'RPY_MESSAGE_COMPOSE'  "Format a message
    EXPORTING
         LANGUAGE = lv_language
         MESSAGE_ID = lv_message_id
         MESSAGE_NUMBER = lv_message_number
         MESSAGE_VAR1 = lv_message_var1
         MESSAGE_VAR2 = lv_message_var2
         MESSAGE_VAR3 = lv_message_var3
         MESSAGE_VAR4 = lv_message_var4
    IMPORTING
         MESSAGE_TEXT = lv_message_text
    TABLES
         LONGTEXT = lt_longtext
    EXCEPTIONS
        MESSAGE_NOT_FOUND = 1
. " RPY_MESSAGE_COMPOSE




ABAP code using 7.40 inline data declarations to call FM RPY_MESSAGE_COMPOSE

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 SPRSL FROM T100 INTO @DATA(ld_language).
DATA(ld_language) = SY-LANGU.
 
 
"SELECT single LISEL FROM SY INTO @DATA(ld_message_text).
 
 
"SELECT single MSGID FROM SY INTO @DATA(ld_message_id).
 
"SELECT single MSGNO FROM SY INTO @DATA(ld_message_number).
 
"SELECT single MSGV1 FROM SY INTO @DATA(ld_message_var1).
DATA(ld_message_var1) = ' '.
 
"SELECT single MSGV2 FROM SY INTO @DATA(ld_message_var2).
DATA(ld_message_var2) = ' '.
 
"SELECT single MSGV3 FROM SY INTO @DATA(ld_message_var3).
DATA(ld_message_var3) = ' '.
 
"SELECT single MSGV4 FROM SY INTO @DATA(ld_message_var4).
DATA(ld_message_var4) = ' '.
 


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!