SAP FPM_DP_VM_CALC_PER_LOT Function Module for Calculate Variation Margin at Lot Level
FPM_DP_VM_CALC_PER_LOT is a standard fpm dp vm calc per lot SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Calculate Variation Margin at Lot Level 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 fpm dp vm calc per lot FM, simply by entering the name FPM_DP_VM_CALC_PER_LOT into the relevant SAP transaction such as SE37 or SE38.
Function Group: FPM_DP
Program Name: SAPLFPM_DP
Main Program: SAPLFPM_DP
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function FPM_DP_VM_CALC_PER_LOT 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 'FPM_DP_VM_CALC_PER_LOT'"Calculate Variation Margin at Lot Level.
EXPORTING
I_RESTWERT = "
I_RESTSTUECKE = "
I_KURS = "
I_TICK = "
I_TICKWERT = "
I_ZUGEORD_ANZAHL = "
IMPORTING
EXP_VAMA = "
EXP_TBW_NEU = "
EXCEPTIONS
ZERODIVIDE = 1 NO_RATE = 2 NO_TICK_VALUE = 3
IMPORTING Parameters details for FPM_DP_VM_CALC_PER_LOT
I_RESTWERT -
Data type: B_BOOK_VALUE_FOREIGNOptional: No
Call by Reference: No ( called with pass by value option)
I_RESTSTUECKE -
Data type: ASTUECKOptional: No
Call by Reference: No ( called with pass by value option)
I_KURS -
Data type: ATRAS-PKTKUROptional: No
Call by Reference: No ( called with pass by value option)
I_TICK -
Data type: VTI_FUTURE-PPTICKOptional: No
Call by Reference: No ( called with pass by value option)
I_TICKWERT -
Data type: VTI_FUTURE-BWTICKOptional: No
Call by Reference: No ( called with pass by value option)
I_ZUGEORD_ANZAHL -
Data type: VTI_FUTURE-ASTUECKOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for FPM_DP_VM_CALC_PER_LOT
EXP_VAMA -
Data type: TB_BZBETROptional: No
Call by Reference: No ( called with pass by value option)
EXP_TBW_NEU -
Data type: TB_BZBETROptional: No
Call by Reference: Yes
EXCEPTIONS details
ZERODIVIDE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_RATE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_TICK_VALUE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for FPM_DP_VM_CALC_PER_LOT 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_exp_vama | TYPE TB_BZBETR, " | |||
| lv_i_restwert | TYPE B_BOOK_VALUE_FOREIGN, " | |||
| lv_zerodivide | TYPE B_BOOK_VALUE_FOREIGN, " | |||
| lv_no_rate | TYPE B_BOOK_VALUE_FOREIGN, " | |||
| lv_exp_tbw_neu | TYPE TB_BZBETR, " | |||
| lv_i_reststuecke | TYPE ASTUECK, " | |||
| lv_i_kurs | TYPE ATRAS-PKTKUR, " | |||
| lv_no_tick_value | TYPE ATRAS, " | |||
| lv_i_tick | TYPE VTI_FUTURE-PPTICK, " | |||
| lv_i_tickwert | TYPE VTI_FUTURE-BWTICK, " | |||
| lv_i_zugeord_anzahl | TYPE VTI_FUTURE-ASTUECK. " |
|   CALL FUNCTION 'FPM_DP_VM_CALC_PER_LOT' "Calculate Variation Margin at Lot Level |
| EXPORTING | ||
| I_RESTWERT | = lv_i_restwert | |
| I_RESTSTUECKE | = lv_i_reststuecke | |
| I_KURS | = lv_i_kurs | |
| I_TICK | = lv_i_tick | |
| I_TICKWERT | = lv_i_tickwert | |
| I_ZUGEORD_ANZAHL | = lv_i_zugeord_anzahl | |
| IMPORTING | ||
| EXP_VAMA | = lv_exp_vama | |
| EXP_TBW_NEU | = lv_exp_tbw_neu | |
| EXCEPTIONS | ||
| ZERODIVIDE = 1 | ||
| NO_RATE = 2 | ||
| NO_TICK_VALUE = 3 | ||
| . " FPM_DP_VM_CALC_PER_LOT | ||
ABAP code using 7.40 inline data declarations to call FM FPM_DP_VM_CALC_PER_LOT
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 PKTKUR FROM ATRAS INTO @DATA(ld_i_kurs). | ||||
| "SELECT single PPTICK FROM VTI_FUTURE INTO @DATA(ld_i_tick). | ||||
| "SELECT single BWTICK FROM VTI_FUTURE INTO @DATA(ld_i_tickwert). | ||||
| "SELECT single ASTUECK FROM VTI_FUTURE INTO @DATA(ld_i_zugeord_anzahl). | ||||
Search for further information about these or an SAP related objects