SAP RM_NPV_CALC_TOOL_TRL Function Module for NPV Calculation Tool
RM_NPV_CALC_TOOL_TRL is a standard rm npv calc tool trl SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NPV Calculation Tool 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 rm npv calc tool trl FM, simply by entering the name RM_NPV_CALC_TOOL_TRL into the relevant SAP transaction such as SE37 or SE38.
Function Group: RM_NPV_TOOL
Program Name: SAPLRM_NPV_TOOL
Main Program: SAPLRM_NPV_TOOL
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RM_NPV_CALC_TOOL_TRL 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 'RM_NPV_CALC_TOOL_TRL'"NPV Calculation Tool.
EXPORTING
* IV_KEYDATE = SY-DATUM "
IV_CURRENCY = "Currency Key
* IV_OBJNR = "Object Number
* IS_DEVIATING_QUANTITY = "Structure for Transfer of Quantities to Risk
* IV_EVALTYPE = "Evaluation type in Risk Management
* IV_BUSTRANSID = "Identifier of the Distributor Business Transaction
* IV_FLAG = "Indicator Inclusive/Exclusive
* IO_POSITION = "Treasury Ledger Position
* IV_POSGUID = "Object Identity in Database Format
* IO_SUBPOSITION = "TRL Subposition: Runtime
* IV_SUBPOSGUID = "Globally Unique Identifier
* IV_HORIZON = SY-DATUM "
EXCEPTIONS
INVALID_INPUT = 1 ERROR = 2
IMPORTING Parameters details for RM_NPV_CALC_TOOL_TRL
IV_KEYDATE -
Data type: DDefault: SY-DATUM
Optional: No
Call by Reference: Yes
IV_CURRENCY - Currency Key
Data type: WAERSOptional: No
Call by Reference: Yes
IV_OBJNR - Object Number
Data type: J_OBJNROptional: Yes
Call by Reference: Yes
IS_DEVIATING_QUANTITY - Structure for Transfer of Quantities to Risk
Data type: TRSS_QUANTITY_RISK_INFOOptional: Yes
Call by Reference: Yes
IV_EVALTYPE - Evaluation type in Risk Management
Data type: TV_AUSWTOptional: Yes
Call by Reference: Yes
IV_BUSTRANSID - Identifier of the Distributor Business Transaction
Data type: TPM_BUSTRANSIDOptional: Yes
Call by Reference: Yes
IV_FLAG - Indicator Inclusive/Exclusive
Data type: TPM_INCL_SIGNOptional: Yes
Call by Reference: Yes
IO_POSITION - Treasury Ledger Position
Data type: CL_POSITION_TRLOptional: Yes
Call by Reference: Yes
IV_POSGUID - Object Identity in Database Format
Data type: OS_GUIDOptional: Yes
Call by Reference: Yes
IO_SUBPOSITION - TRL Subposition: Runtime
Data type: CL_SUBPOSITION_TRLOptional: Yes
Call by Reference: Yes
IV_SUBPOSGUID - Globally Unique Identifier
Data type: OS_GUIDOptional: Yes
Call by Reference: Yes
IV_HORIZON -
Data type: DDefault: SY-DATUM
Optional: No
Call by Reference: Yes
EXCEPTIONS details
INVALID_INPUT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RM_NPV_CALC_TOOL_TRL 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_iv_keydate | TYPE D, " SY-DATUM | |||
| lv_invalid_input | TYPE D, " | |||
| lv_iv_currency | TYPE WAERS, " | |||
| lv_iv_objnr | TYPE J_OBJNR, " | |||
| lv_is_deviating_quantity | TYPE TRSS_QUANTITY_RISK_INFO, " | |||
| lv_error | TYPE TRSS_QUANTITY_RISK_INFO, " | |||
| lv_iv_evaltype | TYPE TV_AUSWT, " | |||
| lv_iv_bustransid | TYPE TPM_BUSTRANSID, " | |||
| lv_iv_flag | TYPE TPM_INCL_SIGN, " | |||
| lv_io_position | TYPE CL_POSITION_TRL, " | |||
| lv_iv_posguid | TYPE OS_GUID, " | |||
| lv_io_subposition | TYPE CL_SUBPOSITION_TRL, " | |||
| lv_iv_subposguid | TYPE OS_GUID, " | |||
| lv_iv_horizon | TYPE D. " SY-DATUM |
|   CALL FUNCTION 'RM_NPV_CALC_TOOL_TRL' "NPV Calculation Tool |
| EXPORTING | ||
| IV_KEYDATE | = lv_iv_keydate | |
| IV_CURRENCY | = lv_iv_currency | |
| IV_OBJNR | = lv_iv_objnr | |
| IS_DEVIATING_QUANTITY | = lv_is_deviating_quantity | |
| IV_EVALTYPE | = lv_iv_evaltype | |
| IV_BUSTRANSID | = lv_iv_bustransid | |
| IV_FLAG | = lv_iv_flag | |
| IO_POSITION | = lv_io_position | |
| IV_POSGUID | = lv_iv_posguid | |
| IO_SUBPOSITION | = lv_io_subposition | |
| IV_SUBPOSGUID | = lv_iv_subposguid | |
| IV_HORIZON | = lv_iv_horizon | |
| EXCEPTIONS | ||
| INVALID_INPUT = 1 | ||
| ERROR = 2 | ||
| . " RM_NPV_CALC_TOOL_TRL | ||
ABAP code using 7.40 inline data declarations to call FM RM_NPV_CALC_TOOL_TRL
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_iv_keydate) | = SY-DATUM. | |||
| DATA(ld_iv_horizon) | = SY-DATUM. | |||
Search for further information about these or an SAP related objects