SAP THMH_HEDGE_READ Function Module for Read Hedge (and Optionally Hedging Relationships) from DB









THMH_HEDGE_READ is a standard thmh hedge read SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Read Hedge (and Optionally Hedging Relationships) from DB 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 thmh hedge read FM, simply by entering the name THMH_HEDGE_READ into the relevant SAP transaction such as SE37 or SE38.

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



Function THMH_HEDGE_READ 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 'THMH_HEDGE_READ'"Read Hedge (and Optionally Hedging Relationships) from DB
EXPORTING
COCODE = "Company Code
* IM_KEY_DATE = "Date of a Business Transaction in the Income Ledger
* HEDGE_ID = "Identification Number of Hedge Item
* PLANNER_ID = "E-Hedge Accounting: Hedge Plan ID
* HR_READ = "
* HR_STRAT_READ = "Checkbox
* IM_VAL_READ = "Checkbox
* IM_TAB_HEDGE = "Table Type for THMT_HEDGE_ITEM
* IM_TAB_HR = "FTR: Table for Transferring HRs to Transact. Mgmt
* IM_FLG_NO_DB_READ = "Checkbox

IMPORTING
E_LINE = "
E_THMHRT_STRAT = "Table Type for THMHRT_HR_STRAT
E_THMT_HEDGE_ITEM = "Table Type for THMT_HEDGE_ITEM
E_THMHRT_HR = "FTR: Table for Transferring HRs to Transact. Mgmt
E_TAB_VAL = "Table Type for THMHRT_HR_VAL
E_TAB_HR_OBS = "FTR: Table for Transferring HRs to Transact. Mgmt

EXCEPTIONS
NO_HEDGE_FOUND = 1 DB_ERROR = 2
.



IMPORTING Parameters details for THMH_HEDGE_READ

COCODE - Company Code

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

IM_KEY_DATE - Date of a Business Transaction in the Income Ledger

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

HEDGE_ID - Identification Number of Hedge Item

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

PLANNER_ID - E-Hedge Accounting: Hedge Plan ID

Data type: THMT_HEDGE_ITEM-PLANNER_ID
Optional: Yes
Call by Reference: Yes

HR_READ -

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

HR_STRAT_READ - Checkbox

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

IM_VAL_READ - Checkbox

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

IM_TAB_HEDGE - Table Type for THMT_HEDGE_ITEM

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

IM_TAB_HR - FTR: Table for Transferring HRs to Transact. Mgmt

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

IM_FLG_NO_DB_READ - Checkbox

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

EXPORTING Parameters details for THMH_HEDGE_READ

E_LINE -

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

E_THMHRT_STRAT - Table Type for THMHRT_HR_STRAT

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

E_THMT_HEDGE_ITEM - Table Type for THMT_HEDGE_ITEM

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

E_THMHRT_HR - FTR: Table for Transferring HRs to Transact. Mgmt

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

E_TAB_VAL - Table Type for THMHRT_HR_VAL

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

E_TAB_HR_OBS - FTR: Table for Transferring HRs to Transact. Mgmt

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

EXCEPTIONS details

NO_HEDGE_FOUND -

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 THMH_HEDGE_READ 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_cocode  TYPE THMT_HEDGE_ITEM-BUKRS, "   
lv_e_line  TYPE I, "   
lv_no_hedge_found  TYPE I, "   
lv_im_key_date  TYPE TPM_TRIL_DATE, "   
lv_db_error  TYPE TPM_TRIL_DATE, "   
lv_hedge_id  TYPE THM_HEDGE_ID, "   
lv_e_thmhrt_strat  TYPE THAHRY_HR_STRAT, "   
lv_planner_id  TYPE THMT_HEDGE_ITEM-PLANNER_ID, "   
lv_e_thmt_hedge_item  TYPE THAY_HEDGE_ITEM, "   
lv_hr_read  TYPE C, "   
lv_e_thmhrt_hr  TYPE VTS_TAB_HRT, "   
lv_e_tab_val  TYPE THAHRY_HR_VAL, "   
lv_hr_strat_read  TYPE C, "   
lv_im_val_read  TYPE XFELD, "   
lv_e_tab_hr_obs  TYPE VTS_TAB_HRT, "   
lv_im_tab_hedge  TYPE THAY_HEDGE_ITEM, "   
lv_im_tab_hr  TYPE VTS_TAB_HRT, "   
lv_im_flg_no_db_read  TYPE XFELD. "   

  CALL FUNCTION 'THMH_HEDGE_READ'  "Read Hedge (and Optionally Hedging Relationships) from DB
    EXPORTING
         COCODE = lv_cocode
         IM_KEY_DATE = lv_im_key_date
         HEDGE_ID = lv_hedge_id
         PLANNER_ID = lv_planner_id
         HR_READ = lv_hr_read
         HR_STRAT_READ = lv_hr_strat_read
         IM_VAL_READ = lv_im_val_read
         IM_TAB_HEDGE = lv_im_tab_hedge
         IM_TAB_HR = lv_im_tab_hr
         IM_FLG_NO_DB_READ = lv_im_flg_no_db_read
    IMPORTING
         E_LINE = lv_e_line
         E_THMHRT_STRAT = lv_e_thmhrt_strat
         E_THMT_HEDGE_ITEM = lv_e_thmt_hedge_item
         E_THMHRT_HR = lv_e_thmhrt_hr
         E_TAB_VAL = lv_e_tab_val
         E_TAB_HR_OBS = lv_e_tab_hr_obs
    EXCEPTIONS
        NO_HEDGE_FOUND = 1
        DB_ERROR = 2
. " THMH_HEDGE_READ




ABAP code using 7.40 inline data declarations to call FM THMH_HEDGE_READ

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 BUKRS FROM THMT_HEDGE_ITEM INTO @DATA(ld_cocode).
 
 
 
 
 
 
 
"SELECT single PLANNER_ID FROM THMT_HEDGE_ITEM INTO @DATA(ld_planner_id).
 
 
 
 
 
 
 
 
 
 
 


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!