Calculation Mode The calculation mode determines how a value is processed when a formula is executed. It could, for example, enable calculation based on the status of the input profile value.
Example
You have uploaded EDM profile values using BAPI
BAPI_ISUPROFILE_UPLOAD
. During import, it was determined that profile values are missing for several intervals. Replacement values are created for these intervals using the allocated replacement value group.
The profile values are analyzed during billing by means of a formula in order to determine the consumption and the maximum demand within the billing period. Billing is then executed on the basis of these values. However, the replacement values for determining the maximum demand are not used. As a result, only the blue curve is included in billing (see graph).

SAP has already predefined a number of calculation modes:
01 – Value included in calculation
01 – Value not included in calculation
99 – Value results in cancellation of calculation
Note
As soon as an interval is allocated to calculation mode 99 in enhancement EESMFO01, the calculation is cancelled (for the entire billing period).
When implementing formulas, you can use the constants from include IEEDMFORMULACALCMOD in order to correspond with the calculation mode within the program.
Constants:
co_calcmod_use type e_formulamod value '01',
co_calcmod_not_use type e_formulamod value '02',
co_calcmod_abort type e_formulamod value '99'.
You can also define additional calculation modes.
To define a calculation mode, go to Customizing for
SAP Utilities
and choose
You can allocate input parameters to calculation modes in the transaction for defining formulas. You must define one calculation mode as a default value for the parameter.
Select (double click) an input parameter from the list. The parameter number of the selected parameter appears automatically in the
Calculation Mode
group box.
Select one of the predefined calculation modes in the
Calc.Mode
(calculation mode) field.
If you want the system to use this calculation mode as the default value for the parameter, select the
Default
Value
field.
Only ever select the
Default Value
field for
one
calculation mode.
Choose
Copy.
Your entries are then transferred to the list.
Repeat the steps whenever you want to allocate one or more calculation modes to input parameters.
You use a function module to calculate formulas. Before defining any extra formulas in addition to those predefined by SAP, you must define a function module for the calculations.
To define formulas, go to Customizing for
SAP Utilities
and choose
In the function modules, you can respond to the calculation modes of the individual intervals in order to influence the results of formula calculation.
Example
You can find information on calculation and calculation modes in the source text of function module ISU_EDM_FORMULA_0005.
You can use the formulas described in the source text to copy a quantity profile and convert it into a demand profile.
Input parameter:
Quantity profile
Output parameters:
Copy of quantity profile
Copy of demand profile (demand)
Only those quantity profile values with calculation mode 01 (
Value Included in Calculation
) are copied and converted.
The demand value is set to zero for the remaining calculation modes.
The default value of the input parameter is used for every interval in the billing period.
In enhancement EEDMFO01, you can set any calculation mode for each interval based on the status of the input profile value, for example.
For each input parameter, you can use variable
xmod<n>
to activate the calculation mode in the function module.
You can use this enhancement to determine the calculation mode of profile values for calculating formulas.
The enhancement contains function module EXIT_SAPLEEDM_FORMUTIL_001. In this function module, you can determine the calculation mode given to the values of a profile for formula calculation.
The dates in the parameters are all given in UTC time. This also applies to the parameters in table format. If you need the dates in the enhancement to be in local time, you have to convert them. You can do this using the macros defined in include IEEDM_TIMCVT.
Example
This example implementation of enhancement EEDMFO01 determines the periods, in which the status of the profile values was set to
Interpolated
or
Extrapolated
.
The calculation mode of the periods is set to 02 –
Value Not Included in Calculation
.