Creating Variant Tables and More

Objective

After completing this lesson, you will be able to create variant tables, use the processing mode and link to database tables.

Variant Tables

The following figure gives you an overview of Variant tables and their use in Conditions, value derivation, and value restrictions.

This figure shows an overview of Variant tables and their use in Conditions, value derivations and value restrictions. The question is for example, whether a key is required, or is the table content unique and when an access is granted.

Usage:

  • Mapping of allowed value combinations (access only for complete value assignment)

    In selection conditions, preconditions, constraints, and in procedures in the "if part"

  • Inference of characteristic values (access only with fully valuated key)

    In procedures and constraints

  • Restricting Value Ranges (Immediate Access)

    In constraints

Restrictions:

  • In simple object dependencies (everything not equal to constraints), only the first value assignment alternative can be used.

  • All the characteristics required to access the table must have a value. Otherwise object dependencies will terminate.

  • If derivation is not successful (for example, missing table entry).

    → Termination; value to be derived undefined.

Linking of Variant Tables

The first figure shows you how to link a variant table with a database table.

This figure explains the way of linking a variant table with a Database table. First a variant table is created without a link. Then you use a database table as a variant table. Inside the basic data of the variant table you could enter the database table.

The second figure gives you further information.

You can link an existing variant table to a database table to be created. You create and activate the database table inside ABAP workbench. There you define names with suitable data elements. For all characteristics used as keys in the variant table, you have to define corresponding fields as keys. Then you link the variant table with the database table. At least you do a data transfer.

How to Maintain and Link DB Tables to Variant Tables

This video shows you other aspects of variant table maintenance. This applies in particular to:

  • The processing mode

  • Linkage of Variant Tables to Database Tables

BAdIs and More

BAdIs in AVC

Working with AVC, you aren't able to work with variant functions. Instead, you have to use BAdIs. The next figure gives you a first impression.

This figure shows BAdIs for AVC. Details are given inside note.

AVC – Enablement of BAdIs for the Advanced Configuration Engine

You can implement the following BAdIs:

  • VCH_HL_MD_DOMAIN_MODIFY
  • VCH_HL_PRE_VALIDATE_ASSIGN
  • VCH_HL_POST_VALIDATE_ASSIGN
  • VCH_HL_ON_SAVE

VCH_HL_MD_DOMAIN_MODIFY

Overrule the values predefined in the characteristic master data.

Execution:

  • Only AVC high-level configuration

  • First activation of a configurable instance

Scope:

  • Add new domain values and intervals.

  • Delete predefined domain values.

  • Change certain attributes of predefined values.

Use Case Examples:

  • Build-up empty domains from tables including language-specific descriptions for string characteristics.

  • Add temporary values for special promotions.

  • Change value description for certain customers, change static defaults, for example, for certain customer materials.

  • Restrict domains on the level of configuration model.

VCH_HL_PRE_VALIDATE_ASSIGN

Modify value assignments before processing the dependencies.

Execution:

  • Every round trip before dependency processing

  • Considered in high-level dependency processing

  • Control assignment on all instances

Scope:

  • Add new assignments.

  • Delete value assignments.

Use Case Examples:

  • Call external Web service, RFCs, other APIs.

  • Call external engine, for example, BRF+.

  • Pass values from one instance to another instance without specifying every characteristic.

  • Read other class types like 001, 019, 017, and z-tables.

  • Read master data table (only data stored on the database) for value assignment.

  • Check user inputs before dependency processing.

  • Replaces many variant functions of LO-VC.

VCH_HL_POST_VALIDATE_ASSIGN

Modify value assignments after processing the dependencies.

Execution:

  • Every round trip after dependency processing

  • Not considered in high-level dependency processing

  • Control assignment on all instances

Scope:

  • Add new assignments (all instances)

  • Delete value assignments (all instances)

Use Case Examples:

  • Switch author to external assignments (avoid changes by user)

  • $SUM_PART; $COUNT_PART (if not needed in validation)

  • Calculation of weights, surfaces, electrical, and mechanical parameters

  • Ability to review fully configured objects looking for specific information and set a value

  • Replaces many variant functions of LO-VC

VCH_HL_ON_SAVE

Modify value assignments while leaving the configuration.

Execution:

  • While leaving configuration

  • Not considered in high-level dependency processing

  • Control assignment on all instances

Scope:

  • Lock configuration.

  • Add new assignments.

  • Delete value assignments.

Use Case Examples:

  • Special checks on valuation consistency.

  • Set values for other processes to use (customer tables).

  • Delete values of helper characteristics (not to be stored to CBASE).

Variant Functions

The next figure gives you a summary of variant functions with LO-VC.

This figure explains the use of Variant Functions. Variant functions are only available in LO-VC. Functions gives you additional functions in object dependency programs. The procedure contain the definition of input and output characteristics, the definition of an ABAP/4 program. It also includes the function in an object dependency, for example, to a procedure, with a keyword FUNCTION, and assign the object dependencies to the configuration profile.

You can only use your own (ABAP/4) programs under LO-VC in the Variant Configuration. This is besides to the functions of the standard object dependencies. These programs describe dependencies that can't be mapped or can only be mapped poorly by the standard object dependencies.

This figure shows examples of Variant Functions.

In the same way as for the syntax element function, pfunction can also be used in procedures.

This figure shows you the use of pfunction.

This figure explains the use of pfunction in Procedures under LO-VC.

Log in to track your progress & complete quizzes