Creating and Testing Object Dependencies

Objective

After completing this lesson, you will be able to create and test object dependencies.

Introduction to Object Dependencies

What are Object Dependencies?

Object dependencies represent a set of rules that are considered when classifying objects. This means that dependencies and restrictions, for example, are always considered automatically and dynamically.

In SAP classification, object dependencies optimize and automate the classification process, that is, the characteristic value assignment.

  • Forbid specific value combinations. Only forklifts with a power of at least 30 kW can have a turbo. If your object, the forklift, has less than 30 kW power, you'll be prohibited from rating it with Turbo.

  • Require a characteristic. If forklifts are manufactured at Jungheinrich, the property "The internal term" must be evaluated during classification. This characteristic is otherwise not a required characteristic.

  • Set values for characteristics based on other selections. The manufacturer Linde only builds forklifts with automatic transmission. The "Automatic" property is to be selected by the system here.

The following figure shows what the examples above look like inside SAP- System.

Three uses of object dependencies--restricting value combinations, requiring characteristics, and automatic value setting--as they appear in SAP

How about two more examples? Object dependencies can:

  • Require characteristics to be assigned values in a specific sequence. You can prevent users from assigning a country to a forklift until a manufacturer has been assigned.
  • Specify default values that depend on a previous valuation. If most, but not all, forklifts manufactured by STILL have a performance of 25 kW, you can use object dependencies to automatically default to 25 kW if STILL is selected. Users can change that setting if necessary, and you can set different default values for other manufacturers.

The following image shows how these object dependencies look in SAP.

Two additional uses of object dependencies--forcing value assignment sequence and dynamic default value setting--as they appear in SAP

The following table summarizes where object dependencies work for managing classes, characteristics, and values.

