Show TOC

DeterminationLocate this document in the navigation structure

In BOPF, a determination is an entity of a business object node that is used to provide functions that are automatically executed as soon as a certain trigger condition is fulfilled. A determination is triggered internally on the basis of changes made to the node instance of a business object. The trigger conditions are checked by BOPF at different points during the transaction cycle, depending on the determination times and the changing operations on the relevant node instances. For each determination, it is necessary to specify both the points of time and the changes that form the trigger condition. Changes can include creating, updating, deleting, or loading node instances. You can use a determination primarily to compute data that is derived from the values of other attributes. The determined attributes and the determining attributes of the trigger condition either belong to the same node or to different nodes.

Example
If there is a change to the quantity of several products (items) in an invoice object instance, the amount attribute (the overall price) for all relevant products has to be calculated again. To calculate this amount automatically, you have to extend the standard change process for the invoice business object instances with the help of determination. The determination can then react to the creation, the modification, the deletion, or the loading of an invoice item by deriving new values for the amount field. For such an example, the solution might look as follows:

After changing the quantity of invoice items, the trigger conditions of the CALCULATE_ITEM_AMOUNT determination and the CALCULATE_TOTAL_AMOUNT determination are both fulfilled. The CALCULATE_ITEM_AMOUNT determination calculates the amount of the changed item (price x quantity), whereas the CALCULATE_TOTAL_AMOUNT determination sums up the amounts of all items to the total amount of the invoice.

Determination Time and Triggers

Depending on the use case in question, BOPF checks the triggers of a determination at several points during the transaction.

A determination time defines at what time in the transaction cycle the trigger condition of that determination should be evaluated. For example, the re-calculation of the invoice amount should take place every time after a modification is performed (determination time: After Modify), but only if there are instances of the ITEM node that were updated (trigger: Update).

The following list shows which trigger operations are evaluated at which determination times:

Table 1: The determination time and the triggers defines the trigger condition

Trigger >

-------------------------------

Determination Time

Create

Update

Delete

Load

Determine

After Modification X X X
Calculate Transient Attributes X X X X
During Check and Determine X
Before Save X X X
Draw Number During Save X X X
During Save X X X
After Successful Save X X X
After Cleanup Transaction X X X
After Failed Save X X X
Determination Dependencies

If, in the example above, you do not define any dependencies between the determinations, the system might calculate the total amount before the item amount. Therefore, you must specify the

CALCULATE_ITEM_AMOUNT determination as a predecessor of the CALCULATE_TOTAL_AMOUNT determination.

To specify whether a determination is a predecessor or a successor of another determination, you define a determination dependency. If there is more than one determination to be executed, the dependencies of the determinations are considered when BOPF checks the trigger conditions of determinations.

Example

The following dependency is defined in such a way that the item amount is calculated before the total amount.

Node: Determination Dependency
ROOT: CALCULATE_TOTAL_AMOUNT

Determination depends on CALCULATE_ITEM_AMOUNT
ROOT > ITEM: CALCULATE_ITEM_AMOUNT

Determination must be executed before CALCULATE_TOTAL_AMOUNT

Dependency defines the execution order of determinations:

Dependencies between determinations
Figure 1: Dependencies between determinations

Examples of valid execution orders are:

4, 1, 3, 2, 5 (for example, the determination DET 2 is always executed before the execution of DET 5)

1, 2, 5, 4, 3 (for example, DET 1 is always executed before the execution of DET 2).

Determination Types

Depending on which category of nodes comes into play when executing determinations, there are two different determination types available:

  • Transient Determination - Modifies only transient fields or nodes. For such determinations no locking is necessary.
  • Persistent Determination - Modifies transient and persistent fields or nodes. Here locking is necessary.
Implementing a Custom Determination Class

The determination logic is encapsulated within an ABAP class that implements the determination interface /BOBF/IF_FRW_DETERMINATION.

More on this: Understanding the Determination API