Object Dependencies
Unit Overview
This unit explains various types and functions of dependencies and their creation. It also explains the use of various tools to work with dependencies.
Unit Objectives
After completing this unit, you will be able to: • Identify the various types of dependencies • Describe the functions of dependencies • Create dependencies
• Use tools for working with dependencies
Unit Contents
Lesson: Types and Functions of Object Dependencies ...124 Lesson: Creating Object Dependencies ...129 Lesson: Tools for Working With Dependencies ...138
Lesson: Types and Functions of Object Dependencies
Lesson Overview
This lesson describes various types of dependencies and their functions.
Lesson Objectives
After completing this lesson, you will be able to: • Identify the various types of dependencies • Describe the functions of dependencies
Business Example
ABC Motors is an automobile manufacturing company. It manufactures various models of cars. The company is implementing variant
configuration solution of SAP R/3 Enterprise to maintain end-product variants. You are the Product Manager of the company and your team has come a long way toward setting up the variant configuration knowledge base. When you try to configure a product, you need to identify the dependencies in the variant configuration solution.
Figure 47: Variant Configuration Knowledge Base for Materials (1)
Defining Object Dependencies
• Local dependencies have the following properties:
– They cannot be maintained centrally and cannot be assigned to other objects.
– They are identified by a number assigned by the system and not by an external name.
• Global dependencies have the following properties:
– They are identified by an assigned external name and are maintained and managed centrally.
– There are special assignment functions that enable you to assign global dependencies to individual objects. However, you can also create all dependencies except constraint nets in the assignment function.
– If you change a global dependency, it affects all the objects where dependency is used.
Types of Object Dependencies
Figure 48: Dependency Types
Object Dependencies in Classification and Variant Configuration
Classification Variant Configuration
• Can be assigned only to classes, characteristics, and values
• Active only when classifying an object and not when finding objects
• Dynamic control of characteristic and values • Automatic characteristic value
assignment
• Required to perform configuration
• Can be assigned to various objects in the knowledge base • Active during the
configuration process as determined by the predefined execution sequence
• Dynamic control of characteristic and values • Automatic characteristic
value assignment
• Multilevel configuration, including checks for
Lesson Summary
You should now be able to:
• Identify the various types of dependencies • Describe the functions of dependencies
Lesson: Creating Object Dependencies
Lesson Overview
This lesson describes how to create dependencies.
Lesson Objectives
After completing this lesson, you will be able to: • Create dependencies
Business Example
ABC Motors is an automobile manufacturing company. It manufactures various models of cars. The company is implementing variant
configuration solution of SAP R/3 Enterprise to maintain end-product variants. You are the Product Manager of the company. You have identified the dependencies in the variant configuration solution. To ensure that the system selects relevant objects for configuring a product, there should be a mutual interdependence between objects. Now, you need to create these object dependencies.
Processing Sequence of Object Dependencies
The following processing sequence applies to the value assignment user interface. Processing is started according to your settings, either on ENTER or on request. It includes dependencies for the configuration profile, the characteristics that have values assigned, and the values used.
0. Default values for characteristic
1. All actions multiple times, until no more values can be inferred 2. All procedures exactly once in the following sequence:
- Configuration profile - Characteristics - Characteristic values
The processing sequence of procedures for each object is defined in the dependency assignment.
3. As in 1. - all actions that are triggered by changes made by procedures. In parallel with points 0. to 3. all constraints are processed as soon as relevant changes are made.
4. All preconditions and then all selection conditions.
When you explode the BOM and task list, the following sequence applies: Selection conditions => actions => procedures => actions
Paradigms of SAP R/3 Enterprise Configurator
• Declarative dependency types – Constraints
– Actions
• Semi-declarative dependency types
Behave like declarative dependency types, but are processed procedurally and internally
In declarative dependencies, the point in time when the dependency is processed and the sequence in which the dependencies are processed are not relevant to the result. The result of a declarative dependency can be explained logically. The dependency describes a rule that must always apply. This contrasts with procedural dependencies, where the result depends on the processing sequence and the point in time when the dependency is processed. Some expressions are in themselves non-declarative. For this reason, these expressions cannot be used in declarative object dependencies:
NOT SPECIFIED; NOT TYPE_OF; <multiple-value characteristic> NE <value>
You can use these expressions in preconditions and selection conditions. Since preconditions and selection conditions are not processed until the end of the configuration process, you can assume that values have been assigned to all the characteristics that are intended to have values, and that any missing information is deliberately not given.
When the not equals (NE) expression is processed for multiple-value characteristics, there is a difference between constraints and actions. In constraints, “not equals“ can be expressed for multiple-value
characteristics, because values are processed individually in constraints. In actions, however, the sum of the selected values is processed. Since it is not clear whether it is deliberate that no value was selected for a multiple-value characteristic or whether a value will be assigned at a later point in time, this expression cannot be processed in actions.
Dependencies, classes, and objects support a declarative and
object-oriented solution for a knowledge base. The system determines the processing sequence of the object dependencies and ensures that they are only executed when required.
Syntax for Object Dependencies
• Each of the five dependency types has its own syntax rules. • Preconditions, selection conditions, actions, and procedures are
simple dependencies.
• Preconditions and selection conditions are Boolean expressions with a binary result.
• Constraints are more complex object dependencies with their own syntax. They are structured like a program. They have a much broader functional scope. They are especially useful for defining and evaluating complex, multilevel configurations, but can also be used with single-level configurations.
• The syntax of dependencies is not the same as ABAP syntax. However, ABAP function modules can be called in dependencies as variant functions.
• Two strings might be separated by any number of blanks.
• Keywords and strings are not case sensitive, except for characteristic values that were originally defined as case sensitive in characteristics maintenance.
• Strings containing hyphens must be enclosed in single quotes and preceded with the keyword SKEY.
• All strings must be entered in their global language-independent form.
• An asterisk (*) at the beginning of a line identifies the line as a comment.
• Elements in lists are separated by commas (,).
• Characteristic values in CHAR format must be enclosed in single quotes. Syntax
• The syntax for object variables is different depending on whether the variable is used in constraints or simple object dependencies.
• In simple dependencies you can use the three object variables $ROOT, $PARENT, and $SELF. These object variables have a fixed meaning: – $ROOT always refers to the header material in a configuration. – $SELF refers to the current object. Actions and procedures can
only set values on this level.
– $PARENT refers to the instance immediately above $SELF in a configuration structure. Instances are created only for configurable materials with an active configuration profile.
• Constraints use a more flexible method of identifying objects and characteristics.
• All objects and characteristics of the variant classes can be directly and concurrently addressed during the execution of a constraint.
Figure 51: Operators
Figure 52: Arithmetical Expressions
• You can use the operator IN to define lists of values that have an OR relationship to each other. Example: COLOR IN (“red“, “yellow“, or “green“)
• This condition is fulfilled if at least one of the values “red“, “yellow“, or “green“ is assigned to characteristic COLOR.
• In a precondition, this condition is also fulfilled if no value is assigned to characteristic COLOR. Example: POWER IN (200, 300, 350)
Value nodes in value hierarchies are not supported in dependencies. The expression, COUNTRY IN “Europe“, where Europe is a value node with subordinate values, is not allowed in dependencies.
• You can use the expression SPECIFIED in: – Preconditions
– Selection conditions
– Conditions in procedures, actions, and constraints • The precondition is fulfilled if any value is selected for the
characteristic. However, it does not matter which value is assigned to the characteristic.
SPECIFIED SPECIAL_PAINT SPECIAL_PAINT SPECIFIED
• The negative form NOT SPECIFIED always goes before the characteristic variable.
NOT SPECIFIED SPECIAL_PAINT
Restrictions: You cannot use NOT SPECIFIED in actions and constraints.
• You use TYPE_OF to define that the condition only applies to one object.
• You use this condition if the dependency is dependent on its environment, for example, dependent on being used for a specific BOM header material.
TYPE_OF($ROOT, (Material)(300)(NR=“U91“))
• If you use a condition like this, for example, a selection condition for a BOM item, the item is included in the BOM explosion if the $ROOT object (header material) has material number “U91“.
Restrictions:
NOT TYPE_OF cannot be used in actions.
• <symb. characteristic> = <symb.term> || <symb.term> = Concatenate terms and cut off after 30 characters
CHAR1= ’Variant’ || ’Configuration’ || ’VariantConfiguration’ ==> Char1 = ’VariantConfigurationVariant’
• <symb. characteristic> LC <symb.term> = Convert to lowercase
CHAR1 LC ’Otto’ ==> CHAR1 = ’otto’ Char1 is case sensitive
• <symb. characteristic> UC <symb.term> = Convert to uppercase
CHAR2 UC CHAR1
Char2 is not case sensitive, unlike Char1
• mdata := Addresses the “master data“: the value in the relevant database field
• set_default := Sets default values
• del_default := Deletes values set by “set_default“
• sum_parts := Calculates the sum for a numeric characteristic across all items in a single-level BOM explosion (multilevel configuration only) • count_parts := Calculates the item quantities (similar to “sum_parts“) • part_of := (In constraints only) allows queries as to whether an object
is a component in the exploded BOM of another object (optionally in a specific position)
• subpart_of := (In constraints only) same as “part_of“ but any BOM structure
Example for mdata:
Item quantity “1“ is entered in the bill of material, and T_POS_MENGE is a reference characteristic with reference to database field STPO-MENGE. The following procedure is processed:
$self.t_pos_menge = $self.t_pos_menge + 1, $self.t_pos_menge = $self.t_pos_menge * 2
This produces the value 1 for the item quantity, because the procedure terminates.
The following procedure is processed:
$self.t_pos_menge = mdata $self.t_pos_menge + 1, $self.t_pos_menge = $self.t_pos_menge * 2
This produces the value 4 for the item quantity. The following procedure is processed:
$self.t_pos_menge = mdata $self.t_pos_menge + 1, $self.t_pos_menge = mdata $self.t_pos_menge * 2 This produces the value 2 for the item quantity.
Status of Object Dependencies
Lesson Summary
You should now be able to: • Create dependencies
Lesson: Tools for Working With Dependencies
Lesson Overview
This lesson describes the tools that are used to work with dependencies.
Lesson Objectives
After completing this lesson, you will be able to: • Use tools for working with dependencies
Business Example
ABC Motors is an automobile manufacturing company. It manufactures various models of cars. The company is implementing variant
configuration solution of SAP R/3 Enterprise to maintain end-product variants. As the Product Manager of the company, you identified the dependencies in the variant configuration solution. To create these dependencies, you need to work with variant functions, tables, and traces.
Variant Tables
• Variant tables are used to store combinations of characteristic values, for example, you can only have a gray car interior if the exterior paint color is blue.
• Variant tables can simplify dependencies. You can reference the table in the dependency and the system can use the table to check assigned values or infer values. If the interdependencies between characteristic values change, you can change the table contents. However, there is no need to change the individual dependencies.
• You can link a variant table to a database table. • You can use variant tables with all dependency types.
– In selection conditions, preconditions, constraints, and the conditional part of actions and procedures, variant tables are
Figure 54: Variant Tables (2)
Variant Functions
• Variant functions enable you to complement an object dependency with special logic for calculations or consistency checks.
• In a function, you can refer to an ABAP function module and transfer import and export parameters. In the function module, you can access the data for processing.
Declaration of function name: FUNCTION Z_LABEL_ID Declaration of characteristics: (CASING = $ROOT.CASING,
CPU = $ROOT.CPU,
HARD_DISK = $ROOT.HARD_DISK, LABEL_ID = $SELF.LABEL_ID)
When you call a user-defined function module, SAP R/3 Enterprise variant configuration has no control over any error situations that occur.
The person who writes the program can use ABAP language elements but has sole responsibility for the code.
Trace Functions
• The trace function traces the internal processing steps that the system makes while processing dependencies.
• You can start the trace function for the following objects: – Simple dependencies
– Constraints
– Tables and functions – Dynamic database • Additional filter criteria:
– You can restrict the trace function to specific dependencies. – You can restrict the trace function for the dynamic database to
a given list of characteristics.
– You can restrict the trace function to a given list of tables or functions.
• You can define the level of detail for your trace: – Less detailed or more detailed
Lesson Summary
You should now be able to:
Unit Summary
You should now be able to:
• Identify the various types of dependencies • Describe the functions of dependencies • Create dependencies
Test Your Knowledge
1. Local dependencies are identified by an external name. Determine whether this statement is true or false.
□ True □ False
2. Object dependencies in classification are active during the configuration process as determined by the predefined execution sequence.
Determine whether this statement is true or false. □ True
□ False
3. Which of the following statements are true for the expression “SPECIFIED“?
Choose the correct answer(s).
□ A You can use the expression “SPECIFIED“ in preconditions. □ B You can use the expression “SPECIFIED“ in selection
conditions.
□ C The negative form of the expression “SPECIFIED“, that is, “NOT SPECIFIED“, always goes after the characteristic variable.
□ D You can use “NOT SPECIFIED“ in actions and constraints.
4. Which of the dependency statuses are correctly matched with their explanations?
Choose the correct answer(s).
□ A Dependency status “1“ - Released □ B Dependency status “1“ - In preparation □ C Dependency status “3“ - Locked
□ D Dependency status “2“ - Locked
5. Identify the correct statements for variant tables. Choose the correct answer(s).
□ A Variant tables are used to store combinations of class values. □ B Variant tables can simplify dependencies.
□ C You can link a variant table to a database table.
6. For the following objects can you start the trace function? Choose the correct answer(s).
□ A Simple dependencies
□ B Import and export parameters □ C Characteristics values
Answers
1. Local dependencies are identified by an external name.
Answer: False
Local dependencies are identified by a number assigned by the system and not by an external name.
2. Object dependencies in classification are active during the configuration process as determined by the predefined execution sequence.
Answer: False
Object dependencies in variant configuration are active during the configuration process as determined by the predefined execution sequence.
3. Which of the following statements are true for the expression “SPECIFIED“?
Answer: A, B
The negative form of the expression “SPECIFIED“ (“NOT SPECIFIED“) always goes before the characteristic variable. In addition, you cannot use “NOT SPECIFIED“ in actions and constraints.
4. Which of the dependency statuses are correctly matched with their explanations?
Answer: A, C
Dependency status “1“ means that the dependency is released and can be used. However, the dependency must be complete before it can be used; Dependency status “2“ means that the dependency is in preparation and cannot be used as yet; Dependency status “3“ means that the dependency is locked for new use.
5. Identify the correct statements for variant tables. Answer: B, C
You can use the variant tables to store combinations of characteristic values. You can also use variant tables with all dependency types.
6. For the following objects can you start the trace function? Answer: A, D
You can start the trace function for simple dependencies, constraints, tables and functions, and dynamic database.