SAP THMHR_HR_CHANGE Function Module for Change Hedging Relationship









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

Function Group: THMHR_ADMIN
Program Name: SAPLTHMHR_ADMIN
Main Program: SAPLTHMHR_ADMIN
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function THMHR_HR_CHANGE 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 'THMHR_HR_CHANGE'"Change Hedging Relationship
EXPORTING
OLD_HR = "Hedging Relationship
* IM_FLG_TESTRUN = "Test Run
* SHOW_RECLASS_POPUP = 'X' "Checkbox
* IM_PROTOCOL_HANDLER = "Protocol Manager
* IM_P_PERSISTENCY_MANAGER = "Treasury Position Management: Persistence Service
* IM_SIMULATION = "Änderung bzw. Reklassifikation simulieren
* IM_RECL_OCI = "Stockholders' Equity
* IM_RECL_OCI_PC = "
* IM_RECLASS_ORIGIN = "Reason for Equity Capital Reclassification
* IM_FLG_SIMULATED = "Simulierten Reklassifikationsbetrag verwenden

IMPORTING
HEDGE = "Hedged Item
EX_RECL_OCI = "Stockholders' Equity
EX_VALUATION_CURR = "Valuation Currency
EX_SUM_OCI = "Stockholders' Equity
EX_RECL_OCI_PC = "
EX_POSITION_CURR = "
EX_SUM_OCI_PC = "

CHANGING
NEW_HR = "Hedging Relationship

EXCEPTIONS
NO_CCODE_AVAILABLE = 1 CHANGE_WITH_LATER_VALS = 10 PERSISTENCY_ERROR = 11 NO_DERIVATIVE_ASSIGNED = 2 NO_HEDGE_ID = 3 NO_PRIOR_HR = 4 NO_HEDGE_FOUND = 5 RECLASS_CANCELLED = 6 DISS_WITH_LATER_VALS = 7 BAD_NUMKR_CONFIG = 8 DB_ERROR = 9
.



IMPORTING Parameters details for THMHR_HR_CHANGE

OLD_HR - Hedging Relationship

Data type: THMHRT_HR
Optional: No
Call by Reference: Yes

IM_FLG_TESTRUN - Test Run

Data type: XFELD
Optional: Yes
Call by Reference: Yes

SHOW_RECLASS_POPUP - Checkbox

Data type: XFELD
Default: 'X'
Optional: Yes
Call by Reference: Yes

IM_PROTOCOL_HANDLER - Protocol Manager

Data type: CL_PROTOCOL_HANDLER_TRP
Optional: Yes
Call by Reference: Yes

IM_P_PERSISTENCY_MANAGER - Treasury Position Management: Persistence Service

Data type: CL_PERSISTENCY_MANAGER_TRG
Optional: Yes
Call by Reference: Yes

IM_SIMULATION - Änderung bzw. Reklassifikation simulieren

Data type: XFELD
Optional: Yes
Call by Reference: Yes

IM_RECL_OCI - Stockholders' Equity

Data type: TPM_OCI
Optional: Yes
Call by Reference: Yes

IM_RECL_OCI_PC -

Data type: TPM_OCI_PC
Optional: Yes
Call by Reference: Yes

IM_RECLASS_ORIGIN - Reason for Equity Capital Reclassification

Data type: TPM_TRIL_RECLASS_ORIGIN
Optional: Yes
Call by Reference: Yes

IM_FLG_SIMULATED - Simulierten Reklassifikationsbetrag verwenden

Data type: XFELD
Optional: Yes
Call by Reference: Yes

EXPORTING Parameters details for THMHR_HR_CHANGE

HEDGE - Hedged Item

Data type: THMT_HEDGE_ITEM
Optional: No
Call by Reference: Yes

EX_RECL_OCI - Stockholders' Equity

Data type: TPM_OCI
Optional: No
Call by Reference: Yes

EX_VALUATION_CURR - Valuation Currency

Data type: TPM_VALUATION_CURR
Optional: No
Call by Reference: Yes

EX_SUM_OCI - Stockholders' Equity

Data type: TPM_OCI
Optional: No
Call by Reference: Yes

EX_RECL_OCI_PC -

Data type: TPM_OCI_PC
Optional: No
Call by Reference: Yes

EX_POSITION_CURR -

Data type: TPM_POSITION_CURR
Optional: No
Call by Reference: Yes

EX_SUM_OCI_PC -

Data type: TPM_OCI_PC
Optional: No
Call by Reference: Yes

CHANGING Parameters details for THMHR_HR_CHANGE

NEW_HR - Hedging Relationship

Data type: THMHRT_HR
Optional: No
Call by Reference: Yes

EXCEPTIONS details

NO_CCODE_AVAILABLE -

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

CHANGE_WITH_LATER_VALS - Stop volume change due to valuations in the future

Data type:
Optional: No
Call by Reference: Yes

PERSISTENCY_ERROR -

