Beruflich Dokumente
Kultur Dokumente
While doing the Variant configuration, we may came across scenarios where std. syntax of VC will not be
sufficient. For this type of scenarios, we can use Variant functions to achieve the desired functionality.
Variant functions will use Function Modules, here we have to write the code using ABAP.
Overview
Variant functions allow us to integrate the function modules with all types of object dependencies. In the object
dependencies we need to use the syntax for calling the function module as well as input and output parameters.
Variant conditions used where standard syntax is not sufficient to map desired functionality. This may be possible in
following cases.
Example:
Using variant function to concatenate values of three characteristics into another characteristic.
Chars Values
Processor Core i7
Core i5
Core i3
RAM 2 GB
4 GB
6 GB
Assign required input and output characteristics and save the variant function. In the above example PROCESSOR,
HARD_DISK, RAM are input parameters.
Tables
Parameter Name Typing Reference Type Content
QUERY LIKE CUOV_01 Table of input parameters and the expected output parameters
MATCH LIKE CUOV_01 Table of output parameters
All partial fields except ATCIO must be filled in a MATCH entry (especially format ATFOR)
The fields ATFOR, ATWRT, and ATFLV only have values assigned for input parameters.
Exceptions:
FAIL This exception shows that the condition represented by the function is not fulfilled.
INTERNAL_ERROR This exception shows that a runtime error has occurred processing the function.
Source Code : Used for writing your own logic for the function module using ABAP.
The following help functions are supported for accessing import parameters:
The characteristics on the left-hand side are characteristics of the function. The characteristics on the right-hand side
are characteristics of the PC.
Characteristic LABEL must be referred to with the variable $SELF, because LABEL is a characteristic of the object
currently being processed. Otherwise, values cannot be inferred. The default object $ROOT is assumed for the other
characteristics.
Testing
As soon as all values assigned to the characteristics of variant function, function module will sets the value for
LABEL.