Variant tables are the data backbone of SAP VC. Instead of hard-coding lookup values in dependency logic, you store them in a table and reference it from procedures or constraints.
This approach means changing pricing rules, material assignments, or size lookups without modifying dependency code.
Source: SAP Help: Variant Tables | SAP Note 3573935
When to Use Variant Tables
Use a variant table when:
- A lookup has more than 5-10 rows
- The data changes often (pricing, material assignments)
- Multiple procedures need the same lookup data
- Business users need to maintain the data without touching dependency code
Do NOT use a variant table for:
- Simple one-to-one mappings (use a direct procedure assignment instead)
- Values that never change (hard-code them)
Creating a Variant Table
Transaction CU61 (variant table definition). The table structure uses characteristic-based columns.
A variant table has columns that correspond to characteristics. The input columns are the lookup keys, and the output columns contain the results of the lookup.
Example: A table that maps motor power and voltage to a cable cross-section:
| MOTOR_POWER (input) | VOLTAGE (input) | CABLE_CS (output) |
|---|---|---|
| 5.5 | 400 | 2.5 |
| 11 | 400 | 4.0 |
| 22 | 400 | 6.0 |
Using a Variant Table in a Procedure
Syntax for table lookup in a procedure:
TABLE <table_name> (
<input_char_1> = $self.<char_1>,
<input_char_2> = $self.<char_2>,
<output_char> = $self.<result_char>
)
Example:
TABLE ZCABLE_CS (
MOTOR_POWER = $self.MOTOR_KW,
VOLTAGE = $self.VOLTAGE_V,
CABLE_CS = $self.CABLE_MM2
)
For conditional lookup:
IF TABLE ZCABLE_CS (
MOTOR_POWER = $self.MOTOR_KW,
VOLTAGE = $self.VOLTAGE_V,
CABLE_CS = $self.CABLE_MM2
)
Setting Defaults from Tables
Replace = with ?= in the output column to set the result as a default value the user can override:
TABLE ZCABLE_CS (
MOTOR_POWER = $self.MOTOR_KW,
VOLTAGE = $self.VOLTAGE_V,
CABLE_CS ?= $self.CABLE_MM2
)
Performance Considerations
From SAP Note 3573935 and practical experience:
- Keep tables lean: only include columns you need
- Index appropriately: the first columns are the primary index
- Maintain DB statistics: use transaction DBACOCKPIT or schedule statistics jobs for CUVTAB tables
- Limit multi-value entries: tables with multi-valued entries increase complexity and affect performance
- Use CU50 trace to verify which table accesses are happening during configuration
Main Variant Table Tables in the Database
| Table | Contents |
|---|---|
| CUVTAB | Variant table header (name, description) |
| CUVTAB_IO | Input/output column definitions |
| CUVTAB_VAL | Table contents (actual data rows) |
Maintenance via CU50
Use CU50 to view variant table data and verify table lookup results during configuration tracing. CU50 shows you exactly which row was selected and what values were returned.
Common Mistakes
- No DB statistics on CUVTAB tables: causes slow configuration response as tables grow
- Too many input columns: each additional column increases lookup complexity : keep inputs to 3-4 maximum
- Hard-coding values that should be in a table: when the business changes pricing twice a year, a table beats modifying dependency code
Sources: SAP Help: Variant Tables | SAP Note 3573935