Data type:
Optional: No
Call by Reference: Yes

NO_DERIVATIVE_ASSIGNED -

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

NO_HEDGE_ID -

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

NO_PRIOR_HR -

Data type:
Optional: No
Call by Reference: Yes

NO_HEDGE_FOUND -

Data type:
Optional: No
Call by Reference: Yes

RECLASS_CANCELLED -

Data type:
Optional: No
Call by Reference: Yes

DISS_WITH_LATER_VALS - Stop dissolve due to valuations in the future

Data type:
Optional: No
Call by Reference: Yes

BAD_NUMKR_CONFIG - Number range for HR not configured

Data type:
Optional: No
Call by Reference: Yes

DB_ERROR -

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for THMHR_HR_CHANGE 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_hedge  TYPE THMT_HEDGE_ITEM, "   
lv_new_hr  TYPE THMHRT_HR, "   
lv_old_hr  TYPE THMHRT_HR, "   
lv_no_ccode_available  TYPE THMHRT_HR, "   
lv_im_flg_testrun  TYPE XFELD, "   
lv_change_with_later_vals  TYPE XFELD, "   
lv_persistency_error  TYPE XFELD, "   
lv_ex_recl_oci  TYPE TPM_OCI, "   
lv_show_reclass_popup  TYPE XFELD, "   'X'
lv_no_derivative_assigned  TYPE XFELD, "   
lv_no_hedge_id  TYPE XFELD, "   
lv_ex_valuation_curr  TYPE TPM_VALUATION_CURR, "   
lv_im_protocol_handler  TYPE CL_PROTOCOL_HANDLER_TRP, "   
lv_ex_sum_oci  TYPE TPM_OCI, "   
lv_no_prior_hr  TYPE TPM_OCI, "   
lv_im_p_persistency_manager  TYPE CL_PERSISTENCY_MANAGER_TRG, "   
lv_im_simulation  TYPE XFELD, "   
lv_ex_recl_oci_pc  TYPE TPM_OCI_PC, "   
lv_no_hedge_found  TYPE TPM_OCI_PC, "   
lv_im_recl_oci  TYPE TPM_OCI, "   
lv_ex_position_curr  TYPE TPM_POSITION_CURR, "   
lv_reclass_cancelled  TYPE TPM_POSITION_CURR, "   
lv_ex_sum_oci_pc  TYPE TPM_OCI_PC, "   
lv_im_recl_oci_pc  TYPE TPM_OCI_PC, "   
lv_diss_with_later_vals  TYPE TPM_OCI_PC, "   
lv_bad_numkr_config  TYPE TPM_OCI_PC, "   
lv_im_reclass_origin  TYPE TPM_TRIL_RECLASS_ORIGIN, "   
lv_db_error  TYPE TPM_TRIL_RECLASS_ORIGIN, "   
lv_im_flg_simulated  TYPE XFELD. "   

  CALL FUNCTION 'THMHR_HR_CHANGE'  "Change Hedging Relationship
    EXPORTING
         OLD_HR = lv_old_hr
         IM_FLG_TESTRUN = lv_im_flg_testrun
         SHOW_RECLASS_POPUP = lv_show_reclass_popup
         IM_PROTOCOL_HANDLER = lv_im_protocol_handler
         IM_P_PERSISTENCY_MANAGER = lv_im_p_persistency_manager
         IM_SIMULATION = lv_im_simulation
         IM_RECL_OCI = lv_im_recl_oci
         IM_RECL_OCI_PC = lv_im_recl_oci_pc
         IM_RECLASS_ORIGIN = lv_im_reclass_origin
         IM_FLG_SIMULATED = lv_im_flg_simulated
    IMPORTING
         HEDGE = lv_hedge
         EX_RECL_OCI = lv_ex_recl_oci
         EX_VALUATION_CURR = lv_ex_valuation_curr
         EX_SUM_OCI = lv_ex_sum_oci
         EX_RECL_OCI_PC = lv_ex_recl_oci_pc
         EX_POSITION_CURR = lv_ex_position_curr
         EX_SUM_OCI_PC = lv_ex_sum_oci_pc
    CHANGING
         NEW_HR = lv_new_hr
    EXCEPTIONS
        NO_CCODE_AVAILABLE = 1
        CHANGE_WITH_LATER_VALS = 10
        PERSISTENCY_ERROR = 11
        NO_DERIVATIVE_ASSIGNED = 2
        NO_HEDGE_ID = 3
        NO_PRIOR_HR = 4
        NO_HEDGE_FOUND = 5
        RECLASS_CANCELLED = 6
        DISS_WITH_LATER_VALS = 7
        BAD_NUMKR_CONFIG = 8
        DB_ERROR = 9
. " THMHR_HR_CHANGE




ABAP code using 7.40 inline data declarations to call FM THMHR_HR_CHANGE

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_show_reclass_popup) = 'X'.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


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!