SAP RDM_OPT_MESSAGE_ADD Function Module for Price Optimization: Generate Error Mess.
RDM_OPT_MESSAGE_ADD is a standard rdm opt message add SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Price Optimization: Generate Error Mess. 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 rdm opt message add FM, simply by entering the name RDM_OPT_MESSAGE_ADD into the relevant SAP transaction such as SE37 or SE38.
Function Group: RDM_OPT_COMMON
Program Name: SAPLRDM_OPT_COMMON
Main Program: SAPLRDM_OPT_COMMON
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RDM_OPT_MESSAGE_ADD 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 'RDM_OPT_MESSAGE_ADD'"Price Optimization: Generate Error Mess..
EXPORTING
I_PROBCLASS = "Application Log: Message Problem Class
* I_DETLEVEL = '3' "Application Log: Level of Detail
* IS_CONTEXT = "Context for a Protocol Entry
* I_SORTFIELD = "Application Log: Sort Criterion/Grouping
* I_MSGID = 'RDM_OPT_OUTBOUND' "Message Class
* I_MSGTY = 'E' "Message Type
I_MSGNO = "Message Number
* I_MSGV1 = "Message Variable 1
* I_MSGV2 = "Message Variable 2
* I_MSGV3 = "Message Variable 3
* I_MSGV4 = "Message Variable 4
CHANGING
XT_MESSAGES = "Application Log: Table with Messages
IMPORTING Parameters details for RDM_OPT_MESSAGE_ADD
I_PROBCLASS - Application Log: Message Problem Class
Data type: BALPROBCLOptional: No
Call by Reference: Yes
I_DETLEVEL - Application Log: Level of Detail
Data type: BALLEVELDefault: '3'
Optional: Yes
Call by Reference: Yes
IS_CONTEXT - Context for a Protocol Entry
Data type: RDM_S_MSGCONTEXTOptional: Yes
Call by Reference: Yes
I_SORTFIELD - Application Log: Sort Criterion/Grouping
Data type: BALSORTOptional: Yes
Call by Reference: Yes
I_MSGID - Message Class
Data type: SY-MSGIDDefault: 'RDM_OPT_OUTBOUND'
Optional: Yes
Call by Reference: Yes
I_MSGTY - Message Type
Data type: SY-MSGTYDefault: 'E'
Optional: Yes
Call by Reference: Yes
I_MSGNO - Message Number
Data type: SY-MSGNOOptional: No
Call by Reference: Yes
I_MSGV1 - Message Variable 1
Data type: SIMPLEOptional: Yes
Call by Reference: Yes
I_MSGV2 - Message Variable 2
Data type: SIMPLEOptional: Yes
Call by Reference: Yes
I_MSGV3 - Message Variable 3
Data type: SIMPLEOptional: Yes
Call by Reference: Yes
I_MSGV4 - Message Variable 4
Data type: SIMPLEOptional: Yes
Call by Reference: Yes
CHANGING Parameters details for RDM_OPT_MESSAGE_ADD
XT_MESSAGES - Application Log: Table with Messages
Data type: BAL_T_MSGOptional: No
Call by Reference: Yes
Copy and paste ABAP code example for RDM_OPT_MESSAGE_ADD 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_probclass | TYPE BALPROBCL, " | |||
| lv_xt_messages | TYPE BAL_T_MSG, " | |||
| lv_i_detlevel | TYPE BALLEVEL, " '3' | |||
| lv_is_context | TYPE RDM_S_MSGCONTEXT, " | |||
| lv_i_sortfield | TYPE BALSORT, " | |||
| lv_i_msgid | TYPE SY-MSGID, " 'RDM_OPT_OUTBOUND' | |||
| lv_i_msgty | TYPE SY-MSGTY, " 'E' | |||
| lv_i_msgno | TYPE SY-MSGNO, " | |||
| lv_i_msgv1 | TYPE SIMPLE, " | |||
| lv_i_msgv2 | TYPE SIMPLE, " | |||
| lv_i_msgv3 | TYPE SIMPLE, " | |||
| lv_i_msgv4 | TYPE SIMPLE. " |
|   CALL FUNCTION 'RDM_OPT_MESSAGE_ADD' "Price Optimization: Generate Error Mess. |
| EXPORTING | ||
| I_PROBCLASS | = lv_i_probclass | |
| I_DETLEVEL | = lv_i_detlevel | |
| IS_CONTEXT | = lv_is_context | |
| I_SORTFIELD | = lv_i_sortfield | |
| I_MSGID | = lv_i_msgid | |
| I_MSGTY | = lv_i_msgty | |
| I_MSGNO | = lv_i_msgno | |
| I_MSGV1 | = lv_i_msgv1 | |
| I_MSGV2 | = lv_i_msgv2 | |
| I_MSGV3 | = lv_i_msgv3 | |
| I_MSGV4 | = lv_i_msgv4 | |
| CHANGING | ||
| XT_MESSAGES | = lv_xt_messages | |
| . " RDM_OPT_MESSAGE_ADD | ||
ABAP code using 7.40 inline data declarations to call FM RDM_OPT_MESSAGE_ADD
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.| DATA(ld_i_detlevel) | = '3'. | |||
| "SELECT single MSGID FROM SY INTO @DATA(ld_i_msgid). | ||||
| DATA(ld_i_msgid) | = 'RDM_OPT_OUTBOUND'. | |||
| "SELECT single MSGTY FROM SY INTO @DATA(ld_i_msgty). | ||||
| DATA(ld_i_msgty) | = 'E'. | |||
| "SELECT single MSGNO FROM SY INTO @DATA(ld_i_msgno). | ||||
Search for further information about these or an SAP related objects