Tables in preconditions
As we are well aware that preconditions are used to display/hide the characteristic(s)/characteristic value(s).
Variant tables are used to store the combinations and can be used in selection conditions, preconditions, procedures and constraints.
We can use tables in preconditions for the following:
- To check the consistency
- Display possible entries
Here, I would like to brief about use of tables in precondition with simple example.
Please note that the example chosen is for demonstration purpose only.
For e.g. Requirement is that based on Brand chosen, only processors of that brand must display.
Class VCL_CLASS contains two characteristics CH_PROC_BRAND (Processors’ Brand) & CH_PROCESSORS (Processors)
Below are the values of each characteristic:
1. Values of CH_PROC_BRAND
2. Values of CH_PROCESSORS
A variant table T_BRAND_PROC has been created and maintained using CU61 & CU60 respectively.
Please note that value assignment alternatives are not relevant to precondition since preconditions are not used to infer values.
Variant table T_BRAND_PROC
No value assignment alternative is defined:
Variant table T_BRAND_PROC has been maintained with required combinations which may not be unique (this is the reason ‘key field’ was not checked in either of the characteristic during table definition)
In order to use this table in precondition, we need to create precondition for each characteristic value of characteristic CH_PROCESSORS and assign it to the respective characteristic value.
I created following precondition for value VCH_AMD A4:
(CH_PROC_BRAND = CH_PROC_BRAND, CH_PROCESSORS = ‘VCH_AMD A4’)
and assigned to it characteristic value ‘VCH_AMD A4’
Similarly, create preconditions for all values of characteristic CH_PROCESSORS and assign to respective characteristic values.
Once all preconditions have been created and assigned to respective characteristic values, create below precondition and assign to characteristic (NOT values)
(CH_PROC_BRAND = CH_PROC_BRAND, CH_PROCESSORS = CH_PROCESSORS)
and assign to characteristic CH_PROCESSORS
Once this is done, we can check result in CU50. We can see that when ‘AMD’ is chosen as processor brand, the possible values in processors are being displayed as per entries maintained in variant table T_BRAND_PROC
When ‘Celeron’ is chosen as processor brand, the possible values in processors are being displayed as per entries maintained in variant table T_BRAND_PROC