SAP THMEX_CREATE_TRANS_FROM_RO Function Module for Create New Plan for Each New Risk Object ID
THMEX_CREATE_TRANS_FROM_RO is a standard thmex create trans from ro SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Create New Plan for Each New Risk Object ID 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 thmex create trans from ro FM, simply by entering the name THMEX_CREATE_TRANS_FROM_RO into the relevant SAP transaction such as SE37 or SE38.
Function Group: THMEX_HM_VIA_RO
Program Name: SAPLTHMEX_HM_VIA_RO
Main Program: SAPLTHMEX_HM_VIA_RO
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function THMEX_CREATE_TRANS_FROM_RO 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 'THMEX_CREATE_TRANS_FROM_RO'"Create New Plan for Each New Risk Object ID.
EXPORTING
IM_P_PERSISTENCY_MANAGER = "Treasury Position Management: Persistence Service
* IM_TEXT = ' ' "Description of Hedge Plan
* IM_MODE = ' ' "'A':= Append; 'M' = merge; ' ' = create a hedgeplan for every single RO
IMPORTING
EX_TAB_MESS = "Application Log: Table with Messages
CHANGING
CH_TABLE = "Plan über Risikoträger anlegen: Bild
EXCEPTIONS
DB_ERROR = 1 INTERNAL_ERROR = 2
IMPORTING Parameters details for THMEX_CREATE_TRANS_FROM_RO
IM_P_PERSISTENCY_MANAGER - Treasury Position Management: Persistence Service
Data type: CL_PERSISTENCY_MANAGER_TRGOptional: No
Call by Reference: Yes
IM_TEXT - Description of Hedge Plan
Data type: THA_PLANNERTEXTDefault: SPACE
Optional: Yes
Call by Reference: Yes
IM_MODE - 'A':= Append; 'M' = merge; ' ' = create a hedgeplan for every single RO
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for THMEX_CREATE_TRANS_FROM_RO
EX_TAB_MESS - Application Log: Table with Messages
Data type: BAL_T_MSGOptional: No
Call by Reference: Yes
CHANGING Parameters details for THMEX_CREATE_TRANS_FROM_RO
CH_TABLE - Plan über Risikoträger anlegen: Bild
Data type: THMEXS_THM_RO_SCREENOptional: No
Call by Reference: Yes
EXCEPTIONS details
DB_ERROR - Database update error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INTERNAL_ERROR - Internal Error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for THMEX_CREATE_TRANS_FROM_RO 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_ch_table | TYPE THMEXS_THM_RO_SCREEN, " | |||
| lv_db_error | TYPE THMEXS_THM_RO_SCREEN, " | |||
| lv_ex_tab_mess | TYPE BAL_T_MSG, " | |||
| lv_im_p_persistency_manager | TYPE CL_PERSISTENCY_MANAGER_TRG, " | |||
| lv_im_text | TYPE THA_PLANNERTEXT, " SPACE | |||
| lv_internal_error | TYPE THA_PLANNERTEXT, " | |||
| lv_im_mode | TYPE C. " SPACE |
|   CALL FUNCTION 'THMEX_CREATE_TRANS_FROM_RO' "Create New Plan for Each New Risk Object ID |
| EXPORTING | ||
| IM_P_PERSISTENCY_MANAGER | = lv_im_p_persistency_manager | |
| IM_TEXT | = lv_im_text | |
| IM_MODE | = lv_im_mode | |
| IMPORTING | ||
| EX_TAB_MESS | = lv_ex_tab_mess | |
| CHANGING | ||
| CH_TABLE | = lv_ch_table | |
| EXCEPTIONS | ||
| DB_ERROR = 1 | ||
| INTERNAL_ERROR = 2 | ||
| . " THMEX_CREATE_TRANS_FROM_RO | ||
ABAP code using 7.40 inline data declarations to call FM THMEX_CREATE_TRANS_FROM_RO
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_im_text) | = ' '. | |||
| DATA(ld_im_mode) | = ' '. | |||
Search for further information about these or an SAP related objects