R3_CREATE_VARIANT
Use the R3_CREATE_VARIANT script element to create a variant. The client of the new variant is automatically the client to which the SAP agent has logged on via the relevant Login object. You can also create SAP system variants such as CUS& and SAP&, in which case the client of the variant is automatically 0000.
Tip: If a variant already exists, you can delete it and recreate it if necessary. For more information, see R3_DELETE_VARIANT.
Important! If an error occurs while the variant is being created, the job aborts.
Transaction: SA38
Interface: Standard
Syntax
R3_CREATE_VAR[IANT] REP[ORT]=...,VAR[IANT]=...[,TEXT=...][,PROTECTED=...]
Parameters
| Parameter | Description | Format | Allowed Values | Default Value |
|---|---|---|---|---|
| REP[ORT]= | Name of the report | Script literal | n.a. | n.a. |
| VAR[IANT]= | Name of the variant | Script literal | n.a. | n.a. |
| TEXT=
(Optional) |
Short text of the variant. The text is written in the language defined in the agent INI file, or in the job settings if specified there (job settings take precedence). If this parameter is omitted, the variant name is used as the short text. | Script literal | n.a. | Variant name |
| PROTECTED=
(Optional) |
Controls whether the variant is protected against modifications. For more information, see Finding and Resolving Errors. | Script literal |
|
NO |
Important Considerations
R3_CREATE_VARIANT always creates variants without contents and automatically sets the Only for Background Processing attribute, making the variant available in SAP jobs but not in the SAP GUI. All other variant properties are set as if the variant were created directly in the SAP GUI.
To add contents to the empty variant, use one of the following script elements:
When processing a report with a new variant, follow this order:
-
Define your selection criteria using R3_SET_SELECT_OPTION.
-
Create the variant using R3_CREATE_VARIANT.
-
Process the report with the variant using R3_ACTIVATE_REPORT.
Examples
The following example uses R3_SET_SELECT_OPTION to define the value "17" for the MIN_AGE parameter with selection type P, then creates a variant using those selections.
R3_SET_SELECT_OPTION SELNAME='MIN_AGE',KIND='P',LOW='17',SIGN='I'
R3_CREATE_VARIANT REP=REPORT01,VAR=NEW,TEXT='New variant'
See also: