Creating and Modifying Variants in Redwood Server
Variants are sets of parameter values used for quickly setting ABAP program parameters. You can create and modify variants from within Redwood Server in the SAP System Maintain Objects editor screen.
Creating Variants
First you import the ABAP program, then you can create variants. You create variants on the ABAP program and set a number of parameters. You should import at least one variant and its variant definition, so that the available parameters are displayed in drop-down menus. This is done with the SAP_ImportVariants process definition, not that it will by default import the variant definition as well. Variant definitions are the set of parameters and their respective values as defined in the variant.
Editing Variants
To be able to edit variants that were created in SAPGui, you will have to import the variants and variant definitions first. When you use SAP_ImportVariants to import variants, the process will import the variant and its variant definition by default. Variant definitions are the set of parameters and their respective values as defined in the variant.
Saving a Variant in the SAP System for use with SAPGui
You can use the SAP_StoreVariant process definition to store variants in you SAP system, see Handling Variants for more information.
Variant Parameter Syntax
Variant parameters should be string parameters, with PAR_
, SEL_
, or FSL_
prefixes, for parameter, select options, and free selections (freie Abgrenzungen in German), respectively. Their names should contain the name of the parameter/select option in SAP for parameters and selection options; free selections must be specified as FSL_<table>/<field>
, where <table>
and <field>
are the technical names of the table and field, respectively. When you want to specify a range, you should enclose it in square brackets []
, as in [a-m,!d,!f,!g]
. These parameter names must be all upper case.
The following operators are available for select options, the mathematical syntax can only be used in RedwoodScript and is displayed here for clarity:
Syntax | Meaning | Mathematical Syntax |
---|---|---|
NOT | Not | ! |
EQ | Equals | = |
BT | Between | - |
CP | Contains Pattern, use + for one character and * for zero or more characters | |
NE | Not Equals | != |
NE | Not Equals | <> |
NP | Not Pattern | |
GE | Greater than or equals | >= |
GT | Greater than | > |
LE | Less than or equals | <= |
LT | Less than | < |
note
When you specify date-ranges, make sure you put spaces between the dates and the hyphen (-), the range 21.02.2010 - 31.12.2010
is valid and this one is not valid:21.02.2010-31.12.2010
.
tip
If you want to specify two or more exact values, you can create a parameter for each select option.
Example
You have a process definition with the following parameters:
PAR_NOEX
- Without Extract, set toX
SEL_FLDATE
- Flight Date, set toBT
and21.02.2010 - 31.12.2010
Another example of a process definition with parameters:
PAR_NOEX
- Without Extract, set toX
SEL_CAR
- Airline, set toBT
and[AA-ZZ, !BC, !AF]
Alternate example of process definition with parameters:
PAR_NOEX
- Without Extract, set toX
SEL_CAR
- Airline, set toCP
andL+
SEL_FLDATE_01
- Flight Date, set toGE
and01.02.2010
SEL_FLDATE_02
- Flight Date, set toLE
and18.02.2010
Free selections example:
FSL_BSID/MANSP
- set toBT
and[AA-CA, !BC, !AF]
Handling Empty/Missing Variant Parameters
You use the PASSNULLVALUES
parameter to specify how you want empty/missing parameters to be interpreted. The parameter accepts the following values:
N
- missing parameters are ignored, the SAP variant parameter/selopt default values will be used; empty parameters are passed on as is, variant parameter/selopt is empty (but set).Y
- missing parameters cause the corresponding SAP variant parameters/selopts to be unset; empty parameters are passed on as is, variant parameter/selopt is empty (but set).
To unset an existing parameter, specify >!<
; Parameters with this value are not forwarded to the SAP system.
Prerequisites
- You have imported the ABAP program, a variant and its variant definition, as outlined in Importing ABAP Programs and Importing Variants.
Procedure
Create a variant
- Navigate to "Environment > SAP".
- Choose Maintain Objects from the context-menu of the SAP System that represents the SAP Instance where the ABAP program is used.
- Expand ABAP Programs and choose New Variant from the context-menu of the ABAP program.
- Fill in a name and optional description, choose Save.
- For each simple parameter/value combination, choose New Parameter.
- Select the name of the parameter from the drop-down, enter an optional description and value.
- For each select option, choose New Select Option.
- Select the name of the parameter from the drop-down, enter an optional description.
- On the Values tab, select to include or exclude the rows in the Sign field, select and operator in the Option field, and enter a lower and higher value (depending on the operator in Option, only a lower value is required).
- Choose Save & Close.
Modify a variant
- Navigate to "Environment > SAP".
- Choose Maintain Objects from the context-menu of the SAP System that represents the SAP Instance where the ABAP program is used.
- Expand ABAP Programs, the ABAP program, client and variant.
- Select the parameter you want to change.
- For each simple parameter/value combination".
- Select the name of the parameter and enter a value into the Value field.
- For each select option:
- Select the name of the parameter.
- On the Values tab, select to include or exclude the rows in the Sign field, select and operator in the Option field, and enter a lower and higher value (depending on the operator in Option, only a lower value is required).
- Choose Save & Close.