Where Object Dependencies Do (and Don't) Work

ActivityClasses?Characteristics?Values?
Classifying objectsYesYesYes
Finding objectsNoNoNo
Configuring variantsNoYesYes

Note

  • Non-classic dependencies offer advanced mechanisms to achieve high modularity, flexibility, and scalability in modern software architecture.
  • Classic object dependencies, the focus of this course, work in:
    • Classic transactions
    • SAP GUI for HTML transactions
    • Apps with a new Classification UI like the Product Master or Document

Object Dependency Types

Object Dependency Types

You can create three types of object dependencies:

  • Preconditions
  • Selection conditions
  • Procedures

The following video introduces these types.

The following table summarizes when to use each type.

If you want to:Then use the:Assign them here:
Temporarily forbid the value assignment of characteristicsPreconditionCharacteristics
Temporarily forbid the use of characteristic valuesPreconditionValues
Make characteristics dynamic as required characteristicsSelection conditionCharacteristics
Set characteristic values automaticallyProcedureCharacteristics, values, or classes

Note

In Variant Configuration, one more type of object dependency is available: constraints. This dependency type is mainly for intensively interactive configuration tasks and for configuration tasks in which you need to consider the dependencies between the characteristics of several objects. The main purpose of a constraint is to monitor the consistency of a configuration. See help.sap.com for detail on this type.

Global vs. Local Object Dependencies

One final distinction of object dependencies lies in their scope and regarding usability within a system:

  • Global object dependencies are available across the entire system, so they can be used by multiple objects or processes. They can be reused in different contexts wherever the same conditions or procedures are needed. Using global object dependencies promotes consistency and reduces redundancy when you have conditions or procedures that are common and applicable to multiple objects or scenarios.
  • Example: Defining a global precondition that ensures user authentication before accessing any resource across a company's intranet portals. This ensures that all applications within the intranet use the same authentication process, maintaining security and consistency.
  • Local object dependencies are specific to a particular object or process and are not available for use where in the system. They are not designed for reuse outside the scope of the specific object or process they are tied to. Using local object dependencies when the conditions or procedures are unique to a specific object or scenario allows for more concise and context-specific definitions without affecting other parts of the system.
  • Example: Setting a local selection condition that filters data for a quarterly sales report unique to the marketing department. This local dependency is tailored to meet the specific criteria and needs of the marketing team's reporting requirements, without influencing other departments' reports.

    Note

    You'll create and maintain global dependencies centrally, using a special function in the Variant Configuration menu. A global dependency is identified by a name and can be used many times.

    In contrast, you'll define local dependencies for a specific class, characteristic, or characteristic value. A local dependency is identified by an internal number and can't be used again.

Object Dependency Syntax

Syntax for Object Dependencies

Now that you've seen the different types of object dependencies and when to use them, let's look at the syntax you'll use to create them.

The following video introduces the basics. A complete list of operators, expressions, and rules is available at help.sap.com.

A few general rules for creating object dependencies:

  • Put character strings used in dependencies in single quote marks ('). Example: COLOR = 'red'
  • When you refer to a characteristic or a characteristic value in a dependency, use the language-independent key (name).
  • Characteristic names with a hyphen are not beautiful in object dependencies. However, they can be used in object dependencies in which the syntax element SKEY is also used.

How to Create a Precondition for a Characteristic or Value

Think back to the examples from the beginning of this course, where object dependencies can:

  • Forbid certain value combinations - such as turbo engines powered below 30 kW.
  • Require characteristics to be assigned values in a specific sequence - such as forcing users to select a manufacturer before selecting a country of origin.

Both of those are examples of preconditions. The first example constrains values, while the second constrains characteristics.

The following slide reviews these examples as they appear in SAP, this time with the "what" precondition and "where" it's applied, and the syntax expressing the precondition.

Screenshots of the two preconditions the upcoming videos will demonstrate.

The following video demonstrates how to create a precondition that requires 30 kW or more for a turbo engine.

The following video demonstrates how to create a precondition that requires users to select a manufacturer before specifying a country.

How to Create a Selection Condition

Remember the example from the beginning of this unit, where an object dependency requires turbos manufactured at Jungheinrich to be evaluated by the internal team, resulting in an internal description?

Here's that example again, this time with the "what", "where," and syntax added.

  • The "what" is the selection condition: Jungheinrich is the manufacturer.
  • The "where" is the value that the condition will modify: the internal description.
  • The syntax, Manufacturer = 'Jungheinrich' defines the selection condition.
Example selection condition described above, as it appears in SAP

The following video demonstrates how to create a selection condition to require an internal description for Jungheinrich forklifts.

How to Create Procedures with Hard or Soft Valuations

Once again, recall the example dependencies from the beginning of this course:

  • Requiring the "Automatic" property when Linde is the manufacturer.
  • Default to 25 kW when STILL is the manufacturer.

Both of these are examples of procedures, which are triggered by the "Manufacturer" value.

With procedures, you can perform the following operations, in whatever sequence you define:

  • Set default values
  • Calculate recursions
  • Overwrite values that other procedures have set

Such a thing can only be done with procedures.

When you enter a Procedure for a:Then it's processed:
ClassAlways
CharacteristicOnly if the characteristic has an assigned value
Characteristic valueOnly if the value is assigned

Note

Manually setting values that differ from values set by procedures can result in inconsistency.

The following image shows these examples, annotated with "What", "Where," and the syntax describing the condition. In the first example "Automatic" is a required ("hard") valuation. For the second, 25 kW is a "soft" default valuation, which the user can change.

Screenshot of how the two procedures described above look in SAP.

The following video demonstrates how to create a procedure to automatically select "Automatic" for Linde forklifts. Users can't change this value.

The following video demonstrates how to create a procedure to automatically default to 25 kW for STILL forklifts. Users can change this value.

How to Create and Test Object Dependencies

Now that you've seen examples of creating the major object dependency types, let's tie in all together, in context. The videos in this section demonstrate the following tasks:

  • Checking the class and creating a characteristic precondition.
  • Creating a value precondition.
  • Creating a characteristic precondition.
  • Creating a procedure to select a characteristic value.
  • Testing the object dependencies you created.

Task 1: Check the Class and Create a Characteristic Precondition

The following video shows how to:

  • Check that a class is suitable for creating dependencies.
  • Create a precondition for a characteristic.

Task 2: Create a Value Precondition

The following video shows how to create a precondition for a characteristic.

Task 3: Create a Procedure for a Characteristic Value

The following video shows how to create a procedure for a characteristic value.

Task 4: Create a Selection Condition for a Characteristic

The following video shows how to create a selection condition for a characteristic.

Task 5: Test Your Object Dependencies

Now that you've created four object dependencies, you're ready to test them. The following video shows how.

Log in to track your progress & complete quizzes