Defining Formulas

 

SAP provides a number of predefined formulas.

You can also define additional formulas.

To define formulas, go to Customizing for SAP Utilities and choose Start of the navigation path Tools Next navigation step System Modifications Next navigation step User-Defined Enhancements for Energy Data Management Next navigation step Formulas End of the navigation path.

Prerequisites

Before defining any formulas in addition to those predefined by SAP, you must define a function module for the calculations. The function module must provide the following interface:

Interface

CHANGING

EXCEPTIONS

REFERENCE (XY_CNTR) TYPE EEDMFORMULACTR

GENERAL_FAULT

REFERENCE (XY_INP) TYPE TEEDMFORMPARLIST_I

REFERENCE (XY_OUT) TYPE TEEDMFORMPARLIST_O

Activities

You must use the following function modules as templates:

  • ISU_EDM_FORMULA_EASY

    This template contains the most common calculation macros and is sufficient in most cases.

  • ISU_EDM_FORMULA_XXXX

    This template contains all existing calculation macros.

Once you have copied the function module, you have to modify it to meet your requirements. You can do this using the functions of the ABAP Workbench.

You can obtain detailed information about the calculation from the source text of function module ISU_EDM_FORMULA_0005.

Process

  1. Select Create Formula.

  2. Enter an ID and a name for the formula in the Form. ProfCalc field (Formula for Calculation of Profiles).

    Input Parameters group box

  3. Enter a parameter name and number.

  4. Choose one of the predefined profile value categories in the PV category field (Profile Value Category).

  5. Enter the number of intervals that must be included in the formula in the No. Intervals field (Number of Influential Intervals).

    If there are no dependencies between the intervals to be calculated, enter 0 for the number of intervals.

    If you need values from previous intervals, enter a number higher than 0 for the number of intervals.

    Refer to the field help for more information.

  6. If you want to be able to allocate more than one profile to the input parameter, select the Repeatable field.

  7. If you want to allocate a constant value and not a profile to the input parameter, select the Constant Value field.

  8. If you want to use a determination method to determine the values for the input parameter, enter a predefined formula variable in the ID Form.Var. field (ID EDM Formula Variable).

    For more information, see Variables.

  9. If you want to be able to use default values for the input parameters, select the Default Value field (Default Value Allowed in Formula).

    For more information, see Default Values.

  10. Wählen Sie Copy (Copy).

    Your entries are then transferred to the list.

  11. Repeat steps 3 to 10 for every additional input parameter required for the formula.

    Calculation Mode group box

    The calculation mode determines how a value is to be processed when the formula is executed.

    Example Example

    Manually entered values cannot be used for billing.

    By using the EXIT_SAPLEEDM_FORMUTIL_001 function module from the EEDMFO01 enhancement, the calculation mode can, for example, carry out a calculation based on the status of the input profile value.

    As a result, values with the status Manually Entered are not included in billing. Only the blue curve is included in billing.

    End of the example.

    Note Note

    SAP has already predefined a number of calculation modes. You can also define additional calculation modes.

    To define calculation modes, go to Customizing for SAP Utilities and choose Start of the navigation path Tools Next navigation step System Modifications Next navigation step User-Defined Enhancements for Energy Data Management Next navigation step Formulas End of the navigation path.

    See also: Calculation Mode

    End of the note.
  12. Select (double click) an input parameter from the list. The parameter number of the selected parameter appears automatically in the Calculation Mode group box.

  13. Select one of the predefined calculation modes in the Calc.Mode (calculation mode) field.

  14. If you want the system to use this calculation mode as the default value for the parameter, select the Default Value field.

    Caution Caution

    Only ever select the Default Value field for one calculation mode.

    End of the caution.
  15. Wählen Sie Copy (Copy).

    Your entries are then transferred to the list.

  16. Repeat the steps 10 to 13 whenever you want to allocate one or more calculation modes to input parameters.

    Output Parameters group box

  17. Enter a parameter name and number.

  18. Choose one of the predefined profile value categories in the PV category field (Profile Value Category).

  19. Enter the number of intervals that must be included in the formula in the No. Intervals field (Number of Influential Intervals).

    If there are no dependencies between the intervals to be calculated, enter 0 for the number of intervals.

    If you need values from previous intervals, enter a number higher than 0 for the number of intervals.

  20. Wählen Sie Copy (Copy).

    Your entries are then transferred to the list.

  21. Repeat steps 15 to 18 for every additional output parameter required for the formula.

  22. Once you have defined all input and output parameters, choose Save.

Example

Function module for executing the formula

ISU_EDM_FORMULA_0005

Input parameters

Parameter number

1

Description of formula parameter

Profiles to be cumulated

Profile value category

Quantity

Repeatable

Yes

Number of intervals

0

Constant value

Output parameters

Parameter number

1

Description of formula parameter

Total profile

Profile value category

Quantity

Number of intervals

0