SAP TPM_TRL_RETREIVE_POSITIONS Function Module for Determine 'Settled' and 'Unsettled' Positions
TPM_TRL_RETREIVE_POSITIONS is a standard tpm trl retreive positions SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Determine 'Settled' and 'Unsettled' Positions 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 tpm trl retreive positions FM, simply by entering the name TPM_TRL_RETREIVE_POSITIONS into the relevant SAP transaction such as SE37 or SE38.
Function Group: TPM_TRL_PERFORMANCE_REP
Program Name: SAPLTPM_TRL_PERFORMANCE_REP
Main Program: SAPLTPM_TRL_PERFORMANCE_REP
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function TPM_TRL_RETREIVE_POSITIONS 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 'TPM_TRL_RETREIVE_POSITIONS'"Determine 'Settled' and 'Unsettled' Positions.
EXPORTING
IM_SELECTION_RANGES = "Differenzierungs-Parameter für Positionen
* IM_FLG_FX_FORW = 'X' "Währungs-Termingeschäfte werden selektiert
* IM_FLG_CURR_ACCOUNT = 'X' "Währungskonten werden selektiert
* IM_FLG_SWAP = 'X' "SWAP-Gesch. werden selektiert
* IM_FLG_CAP_FLOOR = 'X' "CAP-/FLOOR-Gesch. werden selektiert
* IM_FLG_LISTED_FUTURE = 'X' "Handelbare FUTURE werden selektiert
* IM_FLG_OTC_OPTION = 'X' "OTC-Optionen werden selektiert
* IM_FLG_LISTED_OPTION = 'X' "Handelbare Optionen werden selektiert
* IM_SINCL = '1' "
* IM_SULT = ' ' "
IM_KEY_DATE = "Position Date
IM_PERIOD_START_DATE = "Start der Periode, für die die Positionen ermittelt werden
* IM_KEY_DATE_BEGIN = "Stichtag Intervallbegin
* IM_FLG_SECURITY = 'X' "Wertpapiere werden selektiert
* IM_FLG_MM_DEAL = 'X' "Geldhandelsgeschäfte werden selektiert
* IM_FLG_FORW_BOND = 'X' "Forward-Gesch. auf Anleihen werden selektiert
* IM_FLG_REPO = 'X' "REPO-Gesch. werden selektiert
* IM_FLG_FRA = 'X' "FRA-Gesch. werden selektiert
IMPORTING
EX_TAB_POSITION = "Table with Positions
EX_TAB_MESSAGES = "Messages
EX_TAB_TRR_MESSAGES = "Message for Log
TABLES
* IT_R_GLIED = "IN: Selektions-Range für Gliederung der Währungskonten
IMPORTING Parameters details for TPM_TRL_RETREIVE_POSITIONS
IM_SELECTION_RANGES - Differenzierungs-Parameter für Positionen
Data type: DIFS_SELECTION_RANGESOptional: No
Call by Reference: No ( called with pass by value option)
IM_FLG_FX_FORW - Währungs-Termingeschäfte werden selektiert
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IM_FLG_CURR_ACCOUNT - Währungskonten werden selektiert
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IM_FLG_SWAP - SWAP-Gesch. werden selektiert
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IM_FLG_CAP_FLOOR - CAP-/FLOOR-Gesch. werden selektiert
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IM_FLG_LISTED_FUTURE - Handelbare FUTURE werden selektiert
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IM_FLG_OTC_OPTION - OTC-Optionen werden selektiert
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IM_FLG_LISTED_OPTION - Handelbare Optionen werden selektiert
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IM_SINCL -
Data type: VVSFINCLDefault: '1'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IM_SULT -
Data type: TB_SULTIMODefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
IM_KEY_DATE - Position Date
Data type: TPM_POSITION_DATEOptional: No
Call by Reference: No ( called with pass by value option)
IM_PERIOD_START_DATE - Start der Periode, für die die Positionen ermittelt werden
Data type: TPM_POSITION_DATEOptional: No
Call by Reference: No ( called with pass by value option)
IM_KEY_DATE_BEGIN - Stichtag Intervallbegin
Data type: TPM_POSITION_DATEOptional: Yes
Call by Reference: No ( called with pass by value option)
IM_FLG_SECURITY - Wertpapiere werden selektiert
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IM_FLG_MM_DEAL - Geldhandelsgeschäfte werden selektiert
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IM_FLG_FORW_BOND - Forward-Gesch. auf Anleihen werden selektiert
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IM_FLG_REPO - REPO-Gesch. werden selektiert
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IM_FLG_FRA - FRA-Gesch. werden selektiert
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for TPM_TRL_RETREIVE_POSITIONS
EX_TAB_POSITION - Table with Positions
Data type: TRRY_POSITION_EXTEN1Optional: No
Call by Reference: No ( called with pass by value option)
EX_TAB_MESSAGES - Messages
Data type: BAL_T_MSGOptional: No
Call by Reference: No ( called with pass by value option)
EX_TAB_TRR_MESSAGES - Message for Log
Data type: TRRY_MSGOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for TPM_TRL_RETREIVE_POSITIONS
IT_R_GLIED - IN: Selektions-Range für Gliederung der Währungskonten
Data type:Optional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for TPM_TRL_RETREIVE_POSITIONS 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: | ||||
| lt_it_r_glied | TYPE STANDARD TABLE OF STRING, " | |||
| lv_ex_tab_position | TYPE TRRY_POSITION_EXTEN1, " | |||
| lv_im_selection_ranges | TYPE DIFS_SELECTION_RANGES, " | |||
| lv_im_flg_fx_forw | TYPE XFELD, " 'X' | |||
| lv_im_flg_curr_account | TYPE XFELD, " 'X' | |||
| lv_im_flg_swap | TYPE XFELD, " 'X' | |||
| lv_im_flg_cap_floor | TYPE XFELD, " 'X' | |||
| lv_im_flg_listed_future | TYPE XFELD, " 'X' | |||
| lv_im_flg_otc_option | TYPE XFELD, " 'X' | |||
| lv_im_flg_listed_option | TYPE XFELD, " 'X' | |||
| lv_im_sincl | TYPE VVSFINCL, " '1' | |||
| lv_im_sult | TYPE TB_SULTIMO, " ' ' | |||
| lv_im_key_date | TYPE TPM_POSITION_DATE, " | |||
| lv_ex_tab_messages | TYPE BAL_T_MSG, " | |||
| lv_ex_tab_trr_messages | TYPE TRRY_MSG, " | |||
| lv_im_period_start_date | TYPE TPM_POSITION_DATE, " | |||
| lv_im_key_date_begin | TYPE TPM_POSITION_DATE, " | |||
| lv_im_flg_security | TYPE XFELD, " 'X' | |||
| lv_im_flg_mm_deal | TYPE XFELD, " 'X' | |||
| lv_im_flg_forw_bond | TYPE XFELD, " 'X' | |||
| lv_im_flg_repo | TYPE XFELD, " 'X' | |||
| lv_im_flg_fra | TYPE XFELD. " 'X' |
|   CALL FUNCTION 'TPM_TRL_RETREIVE_POSITIONS' "Determine 'Settled' and 'Unsettled' Positions |
| EXPORTING | ||
| IM_SELECTION_RANGES | = lv_im_selection_ranges | |
| IM_FLG_FX_FORW | = lv_im_flg_fx_forw | |
| IM_FLG_CURR_ACCOUNT | = lv_im_flg_curr_account | |
| IM_FLG_SWAP | = lv_im_flg_swap | |
| IM_FLG_CAP_FLOOR | = lv_im_flg_cap_floor | |
| IM_FLG_LISTED_FUTURE | = lv_im_flg_listed_future | |
| IM_FLG_OTC_OPTION | = lv_im_flg_otc_option | |
| IM_FLG_LISTED_OPTION | = lv_im_flg_listed_option | |
| IM_SINCL | = lv_im_sincl | |
| IM_SULT | = lv_im_sult | |
| IM_KEY_DATE | = lv_im_key_date | |
| IM_PERIOD_START_DATE | = lv_im_period_start_date | |
| IM_KEY_DATE_BEGIN | = lv_im_key_date_begin | |
| IM_FLG_SECURITY | = lv_im_flg_security | |
| IM_FLG_MM_DEAL | = lv_im_flg_mm_deal | |
| IM_FLG_FORW_BOND | = lv_im_flg_forw_bond | |
| IM_FLG_REPO | = lv_im_flg_repo | |
| IM_FLG_FRA | = lv_im_flg_fra | |
| IMPORTING | ||
| EX_TAB_POSITION | = lv_ex_tab_position | |
| EX_TAB_MESSAGES | = lv_ex_tab_messages | |
| EX_TAB_TRR_MESSAGES | = lv_ex_tab_trr_messages | |
| TABLES | ||
| IT_R_GLIED | = lt_it_r_glied | |
| . " TPM_TRL_RETREIVE_POSITIONS | ||
ABAP code using 7.40 inline data declarations to call FM TPM_TRL_RETREIVE_POSITIONS
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_flg_fx_forw) | = 'X'. | |||
| DATA(ld_im_flg_curr_account) | = 'X'. | |||
| DATA(ld_im_flg_swap) | = 'X'. | |||
| DATA(ld_im_flg_cap_floor) | = 'X'. | |||
| DATA(ld_im_flg_listed_future) | = 'X'. | |||
| DATA(ld_im_flg_otc_option) | = 'X'. | |||
| DATA(ld_im_flg_listed_option) | = 'X'. | |||
| DATA(ld_im_sincl) | = '1'. | |||
| DATA(ld_im_sult) | = ' '. | |||
| DATA(ld_im_flg_security) | = 'X'. | |||
| DATA(ld_im_flg_mm_deal) | = 'X'. | |||
| DATA(ld_im_flg_forw_bond) | = 'X'. | |||
| DATA(ld_im_flg_repo) | = 'X'. | |||
| DATA(ld_im_flg_fra) | = 'X'. | |||
Search for further information about these or an SAP related objects