SAP RDM_OPT_DEFINE_MAT_OPT Function Module for Define Materials Used in Optimization Processes
RDM_OPT_DEFINE_MAT_OPT is a standard rdm opt define mat opt SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Define Materials Used in Optimization Processes 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 define mat opt FM, simply by entering the name RDM_OPT_DEFINE_MAT_OPT into the relevant SAP transaction such as SE37 or SE38.
Function Group: RDM_OPT_MATNR_IN_PROCESS
Program Name: SAPLRDM_OPT_MATNR_IN_PROCESS
Main Program: SAPLRDM_OPT_MATNR_IN_PROCESS
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RDM_OPT_DEFINE_MAT_OPT 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_DEFINE_MAT_OPT'"Define Materials Used in Optimization Processes.
EXPORTING
I_VKORG = "Sales Organization
I_VTWEG = "Distribution Channel
* I_BUSINESS_SYSTEM = "System Demand Management
* I_DISPLAY = "Checkbox
* I_INIT_TREE = "Checkbox
IMPORTING
E_SEL_CHANGED = "Checkbox
ETR_MATNR_PRO = "Range Table for Material Numbers
ETR_NODE_REG = "Range Table Type for Nodes
ETR_WRGH_REG = "Range Table Type for Nodes
ETR_MATNR_REG = "Range Table for Material Numbers
ETR_NODE_MDP = "Range Table Type for Nodes
ETR_WRGH_MDP = "Range Table Type for Nodes
ETR_MATNR_MDP = "Range Table for Material Numbers
ETR_NODE_PRO = "Range Table Type for Nodes
ETR_WRGH_PRO = "Range Table Type for Nodes
IMPORTING Parameters details for RDM_OPT_DEFINE_MAT_OPT
I_VKORG - Sales Organization
Data type: VKORGOptional: No
Call by Reference: Yes
I_VTWEG - Distribution Channel
Data type: VTWEGOptional: No
Call by Reference: Yes
I_BUSINESS_SYSTEM - System Demand Management
Data type: RDM_BUSINESS_SYSTEMOptional: Yes
Call by Reference: Yes
I_DISPLAY - Checkbox
Data type: XFELDOptional: Yes
Call by Reference: Yes
I_INIT_TREE - Checkbox
Data type: XFELDOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for RDM_OPT_DEFINE_MAT_OPT
E_SEL_CHANGED - Checkbox
Data type: XFELDOptional: No
Call by Reference: Yes
ETR_MATNR_PRO - Range Table for Material Numbers
Data type: RDM_TR_MATNROptional: No
Call by Reference: Yes
ETR_NODE_REG - Range Table Type for Nodes
Data type: RDM_TR_NODEOptional: No
Call by Reference: Yes
ETR_WRGH_REG - Range Table Type for Nodes
Data type: RDM_TR_WRGHOptional: No
Call by Reference: Yes
ETR_MATNR_REG - Range Table for Material Numbers
Data type: RDM_TR_MATNROptional: No
Call by Reference: Yes
ETR_NODE_MDP - Range Table Type for Nodes
Data type: RDM_TR_NODEOptional: No
Call by Reference: Yes
ETR_WRGH_MDP - Range Table Type for Nodes
Data type: RDM_TR_WRGHOptional: No
Call by Reference: Yes
ETR_MATNR_MDP - Range Table for Material Numbers
Data type: RDM_TR_MATNROptional: No
Call by Reference: Yes
ETR_NODE_PRO - Range Table Type for Nodes
Data type: RDM_TR_NODEOptional: No
Call by Reference: Yes
ETR_WRGH_PRO - Range Table Type for Nodes
Data type: RDM_TR_WRGHOptional: No
Call by Reference: Yes
Copy and paste ABAP code example for RDM_OPT_DEFINE_MAT_OPT 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_vkorg | TYPE VKORG, " | |||
| lv_e_sel_changed | TYPE XFELD, " | |||
| lv_etr_matnr_pro | TYPE RDM_TR_MATNR, " | |||
| lv_i_vtweg | TYPE VTWEG, " | |||
| lv_etr_node_reg | TYPE RDM_TR_NODE, " | |||
| lv_etr_wrgh_reg | TYPE RDM_TR_WRGH, " | |||
| lv_i_business_system | TYPE RDM_BUSINESS_SYSTEM, " | |||
| lv_i_display | TYPE XFELD, " | |||
| lv_etr_matnr_reg | TYPE RDM_TR_MATNR, " | |||
| lv_i_init_tree | TYPE XFELD, " | |||
| lv_etr_node_mdp | TYPE RDM_TR_NODE, " | |||
| lv_etr_wrgh_mdp | TYPE RDM_TR_WRGH, " | |||
| lv_etr_matnr_mdp | TYPE RDM_TR_MATNR, " | |||
| lv_etr_node_pro | TYPE RDM_TR_NODE, " | |||
| lv_etr_wrgh_pro | TYPE RDM_TR_WRGH. " |
|   CALL FUNCTION 'RDM_OPT_DEFINE_MAT_OPT' "Define Materials Used in Optimization Processes |
| EXPORTING | ||
| I_VKORG | = lv_i_vkorg | |
| I_VTWEG | = lv_i_vtweg | |
| I_BUSINESS_SYSTEM | = lv_i_business_system | |
| I_DISPLAY | = lv_i_display | |
| I_INIT_TREE | = lv_i_init_tree | |
| IMPORTING | ||
| E_SEL_CHANGED | = lv_e_sel_changed | |
| ETR_MATNR_PRO | = lv_etr_matnr_pro | |
| ETR_NODE_REG | = lv_etr_node_reg | |
| ETR_WRGH_REG | = lv_etr_wrgh_reg | |
| ETR_MATNR_REG | = lv_etr_matnr_reg | |
| ETR_NODE_MDP | = lv_etr_node_mdp | |
| ETR_WRGH_MDP | = lv_etr_wrgh_mdp | |
| ETR_MATNR_MDP | = lv_etr_matnr_mdp | |
| ETR_NODE_PRO | = lv_etr_node_pro | |
| ETR_WRGH_PRO | = lv_etr_wrgh_pro | |
| . " RDM_OPT_DEFINE_MAT_OPT | ||
ABAP code using 7.40 inline data declarations to call FM RDM_OPT_DEFINE_MAT_OPT
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.Search for further information about these or an SAP related objects