Derivation of Variant configuration characteristics
[characteristic derivation] [KEDR] [Variant Configuration] [VCONF]
Symptom
You use configurable materials on your sales orders. The characteristics from the variant configuration should be available in CO-PA for analysis purposes. You want to create a CO-PA characteristic that can contain decimals from variant configuration.
Other terms
Variant Configuration, VCONF, KEDR, characteristic derivation
Reason and Prerequisites
Characteristics of the operating concern can only be defined with data type CHAR or NUMC and both data types don’t allow decimals.
CO-PA derivation can’t deal properly with variant configuration fields from data type F (floating point) if they have been defined with decimals.
Solution
BACKGROUND:
As of Release 4.6A, it is possible to use characteristics from the variant configuration as source fields in derivation steps.
VCONF is a virtual structure which doesn’t exist as a DDIC object so it can’t be looked at via TA SE16 or SE11. It’s used during derivation to CO-PA.
One can see if there are valid fields in table CABN (characteristics)- CABNT (characteristics texts).
To access characteristics from variant configuration field CUOBJ is needed that is either passed from application to CO-PA derivation or filled in derivation with a table lookup on table VBAP.
Field CUOBJ (from which variant configuration data can be derived) is only filled automatically in case of sales order creation. If a sales order number is involved in the process it’s also possible to get the CUOBJ value directly from database (table VBAP) but in case of other transactions if there is no relation to a sales order then it’s not possible to get field CUOBJ filled within CO-PA derivation.
A ‘MOVE’ derivation step should be enough to get the VCONF values into COPA characteristics.
For example let us say you want VCONF-COLOR to be filled in WWCLR.
Create a ‘Move’ derivation step with source field VCONF-COLOR and target field WWDTR.
This will work fine with characteristics of data type CHAR.
However using VCONF fields of data type NUM as source fields of such a ‘MOVE’ derivation step or of a derivation rule can cause problems.
For example say you want VCONF-DIAMETER to be filled in WWDTR where the value should be 32.14
You either have the choice of using NUMC for WWDTR so that the value is rounded (32) or using CHAR for WWDTR so that the value is taken over with all decimals as string (3214).
WORKAROUND:
There is a workaround to pass the value from field VCONF-ABC (that is defined for N decimals) correctly to char WWXXX so that it’s finally stored with the exact value in WWXXX (and not only with the rounded value).
1.) You should create a new enhancement derivation step with source field GLOBAL-CUOBJ and with target field WWXXX. In order to evaluate the current variant configuration for VCONF field (so that the correct value is passed to char WWXXX) you have to implement the following steps in the derivation exit (include ZXKKEU11):
a) Call function module CUCB_GET_SINGLE_INSTANCE with current variant configuration value to get the table with the field values (similar to routine NAME_VCONF–GET_VALUE from include LKEDRF03):
type-pools: ibco2.
data: l_instance type IBCO2_INSTANCE_REC2.
call function ‘CUCB_GET_SINGLE_INSTANCE’
exporting
instance = i_global-cuobj
importing
instance_rec = l_instance
exceptions
invalid_instance = 1
instance_is_a_classification = 2
others = 3.
b) Read ATINN value corresponding to VCONF field ABC from table CABN:
data: l_atinn type cabn-atinn.
select single atinn from CABN into l_atinn
where atnam = ‘ABC’.
c) Read corresponding line from table l_instance-values:
data: l_vconf_value type line of ibco2_instance_rec2-values.
read table l_instance-values into l_vconf_value
with key atinn = l_atinn.
d) Move the floating point value from l_vconf_value into WWXXX (after
some further conversions):
data: a type f,
b type p decimals N. ” N must be replaced by the number of
” decimals of VCONF field ABC
if sy-subrc = 0.
a = l_vconf_value-atflv.
b = a.
<CO-PA line item>-WWXXX = b. ” <CO-PA line item> must be replaced
” by the current CO-PA line item
endif.
The above is a blueprint for doing the derivation.