R3_MODIFY_VARIANT
Use the R3_MODIFY_VARIANT script element to modify variant entries. You can define the variant type either as a parameter (KIND=P) or as a selection option (KIND=S). Non-specified parameters remain unchanged.
Important!
-
You cannot use R3_MODIFY_VARIANT to change dynamic variant selections in logical databases.
-
If the ABAP program to which the variant belongs uses a logical database such as PSJ, modifying the variant may cause errors in the SAP system because the selection screen is dynamically modified. In this case, copy the original variant and modify the copy instead.
-
Parameter values and selection options in SAP Basis versions below 7.10 and XBP versions below 3.0 are limited to a maximum of 45 characters. SAP Basis 7.10 and XBP 3.0 or later allow up to 132 characters, matching the SAP GUI limit.
Transaction: SA38
Interface: AE and Standard
This page includes the following:
Syntax with Parameters (KIND=P)
R3_MODIFY_VARIANT REPORT=...,VARIANT=...,SELNAME=...,KIND=P,LOW=...[,VERIFY=...][,DELAY=...][,MERGE=...]
Parameters
| Parameter | Description | Format | Allowed Values | Default Value |
|---|---|---|---|---|
| REP[ORT]= | Name of the report | Name or script literal | n.a. | n.a. |
| VAR[IANT]= | Name of the variant | Name or script literal | n.a. | n.a. |
| SELN[AME]= | Name of the parameter | Name or script literal | n.a. | n.a. |
| KIND=P |
Sets the parameter type to parameter (P). Note: In the report, this is queried with PARAMETERS. |
Name or script literal | n.a. | n.a. |
| LOW= | Parameter value | Name or script literal | n.a. | n.a. |
| VERIFY=
(Optional) |
Controls whether modifications made to the variant are verified | Name or script literal |
|
NO |
| DELAY=
(Optional) |
Time in seconds the agent waits after the variant has been modified. Use this when the SAP system runs with multiple application servers to allow buffer synchronization to complete. | Number | n.a. | 0 |
| MERGE=
(Optional) |
Controls whether variant parameters are merged | Name or script literal |
|
YES |
Examples (KIND=P)
The following example modifies the TCODE parameter of the SAP_STANDARD variant.
R3_MODIFY_VARIANT REPORT=RSUSR002,VAR=SAP_STANDARD,SELN=TCODE,KIND=P,LOW='SE01'
Syntax with Selection Options (KIND=S)
R3_MODIFY_VARIANT REPORT=...,VARIANT=...,SELNAME=...,KIND=S,LOW=...[,HIGH=...][,SIGN=...][,OPTION=...][,MODE=...][,VERIFY=...][,DELAY=...][,MERGE=...]
Parameters
| Parameter | Description | Format | Allowed Values | Default Value |
|---|---|---|---|---|
| REP[ORT]= | Name of the report | Name or script literal | n.a. | n.a. |
| VAR[IANT]= | Name of the variant | Name or script literal | n.a. | n.a. |
| SELN[AME]= | Name of the parameter | Name or script literal | n.a. | n.a. |
| KIND=S |
Sets the parameter type to selection option (S). Note: In the report, this is queried with SELECT-OPTIONS. |
Name or script literal | n.a. | n.a. |
| LOW= | Lower limit value for the selection option | Name or script literal | n.a. | n.a. |
| HIGH=
(Optional) |
Upper limit value for the selection option. Use only together with OPTION=BT or OPTION=NB to define an interval. | Name or script literal | n.a. | n.a. |
| SIGN=
(Optional) |
Specifies whether matching values are included or excluded | Name or script literal |
|
I |
| OPTION=
(Optional) |
Selection operator. You can define multiple individual values for a selection option. The order within the variant does not necessarily reflect the order in which they were defined. Note: Once a selection option has been modified, its value range can only be changed by a new modification — it cannot be reset to its initial value. |
Name or script literal |
|
EQ |
| MODE=
(Optional) |
Controls whether the selection term is replaced or appended. Use APPEND to create multiple selections. Note: When MODE=APPEND is used, the MERGE= parameter is automatically set to YES. |
Name or script literal |
|
REPLACE |
| VERIFY=
(Optional) |
Controls whether modifications made to the variant are verified | Name or script literal |
|
NO |
| DELAY=
(Optional) |
Time in seconds the agent waits after the variant has been modified. Use this when the SAP system runs with multiple application servers to allow buffer synchronization to complete. | Number | n.a. | 0 |
| MERGE=
(Optional) |
Controls whether variant parameters are merged | Name or script literal |
|
YES |
Examples (KIND=S)
The following example selects all users whose names start with "B".
R3_MODIFY_VARIANT REP=RSUSR002,VAR=SAP_STANDARD,SELN=USER,KIND=S,LOW='B*',SIGN=I,OPTION=CP
The following example selects all users except those whose names fall between "USER100" and "USER199".
R3_MODIFY_VARIANT ...,SELN=USER,KIND=S,LOW='USER100',HIGH='USER199',SIGN=I,OPTION=NB
The following example uses multiple selection to select company code 10 and codes 71 to 77.
R3_MODIFY_VARIANT REP=RF...,VAR=v1,SELN=BUKRS,KIND=S,LOW='10',SIGN=I,OPTION=EQ,MODE=R
R3_MODIFY_VARIANT REP=RF...,VAR=v1,SELN=BUKRS,KIND=S,LOW='71',HIGH='77',SIGN=I,OPTION=BT,MODE=A
See also: