R3_CREATE_VARIANT
The R3_CREATE_VARIANT script element creates a variant. The client to which the SAP agent has logged on because of the relevant Login object is automatically the client of the new variant. You can also create SAP system variants such as CUS& and SAP&. The client of the variant is automatically 0000 in that case.
Tip: If a variant already exists, you can delete it. You can recreate it if necessary. 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
-
R3_CREATE_VAR[IANT]
Creates a new variant - REP[ORT]=
Name of the report
Format: script literal - VAR[IANT]=
Name of the variant
Format: script literal - TEXT=
(Optional) Short text of the variant. The text is written in the language that the administrator has defined in the INI file of the agent. The language can also be defined in the job settings. In this case, the job settings override the INI file settings. If you do not specify this parameter, the name of the variant is used as the short text.
Format: script literal - PROTECTED=
(Optional) Protection against modifications
Format: script literal
Allowed values:- NO (default)
The variant can be modified without limitations - YES
Only the SAP system user can modify the variant. See also Finding and Resolving Errors
- NO (default)
When it creates the variant, the AE automatically sets the attribute "Only for Background Processing". Therefore, it is available in the SAP job, but not for a user working with the SAP GUI. All other variant properties are set as if they were directly created in the SAP GUI.
The R3_CREATE_VARIANT script element always creates variants without contents. Use one of the following script elements to add your contents to an empty variant:
Keep the following order when you process a report with a new variant:
- Define your selection criteria. See R3_SET_SELECT_OPTION
- Create the variant. See R3_CREATE_VARIANT
- Process the report with the above variant. See R3_ACTIVATE_REPORT
Example
The following example uses R3_SET_SELECT_OPTION to define the value "17" for the "MIN_AGE" parameter, which is the name of the selected option. "P" is set as the parameter that defines the type of selection. These selections are then used to create a variant through R3_CREATE_VARIANT.
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: